/* ═══════════════════════════════════════════════════════════════════════
   TOYS — Book-based collection UI
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Count badge in header ── */
.disc-count {
    margin-left: auto;
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.4);
}

/* ── Closed book ── */
.disc-book-closed {
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer;
    padding: 1rem 0 0.5rem;
    transition: transform 0.2s;
}
.disc-book-closed:hover { transform: scale(1.04); }
.disc-book-closed:active { transform: scale(0.97); }
.disc-book-closed__img {
    width: 100px; height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 4px 16px rgba(167, 139, 250, 0.3));
    animation: discBookIdle 3s ease-in-out infinite;
}
@keyframes discBookIdle {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-4px) rotate(1deg); }
}
.disc-book-closed__hint {
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 0.5rem;
}

/* ── Open book container ── */
.disc-book {
    animation: discBookOpen 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes discBookOpen {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Book layout (background + overlaid pages) ── */
.disc-book__layout {
    position: relative;
    /* Bleed past card padding for maximum size */
    margin-left: -1rem;
    margin-right: -1rem;
    width: calc(100% + 2rem);
    aspect-ratio: 1.65 / 1;
    margin-bottom: 0.5rem;
}
.disc-book__bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    z-index: 0;
}

/* ── Pages (overlaid inside the book's blue decorative border) ──
   Carefully positioned to sit inside the ornamental frame. */
.disc-book__page {
    position: absolute;
    top: 16%; bottom: 12%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    z-index: 1;
}
.disc-book__page--left {
    left: 9%; right: 53%;
}
.disc-book__page--right {
    left: 53%; right: 9%;
}

/* ── Individual slot (shared) ── */
.disc-slot {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    border-radius: 4px;
    padding: 2px;
    cursor: default;
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s, transform 0.2s;
}

/* ── Discovered slot ── */
.disc-slot--discovered {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.15);
}
.disc-slot--discovered:hover {
    transform: scale(1.06);
}
.disc-slot--discovered .disc-slot__img {
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.4));
}

/* ── Locked slot ── */
.disc-slot--locked {
    background: rgba(167, 139, 250, 0.04);
    border: 2px dashed rgba(167, 139, 250, 0.15);
}

/* Silhouette wrapper (holds image + question mark) */
.disc-slot__silhouette {
    position: relative;
    width: 70%;
    max-height: 58%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 1;
}
.disc-slot--locked .disc-slot__img {
    width: 100%;
    object-fit: contain;
    filter: brightness(0) saturate(0) opacity(0.12);
}

/* Question mark overlay */
.disc-slot__qmark {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(167, 139, 250, 0.35);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* Slot image (discovered) */
.disc-slot--discovered .disc-slot__img {
    width: 70%;
    max-height: 60%;
    object-fit: contain;
    flex-shrink: 1;
}

/* Slot label */
.disc-slot__label {
    font-family: var(--font-display);
    font-size: 0.35rem;
    letter-spacing: 0.02em;
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    line-height: 1.1;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.disc-slot--discovered .disc-slot__label {
    color: rgba(255, 255, 255, 0.65);
}
.disc-slot--locked .disc-slot__label {
    color: rgba(167, 139, 250, 0.3);
    font-style: italic;
}

/* ── Navigation ── */
.disc-book__nav {
    display: flex; align-items: center; justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.disc-book__arrow {
    background: none; border: none; cursor: pointer;
    padding: 0; width: 36px; height: 36px;
    transition: transform 0.15s, opacity 0.2s;
}
.disc-book__arrow img {
    width: 100%; height: 100%;
    object-fit: contain;
}
.disc-book__arrow:hover { transform: scale(1.12); }
.disc-book__arrow:active { transform: scale(0.9); }
.disc-book__arrow:disabled { opacity: 0.25; pointer-events: none; }

.disc-book__spread-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
}

/* ── Close button ── */
.disc-book__close-btn {
    display: block;
    margin: 0 auto;
    padding: 0.4rem 1.2rem;
    border-radius: 8px;
    border: 1.5px solid rgba(167, 139, 250, 0.2);
    background: rgba(167, 139, 250, 0.08);
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.2s;
}
.disc-book__close-btn:hover {
    background: rgba(167, 139, 250, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

/* ── Page turn animation ── */
.disc-book__spread {
    position: absolute;
    inset: 0;
}

/* ── Page flip overlay (1:1 image laid on top of book) ── */
.disc-book__flip-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 3;
    pointer-events: none;
    display: none;
}
/* During flip, hide pages behind the overlay */
.disc-book__page--flipping {
    visibility: hidden;
}

/* ── Responsive — desktop ── */
@media (min-width: 520px) {
    .disc-book__layout {
        max-width: 680px;
        margin-left: auto; margin-right: auto;
        width: 100%;
    }
    .disc-slot__label { font-size: 0.45rem; }
    .disc-slot--discovered .disc-slot__img { max-height: 65%; }
    .disc-book__page { gap: 6px; padding: 6px; }
    .disc-slot__qmark { font-size: 1.3rem; }
}

/* ── Responsive — large desktop ── */
@media (min-width: 768px) {
    .disc-book__layout {
        max-width: 780px;
    }
    .disc-slot__label { font-size: 0.5rem; }
    .disc-book__page { gap: 8px; padding: 8px; }
    .disc-slot__qmark { font-size: 1.5rem; }
}

/* ── Responsive — small mobile ── */
@media (max-width: 374px) {
    .disc-book-closed__img { width: 80px; height: 80px; }
    .disc-book__page { gap: 2px; padding: 2px; top: 17%; bottom: 13%; }
    .disc-book__page--left { left: 10%; right: 53%; }
    .disc-book__page--right { left: 53%; right: 10%; }
    .disc-slot__label { display: none; }
    .disc-book__arrow { width: 28px; height: 28px; }
    .disc-slot__qmark { font-size: 0.85rem; }
}
