/* PrayagEdu Scan & Play – player (phone) styles. Black, red, white. */
:root {
    --black: #000;
    --surface: #121218;
    --surface-2: #1c1c24;
    --line: #33333d;
    --red: #C8102E;
    --red-hi: #e3173a;
    --white: #fff;
    --muted: #b8b8c2;
    --good: #12b76a;
    --head: 'Archivo', 'Arial Narrow', Arial, sans-serif;
    --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

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

body {
    margin: 0;
    background: var(--black);
    color: var(--white);
    font: 400 17px/1.45 var(--body);
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p, ul, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.page {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- Brand ---------- */
.wordmark {
    font: 900 26px/1 var(--head);
    letter-spacing: -.02em;
    color: var(--white);
}
.wordmark b { color: var(--white); background: var(--red); padding: 2px 6px 3px; margin-left: 3px; font-weight: 900; }
.logo-img { height: 36px; width: auto; display: block; }

.hero {
    margin: 0 -16px;
    padding: 20px 16px 26px;
    background: var(--red);
    /* the angled cut used on the banners */
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), 0 100%);
}
.hero .wordmark b { background: var(--black); }
.hero-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-tag {
    font: 800 12px/1 var(--head);
    letter-spacing: .14em;
    text-transform: uppercase;
    border: 2px solid var(--white);
    padding: 6px 9px;
}
.hero-title {
    margin-top: 20px;
    font: 900 clamp(40px, 13vw, 58px)/.92 var(--head);
    letter-spacing: -.03em;
    text-transform: uppercase;
}
.hero-title em { font-style: normal; color: var(--black); }
.hero-sub { margin-top: 12px; font: 600 18px/1.3 var(--body); }
.hero-small { padding-bottom: 34px; }
.hero-small .hero-title { font-size: clamp(34px, 11vw, 48px); }

.eyebrow {
    font: 800 13px/1 var(--head);
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--red-hi);
}

