/* "What's new" guide (v12.0). Bottom sheet on phones, centred card on wider screens.
   Dark mode is handled at the bottom via html.dark, same switch as the rest of the app. */

html.wn-lock, html.wn-lock body { overflow: hidden; }

.wn-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;               /* above the floating nav (11000) and install modal (10000) */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: rgba(8, 12, 24, 0.62);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.wn-overlay.wn-show { opacity: 1; }

.wn-card {
    --wn-bg: #ffffff;
    --wn-text: #1b2333;
    --wn-muted: #566075;
    --wn-line: #e3e8f1;
    --wn-ghost: #eef2f9;
    --wn-mock: #ffffff;
    --wn-mock-line: #d9e0ee;
    --wn-primary: #2563eb;

    width: 100%;
    max-width: 400px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
    background: var(--wn-bg);
    color: var(--wn-text);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    transform: translateY(24px);
    transition: transform 0.25s ease;
}
.wn-overlay.wn-show .wn-card { transform: none; }

@media (min-width: 480px) {
    .wn-overlay { align-items: center; }
}

/* ── Header ── */
.wn-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 8px 12px 20px;
    border-bottom: 1px solid var(--wn-line);
}
.wn-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: inherit;
}
.wn-close {
    flex: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--wn-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.wn-close:hover { background: var(--wn-ghost); }

/* ── Slides ── */
.wn-view {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden auto;
    touch-action: pan-y;
}
.wn-track {
    display: flex;
    transition: transform 0.3s ease;
}
.wn-slide {
    flex: 0 0 100%;
    min-width: 0;
    padding: 18px 20px 6px;
    box-sizing: border-box;
}
.wn-art {
    height: 132px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(var(--rgb), 0.13);
    overflow: hidden;
}
.wn-slide h3 {
    margin: 16px 0 6px;
    font-size: 1.2rem;
    line-height: 1.25;
    color: inherit;
}
.wn-slide p {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.55;
    color: var(--wn-muted);
}

/* ── Mini mock-ups inside the art area ── */
.wn-mock {
    background: var(--wn-mock);
    border: 1px solid var(--wn-mock-line);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--wn-text);
}
/* ── Card 1: Level Filter ── */
.wn-level-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 90%;
    max-width: 290px;
}
.wn-level-pill span {
    background: #ffc107;
    color: #1b2333;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    display: inline-block;
}
.wn-level-sheet-mock {
    width: 100%;
    background: var(--wn-mock);
    border: 1px solid var(--wn-mock-line);
    border-radius: 10px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
}
.wn-level-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    padding: 3px 6px;
    border-radius: 6px;
    color: var(--wn-text);
}
.wn-level-row.active {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.wn-level-row small {
    color: var(--wn-muted);
    font-size: 0.7rem;
}

/* ── Card 2: Our Story & Mission ── */
.wn-story-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 90%;
    max-width: 290px;
}
.wn-story-pill span {
    background: #9333ea;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(147, 51, 234, 0.3);
    display: inline-block;
}
.wn-story-card {
    width: 100%;
    background: var(--wn-mock);
    border: 1px solid var(--wn-mock-line);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
}
.wn-story-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--wn-text);
}
.wn-story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.wn-story-tag {
    background: rgba(147, 51, 234, 0.12);
    border: 1px solid rgba(147, 51, 234, 0.3);
    color: var(--wn-text);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
}

