/* Logtrade Christmas Calendar 2026 */
:root {
    --midnight: #0b1633;
    --navy: #13224d;
    --navy-2: #1b2f66;
    --gold: #d4af37;
    --gold-light: #f3d77a;
    --red: #c8102e;
    --red-dark: #8a0c22;
    --green: #17663d;
    --snow: #f4f8ff;
    --bg: var(--midnight);
    --bg-grad: radial-gradient(ellipse at top, #1d3470 0%, #0b1633 55%, #060d22 100%);
    --text: #eef2fb;
    --muted: #a9b6d6;
    --panel: rgba(255, 255, 255, 0.07);
    --panel-border: rgba(243, 215, 122, 0.22);
    --panel-strong: rgba(19, 34, 77, 0.88);
    --input-bg: rgba(5, 12, 32, 0.55);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --font-display: Georgia, "Cambria", "Times New Roman", serif;
    --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f3f6fc;
    --bg-grad: linear-gradient(180deg, #dfe9f8 0%, #f6f9ff 45%, #ffffff 100%);
    --text: #14213f;
    --muted: #55617f;
    --panel: rgba(255, 255, 255, 0.75);
    --panel-border: rgba(19, 34, 77, 0.12);
    --panel-strong: rgba(255, 255, 255, 0.95);
    --input-bg: #ffffff;
    --shadow: 0 14px 30px rgba(19, 34, 77, 0.12);
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    background-image: var(--bg-grad);
    background-attachment: fixed;
    overflow-x: hidden;
}

#snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .75; }
:root[data-theme="light"] #snow { opacity: .0; }

a { color: var(--gold-light); }
:root[data-theme="light"] a { color: #8a6a10; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: 1.3rem; color: var(--gold-light); }
:root[data-theme="light"] h2 { color: #7a5c06; }
p { margin: 0 0 .8em; }
code { background: rgba(0,0,0,.25); padding: .1em .35em; border-radius: 5px; }
img { max-width: 100%; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--gold); color: #000; padding: .5em 1em; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.right { text-align: right; display: block; }
.lead { font-size: 1.1rem; }
.strong { font-weight: 700; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: .85rem; }
.big-emoji { font-size: 3.5rem; font-family: var(--font-emoji); line-height: 1.2; margin-bottom: .3em; }

/* Layout */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: rgba(8, 16, 40, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--panel-border);
}
:root[data-theme="light"] .site-header { background: rgba(255,255,255,.88); }
.header-inner { max-width: 1240px; margin: 0 auto; padding: .55rem 16px; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand-logo { background: #fff; border-radius: 10px; padding: 4px 8px; display: flex; align-items: center; height: 36px; }
.brand-logo img { height: 22px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; }
.brand-year { font-size: .75rem; color: var(--gold); letter-spacing: .2em; }

.main-nav { display: flex; gap: .15rem; flex-wrap: wrap; flex: 1; justify-content: center; }
.main-nav a {
    color: var(--text); text-decoration: none; padding: .4rem .7rem; border-radius: 999px;
    font-size: .9rem; white-space: nowrap; transition: background .2s;
}
.main-nav a:hover { background: var(--panel); }
.main-nav a.active { background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; }
.nav-toggle, .nav-burger { display: none; }

.header-tools { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.xp-chip {
    display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; color: #1b1300;
    background: linear-gradient(135deg, var(--gold-light), var(--gold)); padding: .25rem .7rem; border-radius: 999px; font-weight: 700; font-size: .9rem;
}
.xp-value.bump, [data-animate-number].bump { display: inline-block; animation: bump .9s ease; }
@keyframes bump { 30% { transform: scale(1.25); } }

.lang-switch { display: inline-flex; border: 1px solid var(--panel-border); border-radius: 999px; overflow: hidden; }
.lang-switch a { padding: .25rem .6rem; text-decoration: none; color: var(--text); font-size: .85rem; font-weight: 600; }
.lang-switch a.active { background: var(--gold); color: #1b1300; }

.site-main { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 1.5rem 16px 3rem; }
.site-footer { position: relative; z-index: 1; text-align: center; padding: 2rem 16px 2.5rem; color: var(--muted); border-top: 1px solid var(--panel-border); }
.site-footer p:first-child { font-family: var(--font-display); color: var(--gold-light); font-size: 1.05rem; }

@media (max-width: 980px) {
    .nav-burger { display: flex; flex-direction: column; gap: 4px; cursor: pointer; padding: 8px; order: 3; }
    .nav-burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }
    .main-nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
        background: var(--panel-strong); padding: .5rem 16px 1rem; border-bottom: 1px solid var(--panel-border); box-shadow: var(--shadow);
    }
    .main-nav a { padding: .7rem 1rem; border-radius: 12px; font-size: 1rem; }
    .nav-toggle:checked ~ .main-nav { display: flex; }
    .header-tools { order: 2; }
    .brand-text { display: none; }
}

/* Panels & controls */
.glass {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.panel { padding: 2rem 1rem; }
.narrow { max-width: 560px; margin: 2rem auto; }
.page-title { text-align: center; margin: .5rem 0 1rem; }
.title-script { font-style: italic; color: var(--gold-light); text-shadow: 0 2px 18px rgba(212,175,55,.35); }
:root[data-theme="light"] .title-script { color: #8a6a10; text-shadow: none; }
.eyebrow { text-transform: uppercase; letter-spacing: .25em; font-size: .75rem; color: var(--gold); margin-bottom: .3rem; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
    padding: .6rem 1.2rem; border-radius: 999px; border: 1px solid var(--panel-border);
    background: var(--panel); color: var(--text); transition: transform .15s, box-shadow .2s, background .2s;
    min-height: 44px;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #e0263f, var(--red-dark)); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(200,16,46,.35); }
.btn-ghost { background: transparent; }
.btn-danger { background: #7a0f1f; color: #fff; border-color: transparent; }
.btn-lg { padding: .85rem 1.8rem; font-size: 1.1rem; }
.btn-small { padding: .3rem .8rem; min-height: 34px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--gold-light); cursor: pointer; font: inherit; padding: .2rem; text-decoration: underline; }
:root[data-theme="light"] .btn-link { color: #8a6a10; }
.button-row { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin: .8rem 0; }
.button-row.wrap { flex-wrap: wrap; justify-content: flex-start; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .6rem 0; }
.inline-form input, .inline-form select { flex: 1 1 180px; }

input, select, textarea {
    font: inherit; color: var(--text); background: var(--input-bg); border: 1px solid var(--panel-border);
    border-radius: 12px; padding: .65rem .85rem; width: 100%; min-height: 44px;
}
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: auto; accent-color: var(--red); }
label { font-weight: 600; display: block; }
.label { font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: .7rem; }
.checkbox { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; margin-bottom: .8rem; }
.form-grid label { display: flex; flex-direction: column; gap: .3rem; }

.alert { border-radius: 12px; padding: .75rem 1rem; margin: .8rem 0; border: 1px solid transparent; }
.alert-error { background: rgba(200,16,46,.18); border-color: rgba(200,16,46,.5); }
.alert-success { background: rgba(23,102,61,.25); border-color: rgba(60,180,110,.5); }
.alert-info { background: rgba(91,192,235,.12); border-color: rgba(91,192,235,.4); }

.tabs { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { font: inherit; cursor: pointer; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--panel-border); background: var(--panel); color: var(--text); min-height: 40px; }
.tab.active { background: var(--gold); color: #1b1300; font-weight: 700; border-color: transparent; }

.spinner { width: 42px; height: 42px; border: 4px solid var(--panel-border); border-top-color: var(--gold); border-radius: 50%; display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { display: flex; justify-content: center; padding: 4rem 0; }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }

.avatar {
    display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0;
    background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--av, #c8102e) 70%, #fff), var(--av, #c8102e));
    border: 2px solid var(--gold); font-family: var(--font-emoji); vertical-align: middle;
}
.avatar.anon { background: #2b3556; }
.avatar-sm { width: 30px; height: 30px; font-size: 1rem; border-width: 1.5px; }
.avatar-md { width: 42px; height: 42px; font-size: 1.35rem; }
.avatar-lg { width: 60px; height: 60px; font-size: 2rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 3.2rem; border-width: 3px; }
.header-avatar { display: flex; text-decoration: none; }

/* Welcome */
.welcome { position: relative; min-height: calc(100vh - 220px); display: flex; align-items: center; justify-content: center; padding: 1rem 0 3rem; }
.welcome-scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.moon { position: absolute; top: 9%; right: 12%; width: 90px; height: 90px; border-radius: 50%; background: #fdf3c4; box-shadow: 0 0 60px 20px rgba(253,243,196,.25); }
.hills .hill { position: absolute; bottom: -10%; border-radius: 50%; background: #e8f0fb; }
.hills .h1 { left: -10%; width: 70%; height: 38%; opacity: .9; }
.hills .h2 { right: -15%; width: 75%; height: 42%; background: #f4f8ff; }
.hills .h3 { left: 25%; width: 60%; height: 28%; background: #dbe6f5; }
.trees { position: absolute; bottom: 14%; left: 0; right: 0; height: 160px; }
.tree { position: absolute; bottom: 0; width: 0; height: 0; border-left: 34px solid transparent; border-right: 34px solid transparent; border-bottom: 110px solid #17663d; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.tree .tree-star { position: absolute; left: -9px; top: -6px; color: var(--gold-light); font-size: 18px; animation: twinkle 2s ease-in-out infinite; }
.tree.t0 { left: 4%; transform: scale(.8); } .tree.t1 { left: 16%; transform: scale(1.1); } .tree.t2 { left: 30%; transform: scale(.7); }
.tree.t3 { right: 30%; transform: scale(.9); } .tree.t4 { right: 18%; transform: scale(1.2); } .tree.t5 { right: 6%; transform: scale(.75); } .tree.t6 { left: 48%; transform: scale(.6); opacity: .8; }
@keyframes twinkle { 50% { opacity: .35; transform: scale(.8); } }
.lights { position: absolute; top: 0; left: 0; right: 0; height: 60px; display: flex; justify-content: space-around; }
.lights::before { content: ""; position: absolute; top: 18px; left: 0; right: 0; height: 30px; border-bottom: 2px solid rgba(255,255,255,.25); border-radius: 0 0 50% 50%; }
.bulb { width: 12px; height: 18px; border-radius: 50%; margin-top: 30px; background: hsl(calc(var(--i) * 47), 85%, 60%); box-shadow: 0 0 14px 4px hsla(calc(var(--i) * 47), 85%, 60%, .6); animation: glow 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * .13s); }
@keyframes glow { 50% { opacity: .35; box-shadow: none; } }

.welcome-card { max-width: 560px; width: 100%; text-align: center; padding: 2.2rem 1.5rem; background: var(--panel-strong); }
.welcome-title { font-size: clamp(2.2rem, 7vw, 3.6rem); color: var(--gold-light); text-shadow: 0 4px 24px rgba(212,175,55,.35); margin-bottom: .3rem; }
.welcome-title span { display: block; }
.welcome-title-sv { font-size: .62em; color: var(--text); font-style: italic; }
.welcome-slogan { color: var(--muted); font-size: 1.05rem; }
.choose-language { margin-top: 1.5rem; font-weight: 600; letter-spacing: .05em; }
.language-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .6rem; }
.btn-lang { padding: 1rem; font-size: 1.15rem; flex-direction: column; border-radius: 16px; background: linear-gradient(135deg, var(--navy-2), var(--navy)); border: 1px solid var(--gold); color: #fff; }
.btn-lang:hover { background: linear-gradient(135deg, #e0263f, var(--red-dark)); }
.lang-flag { font-size: 1.8rem; font-family: var(--font-emoji); }
.welcome-countdown { margin-top: 1.2rem; color: var(--gold-light); }
.welcome-gift { display: flex; justify-content: center; margin-bottom: .8rem; }
.gift-box { position: relative; width: 74px; height: 64px; }
.gift-box::before { content: ""; position: absolute; bottom: 0; left: 6px; right: 6px; height: 44px; background: var(--red); border-radius: 4px; }
.gift-lid { position: absolute; top: 8px; left: 0; right: 0; height: 16px; background: #e0263f; border-radius: 4px; animation: lid 3s ease-in-out infinite; transform-origin: left bottom; }
.gift-ribbon { position: absolute; top: 8px; bottom: 0; left: 50%; width: 10px; margin-left: -5px; background: var(--gold); }
@keyframes lid { 0%, 70%, 100% { transform: rotate(0); } 80% { transform: rotate(-18deg) translateY(-6px); } 90% { transform: rotate(-8deg); } }

/* Auth */
.auth-page { display: flex; justify-content: center; padding: 1.5rem 0; }
.auth-card { width: 100%; max-width: 440px; text-align: center; background: var(--panel-strong); }
.auth-card.wide { max-width: 760px; }
.auth-card form { text-align: left; }
.auth-icon { font-size: 2.6rem; font-family: var(--font-emoji); }
.code-input { font-size: 1.8rem; letter-spacing: .5em; text-align: center; font-weight: 700; }
.auth-card .inline-form { justify-content: center; }

/* Calendar */
.calendar-hero { text-align: center; margin-bottom: 1.5rem; }
.slogan { color: var(--gold-light); font-family: var(--font-display); font-style: italic; }
.calendar-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; margin-top: 1rem; }
.progress-card { margin: 0; padding: .9rem 1rem; text-align: center; }
.progress-label { font-size: .9rem; color: var(--muted); margin-bottom: .3rem; }
.progress-bar { height: 12px; border-radius: 999px; background: rgba(0,0,0,.3); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); border-radius: 999px; transition: width 1s ease; }
.countdown { font-family: Consolas, "Courier New", monospace; font-size: 1.25rem; font-weight: 700; color: var(--gold-light); }
:root[data-theme="light"] .countdown { color: #8a6a10; }
.big-countdown { max-width: 420px; margin: 1rem auto; }
.big-countdown .countdown { font-size: 2rem; }

.calendar-board {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px;
    padding: 18px; border-radius: 26px;
    background: linear-gradient(160deg, rgba(122, 59, 31, .55), rgba(61, 26, 10, .65));
    border: 3px solid var(--gold); box-shadow: var(--shadow), inset 0 0 40px rgba(0,0,0,.35);
}
.door {
    position: relative; aspect-ratio: 3 / 4; perspective: 700px; text-decoration: none; color: #fff;
    display: flex; flex-direction: column; border-radius: 14px;
}
.door-frame { position: relative; flex: 1; border-radius: 12px; background: #0b1633; box-shadow: inset 0 0 18px rgba(0,0,0,.8); overflow: visible; }
.door-inside { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; font-family: var(--font-emoji); border-radius: 12px;
    background: radial-gradient(circle, rgba(243,215,122,.35), transparent 70%); }
.door-panel {
    position: absolute; inset: 0; border-radius: 12px; transform-origin: left center; transition: transform .7s cubic-bezier(.3,.7,.3,1);
    display: flex; flex-direction: column; align-items: center; justify-content: center; backface-visibility: hidden;
    border: 2px solid rgba(243,215,122,.7); box-shadow: 0 6px 14px rgba(0,0,0,.35);
    background: var(--door-bg, linear-gradient(145deg, #c8102e, #8a0c22));
}
.door-number { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 700; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
.door-deco { font-size: 1.1rem; font-family: var(--font-emoji); opacity: .9; }
.door-knob { position: absolute; right: 9px; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 4px rgba(0,0,0,.5); }
.door-badge { font-size: .75rem; text-align: center; margin-top: 6px; color: #fff; font-weight: 600; min-height: 1.2em; }
.variant-0 .door-panel { --door-bg: linear-gradient(145deg, #c8102e, #7e0b1f); }
.variant-1 .door-panel { --door-bg: linear-gradient(145deg, #17663d, #0c3d24); }
.variant-2 .door-panel { --door-bg: linear-gradient(145deg, #1b2f66, #0b1633); }
.variant-3 .door-panel { --door-bg: repeating-linear-gradient(45deg, #c8102e 0 12px, #f4f8ff 12px 24px); }
.variant-4 .door-panel { --door-bg: linear-gradient(145deg, #6b2fa0, #3c1561); }
.variant-5 .door-panel { --door-bg: radial-gradient(circle at 30% 20%, #2f8a5b, #0c3d24); }
.variant-6 .door-panel { --door-bg: repeating-linear-gradient(90deg, #17663d 0 14px, #1d7a49 14px 28px); }
.variant-7 .door-panel { --door-bg: radial-gradient(circle at 70% 30%, #e0263f, #6d0818); }
.variant-3 .door-number { color: #0b1633; text-shadow: 0 0 6px #fff, 0 0 2px #fff; }
.door-gold .door-panel { --door-bg: linear-gradient(145deg, #f3d77a, #b8860b); border-color: #fff6cf; box-shadow: 0 0 24px rgba(243,215,122,.6); }
.door-gold .door-number { color: #3d2a00; text-shadow: 0 1px 0 #fff6cf; }
.door-special:not(.door-gold) .door-panel::after { content: "★"; position: absolute; top: 6px; left: 8px; color: var(--gold-light); font-size: .9rem; }

.door-locked { cursor: not-allowed; }
.door-locked .door-panel { filter: saturate(.55) brightness(.75); }
.door-locked:active .door-panel { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.door-available .door-panel, .door-special .door-panel { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 22px rgba(243,215,122,.75); } }
.door-available:hover .door-panel, .door-special:hover .door-panel { transform: rotateY(-22deg); }
.door-opened .door-panel { transform: rotateY(-35deg); }
.door-completed .door-panel { transform: rotateY(-72deg); }
.door-completed .door-badge { color: var(--gold-light); }
.door-disabled { opacity: .5; }

@media (max-width: 900px) { .calendar-board { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .calendar-board { grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px; } .door-badge { font-size: .68rem; } }

/* Door page */
.door-page { max-width: 900px; margin: 0 auto; }
.door-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.door-date { color: var(--gold-light); font-family: var(--font-display); font-style: italic; }
.door-header { display: grid; grid-template-columns: 120px 1fr; gap: 1.25rem; align-items: center; margin-bottom: 1rem; }
.door-opening { position: relative; width: 120px; height: 150px; border-radius: 14px; background: #0b1633; border: 3px solid var(--gold); perspective: 600px; overflow: visible; }
.opening-left, .opening-right { position: absolute; top: 0; bottom: 0; width: 50%; background: linear-gradient(145deg, #c8102e, #7e0b1f); transition: transform 1.1s cubic-bezier(.3,.7,.3,1); }
.opening-left { left: 0; transform-origin: left; border-radius: 10px 0 0 10px; }
.opening-right { right: 0; transform-origin: right; border-radius: 0 10px 10px 0; }
.opening-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 3.4rem; font-family: var(--font-emoji); transform: scale(.4); opacity: 0; transition: all .8s .5s; }
.door-header.is-open .opening-left { transform: rotateY(-110deg); }
.door-header.is-open .opening-right { transform: rotateY(110deg); }
.door-header.is-open .opening-icon { transform: scale(1); opacity: 1; }
.door-page-gold .opening-left, .door-page-gold .opening-right { background: linear-gradient(145deg, #f3d77a, #b8860b); }
@media (max-width: 600px) { .door-header { grid-template-columns: 1fr; text-align: center; } .door-opening { margin: 0 auto; } }

.instructions summary { cursor: pointer; font-weight: 700; color: var(--gold-light); }
:root[data-theme="light"] .instructions summary { color: #7a5c06; }
.instructions p:first-of-type { margin-top: .7rem; }
.mode-banner { text-align: center; font-weight: 700; padding: .5rem 1rem; border-radius: 999px; margin: 0 auto 1rem; max-width: 560px; }
.mode-banner.practice { background: rgba(91,192,235,.18); border: 1px solid rgba(91,192,235,.5); }
.mode-banner.preview { background: rgba(212,175,55,.2); border: 1px solid var(--gold); }

.result-card { text-align: center; }
.result-card.success { border-color: var(--gold); background: linear-gradient(135deg, rgba(212,175,55,.18), rgba(23,102,61,.18)); }
.result-points { font-family: var(--font-display); font-size: 2.8rem; color: var(--gold-light); font-weight: 700; }
.bonus { color: var(--gold-light); font-weight: 700; }
.achievement-unlock { margin: .6rem auto; padding: .6rem 1rem; border-radius: 999px; background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #2a1d00; display: inline-block; animation: unlock .9s cubic-bezier(.3,1.6,.5,1); }
@keyframes unlock { from { transform: scale(.3) rotate(-10deg); opacity: 0; } }

/* Games – shared */
.game-start, .game-over { text-align: center; padding: 1rem; }
.game-over h3 { color: var(--gold-light); }
.game-hud { display: flex; justify-content: space-between; gap: 1rem; font-weight: 700; margin-bottom: .8rem; flex-wrap: wrap; }
.stage-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(5,12,32,.72); border-radius: 14px; text-align: center; padding: 1rem; color: #fff; }
.legend { font-family: var(--font-emoji), var(--font-body); }

/* Quiz */
.quiz { max-width: 760px; margin: 0 auto 1.25rem; }
.quiz-progress { display: flex; gap: .4rem; justify-content: center; margin-bottom: .4rem; flex-wrap: wrap; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--panel-border); background: transparent; padding: 0; cursor: pointer; }
.dot.current { border-color: var(--gold); background: rgba(212,175,55,.35); }
.dot.correct { background: #2eaa63; border-color: #2eaa63; }
.dot.wrong { background: var(--red); border-color: var(--red); }
.quiz-count { text-align: center; color: var(--muted); font-size: .85rem; }
.quiz-visual { display: flex; align-items: center; justify-content: center; gap: 1rem; font-size: 2.4rem; font-family: var(--font-emoji); margin: .5rem 0 1rem; flex-wrap: wrap; }
.quiz-visual.emoji-big { font-size: clamp(2.2rem, 7vw, 3.4rem); letter-spacing: .1em; }
.flag { width: 96px; height: 64px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.3); }
.quiz-question { text-align: center; font-size: 1.3rem; color: var(--text); }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1rem; }
.quiz-options.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .quiz-options { grid-template-columns: 1fr; } .quiz-options.two { grid-template-columns: 1fr 1fr; } }
.option {
    font: inherit; text-align: left; cursor: pointer; padding: .9rem 1rem; border-radius: 14px; min-height: 56px;
    background: var(--input-bg); color: var(--text); border: 2px solid var(--panel-border); transition: all .2s;
}
.quiz-truefalse .option { text-align: center; font-size: 1.15rem; font-weight: 700; }
.option:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); }
.option.correct { background: rgba(46,170,99,.3); border-color: #2eaa63; }
.option.wrong { background: rgba(200,16,46,.3); border-color: var(--red); animation: shake .4s; }
.option.dim { opacity: .55; }
.option:disabled { cursor: default; }
.quiz-feedback { margin-top: 1rem; padding: 1rem; border-radius: 14px; animation: unlock .5s ease; }
.quiz-feedback.good { background: rgba(46,170,99,.18); border: 1px solid rgba(46,170,99,.5); }
.quiz-feedback.bad { background: rgba(200,16,46,.15); border: 1px solid rgba(200,16,46,.45); }
.quiz-feedback p { margin: .3rem 0 0; }
.quiz-nav { text-align: center; margin-top: 1rem; }

/* Memory */
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 520px; margin: 0 auto; }
.memory-card { aspect-ratio: 1; perspective: 600px; background: none; border: none; padding: 0; cursor: pointer; }
.memory-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.memory-card.flipped .memory-inner { transform: rotateY(180deg); }
.memory-back, .memory-front { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 12px; backface-visibility: hidden; font-family: var(--font-emoji); }
.memory-back { background: repeating-linear-gradient(45deg, #c8102e 0 10px, #a00d25 10px 20px); border: 2px solid var(--gold); font-size: 1.6rem; }
.memory-front { background: #f4f8ff; transform: rotateY(180deg); font-size: clamp(1.8rem, 7vw, 2.6rem); border: 2px solid var(--gold); }
.memory-card.matched .memory-front { background: #fff6cf; box-shadow: 0 0 16px rgba(243,215,122,.8); }

/* Go Kart */
.gokart-track { position: relative; height: 46px; border-radius: 999px; background: repeating-linear-gradient(90deg, #333 0 30px, #3d3d3d 30px 60px); margin-bottom: 1rem; overflow: hidden; border: 2px dashed #fff; }
.kart { position: absolute; top: 4px; font-size: 1.8rem; animation: drive 6s linear infinite; font-family: var(--font-emoji); }
.flag-end { position: absolute; right: 8px; top: 6px; font-size: 1.6rem; font-family: var(--font-emoji); }
@keyframes drive { from { left: -40px; } to { left: 100%; } }
.driver-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; margin: 1rem 0; }
.driver { font: inherit; cursor: pointer; padding: 1rem .6rem; border-radius: 16px; border: 2px solid var(--panel-border); background: var(--input-bg); color: var(--text); display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.driver.selected { border-color: var(--gold); box-shadow: 0 0 18px rgba(212,175,55,.5); }
.driver.winner { background: linear-gradient(135deg, rgba(243,215,122,.35), rgba(212,175,55,.15)); }
.driver-helmet { font-size: 2rem; font-family: var(--font-emoji); }
.driver-name { font-weight: 700; }
.driver-votes, .driver-mine { font-size: .8rem; color: var(--muted); }
.driver-mine { color: var(--gold-light); }

/* Wheel */
.wheel-stage { position: relative; width: min(360px, 86vw); margin: 0 auto 1rem; }
.wheel { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 20px rgba(0,0,0,.45)); transform-origin: 50% 50%; }
.wheel-pointer { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); color: var(--gold-light); font-size: 2rem; z-index: 2; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.wheel-text { fill: #fff; font-size: 15px; font-weight: 800; font-family: var(--font-body); }
.wheel-center { font-size: 18px; }
.wheel-result { text-align: center; font-size: 1.4rem; font-weight: 700; color: var(--gold-light); animation: unlock .6s ease; }

/* Catch */
.catch-stage { position: relative; max-width: 720px; margin: 0 auto; }
.catch-canvas { width: 100%; height: auto; display: block; border-radius: 14px; border: 2px solid var(--gold); touch-action: none; background: #0b1633; }

/* Reaction */
.reaction-pad {
    height: 260px; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
    font-size: 1.6rem; font-weight: 800; cursor: pointer; user-select: none; touch-action: manipulation; transition: background .1s; color: #fff;
    background: #24417e; border: 3px solid var(--gold); margin-bottom: 1rem; text-align: center; padding: 1rem;
}
.reaction-light { width: 60px; height: 60px; border-radius: 50%; background: #333; box-shadow: inset 0 0 10px rgba(0,0,0,.6); }
.reaction-pad.state-wait { background: #6d0818; }
.reaction-pad.state-wait .reaction-light { background: var(--red); box-shadow: 0 0 30px var(--red); }
.reaction-pad.state-go { background: #0f5a33; }
.reaction-pad.state-go .reaction-light { background: #3ee07f; box-shadow: 0 0 40px #3ee07f; }
.reaction-pad.state-early { background: #8a5a00; }
.reaction-pad.state-done { background: #1b2f66; }
.reaction-results { text-align: center; }

/* Words */
.word-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.word-row { padding: .8rem; border-radius: 14px; background: var(--input-bg); border: 1px solid var(--panel-border); }
.word-row.solved { border-color: #2eaa63; }
.word-row.skipped { opacity: .75; }
.scrambled { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: .4rem; }
.tile { width: 36px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 800; font-size: 1.2rem; color: #2a1d00; background: linear-gradient(145deg, #fff6cf, var(--gold)); box-shadow: 0 3px 0 #8a6a10; }
.hint { font-size: .85rem; color: var(--muted); margin: 0 0 .4rem; }
.word-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.word-form input { flex: 1 1 160px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.wrong-text { color: #ff8a9a; }
.answer { margin: 0; font-size: 1.1rem; letter-spacing: .08em; }

/* Mystery boxes & finale present */
.gift-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; max-width: 520px; margin: 1rem auto; }
.mystery-box, .present-big { position: relative; aspect-ratio: 1; background: none; border: none; cursor: pointer; padding: 0; transition: transform .25s; }
.mystery-box:hover:not(:disabled) { transform: translateY(-6px) rotate(-3deg); }
.mystery-box.faded { opacity: .35; }
.box-body { position: absolute; left: 10%; right: 10%; bottom: 0; height: 62%; border-radius: 6px; background: var(--box, var(--red)); box-shadow: inset -8px -8px 0 rgba(0,0,0,.15); }
.box-lid { position: absolute; left: 4%; right: 4%; top: 22%; height: 18%; border-radius: 6px; background: var(--lid, #e0263f); z-index: 2; transition: transform .7s cubic-bezier(.3,1.4,.5,1); }
.box-ribbon { position: absolute; left: 46%; width: 8%; top: 22%; bottom: 0; background: var(--gold); z-index: 3; }
.box-ribbon::before, .box-ribbon::after { content: ""; position: absolute; top: -18%; width: 220%; height: 22%; border: 4px solid var(--gold); border-radius: 50%; }
.box-ribbon::before { right: 50%; } .box-ribbon::after { left: 50%; }
.mystery-box.opened .box-lid, .present-big.opened .box-lid { transform: translateY(-50%) rotate(-25deg); }
.mystery-box.opened .box-ribbon, .present-big.opened .box-ribbon { opacity: 0; }
.box-reward { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 800; color: var(--gold-light); text-shadow: 0 2px 8px #000; z-index: 4; animation: unlock .7s ease; }
.color-1 { --box: #17663d; --lid: #1d7a49; } .color-2 { --box: #1b2f66; --lid: #263f85; } .color-3 { --box: #6b2fa0; --lid: #8344bd; }
.color-4 { --box: #b8860b; --lid: #d4a017; } .color-5 { --box: #0f7c8c; --lid: #14a0b4; }
.present-big { width: min(220px, 60vw); margin: 1rem auto; display: block; }
.final-present { text-align: center; }

/* Scenes */
.scene-wrap { overflow: auto; border-radius: 14px; border: 2px solid var(--gold); touch-action: pinch-zoom; }
.scene { width: 100%; height: auto; display: block; cursor: crosshair; }
.found-ring { fill: none; stroke: var(--gold-light); stroke-width: 4; stroke-dasharray: 6 4; animation: spin 8s linear infinite; transform-box: fill-box; transform-origin: center; }
.miss-mark { fill: #ff4d6d; font-size: 22px; font-weight: 800; }
.miss-mark.small { font-size: 14px; }
.spot-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.spot-panels figure { margin: 0; }
.spot-panels .scene { border-radius: 12px; border: 2px solid var(--gold); }
.spot-panels figcaption { text-align: center; font-size: .85rem; color: var(--muted); margin-top: .3rem; }
@media (max-width: 700px) { .spot-panels { grid-template-columns: 1fr; } }

/* Route */
.route-map { width: 100%; height: auto; display: block; border-radius: 14px; border: 2px solid var(--gold); background: #eaf2fb; }
.route-line { fill: none; stroke: var(--red); stroke-width: .9; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 2 1.2; }
.route-line.optimal { stroke: #17663d; stroke-dasharray: none; opacity: .45; stroke-width: 1.6; }
.route-stop, .route-depot { cursor: pointer; }
.route-stop circle { fill: #fff; stroke: var(--navy-2); stroke-width: .6; transition: fill .2s; }
.route-stop:hover circle { fill: #fff6cf; }
.route-stop.visited circle { fill: var(--gold-light); stroke: var(--red); }
.route-depot circle { fill: var(--red); stroke: var(--gold); stroke-width: .7; }
.route-icon { font-size: 4.2px; font-family: var(--font-emoji); font-weight: 700; fill: #0b1633; }
.route-label { font-size: 2.8px; fill: #0b1633; font-weight: 700; }

/* Detective */
.clue-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .7rem; }
.clue-card { display: flex; gap: .7rem; align-items: flex-start; padding: .9rem; border-radius: 14px; background: #fff8e1; color: #2a1d00; box-shadow: 0 4px 10px rgba(0,0,0,.25); transform: rotate(-.5deg); }
.clue-card:nth-child(even) { transform: rotate(.6deg); }
.clue-icon { font-size: 1.6rem; font-family: var(--font-emoji); }
.detective fieldset { border: none; padding: 0; margin: 0 0 1rem; }
.detective legend { font-weight: 700; font-family: var(--font-display); font-size: 1.15rem; margin-bottom: .6rem; color: var(--gold-light); }
.suspect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.suspect, .evidence { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; padding: .8rem; border-radius: 14px; border: 2px solid var(--panel-border); background: var(--input-bg); cursor: pointer; font-weight: 400; }
.evidence { flex-direction: row; text-align: left; }
.evidence-list { display: grid; gap: .5rem; }
.suspect.selected, .evidence.selected { border-color: var(--gold); }
.suspect.correct, .evidence.correct { border-color: #2eaa63; background: rgba(46,170,99,.2); }
.suspect input, .evidence input { position: absolute; opacity: 0; }
.suspect-icon { font-size: 2rem; font-family: var(--font-emoji); }
.solution { padding: 1rem; border-radius: 14px; }
.solution.good { background: rgba(46,170,99,.18); }
.solution.bad { background: rgba(200,16,46,.15); }

/* Appreciation & gifts */
.gift-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; }
.gift-option { font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .6rem .3rem; border-radius: 14px; border: 2px solid var(--panel-border); background: var(--input-bg); color: var(--text); }
.gift-option span { font-size: 1.8rem; font-family: var(--font-emoji); }
.gift-option.selected { border-color: var(--gold); box-shadow: 0 0 14px rgba(212,175,55,.45); }

/* Finale */
.finale-greeting { text-align: center; background: linear-gradient(160deg, rgba(212,175,55,.22), rgba(200,16,46,.18)); }
.finale-tree { position: relative; width: 120px; height: 150px; margin: 0 auto 1rem; }
.ft-star { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); color: var(--gold-light); font-size: 2rem; animation: twinkle 1.6s infinite; z-index: 2; }
.ft-layer { position: absolute; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: solid transparent; border-right: solid transparent; border-bottom: solid #1d7a49; }
.ft-layer.l1 { top: 14px; border-width: 0 30px 44px; }
.ft-layer.l2 { top: 40px; border-width: 0 45px 52px; border-bottom-color: #17663d; }
.ft-layer.l3 { top: 70px; border-width: 0 60px 60px; border-bottom-color: #0f5a33; }
.ft-trunk { position: absolute; bottom: 0; left: 50%; width: 18px; height: 22px; margin-left: -9px; background: #5b3a1e; }
.finale-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.25rem; }
.stat { margin: 0; text-align: center; padding: 1rem .6rem; }
.stat-value { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--gold-light); }
:root[data-theme="light"] .stat-value { color: #8a6a10; }
.stat-label { font-size: .85rem; color: var(--muted); }
.badge-row { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 1rem; }
.badge-mini { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .7rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--gold); font-family: var(--font-emoji), var(--font-body); }
.mini-board { list-style: none; padding: 0; margin: 0 0 1rem; }
.mini-board li { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: 10px; }
.mini-board li.me { background: rgba(212,175,55,.2); }
.mini-board .rank { width: 2rem; font-weight: 800; color: var(--gold-light); text-align: right; }
.mini-board .name { flex: 1; }
.mini-board .xp { font-weight: 700; }

/* Leaderboard */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: .6rem; margin: 1rem 0 1.5rem; }
.podium-step { display: flex; flex-direction: column; align-items: center; flex: 0 1 180px; }
.podium-person { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: .4rem; animation: unlock .8s ease; }
.podium-person.me .podium-name { color: var(--gold-light); }
.podium-name { font-weight: 700; font-size: .9rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-size: .8rem; color: var(--muted); }
.podium-block { width: 100%; border-radius: 12px 12px 0 0; display: flex; align-items: flex-start; justify-content: center; padding-top: .5rem; font-size: 2rem; font-family: var(--font-emoji); border: 2px solid var(--gold); border-bottom: none; }
.step-1 .podium-block { height: 130px; background: linear-gradient(180deg, #f3d77a, #b8860b); }
.step-2 .podium-block { height: 95px; background: linear-gradient(180deg, #e6ecf5, #9aa6b8); }
.step-3 .podium-block { height: 70px; background: linear-gradient(180deg, #e3a76f, #9a5a24); }
.table-wrap { overflow-x: auto; }
.board { width: 100%; border-collapse: collapse; }
.board th, .board td { padding: .6rem .5rem; border-bottom: 1px solid var(--panel-border); text-align: left; vertical-align: middle; }
.board th { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.board .num { text-align: right; white-space: nowrap; }
.board .rank { font-weight: 800; color: var(--gold-light); width: 3rem; }
.board tr.me { background: rgba(212,175,55,.18); }
.board.compact th, .board.compact td { padding: .4rem .45rem; font-size: .9rem; }
.board td.neg { color: #ff8a9a; }
.board .who { display: flex; align-items: center; gap: .5rem; }
.board .actions { white-space: nowrap; }
@media (max-width: 600px) { .hide-sm { display: none; } }

/* Achievements */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.badge-card { text-align: center; padding: 1.2rem; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-border); }
.badge-card h2 { font-size: 1.1rem; margin: .6rem 0 .3rem; }
.badge-card p { font-size: .9rem; color: var(--muted); }
.badge-card.locked { filter: grayscale(.8); opacity: .65; }
.badge-card.unlocked { border-color: var(--gold); box-shadow: 0 0 22px rgba(212,175,55,.22); }
.badge-medal { position: relative; width: 92px; height: 110px; margin: 0 auto; }
.medal-ribbon { position: absolute; top: 0; left: 26px; width: 40px; height: 40px; background: linear-gradient(90deg, var(--red) 0 33%, #fff 33% 66%, var(--green) 66%); clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%); }
.medal-disc { position: absolute; bottom: 0; left: 6px; width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; font-family: var(--font-emoji);
    background: radial-gradient(circle at 35% 30%, #fff6cf, var(--gold) 55%, #8a6a10); border: 3px solid #fff3c0; box-shadow: 0 6px 14px rgba(0,0,0,.35); }
.badge-date { color: var(--gold-light) !important; font-weight: 600; }

/* Wall */
.wall-composer { max-width: 760px; margin: 0 auto 1.5rem; }
.wall-feed { max-width: 760px; margin: 0 auto; display: grid; gap: .9rem; }
.wall-post { padding: 1rem; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-border); box-shadow: var(--shadow); }
.wall-post header { display: flex; gap: .7rem; align-items: center; margin-bottom: .5rem; }
.wall-post header > div { flex: 1; }
.wall-post.for-me { border-color: var(--gold); }
.wall-post.kind-appreciation { border-left: 4px solid var(--red); }
.wall-post.kind-gift { border-left: 4px solid var(--gold); }
.wall-post.kind-joke { border-left: 4px solid #5bc0eb; }
.wall-post.removed { opacity: .5; }
.wall-text { white-space: pre-wrap; word-break: break-word; }
.wall-gift { font-size: 2.2rem; font-family: var(--font-emoji); animation: unlock .7s ease; }
.wall-post footer { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.reactions { display: flex; gap: .3rem; flex-wrap: wrap; }
.reaction { font: inherit; cursor: pointer; padding: .2rem .55rem; border-radius: 999px; border: 1px solid var(--panel-border); background: var(--input-bg); color: var(--text); font-family: var(--font-emoji), var(--font-body); min-height: 34px; }
.reaction.mine { border-color: var(--gold); background: rgba(212,175,55,.2); }
.to { color: var(--gold-light); }
.badge-pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; background: var(--gold); color: #2a1d00; font-size: .8rem; font-weight: 700; }
.badge-pill.danger { background: var(--red); color: #fff; }

/* Profile & settings */
.profile-hero { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.profile-hero h1 { margin: 0; }
.door-chips { display: grid; grid-template-columns: repeat(8, 1fr); gap: .4rem; margin-bottom: 1.2rem; }
.door-chip { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--panel-border); text-decoration: none; color: var(--muted); font-weight: 700; }
.door-chip.done { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #2a1d00; border-color: transparent; }
.gift-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.gift-list li { display: flex; gap: .7rem; align-items: flex-start; }
.gift-emoji { font-size: 1.8rem; font-family: var(--font-emoji); }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: .5rem; }
.avatar-option { background: none; border: 3px solid transparent; border-radius: 50%; padding: 3px; cursor: pointer; display: flex; justify-content: center; }
.avatar-option.selected { border-color: var(--gold-light); box-shadow: 0 0 14px rgba(243,215,122,.6); }
.settings { max-width: 720px; margin: 0 auto 1.25rem; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--panel-border); font-weight: 400; cursor: pointer; }
.setting-row p { margin: 0; }
.segmented { display: inline-flex; border: 1px solid var(--panel-border); border-radius: 999px; overflow: hidden; }
.segmented button { font: inherit; border: none; background: transparent; color: var(--text); padding: .45rem .9rem; cursor: pointer; }
.segmented button.active { background: var(--gold); color: #2a1d00; font-weight: 700; }
.switch { appearance: none; -webkit-appearance: none; width: 52px !important; height: 30px; min-height: 30px !important; border-radius: 999px; background: #44506f; position: relative; cursor: pointer; flex-shrink: 0; border: none; padding: 0; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch:checked { background: #2eaa63; }
.switch:checked::after { transform: translateX(22px); }

/* Rules */
.prose { max-width: 820px; margin: 0 auto 1.25rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }

/* Awards */
.awards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.award-card { text-align: center; margin: 0; }
.award-card.mine { border-color: var(--gold); box-shadow: 0 0 26px rgba(212,175,55,.45); }
.award-icon { font-size: 3rem; font-family: var(--font-emoji); }
.winner-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.winner-list li { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; }

/* Admin */
.admin-nav { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-bottom: 1.25rem; }
.admin-nav a { padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--panel-border); text-decoration: none; color: var(--text); background: var(--panel); font-size: .9rem; }
.admin-nav a.active { background: var(--gold); color: #2a1d00; font-weight: 700; }
.bar-chart { display: grid; gap: .3rem; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 40px; gap: .5rem; align-items: center; font-size: .85rem; }
.bar { height: 14px; border-radius: 999px; background: linear-gradient(90deg, var(--red), var(--gold)); }
.bar-value { text-align: right; }
.settings-list { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.settings-list dt { font-weight: 700; color: var(--muted); }
.settings-list dd { margin: 0; word-break: break-all; }
.email-preview { width: 100%; height: 620px; border: 1px solid var(--panel-border); border-radius: 12px; background: #0b1633; }
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: .3rem 0; }
.question-edit { border-top: 1px solid var(--panel-border); padding: .6rem 0; }
.question-edit summary { cursor: pointer; font-weight: 600; }
.question-edit table input { min-height: 36px; padding: .35rem .5rem; }
.spirit-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .3rem; margin-bottom: 1rem; }
@media (max-width: 600px) { .settings-list { grid-template-columns: 1fr; } }

/* Confetti */
#confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: .9; } }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: .8rem 1.2rem; background: #fff3c0; color: #2a1d00; box-shadow: 0 -2px 10px rgba(0,0,0,.3); }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .8rem; top: .6rem; }
#blazor-error-ui .reload { color: #8a0c22; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
    #snow { display: none; }
}

.site-footer { background: rgba(8, 16, 40, 0.78); backdrop-filter: blur(6px); }
:root[data-theme="light"] .site-footer { background: rgba(255, 255, 255, 0.85); }
.lang-flag .flag { width: 42px; height: 28px; }
.door-inside { z-index: 1; }
.door-panel { z-index: 2; }
.door-header.is-open .opening-left { transform: perspective(500px) rotateY(-82deg); }
.door-header.is-open .opening-right { transform: perspective(500px) rotateY(82deg); }

@media (max-width: 560px) {
    .header-inner { gap: .4rem; padding: .45rem 10px; }
    .brand-logo { height: 30px; padding: 3px 6px; }
    .brand-logo img { height: 16px; }
    .header-tools { gap: .35rem; }
    .xp-chip { padding: .2rem .5rem; font-size: .8rem; }
    .header-avatar { display: none; }
    .lang-switch a { padding: .2rem .45rem; font-size: .8rem; }
    .nav-burger { padding: 6px; }
    .site-main { padding: 1rem 12px 2.5rem; }
    .glass { padding: 1rem; }
    .door-header { gap: .8rem; }
}
