:root {
    --bg: #141022;
    --panel: #221b37;
    --paper: #faf2ff;
    --muted: #e0d3ec;
    --accent: #9cf4da;
    --warm: #ffc4ab;
    --line: #62527a;
    background: var(--bg);
    color: var(--paper);
    font-family: system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.65; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: .22em; }
a:focus-visible,button:focus-visible { outline: 3px solid var(--warm); outline-offset: 4px; }
img { display: block; max-width: 100%; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3,.brand { font-family: Georgia,'Times New Roman',serif; font-weight: 500; line-height: 1.1; }
h2 { font-size: clamp(2.25rem,5vw,4.8rem); letter-spacing: -.04em; margin-bottom: .35em; }
.top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .5rem 2rem;
    min-height: 68px;
    padding: .8rem max(5vw,calc((100vw - 1380px)/2));
    border-bottom: 1px solid var(--line);
    background: #191229;
}
.top a { color: var(--paper); }
.brand { font-size: clamp(1.35rem,3vw,2rem); text-decoration: none; }
.brand small { color: var(--warm); margin-left: .7rem; font: 740 .68rem system-ui; letter-spacing: .13em; }
nav { display: flex; flex-wrap: wrap; gap: .42rem 1rem; font-size: .89rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: .6rem; top: .6rem; z-index: 4; background: var(--bg); padding: .5rem; }
.hero { position: relative; display: grid; isolation: isolate; align-items: center; min-height: clamp(560px,80vh,820px); }
.hero picture,.hero::after { position: absolute; inset: 0; }
.hero picture { z-index: -2; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 64% 40%; }
.hero::after { content: ''; z-index: -1; background: linear-gradient(90deg,#1b132eef 0%,#231630a1 37%,transparent 76%); }
.hero-copy { margin-inline: max(5vw,calc((100vw - 1380px)/2)); }
.hero h1 { max-width: 8ch; font-size: clamp(4.5rem,10vw,10rem); letter-spacing: -.065em; }
.hero p { color: var(--paper); max-width: 33ch; font-size: clamp(1rem,1.9vw,1.35rem); margin: 1.1rem 0 1.55rem; }
.cta,button { display: inline-block; color: #211833; background: var(--accent); border: 1px solid var(--accent); border-radius: .36rem; padding: .68rem 1rem; font: 720 1rem/1.28 system-ui; cursor: pointer; text-decoration: none; }
button:disabled { cursor: default; opacity: .55; }
.section,footer,#daily-editorial { width: min(90%,1380px); margin-inline: auto; }
.section { padding-block: clamp(2.65rem,7vw,6.5rem); border-bottom: 1px solid var(--line); }
#nhap-son { margin-top: clamp(1rem,3vw,2.75rem); padding-top: 0; }
.quest-intro {
    min-height: 285px;
    padding: clamp(1.6rem,5vw,4.8rem);
    display: grid;
    align-content: center;
    background: linear-gradient(90deg,#1b132eef,#1b132e30),url('/assets/duong-vao.webp') center 49% / cover;
    border: 1px solid var(--line);
    border-radius: .8rem .8rem 0 0;
}
.quest-intro p { max-width: 39ch; }
.quest { padding: clamp(.85rem,3vw,2.4rem); background: #1c162d; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 .8rem .8rem; }
.schools { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .95rem; }
.school { padding: clamp(.95rem,2vw,1.65rem); background: var(--panel); border-top: 3px solid var(--accent); }
.school:nth-child(2) { border-color: var(--warm); }
.school:nth-child(3) { border-color: #d6b4ff; }
.school h3,.trial h3,#outcome h3 { font-size: clamp(1.75rem,3.25vw,3.1rem); margin-bottom: .55rem; }
.school p { color: var(--muted); margin-bottom: .9rem; }
.school a { display: inline-block; margin: .4rem 0 0 .65rem; }
#journey { margin-bottom: .75rem; color: var(--warm); }
.trial { display: grid; grid-template-columns: minmax(0,.94fr) minmax(0,1.06fr); background: var(--panel); }
.trial img { width: 100%; height: 100%; max-height: 440px; object-fit: cover; }
.trial > div { align-self: center; padding: clamp(1.1rem,3.4vw,3.2rem); }
.eyebrow { color: var(--warm); margin-bottom: .55rem; }
.choices { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.choices button,#restart,#restart-no { color: var(--accent); background: transparent; }
#turn-result,#outcome,#restart-confirm { background: #2c2040; margin-top: 1rem; padding: clamp(1rem,2.5vw,2rem); }
#response-text,#restart-confirm p { margin-bottom: .85rem; }
#restart-wrap { margin-top: 1rem; }
#totals { display: flex; flex-wrap: wrap; gap: .55rem; list-style: none; padding: 0; }
#totals li { border: 1px solid var(--line); padding: .3rem .65rem; }
.gallery { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: clamp(.9rem,2vw,1.6rem); margin-top: 1.5rem; }
.card { min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: .65rem; }
.card img { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; }
.card h3 { font-size: 1.43rem; margin: .73rem .85rem .5rem; }
.card p { color: var(--muted); margin: 0 .85rem 1rem; font-size: .95rem; }
.library { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .95rem; margin-top: 1.4rem; }
.library section { padding: 1rem; background: var(--panel); border-top: 3px solid var(--warm); }
.library h3 { font-size: 1.33rem; }
.library ul { padding-left: 1.15rem; margin-bottom: 0; }
.library li + li { margin-top: .5rem; }
.entry { width: min(90%,805px); margin: clamp(2rem,8vw,6rem) auto; }
.entry h1 { font-size: clamp(2.5rem,8vw,5.6rem); margin-block: .55em; }
.entry h2 { font-size: clamp(1.6rem,3vw,2.35rem); margin-top: .85em; }
.entry p { margin-block: .7em; }
.entry img { width: min(100%,665px); height: auto; }
#daily-editorial,footer { padding-block: 2rem; }
footer { border-top: 1px solid var(--line); color: var(--muted); }

@media (max-width: 930px) {
    .gallery,.library { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 670px) {
    .hero { min-height: 560px; align-items: end; padding-bottom: 2rem; }
    .hero img { object-position: 68% 40%; }
    .hero::after { background: linear-gradient(0deg,#19132b 0%,#231630ac 34%,transparent 72%); }
    .schools,.trial { grid-template-columns: 1fr; }
    .trial img { height: auto; max-height: 310px; }
    .quest-intro { min-height: 230px; }
}
@media (max-width: 460px) {
    .gallery,.library { grid-template-columns: 1fr; }
}