/* ── Card 2: Authentic File Card ── */
.wn-real-card {
    background: var(--wn-mock);
    border: 1px solid var(--wn-mock-line);
    border-radius: 8px;
    padding: 8px 10px;
    width: 90%;
    max-width: 310px;
    box-sizing: border-box;
}
.wn-real-file-top {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--wn-text);
    margin-bottom: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wn-real-size {
    opacity: 0.7;
    font-size: 0.8em;
}
.wn-real-actions {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}
.wn-real-btn {
    flex: 1 1 auto;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 4px 4px;
    border-radius: 6px;
    text-align: center;
    white-space: nowrap;
    line-height: 1.3;
}
.wn-real-btn.open { background: #2e7d32; color: #fff; }
.wn-real-btn.download { background: #0069d9; color: #fff; }
.wn-real-btn.saved { background: #00695c; color: #fff; }
.wn-real-btn.share { background: #0284c7; color: #fff; }
html.dark .wn-real-btn.share { background: #0284c7; color: #fff; }

/* ── Card 2: Organized Saved Books (Checkboxes & Download Selected) ── */
.wn-list { width: 78%; padding: 8px 10px; }
.wn-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.wn-cb {
    flex: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--wn-mock-line);
    border-radius: 4px;
    box-sizing: border-box;
}
.wn-cb.on { background: #16a34a; border-color: #16a34a; position: relative; }
.wn-cb.on::after {
    content: "";
    position: absolute;
    left: 3px; top: 0;
    width: 3px; height: 7px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.wn-dl {
    margin-top: 6px;
    padding: 6px 0;
    border-radius: 6px;
    background: var(--wn-primary);
    color: #fff;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ── Card 3: Authentic Offline Status & Header ── */
.wn-offline-scene {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 90%;
    max-width: 310px;
}
.wn-real-pill span {
    background-color: #d97706;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    padding: 2px 12px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    display: inline-block;
}
.wn-real-header {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    padding: 8px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
html.dark .wn-real-header {
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
}
.wn-real-logo-box {
    position: relative;
    width: 32px;
    height: 32px;
    flex: none;
    display: inline-flex;
}
.wn-real-logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}
.wn-real-logo-box .logo-dark { display: none; }
html.dark .wn-real-logo-box .logo-light { display: none; }
html.dark .wn-real-logo-box .logo-dark { display: block; }

.wn-real-logo-badge {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #f59e0b;
    border: 1.5px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
html.dark .wn-real-logo-badge { border-color: #0f172a; }
.wn-real-header-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: Georgia, serif;
    letter-spacing: 0.2px;
}
.wn-shelf { display: flex; flex-direction: column; align-items: center; }
.wn-books { display: flex; align-items: flex-end; gap: 4px; }
.wn-books i {
    display: block;
    width: 16px;
    border-radius: 3px 3px 1px 1px;
    background: var(--c);
    height: var(--h);
}
.wn-plank { width: 150px; height: 6px; margin-top: 1px; border-radius: 3px; background: #8b5e34; }

/* ── Footer: Back / book-spine progress / Next ── */
.wn-foot {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 16px;
}
.wn-btn {
    min-width: 76px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.wn-back { justify-self: start; background: var(--wn-ghost); color: var(--wn-text); }
.wn-next { justify-self: end; background: var(--wn-primary); color: #fff; }
.wn-back.wn-off { visibility: hidden; }

.wn-spines { display: flex; align-items: flex-end; height: 30px; }
.wn-spine {
    width: 20px;
    height: var(--h);
    padding: 0 4px;
    border: 0;
    background: rgba(var(--rgb), 0.4);
    background-clip: content-box;
    cursor: pointer;
    transition: height 0.2s ease, background-color 0.2s ease;
}
.wn-spine:nth-child(1) { --h: 18px; }
.wn-spine:nth-child(2) { --h: 22px; }
.wn-spine:nth-child(3) { --h: 16px; }
.wn-spine:nth-child(4) { --h: 20px; }
.wn-spine[aria-current="true"] { --h: 28px; background-color: rgb(var(--rgb)); }

.wn-btn:focus-visible, .wn-close:focus-visible, .wn-spine:focus-visible, .wn-link:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

/* ── Re-open links (footer + About) ── */
.wn-link {
    padding: 8px 4px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.wn-link-about { color: #1565c0; }

/* ── Dark mode ── */
html.dark .wn-overlay { background: rgba(0, 0, 0, 0.75); }
html.dark .wn-card {
    --wn-bg: #1e2430;
    --wn-text: #e8eaf0;
    --wn-muted: #9aa3b8;
    --wn-line: #3a4560;
    --wn-ghost: #2a3142;
    --wn-mock: #262d3d;
    --wn-mock-line: #3a4560;
    --wn-primary: #3b82f6;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
html.dark .wn-art { background: rgba(var(--rgb), 0.2); }
html.dark .wn-pin { border-color: #1e2430; }
html.dark .wn-link-about { color: #7eb3ff; }

/* ── Small phones (360px) ── */
@media (max-width: 380px) {
    .wn-slide { padding: 16px 16px 4px; }
    .wn-art { height: 120px; }
    .wn-foot { padding: 10px 12px 14px; }
    .wn-btn { min-width: 68px; padding: 0 14px; }
}
@media (max-height: 520px) {
    .wn-art { height: 84px; }
}

@media (prefers-reduced-motion: reduce) {
    .wn-overlay, .wn-card, .wn-track, .wn-spine { transition: none; }
}
