.shelf-page {
    max-width: 920px;
    min-height: 686px;
}

.shelf-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.shelf-level {
    min-width: 9.5rem;
    text-align: left;
    background: #fff;
    border: 1px solid #a67c4a;
    border-radius: 0.5rem;
    padding: 0.25rem 0.85rem;
    color: inherit;
}

.shelf-level:hover,
.shelf-level:focus-visible {
    box-shadow: 0 0.35rem 0.8rem rgba(92, 64, 51, 0.16);
    outline: none;
}

.shelf-level.is-on {
    background: #f6ead4;
    box-shadow: 0 0 0 2px #a67c4a;
}

.shelf-top-you {
    background: #f6ead4;
    font-weight: 700;
}

.shelf-level.is-locked {
    opacity: 0.55;
    cursor: not-allowed;
    border-color: #c5cdd8;
}

.shelf-level-name {
    display: block;
    font-weight: 700;
    color: #5c4033;
}

.shelf-level-blurb {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
}

.shelf-hud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
}

.shelf-lives {
    display: flex;
    gap: 0.3rem;
    font-size: 1.15rem;
}

.shelf-lives span {
    opacity: 0.28;
}

.shelf-lives span.is-on {
    opacity: 1;
    color: #c9a227;
}

.shelf-stat {
    font-size: 0.9rem;
    color: #5c4033;
}

.shelf-stat-label {
    color: #6c757d;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.shelf-hint {
    font-weight: 700;
    color: #5c4033;
    min-height: 1.4rem;
}

.shelf-typed {
    min-height: 2rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #3a5174;
}

.shelf-typed .is-done {
    color: #1cc88a;
}

.shelf-stage {
    position: relative;
    min-height: 280px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, #f3e2c0 0%, #e8d0a0 55%, #c9a36a 100%);
    box-shadow: inset 0 0 0 1px rgba(92, 64, 51, 0.12);
    padding: 1.1rem 0.85rem 1.4rem;
}

.shelf-board {
    position: relative;
    z-index: 1;
}

.shelf-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.28rem;
    min-height: 4.6rem;
    padding: 0.15rem 0.2rem 0.35rem;
}

.shelf-plank {
    height: 10px;
    border-radius: 2px;
    background: linear-gradient(180deg, #b8894d 0%, #8d6232 100%);
    box-shadow: 0 3px 0 #6d4c2b;
    margin-bottom: 0.7rem;
}

.shelf-spine {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    max-width: 6.5rem;
    min-height: 3.8rem;
    padding: 0.2rem 0.28rem;
    border-radius: 3px 3px 2px 2px;
    background: linear-gradient(90deg, #7a4e2e 0%, #a0673a 45%, #7a4e2e 100%);
    color: #f6ead4;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 2px 2px 0 rgba(60, 35, 18, 0.25);
}

.shelf-spine.is-prefix {
    opacity: 0.42;
    filter: grayscale(0.35);
}

.shelf-spine.is-placed {
    background: linear-gradient(90deg, #3a5174 0%, #5c7aaa 45%, #3a5174 100%);
}

.shelf-spine.is-nt {
    background: linear-gradient(90deg, #5c4033 0%, #8d6e63 45%, #5c4033 100%);
}

.shelf-spine.is-nt.is-placed {
    background: linear-gradient(90deg, #2f5d4e 0%, #4f8a76 45%, #2f5d4e 100%);
}

.shelf-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    min-height: 3.8rem;
    border: 2px dashed #7284b7;
    border-radius: 4px;
    background: rgba(255, 224, 130, 0.45);
    color: #3a5174;
    font-weight: 700;
    font-size: 1.1rem;
    animation: shelf-glow 1.1s ease-in-out infinite;
}

.shelf-stage.is-miss .shelf-slot {
    animation: none;
    border-color: #c0392b;
    background: rgba(192, 57, 43, 0.18);
}

.shelf-over {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(244, 247, 251, 0.88);
    padding: 1rem;
}

.shelf-over-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 0.5rem 1.4rem rgba(92, 64, 51, 0.18);
    max-width: 22rem;
    width: 100%;
}

.shelf-over-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.shelf-over-stats span {
    color: #6c757d;
}

.shelf-over-stats strong {
    color: #5c4033;
}

@keyframes shelf-glow {
    0%, 100% { box-shadow: 0 0 0 2px rgba(114, 132, 183, 0.45); }
    50% { box-shadow: 0 0 0 6px rgba(114, 132, 183, 0.25); }
}

@media (max-width: 576px) {
    .shelf-spine {
        min-width: 1.7rem;
        min-height: 3.2rem;
        font-size: 0.52rem;
        max-width: 4.8rem;
    }

    .shelf-slot {
        min-width: 2rem;
        min-height: 3.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shelf-slot {
        animation: none;
    }
}
