/* Khoj-E-Suraag · Indus Fiesta 2026 — mobile-first theme.
   Parchment + deep red + saffron gold + ink black, after the event poster. */
:root {
  --bg: #f3e4c8; --bg2: #ead6b0; --panel: #fffaf0; --panel2: #f8ecd4; --line: #dcc497; --line2: #c9a96e;
  --ink: #1b1411; --text: #1b1411; --muted: #7b6249;
  --red: #c8161d; --red-d: #8e0e13; --gold: #f2a900; --gold-d: #b97f00; --black: #16100e;
  --green: #18804a; --violet: #6f3fa6; --amber: #e39b00; --cyan: #c8161d;
  --radius: 14px;
  --display: 'Bungee', 'Arial Black', system-ui, sans-serif;
  --mono: 'Share Tech Mono', ui-monospace, Consolas, monospace;
  --body: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --checker: repeating-linear-gradient(90deg, var(--red) 0 12px, var(--gold) 12px 24px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 500 17px/1.45 var(--body); color: var(--text); background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 50% -200px, #fff6e2 0%, transparent 70%),
    linear-gradient(rgba(200,22,29,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(200,22,29,.045) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  -webkit-font-smoothing: antialiased; padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--red); text-decoration: none; font-weight: 700; }
h1, h2, h3 { margin: 0 0 .45em; line-height: 1.1; font-weight: 400; font-family: var(--display); letter-spacing: .01em; }
h1 { font-size: clamp(1.9rem, 9vw, 3.4rem); }
h2 { font-size: 1.15rem; } h3 { font-size: .98rem; }
p { margin: .4em 0; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.glow { color: var(--red); text-shadow: 3px 3px 0 var(--black); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1 1 0; min-width: 0; }
.between { justify-content: space-between; } .hidden { display: none !important; } .center { text-align: center; }
.stack > * + * { margin-top: 14px; }
.nowrap { white-space: nowrap; } .clip { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn-text { color: var(--red); font-weight: 700; } .tight { padding-left: 18px; } .tight li { margin: 4px 0; }
hr { border: 0; border-top: 1px dashed var(--line2); margin: 14px 0; }

/* ---------- layout ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px 14px 48px; }
.wrap.narrow { max-width: 560px; } .wrap.wide { max-width: 1400px; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--black); color: #fff; border-bottom: 4px solid transparent; border-image: var(--checker) 4;
}
.topbar .pill.soft { background: #2a1f1a; color: #fff; border-color: #4a3a2e; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
.topbar button.ghost { color: #fff; border-color: #4a3a2e; white-space: nowrap; flex: 0 0 auto; }
.brand { font-family: var(--display); font-size: 1.02rem; color: var(--gold) !important; letter-spacing: .02em; white-space: nowrap; }
.brand span { color: var(--red); }
.spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; }
.g2tight { grid-template-columns: 1fr 1fr; gap: 10px; } .g3tight { grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) {
  .g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); } .g4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .g3tight { grid-template-columns: repeat(3, 1fr); }
  .wrap { padding: 22px 20px 60px; }
}

/* ---------- cards with poster ornaments ---------- */
.card {
  position: relative; background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 3px 0 var(--line2);
}
.card.pad0 { padding: 0; overflow: hidden; }
.card::after { /* little gold-and-red diamond, like the poster's corner marks */
  content: ''; position: absolute; top: -7px; right: 18px; width: 11px; height: 11px; transform: rotate(45deg);
  background: var(--gold); border: 2px solid var(--red); pointer-events: none;
}
.card.pad0::after, .modal::after, .qr-card::after, .slip::after { display: none; }

/* ---------- controls ---------- */
button, .btn {
  font: 700 1rem var(--body); letter-spacing: .02em; color: var(--ink); background: var(--panel2); border: 2px solid var(--ink);
  border-radius: 12px; padding: 10px 16px; min-height: 48px; cursor: pointer; box-shadow: 0 3px 0 var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; transition: transform .05s, box-shadow .05s;
}
button:active, .btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
button.primary, .btn.primary { background: var(--red); color: #fff; border-color: var(--red-d); box-shadow: 0 4px 0 var(--red-d); }
button.good { background: var(--green); color: #fff; border-color: #0d5430; box-shadow: 0 4px 0 #0d5430; }
button.danger { background: #fff; border-color: var(--red); color: var(--red); box-shadow: 0 3px 0 var(--red); }
button.ghost, .btn.ghost { background: transparent; box-shadow: none; border-width: 1.5px; }
button.sm, .btn.sm { min-height: 36px; padding: 5px 11px; font-size: .9rem; border-radius: 9px; box-shadow: 0 2px 0 var(--ink); }
button.big, .btn.big { min-height: 58px; font-size: 1.15rem; font-family: var(--display); font-weight: 400; letter-spacing: .03em; }
.block { display: flex; width: 100%; }
input, select, textarea {
  font: 600 16px var(--body); /* 16px stops iOS from zooming in */ color: var(--ink); background: #fff;
  border: 2px solid var(--line2); border-radius: 12px; padding: 11px 13px; width: 100%; min-height: 48px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--gold); outline-offset: 0; border-color: var(--red); }
input[type=range] { padding: 0; min-height: 34px; accent-color: var(--red); border: 0; background: transparent; }
label { display: block; font: 400 .8rem var(--mono); color: var(--muted); margin: 0 0 4px; letter-spacing: .06em; text-transform: uppercase; }
.field { margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: center; text-transform: none; font: 600 .95rem var(--body); color: var(--ink); margin: 10px 0; letter-spacing: 0; }
.check input { width: 20px; min-height: 20px; }

/* ---------- pills, tabs, tables ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 400 .78rem var(--mono); letter-spacing: .05em; text-transform: uppercase; border: 1.5px solid var(--line2); color: var(--muted); background: #fff; white-space: nowrap; }
.pill.soft { background: var(--panel2); color: var(--ink); }
.pill.live, .pill.hunting { background: var(--gold); color: var(--ink); border-color: var(--gold-d); }
.pill.live { animation: blink 1.4s infinite; }
.pill.working, .pill.in_progress { background: var(--red); color: #fff; border-color: var(--red-d); }
.pill.stopped { background: var(--violet); color: #fff; border-color: transparent; }
.pill.closed, .pill.done { background: var(--green); color: #fff; border-color: transparent; }
.pill.timeout, .pill.skipped { background: #4a3d36; color: #fff; border-color: transparent; }
.pill.sev-medium { background: var(--gold); color: var(--ink); border-color: transparent; } .pill.sev-high { background: var(--red); color: #fff; border-color: transparent; }
@keyframes blink { 50% { opacity: .55; } }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: .75rem; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs .btn { white-space: nowrap; min-height: 42px; flex: 0 0 auto; }
.tabs button.on { background: var(--black); color: var(--gold); border-color: var(--black); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { text-align: left; font: 400 .74rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 9px 8px; border-bottom: 2px solid var(--line2); background: var(--panel2); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.me td { background: #fff2c4; } tr.out td { opacity: .45; } tr.sel td { background: #fbdcdc; }
.hist { padding: 9px 0; border-bottom: 1px dashed var(--line); } .hist:last-child { border-bottom: 0; }

/* ---------- progress ---------- */
.bar { height: 10px; border-radius: 99px; background: #f0dfbd; overflow: hidden; border: 1.5px solid var(--line2); }
.bar > i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); transition: width 1s linear; }
.bar.warn > i { background: var(--red); }
.pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.pips i { width: 10px; height: 10px; border-radius: 2px; background: #e7d3ad; border: 1px solid var(--line2); }
.pips i.on { background: var(--red); border-color: var(--red-d); } .pips i.gate { transform: rotate(45deg) scale(.85); }
.stat { text-align: center; } .stat b { display: block; font: 400 1.7rem/1 var(--display); }
.stat span { color: var(--muted); font: 400 .74rem var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.score-big { font: 400 2.5rem/1 var(--display); color: var(--red); }
.timer { font: 400 1.9rem/1 var(--mono); font-variant-numeric: tabular-nums; } .timer.big { font-size: 2.6rem; }
.urgent { color: var(--red); animation: blink 1s infinite; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; border: 1px solid rgba(0,0,0,.35); }
.note { background: #fff1c9; border: 1.5px dashed var(--gold-d); border-radius: 10px; padding: 9px 11px; font-size: .92rem; }

/* ---------- toast + modal ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; width: max-content; max-width: calc(100vw - 28px);
  padding: 13px 18px; border-radius: 12px; background: var(--black); color: #fff; border: 2px solid var(--gold); box-shadow: 0 6px 24px rgba(0,0,0,.3); font-weight: 700; text-align: center;
}
.toast.err { border-color: var(--red); background: #3a0b0d; } .toast.ok { border-color: #3fd28a; background: #0d3320; }
.modal-bg { position: fixed; inset: 0; background: rgba(22,16,14,.72); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal { width: 100%; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) { .modal-bg { align-items: center; padding: 16px; } .modal { width: min(560px, 100%); border-radius: 16px; } .modal.wide { width: min(980px, 100%); } }

/* ---------- home ---------- */
.home-hero { margin: -16px -14px 0; position: relative; }
.home-hero img { display: block; width: 100%; height: auto; }
.home-hero .landscape { display: none; }
@media (min-width: 720px) { .home-hero { margin: 0 0 6px; border-radius: 16px; overflow: hidden; border: 3px solid var(--black); } .home-hero .portrait { display: none; } .home-hero .landscape { display: block; } }
.tagline { text-align: center; font: 400 .95rem var(--mono); letter-spacing: .08em; margin: 14px 0 4px; }
.tagline b { color: var(--red); font-weight: 400; }
.tile { display: block; color: inherit; font-weight: 500; text-align: left; }
.tile h2 { margin: 6px 0 4px; } .tile .ico { font-size: 1.8rem; }
.tile.mine { border-color: var(--green); }
.ico { font-size: 2.4rem; line-height: 1.2; }
.hosts { margin-top: 22px; text-align: center; }
.hosts .lbl { font: 400 .78rem var(--mono); letter-spacing: .12em; color: var(--muted); }
.hosts .logos { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 8px; }
.hosts img { height: 62px; width: auto; border-radius: 12px; background: #fff; padding: 4px; border: 1.5px solid var(--line2); }
.hosts .x { font-family: var(--display); color: var(--red); }
.foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 14px; }

/* ---------- team / volunteer ---------- */
.task { border-left: 6px solid var(--line2); }
.task.hunting { border-left-color: var(--gold); } .task.working { border-left-color: var(--red); } .task.done { border-left-color: var(--green); }
.task.timeout, .task.skipped { border-left-color: #4a3d36; } .task.stopped { border-left-color: var(--violet); }
.prompt { font-size: 1.28rem; font-weight: 700; line-height: 1.35; padding: 14px; border-radius: 12px; background: #fff; border: 2px dashed var(--line2); margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt.clue { border: 2px solid var(--gold); background: #fff8e1; font-size: 1.36rem; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--gold); }
.shake { animation: shake .35s; } @keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.minimaze { height: 220px; background: var(--black); }
.rate { display: grid; grid-template-columns: 1fr 48px; gap: 10px; align-items: center; margin: 8px 0; }
.rate-val { font: 400 1.6rem var(--display); text-align: center; color: var(--red); }
.celebrate { animation: pop .5s ease-out; } @keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }

/* ---------- maze ---------- */
.maze-box { position: relative; width: 100%; height: 100%; min-height: 240px; background: var(--black); }
.maze-canvas { display: block; }
.tip { position: fixed; z-index: 50; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: var(--black); color: #fff; border: 1.5px solid var(--gold); font-size: .9rem; }

/* ---------- big screen (dark, like the poster's glowing corridor) ---------- */
body.screen {
  --panel: #1e1613; --panel2: #2a1f1a; --line: #4a3427; --line2: #6a4a35; --text: #f8ecd4; --ink: #f8ecd4; --muted: #c6a985;
  background: #120c0a; color: var(--text); overflow: hidden;
}
body.screen .card { box-shadow: none; }
.screen-wrap { height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.screen-head { display: flex; gap: 18px; align-items: center; padding: 10px 22px; background: var(--black); border-bottom: 5px solid transparent; border-image: var(--checker) 5; }
.screen-head h1 { font-size: 2rem; margin: 0; color: var(--red); text-shadow: 3px 3px 0 #000, 0 0 18px rgba(200,22,29,.5); }
.screen-head .sub { font: 400 .8rem var(--mono); color: var(--gold); letter-spacing: .14em; }
.screen-head img { height: 44px; border-radius: 50%; background: #fff; }
.screen-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; padding: 14px; min-height: 0; }
.screen-side { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 14px; min-height: 0; }
.live-box { display: flex; gap: 16px; align-items: center; }
.lb { display: flex; flex-direction: column; min-height: 0; } .lb .rows { overflow: hidden; flex: 1; }
.lb-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.lb-row .rk { font-family: var(--display); color: var(--muted); }
.lb-row:nth-child(1) .rk { color: var(--gold); } .lb-row:nth-child(2) .rk { color: #e8dccb; } .lb-row:nth-child(3) .rk { color: #e0975a; }
.lb-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.lb-row .sc { font: 400 1.1rem var(--display); color: var(--gold); text-align: right; }
body.screen .pips i { background: #3a2a22; border-color: #5a4030; } body.screen .pips i.on { background: var(--gold); border-color: var(--gold-d); }
.feed { max-height: 190px; overflow: hidden; font-size: .92rem; } .feed div { padding: 4px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.feed div:first-child { color: var(--text); font-weight: 700; } .feed.tall { max-height: 340px; overflow: auto; }
.legend { display: flex; gap: 14px; font: 400 .74rem var(--mono); color: var(--muted); flex-wrap: wrap; }
@media (max-width: 1000px) { body.screen { overflow: auto; } .screen-wrap { height: auto; } .screen-main { grid-template-columns: 1fr; } .maze-box { height: 62vw; } }

/* ---------- organiser ---------- */
.live-card { border-color: var(--gold); background: #fff8e1; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 8px; border: 1.5px solid var(--line2); border-radius: 10px; background: #fff; }
.admin-live { grid-template-columns: 1fr; margin-top: 14px; }
@media (min-width: 900px) { .admin-live { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); } }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tile-t { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 1px; padding: 8px 10px; min-height: 0; box-shadow: none; border-width: 2.5px; background: #fff; }
.tile-t span { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tile-t small { color: var(--muted); font-size: .76rem; font-weight: 600; }
.st-hunting { border-color: var(--gold) !important; } .st-working { border-color: var(--red) !important; } .st-stopped { border-color: var(--violet) !important; }
.st-done { border-color: var(--green) !important; } .st-timeout, .st-skipped { border-color: #4a3d36 !important; } .st-out { opacity: .35; } .st-idle { border-color: var(--line) !important; }
.tile-t.st-done { background: #e3f5ea; } .tile-t.st-hunting { background: #fff4d4; } .tile-t.st-working { background: #fde3e3; } .tile-t.st-stopped { background: #efe5fa; }
.lg { padding-left: 16px; position: relative; } .lg::before { content: ''; position: absolute; left: 0; top: 2px; width: 10px; height: 10px; border-radius: 3px; border: 2.5px solid; border-color: inherit; }
.sum.warn { border-color: var(--red); } .big-num { font: 400 2rem var(--display); } .big-num small { font-size: 1rem; color: var(--muted); }
.inc.sev-high { border-color: var(--red); } .inc.sev-medium { border-color: var(--gold); }
.danger-zone { border-color: var(--red); }
.url { font-family: var(--mono); background: #fff; padding: 5px 9px; border-radius: 8px; border: 1.5px solid var(--line2); user-select: all; display: inline-block; overflow-wrap: anywhere; }

/* ---------- scanner ---------- */
.scanbox { position: relative; border-radius: 14px; overflow: hidden; background: #000; margin: 10px 0; aspect-ratio: 1; max-height: 58vh; border: 3px solid var(--black); }
.scanbox video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanframe { position: absolute; inset: 16%; border: 4px solid var(--gold); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.4); }

/* ---------- printing ---------- */
.print-bar { display: flex; gap: 12px; align-items: center; padding: 12px 16px; flex-wrap: wrap; background: var(--black); color: #fff; }
body.printing { background: #fff; }
.qr-sheet { display: grid; grid-template-columns: repeat(2, 1fr); }
.qr-card { border: 1px dashed #999; padding: 16px; text-align: center; break-inside: avoid; page-break-inside: avoid; height: 13.4cm; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #000; position: relative; }
.qr-card::before { content: ''; position: absolute; inset: 8px; border: 3px solid var(--red); border-radius: 10px; pointer-events: none; }
.qr-h { font-family: var(--display); color: var(--red); font-size: 1.15rem; letter-spacing: .04em; }
.qr-sub { font: 400 .75rem var(--mono); letter-spacing: .14em; }
.qr-round { font: 400 1.6rem var(--display); color: #fff; background: var(--red); padding: 0 14px; border-radius: 8px; margin: 4px 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.qr-img svg { width: 6.6cm; height: 6.6cm; }
.qr-help { font-size: .9rem; color: #333; }
.qr-code { font-family: var(--mono); font-size: 2.1rem; font-weight: 700; letter-spacing: .25em; }
.qr-org { font-size: .68rem; color: #999; margin-top: 4px; }
.poster { color: #000; text-align: center; padding: 1.2cm 1cm; max-width: 19cm; margin: 8mm auto 0; border: 4px solid var(--red); border-radius: 14px; }
.poster-qr svg { width: 11cm; height: 11cm; }
.poster-url { font: 700 1.5rem var(--mono); margin: 4px 0 10px; }
.poster-steps { text-align: left; font-size: 1.25rem; line-height: 1.5; max-width: 15cm; margin: 0 auto; }
.poster-logos { display: flex; justify-content: center; gap: 18px; margin-top: 16px; } .poster-logos img { height: 2cm; }
.joinbox { text-align: center; background: #fff8e1; border: 2px dashed var(--gold-d); border-radius: 12px; padding: 12px; margin: 10px 0; }
.joincode { font: 700 2.3rem var(--mono); letter-spacing: .3em; color: var(--red); margin: 2px 0 8px; }
.slips { display: grid; grid-template-columns: repeat(2, 1fr); }
.slip { border: 1px dashed #999; padding: 12px; text-align: center; color: #000; break-inside: avoid; page-break-inside: avoid; }
.slip.vol { background: #fff4d4; }
.slip-h { font: 400 .78rem var(--mono); letter-spacing: .12em; color: var(--red); } .slip-t { font: 400 1.15rem var(--display); }
.slip-qr svg { width: 2.6cm; height: 2.6cm; } .slip-code { font-family: var(--mono); font-size: 1.9rem; font-weight: 700; letter-spacing: .2em; }
@media print {
  .no-print, .topbar, .tabs { display: none !important; }
  body, body.printing { background: #fff !important; }
  @page { size: A4; margin: 8mm; }
}