/* ---------- Cards & forms ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 16px;
}

.form { display: flex; flex-direction: column; gap: 16px; }

.field { display: block; }
.field > span, .field > legend {
    display: block;
    margin-bottom: 6px;
    font: 600 15px/1.2 var(--body);
    color: var(--white);
}
.field small { color: var(--muted); font-weight: 400; }

input[type=text], input[type=tel] {
    width: 100%;
    height: 54px;
    padding: 0 14px;
    background: var(--black);
    color: var(--white);
    border: 2px solid var(--line);
    border-radius: 10px;
    font: 500 18px/1 var(--body);
    appearance: none;
}
input[type=text]:focus, input[type=tel]:focus { outline: none; border-color: var(--white); }

.input-prefix { display: flex; }
.input-prefix i {
    display: flex; align-items: center;
    padding: 0 12px;
    font: 600 18px/1 var(--body);
    color: var(--muted);
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-right: 0;
    border-radius: 10px 0 0 10px;
}
.input-prefix input { border-radius: 0 10px 10px 0; letter-spacing: .04em; }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { position: relative; display: block; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span {
    display: flex; align-items: center; justify-content: center;
    min-height: 50px;
    padding: 6px 8px;
    text-align: center;
    background: var(--black);
    border: 2px solid var(--line);
    border-radius: 10px;
    font: 600 16px/1.15 var(--body);
}
.chip input:checked + span { background: var(--white); border-color: var(--white); color: var(--black); }
.chip input:focus-visible + span { border-color: var(--white); }

.check { display: flex; gap: 12px; align-items: flex-start; min-height: 48px; padding: 4px 0; font-size: 15px; }
.check input { flex: 0 0 26px; width: 26px; height: 26px; margin: 2px 0 0; accent-color: var(--red); }

.field-error { margin-top: 6px; color: #ff8a9c; font: 600 14px/1.3 var(--body); }

/* ---------- Buttons ---------- */
.btn {
    display: flex; align-items: center; justify-content: center;
    width: 100%;
    min-height: 54px;
    padding: 10px 18px;
    border: 0;
    border-radius: 12px;
    font: 800 18px/1.1 var(--head);
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:active { background: var(--red-hi); transform: translateY(1px); }
.btn-white { background: var(--white); color: var(--black); }
.btn-xl { min-height: 64px; font-size: 22px; }
.btn[disabled] { opacity: .55; }
.btn-link {
    width: 100%; min-height: 48px;
    background: none; border: 0;
    color: var(--muted);
    font: 500 15px/1.2 var(--body);
    text-decoration: underline;
    cursor: pointer;
}

.notice {
    display: flex; flex-direction: column; gap: 2px;
    padding: 14px 16px;
    background: var(--white);
    color: var(--black);
    border-left: 8px solid var(--red);
    border-radius: 8px;
}
.notice strong { font: 800 19px/1.2 var(--head); }

.welcome { display: flex; flex-direction: column; gap: 10px; text-align: center; padding-top: 24px; }
.welcome h2 { font: 900 38px/1 var(--head); }
.welcome .btn { margin-top: 10px; }

.foot { margin-top: auto; padding-top: 12px; text-align: center; color: var(--muted); font-size: 14px; }
.foot strong { color: var(--white); }

/* ---------- Game ---------- */
.game { padding-top: 0; }
.stage { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.stage[data-stage=countdown], .stage[data-stage=ending] { align-items: center; justify-content: center; text-align: center; }
.stage[data-stage=playing] { padding-top: 12px; gap: 12px; }
.stage[data-stage=result] { padding-top: 24px; text-align: center; align-items: stretch; }

.rules { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.rules li { display: flex; align-items: center; gap: 14px; font-size: 16px; }
.rules b {
    flex: 0 0 64px;
    font: 900 24px/1 var(--head);
    color: var(--white);
    background: var(--red);
    padding: 9px 0;
    text-align: center;
    border-radius: 8px;
}

.count {
    font: 900 44vw/1 var(--head);
    color: var(--red);
    letter-spacing: -.04em;
}
.count.pop { animation: pop .9s ease-out; }
.count-small { font-size: clamp(48px, 15vw, 72px); color: var(--white); text-transform: uppercase; }
@keyframes pop { from { transform: scale(1.5); opacity: .2; } 35% { transform: scale(1); opacity: 1; } }

.hud { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hud-box { flex: 1; }
.hud-right { text-align: right; }
.hud small { display: block; font: 800 11px/1 var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.hud-box b { font: 900 34px/1.05 var(--head); }
.hud-timer {
    position: relative;
    flex: 0 0 auto;
    min-width: 104px;
    padding: 6px 12px 8px;
    text-align: center;
    background: var(--white);
    color: var(--black);
    border-radius: 12px;
}
.hud-timer b { font: 900 46px/1 var(--head); font-variant-numeric: tabular-nums; }
.hud-timer small { color: var(--black); }
.hud-timer.low { background: var(--red); color: var(--white); }
.hud-timer.low small { color: var(--white); }
.hud-delta {
    position: absolute; left: 0; right: 0; top: 100%;
    font: 900 20px/1.4 var(--head);
    color: var(--red-hi);
    opacity: 0;
}
.hud-delta.show { animation: drop .9s ease-out; }
@keyframes drop { from { opacity: 1; transform: translateY(-6px); } to { opacity: 0; transform: translateY(14px); } }

.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--red); transform-origin: left center; }

.question {
    display: flex; flex-direction: column; justify-content: center; gap: 10px;
    min-height: 150px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    text-align: center;
}
.q-label { font: 800 13px/1 var(--head); letter-spacing: .18em; text-transform: uppercase; color: var(--red-hi); }
.q-text { font: 800 26px/1.2 var(--head); overflow-wrap: anywhere; }
.q-text.big { font-size: 46px; letter-spacing: .02em; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.options.two { grid-template-columns: 1fr 1fr; }
.opt {
    min-height: 76px;
    padding: 8px 10px;
    background: var(--white);
    color: var(--black);
    border: 3px solid var(--white);
    border-radius: 14px;
    font: 800 22px/1.15 var(--head);
    overflow-wrap: anywhere;
    cursor: pointer;
    touch-action: manipulation;
}
.options.two .opt { min-height: 110px; font-size: 28px; text-transform: uppercase; }
.opt:active { transform: scale(.98); }
.opt.picked { background: var(--surface-2); color: var(--white); border-color: var(--white); }
.opt.right { background: var(--good); border-color: var(--good); color: var(--white); }
.opt.wrong { background: var(--red); border-color: var(--red); color: var(--white); }
.options.locked .opt { pointer-events: none; }

/* full-screen green / red flash on every answer */
.flash-good { animation: flash-good .35s ease-out; }
.flash-bad { animation: flash-bad .45s ease-out; }
@keyframes flash-good { from { box-shadow: inset 0 0 0 100vmax rgba(18, 183, 106, .45); } to { box-shadow: inset 0 0 0 100vmax rgba(18, 183, 106, 0); } }
@keyframes flash-bad { from { box-shadow: inset 0 0 0 100vmax rgba(200, 16, 46, .55); } to { box-shadow: inset 0 0 0 100vmax rgba(200, 16, 46, 0); } }

.toast { text-align: center; color: var(--muted); font-size: 15px; }

/* ---------- Result ---------- */
.final { font: 900 32vw/.9 var(--head); letter-spacing: -.04em; color: var(--white); }
@media (min-width: 480px) { .final { font-size: 150px; } .count { font-size: 210px; } }
.final-sub { font-size: 18px; color: var(--muted); }
.final-sub b { color: var(--white); }

.ranks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rank { padding: 12px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.rank small { display: block; font: 800 11px/1 var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rank b { display: block; margin-top: 6px; font: 900 36px/1 var(--head); }

.cta {
    display: flex; flex-direction: column; gap: 10px;
    margin-top: 8px;
    padding: 20px 16px;
    background: var(--red);
    border-radius: 14px;
    text-align: center;
}
.cta h3 { font: 900 26px/1.05 var(--head); text-transform: uppercase; }
.cta-done { padding: 12px; background: var(--black); border-radius: 10px; font-weight: 600; }
.cta-contact { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; }
.cta-contact a { display: inline-flex; align-items: center; min-height: 48px; color: var(--white); font: 800 18px/1 var(--head); }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
