.library-page {
    background:
        radial-gradient(circle at 9% 4%, rgba(216, 240, 107, .18), transparent 25rem),
        radial-gradient(circle at 95% 25%, rgba(53, 117, 93, .08), transparent 30rem),
        var(--paper);
}

.library-header .button { text-decoration: none; }

.library-location {
    padding-right: 2px;
    color: rgba(255, 255, 255, .72);
    font-size: .78rem;
    font-weight: 750;
    letter-spacing: .04em;
}

.library-shell {
    width: min(1240px, 100%);
    margin-inline: auto;
    padding: clamp(30px, 5vw, 68px) clamp(16px, 4vw, 48px) 72px;
}

.library-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr);
    gap: clamp(28px, 6vw, 80px);
    align-items: end;
    padding-bottom: clamp(34px, 5vw, 60px);
}

.library-intro { max-width: 730px; }

.library-intro h1 {
    margin: 0;
    font-size: clamp(2.7rem, 6vw, 5.4rem);
    line-height: .98;
    letter-spacing: -.065em;
}

.library-intro h1 em {
    color: var(--forest-2);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
}

.library-intro > p:last-child {
    max-width: 620px;
    margin: 19px 0 0;
    color: var(--ink-soft);
    font-size: clamp(.94rem, 1.5vw, 1.08rem);
}

.library-search-panel {
    padding: 20px;
    background: rgba(255, 254, 250, .82);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(20, 45, 38, .07);
    backdrop-filter: blur(12px);
}

.library-summary {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 13px;
    color: #53645e;
    font-size: .75rem;
    font-weight: 750;
}

.summary-mark {
    width: 8px;
    height: 8px;
    background: var(--grass);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(53, 117, 93, .11);
}

.search-form label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink);
    font-size: .79rem;
    font-weight: 800;
}

.search-control { position: relative; }

.search-control input {
    padding-right: 43px;
    padding-left: 40px;
    border-radius: 11px;
}

.search-control input::-webkit-search-cancel-button { display: none; }

.search-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 15px;
    width: 13px;
    height: 13px;
    border: 2px solid #73817c;
    border-radius: 50%;
    transform: translateY(-56%);
    pointer-events: none;
}

.search-icon::after {
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 6px;
    height: 2px;
    content: "";
    background: #73817c;
    border-radius: 2px;
    transform: rotate(45deg);
}

.clear-search {
    position: absolute;
    top: 50%;
    right: 7px;
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    color: #5f6d68;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 1.25rem;
    line-height: 1;
    transform: translateY(-50%);
    cursor: pointer;
}

