/* Tửu Quán Truyện — editorial modern theme */

:root {
    --accent: #f59e0b;
    --accent-deep: #b45309;
    --ink-950: #09090b;
    --ink-900: #18181b;
    --ink-800: #27272a;
    --spring: cubic-bezier(.2,.8,.2,1.05);
}

html { -webkit-tap-highlight-color: transparent; }
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'ss01', 'cv11';
}

/* Background — subtle warm glow */
.dark body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(245,158,11,.08), transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(239,68,68,.05), transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Scrollbar */
@media (min-width: 1024px) {
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: rgba(113,113,122,.3); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
    .dark ::-webkit-scrollbar-thumb { background: rgba(63,63,70,.6); border: 2px solid transparent; background-clip: padding-box; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(113,113,122,.5); border: 2px solid transparent; background-clip: padding-box; }
}

/* Display headings — Fraunces tuned */
.font-display { font-family: Fraunces, 'Noto Serif SC', Georgia, serif; font-feature-settings: 'ss01', 'ss04'; letter-spacing: -.01em; }

/* Utility — balance text for headlines */
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

/* Hide scrollbar for horizontal scrollers */
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Glass surface */
.glass {
    background: rgba(9,9,11,.55);
    backdrop-filter: saturate(1.2) blur(18px);
    -webkit-backdrop-filter: saturate(1.2) blur(18px);
    border: 1px solid rgba(255,255,255,.06);
}
.glass-light {
    background: rgba(255,255,255,.7);
    backdrop-filter: saturate(1.2) blur(18px);
    -webkit-backdrop-filter: saturate(1.2) blur(18px);
    border: 1px solid rgba(0,0,0,.05);
}

/* Card tilt on hover */
.card-tilt { transition: transform .5s var(--spring), box-shadow .35s ease; transform-origin: center; will-change: transform; }
.card-tilt:hover { transform: translateY(-4px) scale(1.02); }

/* Cover mask — fade bottom for overlay text */
.mask-b { -webkit-mask-image: linear-gradient(to bottom, black 65%, transparent 100%); mask-image: linear-gradient(to bottom, black 65%, transparent 100%); }

/* Skeleton shimmer */
.skel {
    background: linear-gradient(90deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 100%);
    background-size: 200% 100%;
    animation: shimmer 2.2s linear infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Clamp helpers */
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Chip / pill buttons */
.chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .7rem; border-radius: 999px;
    font-size: .75rem; font-weight: 500;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.85);
    transition: all .2s var(--spring);
}
.chip:hover { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); color: #fbbf24; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #0a0a0c; font-weight: 600; }

/* Underline accent */
.underline-accent { background-image: linear-gradient(90deg, var(--accent), #ef4444); background-repeat: no-repeat; background-size: 100% 3px; background-position: 0 100%; padding-bottom: 3px; }

/* Asian motif separator */
.ornament { position: relative; text-align: center; }
.ornament::before, .ornament::after {
    content: ''; position: absolute; top: 50%; width: 40%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245,158,11,.4), transparent);
}
.ornament::before { left: 0; }
.ornament::after { right: 0; }

/* Hero typography */
.hero-title {
    font-family: Fraunces, 'Noto Serif SC', Georgia, serif;
    font-weight: 900;
    letter-spacing: -.02em;
    line-height: .95;
    font-variation-settings: "SOFT" 80, "opsz" 144;
}

/* Reader — kept from prev */
.reader-page { display: block; width: 100%; max-width: 100%; height: auto; background: #000; }
.reader-root { scroll-behavior: smooth; }
.reader-root[data-mode="webtoon"] .reader-page { margin: 0 auto; }
.reader-root[data-mode="webtoon"][data-gap="0"] .reader-page { margin-bottom: 0; }
.reader-root[data-mode="webtoon"][data-gap="1"] .reader-page { margin-bottom: 4px; }
.reader-root[data-mode="webtoon"][data-gap="2"] .reader-page { margin-bottom: 12px; }
.reader-root[data-mode="single"] .reader-pages { max-width: 960px; margin: 0 auto; }
.reader-root[data-mode="single"] .reader-page { display: none; }
.reader-root[data-mode="single"] .reader-page.active { display: block; }
.reader-root[data-mode="horizontal"] .reader-pages { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0; }
.reader-root[data-mode="horizontal"] .reader-page { flex: 0 0 100%; scroll-snap-align: start; height: auto; max-height: 100vh; width: auto; object-fit: contain; margin: 0 auto; }
.reader-root[data-brightness="50"] .reader-page { filter: brightness(.5); }
.reader-root[data-brightness="65"] .reader-page { filter: brightness(.65); }
.reader-root[data-brightness="80"] .reader-page { filter: brightness(.8); }
.reader-root[data-brightness="100"] .reader-page { filter: none; }
.reader-root[data-width="narrow"] .reader-pages { max-width: 720px; margin: 0 auto; }
.reader-root[data-width="normal"] .reader-pages { max-width: 960px; margin: 0 auto; }
.reader-root[data-width="wide"] .reader-pages { max-width: 1280px; margin: 0 auto; }
.reader-root[data-width="full"] .reader-pages { max-width: 100%; }

.reader-toolbar { transition: transform .3s var(--spring), opacity .3s ease; }
.reader-toolbar.hidden-ui { transform: translateY(-110%); opacity: 0; pointer-events: none; }
.reader-bottombar.hidden-ui { transform: translateY(110%); opacity: 0; pointer-events: none; }

.reader-progress-rail { position: fixed; top: 80px; bottom: 80px; right: 8px; width: 3px; background: rgba(255,255,255,.06); border-radius: 3px; z-index: 20; }
.reader-progress-fill { position: absolute; top: 0; left: 0; width: 100%; background: linear-gradient(180deg,#fbbf24,#d97706); border-radius: 3px; transition: height .12s linear; }

.reader-page.zoomed { cursor: zoom-out; transform: scale(1.5); transform-origin: var(--zoom-x, 50%) var(--zoom-y, 50%); transition: transform .25s ease; }
.reader-page.zoomable { cursor: zoom-in; }

/* Number input spinner cleanup */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
