/* Noto Sans Oriya, bundled (SIL Open Font License, see /fonts/OFL.txt) so Odia renders correctly on every phone */
@font-face { font-family: 'Noto Sans Oriya'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(/fonts/noto-sans-oriya-oriya-400-normal.woff2) format('woff2'); unicode-range: U+0B00-0B7F, U+0964-0965, U+200C-200D, U+25CC; }
@font-face { font-family: 'Noto Sans Oriya'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(/fonts/noto-sans-oriya-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20B9, U+2190-21FF, U+2212, U+2713; }
@font-face { font-family: 'Noto Sans Oriya'; font-style: normal; font-display: swap; font-weight: 600;
  src: url(/fonts/noto-sans-oriya-oriya-600-normal.woff2) format('woff2'); unicode-range: U+0B00-0B7F, U+0964-0965, U+200C-200D, U+25CC; }
@font-face { font-family: 'Noto Sans Oriya'; font-style: normal; font-display: swap; font-weight: 600;
  src: url(/fonts/noto-sans-oriya-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20B9, U+2190-21FF, U+2212, U+2713; }
@font-face { font-family: 'Noto Sans Oriya'; font-style: normal; font-display: swap; font-weight: 700;
  src: url(/fonts/noto-sans-oriya-oriya-700-normal.woff2) format('woff2'); unicode-range: U+0B00-0B7F, U+0964-0965, U+200C-200D, U+25CC; }
@font-face { font-family: 'Noto Sans Oriya'; font-style: normal; font-display: swap; font-weight: 700;
  src: url(/fonts/noto-sans-oriya-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20B9, U+2190-21FF, U+2212, U+2713; }
@font-face { font-family: 'Noto Sans Oriya'; font-style: normal; font-display: swap; font-weight: 800;
  src: url(/fonts/noto-sans-oriya-oriya-800-normal.woff2) format('woff2'); unicode-range: U+0B00-0B7F, U+0964-0965, U+200C-200D, U+25CC; }
@font-face { font-family: 'Noto Sans Oriya'; font-style: normal; font-display: swap; font-weight: 800;
  src: url(/fonts/noto-sans-oriya-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20B9, U+2190-21FF, U+2212, U+2713; }

:root {
  --fs: 1;
  /* Warm, Odisha-inspired palette: peacock teal, turmeric, sindoor red on handmade-paper cream. */
  --ink: #2a2017;
  --quiet: #6e6253;
  --line: #e8dccb;
  --bg: #fbf5ea;
  --card: #ffffff;
  --accent: #0d6c69;
  --accent-deep: #084b49;
  --accent-tint: #e1f1ee;
  --turmeric: #e8a33a;
  --turmeric-tint: #fdf1db;
  --sindoor: #b63b20;
  --good: #23784a;
  --good-tint: #e3f3e8;
  --bad: #b3261e;
  --bad-tint: #fbe9e7;
  --model-a: #0d6c69;
  --model-b: #c26a00;
  --tie: #c9bfb0;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(60, 40, 15, 0.06), 0 4px 14px rgba(60, 40, 15, 0.07);
  --shadow-lift: 0 2px 4px rgba(60, 40, 15, 0.08), 0 10px 24px rgba(60, 40, 15, 0.12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(232, 163, 58, 0.16), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: "Noto Sans Oriya", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: calc(18px * var(--fs));
  line-height: 1.6;
  min-height: 100vh;
}
/* A saree-border stripe across the top of every page. */
body::before {
  content: ""; display: block; height: 7px;
  background:
    linear-gradient(135deg, var(--turmeric) 25%, transparent 25%) 0 0 / 14px 7px repeat-x,
    linear-gradient(225deg, var(--turmeric) 25%, transparent 25%) 0 0 / 14px 7px repeat-x,
    linear-gradient(90deg, var(--sindoor), #8f2a14 50%, var(--sindoor));
}
:lang(or), .or { font-family: "Noto Sans Oriya", "Noto Sans", sans-serif; line-height: 1.75; }
.or-text { font-size: calc(21px * var(--fs)); line-height: 1.75; }
#app { max-width: 560px; margin: 0 auto; padding: 10px 16px 120px; min-height: 100vh; }

h1 { font-size: 1.45em; line-height: 1.3; margin: 10px 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.12em; margin: 22px 0 8px; }
p { margin: 0 0 12px; }
.quiet { color: var(--quiet); }
.small { font-size: 0.85em; }
.center { text-align: center; }
a { color: var(--accent); }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 12px; margin-bottom: 10px; border-bottom: 1px dashed var(--line); }
.topbar .title { font-weight: 800; font-size: 0.95em; color: var(--accent-deep); line-height: 1.35; }
.topbar .sub { color: var(--quiet); font-size: 0.8em; }
.icon-btn { background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-height: 44px; min-width: 44px; padding: 0 10px; font: inherit; font-size: 0.85em; font-weight: 600; color: var(--ink); box-shadow: var(--shadow); cursor: pointer; }
.icon-btn:active { transform: scale(0.96); }
.icon-btn.brand { padding: 0; display: grid; place-items: center; overflow: hidden; border: none; background: transparent; box-shadow: none; }
.icon-btn.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: var(--shadow); }

/* buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 12px 16px; margin: 10px 0;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
  font: inherit; font-weight: 600; color: var(--ink); text-decoration: none; text-align: center;
  box-shadow: var(--shadow); cursor: pointer; transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); box-shadow: none; }
.btn.primary {
  background: linear-gradient(180deg, #13807c, var(--accent) 55%, var(--accent-deep));
  border-color: var(--accent-deep); color: #fff; font-size: 1.1em; min-height: 64px;
  box-shadow: 0 6px 16px rgba(13, 108, 105, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn.big { min-height: 84px; font-size: 1.3em; }
.btn:disabled { opacity: 0.45; box-shadow: none; }
.btn.secondary { background: var(--accent-tint); border-color: transparent; color: var(--accent-deep); box-shadow: none; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* cards */
.card { background: var(--card); border: 1px solid rgba(232, 220, 203, 0.7); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; box-shadow: var(--shadow); }
.card h2 { color: var(--accent-deep); }
.card.hint { background: var(--turmeric-tint); border-color: transparent; box-shadow: none; }

/* home hero */
.hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 24px; padding: 22px 20px 20px; margin: 8px 0 14px;
  background:
    radial-gradient(circle at 105% -10%, rgba(232, 163, 58, 0.55) 0 22%, transparent 23%),
    radial-gradient(circle at 105% -10%, rgba(232, 163, 58, 0.22) 0 34%, transparent 35%),
    radial-gradient(circle at -10% 115%, rgba(255, 255, 255, 0.10) 0 30%, transparent 31%),
    linear-gradient(150deg, #13807c, var(--accent) 45%, var(--accent-deep));
  box-shadow: 0 12px 28px rgba(8, 75, 73, 0.30);
}
.hero::after { /* a row of small temple-flag triangles along the bottom edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; opacity: 0.55;
  background: linear-gradient(135deg, var(--turmeric) 25%, transparent 25%) 0 0 / 12px 6px repeat-x, linear-gradient(225deg, var(--turmeric) 25%, transparent 25%) 0 0 / 12px 6px repeat-x;
}
.hero-greet { font-size: 1.5em; font-weight: 800; line-height: 1.3; padding-right: 40px; }
.hero-sub { opacity: 0.92; font-size: 0.92em; margin: 6px 0 14px; }
.btn.hero-btn {
  background: linear-gradient(180deg, #f3b955, var(--turmeric)); color: #3a2400; border: none; min-height: 68px; font-size: 1.2em; font-weight: 800;
  margin: 6px 0 4px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 600; }
.goal-num { font-weight: 800; color: var(--accent); font-size: 1.15em; }

/* home tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 104px; padding: 12px 10px;
  background: var(--card); border: 1px solid rgba(232, 220, 203, 0.7); border-radius: var(--radius); box-shadow: var(--shadow);
  font: inherit; font-weight: 700; font-size: 0.95em; color: var(--ink); text-align: center; line-height: 1.35; cursor: pointer;
}
.tile:active { transform: scale(0.98); box-shadow: none; }
.tile-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--turmeric-tint); font-size: 1.35em; line-height: 1; }

.progress { height: 14px; background: #efe6d6; border-radius: 7px; overflow: hidden; margin: 8px 0 6px; }
.progress > div { height: 100%; min-width: 6px; background: linear-gradient(90deg, var(--turmeric), var(--accent)); border-radius: 7px; transition: width 0.6s ease; }

.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); background: var(--card); }
.dots span.on { background: var(--accent); }

/* conversation bubbles */
.speakers { font-size: 0.85em; color: var(--quiet); margin-bottom: 8px; }
.bubble { border-radius: 18px 18px 18px 6px; padding: 10px 14px; margin: 8px 0; max-width: 92%; border: 1px solid var(--line); background: var(--card); box-shadow: 0 1px 2px rgba(60, 40, 15, 0.05); }
.bubble .who { font-size: 0.78em; font-weight: 800; color: var(--quiet); letter-spacing: 0.01em; }
.bubble.alt { margin-left: auto; border-radius: 18px 18px 6px 18px; background: var(--turmeric-tint); border-color: #f2dfb8; }
.bubble.past { opacity: 0.62; }
.bubble.current { border: 2px solid var(--accent); background: var(--accent-tint); max-width: 100%; box-shadow: var(--shadow); }
.bubble.current .who { color: var(--accent-deep); }

/* options */
.question { font-weight: 800; margin: 18px 0 6px; color: var(--accent-deep); }
.option {
  display: block; width: 100%; text-align: left; font: inherit; color: var(--ink);
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px 14px; margin: 10px 0; min-height: 80px; position: relative; box-shadow: var(--shadow); cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease;
}
.option:active { transform: scale(0.99); }
.option .label { display: block; width: fit-content; font-size: 0.75em; font-weight: 800; color: var(--quiet); background: #f4ece0; border-radius: 999px; padding: 1px 10px; margin-bottom: 6px; }
.option.selected { border: 3px solid var(--accent); background: var(--accent-tint); padding: 11px 15px 13px; box-shadow: 0 6px 16px rgba(13, 108, 105, 0.18); }
.option.selected .label { color: #fff; background: var(--accent); }
.option.selected::after { content: "✓"; position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; box-shadow: 0 2px 6px rgba(13, 108, 105, 0.35); }
.tie-row { display: flex; gap: 10px; }
.tie-row .tie { flex: 1; min-height: 56px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); font: inherit; font-weight: 700; color: var(--ink); box-shadow: var(--shadow); cursor: pointer; }
.tie-row .tie.selected.good { border-color: var(--good); background: var(--good-tint); color: var(--good); }
.tie-row .tie.selected.bad { border-color: var(--bad); background: var(--bad-tint); color: var(--bad); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.chip { min-height: 44px; padding: 6px 14px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--card); font: inherit; font-size: 0.88em; color: var(--quiet); cursor: pointer; }
.chip.on { border-color: var(--bad); background: var(--bad-tint); color: var(--bad); font-weight: 700; }

.sticky-actions { position: sticky; bottom: var(--banner-h, 0px); background: linear-gradient(to bottom, rgba(251, 245, 234, 0), var(--bg) 24%); padding: 18px 0 10px; }

/* tabs */
.tabs { display: flex; gap: 6px; margin: 10px 0; padding: 4px; background: #f1e8da; border-radius: 14px; }
.tabs button { flex: 1; min-height: 46px; border-radius: 11px; border: none; background: transparent; font: inherit; font-size: 0.9em; font-weight: 700; color: var(--quiet); cursor: pointer; }
.tabs button.on { background: var(--card); color: var(--accent-deep); box-shadow: var(--shadow); }

/* choice list */
.choice { display: block; width: 100%; min-height: 56px; margin: 8px 0; text-align: left; padding: 12px 16px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); font: inherit; font-weight: 600; color: var(--ink); }
.choice.selected { border: 3px solid var(--accent); background: var(--accent-tint); color: var(--accent); }

/* reveal */
.strip { display: flex; gap: 5px; margin: 10px 0; flex-wrap: wrap; }
.strip span { width: 30px; height: 30px; border-radius: 7px; background: var(--tie); }
.strip span.a { background: var(--model-a); }
.strip span.b { background: var(--model-b); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.85em; color: var(--quiet); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; background: var(--good-tint); color: var(--good); font-weight: 700; font-size: 0.9em; }
.model-a { color: var(--model-a); font-weight: 700; }
.model-b { color: var(--model-b); font-weight: 700; }
details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; padding: 10px 14px; }
details summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.picked { border-left: 4px solid var(--good); padding-left: 10px; }

/* standings */
.rank { display: grid; grid-template-columns: 34px 1fr; gap: 6px 10px; align-items: start; }
.rank .pos { font-size: 1.3em; font-weight: 800; color: var(--turmeric); text-align: center; }
.bar { height: 12px; background: #efe6d6; border-radius: 6px; position: relative; overflow: hidden; margin: 6px 0 4px; }
.bar > div { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(90deg, #13807c, var(--accent)); border-radius: 6px; }
.bar > .ci { background: rgba(13, 108, 105, 0.18); border-radius: 0; }

.banner { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px; background: var(--accent-deep); color: #fff; font-size: 0.85em; text-align: center; z-index: 10; }
.toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 20; font-size: 0.9em; box-shadow: var(--shadow-lift); }

input[type=text], input[type=password], textarea, select {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); margin: 4px 0 10px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13, 108, 105, 0.15); }
button:focus-visible, .btn:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 2px; }
textarea { min-height: 200px; }
label.check { display: flex; align-items: center; gap: 12px; min-height: 48px; }
label.check input { width: 26px; height: 26px; accent-color: var(--accent); }

/* admin */
.admin table { width: 100%; border-collapse: collapse; font-size: 0.8em; }
.admin th, .admin td { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin .scroll { overflow-x: auto; }
.admin .btn { min-height: 44px; font-size: 0.9em; }
.admin pre { white-space: pre-wrap; word-break: break-word; font-size: 0.75em; background: #f4ede1; padding: 10px; border-radius: 10px; }
.mini { min-height: 36px; padding: 4px 10px; font-size: 0.8em; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-family: inherit; }

.turn-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 6px; }
.turn-tools .icon-btn { min-width: 48px; }

.pick { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--card); font-size: 0.88em; }
.pick:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); font-weight: 600; }

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