.clear-search:hover { color: var(--forest); background: #edf1e8; }

.library-results {
    padding: clamp(20px, 3.2vw, 36px);
    background: rgba(255, 254, 250, .88);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.results-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 25px;
}

.results-heading h2 {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    letter-spacing: -.035em;
}

.results-heading > p {
    margin: 0;
    color: var(--ink-soft);
    font-size: .75rem;
    text-align: right;
}

.play-grid,
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.play-grid {
    margin: 0;
    padding: 0;
    list-style: none;
}

.play-card {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid #dce2dc;
    border-radius: 15px;
    box-shadow: 0 9px 24px rgba(22, 47, 40, .055);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.play-card:hover {
    border-color: #b8c6bc;
    box-shadow: 0 17px 35px rgba(22, 47, 40, .11);
    transform: translateY(-3px);
}

.play-card-link {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
    border-radius: 14px;
}

.play-card-preview {
    position: relative;
    height: 116px;
    overflow: hidden;
    background:
        repeating-linear-gradient(90deg, transparent 0 16.66%, rgba(255, 255, 255, .035) 16.66% 33.32%),
        linear-gradient(135deg, var(--grass-dark), var(--grass));
}

.play-card-preview::after {
    position: absolute;
    right: -28px;
    bottom: -52px;
    width: 145px;
    height: 145px;
    content: "";
    border: 30px solid rgba(216, 240, 107, .08);
    border-radius: 50%;
}

.mini-pitch {
    position: absolute;
    inset: 14px 17px;
    border: 1px solid rgba(255, 255, 255, .68);
}

.mini-pitch::before,
.mini-pitch::after {
    position: absolute;
    top: 0;
    bottom: 0;
    content: "";
    border-left: 1px solid rgba(255, 255, 255, .52);
}

.mini-pitch::before { left: 24%; }
.mini-pitch::after { right: 24%; }

.mini-pitch span {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 1px solid rgba(255, 255, 255, .7);
}

.card-order {
    position: absolute;
    z-index: 2;
    top: 14px;
    left: 16px;
    padding: 4px 8px;
    color: white;
    background: rgba(12, 48, 39, .72);
    border: 1px solid rgba(255, 255, 255, .19);
    border-radius: 20px;
    font-size: .63rem;
    font-weight: 850;
    letter-spacing: .08em;
}

.card-arrow {
    position: absolute;
    z-index: 2;
    top: 13px;
    right: 15px;
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    color: var(--forest);
    background: var(--lime);
    border-radius: 9px;
    font-size: .9rem;
    font-weight: 900;
    transition: transform .18s ease;
}

.play-card:hover .card-arrow { transform: translate(2px, -2px); }

.play-card-body {
    display: flex;
    min-height: 190px;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.play-card-body h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.3;
    letter-spacing: -.025em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.card-description {
    display: -webkit-box;
    min-height: 3.6em;
    overflow: hidden;
    margin: 8px 0 18px;
    color: var(--ink-soft);
    font-size: .76rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.card-description.is-empty { color: #89958f; font-style: italic; }

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: auto;
}

.card-metric {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    color: #4d5f58;
    background: #f0f3ed;
    border-radius: 7px;
    font-size: .67rem;
    font-weight: 750;
}

.metric-dot {
    width: 6px;
    height: 6px;
    background: var(--blue);
    border-radius: 50%;
}

.card-metric:last-child .metric-dot { background: var(--coral); }

.card-date {
    margin: 15px 0 0;
    padding-top: 12px;
    color: #75827d;
    border-top: 1px solid #ebeee9;
    font-size: .66rem;
}

.skeleton-card {
    height: 307px;
    overflow: hidden;
    padding: 135px 18px 18px;
    background: linear-gradient(#e2e8e1 0 116px, #fffefa 116px);
    border: 1px solid #e0e5df;
    border-radius: 15px;
}

.skeleton-card span,
.skeleton-card i,
.skeleton-card b {
    display: block;
    background: #e9ede8;
    border-radius: 6px;
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-card span { width: 68%; height: 17px; margin-bottom: 13px; }
.skeleton-card i { width: 100%; height: 9px; margin-top: 8px; }
.skeleton-card i:nth-of-type(2) { width: 77%; }
.skeleton-card b { width: 45%; height: 25px; margin-top: 24px; }

@keyframes skeleton-pulse {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
}

.library-message {
    display: flex;
    min-height: 330px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 42px 20px;
    text-align: center;
    background: #fafbf8;
    border: 1px dashed #cbd4cc;
    border-radius: 15px;
}

.library-message h3 { margin: 14px 0 0; font-size: 1.12rem; letter-spacing: -.025em; }
.library-message p { max-width: 460px; margin: 7px 0 20px; color: var(--ink-soft); font-size: .82rem; }

.message-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: var(--danger);
    background: #fde7e3;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 900;
}

.search-message-icon {
    position: relative;
    color: var(--forest);
    background: #edf1e8;
}

.search-message-icon::before {
    width: 15px;
    height: 15px;
    content: "";
    border: 3px solid currentColor;
    border-radius: 50%;
    transform: translate(-2px, -2px);
}

.search-message-icon::after {
    position: absolute;
    top: 29px;
    left: 29px;
    width: 10px;
    height: 3px;
    content: "";
    background: currentColor;
    border-radius: 4px;
    transform: rotate(45deg);
}

.empty-pitch {
    position: relative;
    width: 78px;
    height: 52px;
    background: var(--grass);
    border: 5px solid #e6eae2;
    border-radius: 9px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
}

.empty-pitch::before,
.empty-pitch::after,
.empty-pitch span {
    position: absolute;
    top: 0;
    bottom: 0;
    content: "";
    border-left: 1px solid rgba(255, 255, 255, .7);
}

.empty-pitch::before { left: 25%; }
.empty-pitch::after { right: 25%; }
.empty-pitch span { left: 50%; }

.noscript-message { min-height: 180px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    padding: 0;
    margin: -1px;
    white-space: nowrap;
    border: 0;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
}

@media (max-width: 930px) {
    .library-hero { grid-template-columns: 1fr; gap: 24px; }
    .library-search-panel { max-width: 600px; }
    .play-grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .library-location { display: none; }
    .library-header .button { min-height: 38px; padding: 8px 10px; font-size: .76rem; }
    .library-shell { padding-top: 29px; padding-bottom: 40px; }
    .library-intro h1 { font-size: clamp(2.35rem, 13vw, 3.7rem); }
    .library-search-panel { padding: 16px; }
    .library-results { padding: 16px; border-radius: 17px; }
    .results-heading { align-items: flex-start; flex-direction: column; gap: 7px; margin-bottom: 18px; }
    .results-heading > p { text-align: left; }
    .play-grid, .skeleton-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .skeleton-card:nth-child(n + 4) { display: none; }
    .library-message { min-height: 300px; padding-inline: 15px; }
}

@media (max-width: 360px) {
    .library-header .brand-copy { display: none; }
    .library-shell { padding-inline: 10px; }
    .library-intro h1 { font-size: 2.3rem; }
    .library-intro > p:last-child { font-size: .88rem; }
    .library-search-panel, .library-results { padding: 13px; }
    .play-card-body { padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-card span,
    .skeleton-card i,
    .skeleton-card b { animation: none; }
}
