/* MISHKUK web: the same look as the app (lib/theme/colors.dart). */
:root {
  --bg-top-left: #D9D5F8;
  --bg-middle: #F4F2FC;
  --bg-bottom-right: #F6DCF5;
  --grid: rgba(123, 92, 240, 0.08);
  --ink: #1A1530;
  --ink-secondary: #5B5675;
  --muted: #6B6B70;
  --brand: #7B5CF0;
  --white: #FFFFFF;
  --black: #000000;
  --chip: #F2F2F2;
  --separator: #D9D9D9;
  --card-border: #ECE9F7;
  --card-shadow: rgba(26, 21, 48, 0.08);
  --success: #1E7B34;
  --imposter: #C62828;
  --link: #0B6FB8;
  --scrim: rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, "SF Arabic", "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 17.67px 17.67px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 17.67px 17.67px,
    linear-gradient(135deg, var(--bg-top-left), var(--bg-middle) 50%, var(--bg-bottom-right));
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
}
[hidden] { display: none !important; }
button { font: inherit; }

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.top { display: flex; align-items: center; justify-content: space-between; margin: 4px 4px 18px; }
.logo {
  direction: ltr;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--ink);
}
.logo span { color: var(--brand); }
.round {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 4px 12px;
  font-weight: 800;
  font-size: 14px;
}
.state { flex: 1; }

h1 { font-size: 24px; font-weight: 800; margin: 8px 0; }
h2 { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.title { margin: 6px 6px 2px; }
.sub { margin: 0 6px 14px; }
.muted { color: var(--ink-secondary); font-weight: 600; line-height: 1.5; margin: 6px 0; }
.center-text { text-align: center; }
.emoji { font-size: 44px; }

.card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 4px 16px var(--card-shadow);
  overflow: hidden;
}
.card.center { padding: 26px 20px; text-align: center; }

.notice {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-inline-start: 4px solid var(--brand);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-weight: 700;
}

/* Names to pick from */
.name {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  background: none;
  border: 0;
  border-top: 0.7px solid var(--separator);
  text-align: start;
  color: var(--black);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}
.name:first-child { border-top: 0; }
.name:disabled { cursor: default; color: var(--muted); }
.name .dot { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.name .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name .tag { font-size: 13px; font-weight: 700; color: var(--muted); }
.name .chev { color: var(--muted); font-size: 22px; }

.pill {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 15px;
  border: 0;
  border-radius: 30px;
  background: var(--brand);
  color: var(--white);
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
}
.pill.ghost { background: var(--chip); color: var(--black); }

.avatar {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; object-position: top;
  margin: 0 auto 6px; display: block;
}

/* Waiting dots */
.dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0 4px; }
.dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand); opacity: 0.25;
  animation: blink 1.2s infinite;
}
.dots i:nth-child(2) { animation-delay: 0.4s; }
.dots i:nth-child(3) { animation-delay: 0.8s; }
@keyframes blink { 33% { opacity: 1; } }

/* Result */
.result .mascot { width: 130px; height: auto; display: block; margin: -6px auto 4px; }
.result .you { font-weight: 800; color: var(--imposter); margin: 0 0 8px; }
.facts { display: grid; gap: 10px; margin-top: 12px; }
.facts div {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--chip); border-radius: 12px; padding: 12px 14px;
}
.facts b { font-size: 18px; text-align: end; }

.banner {
  display: block;
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 16px;
  background: var(--black);
  color: var(--white);
  text-align: center;
  font-weight: 800;
  text-decoration: none;
}
footer { text-align: center; margin-top: 12px; font-size: 13px; }
footer a { color: var(--link); font-weight: 700; }

/* Dialog */
.scrim {
  position: fixed; inset: 0; z-index: 20;
  background: var(--scrim);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.dialog {
  width: 100%; max-width: 340px;
  background: var(--white);
  border-radius: 26px;
  padding: 22px 20px 18px;
  box-shadow: 0 10px 40px var(--card-shadow);
}
.dialog .actions { display: flex; gap: 10px; }
.dialog .pill { margin-top: 14px; font-size: 17px; padding: 13px; }

/* Reveal: like the app's pass-the-phone page */
.reveal { position: fixed; inset: 0; z-index: 10; background: var(--white); overflow: hidden; touch-action: none; }
.under {
  position: absolute; left: 0; right: 0; bottom: 0; height: 256px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 20px max(16px, env(safe-area-inset-bottom));
}
.word-card { text-align: center; }
.word-label { color: var(--muted); font-weight: 700; font-size: 15px; }
.word { font-size: 44px; font-weight: 900; color: var(--black); margin: 4px 0; word-break: break-word; }
.word.imposter { color: var(--imposter); }
.hint { font-size: 16px; font-weight: 600; color: var(--black); }
.panel {
  position: absolute; inset: 0 0 -10px 0;
  display: flex; flex-direction: column; align-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  color: var(--white);
  cursor: grab;
  user-select: none;
  will-change: transform;
}
.panel-round { font-weight: 800; opacity: 0.85; }
.panel-name { font-size: 40px; font-weight: 900; margin-top: 18px; text-align: center; word-break: break-word; }
.panel-char { flex: 1; min-height: 0; max-height: 52vh; width: auto; object-fit: contain; margin: 16px 0; pointer-events: none; }
.panel-help { text-align: center; font-weight: 800; font-size: 17px; }
.panel-help .arrow { font-size: 30px; line-height: 1; animation: nudge 1.4s infinite; }
/* Index page: the game's one-line intro. */
.card.intro { padding: 16px 20px; }
.card.intro p { margin: 0; }

/* Legal data still to fill in (legal.js): clearly marked. */
.legal-todo { background: #fff3a0; color: #7a4b00; padding: 0 4px; border-radius: 4px; }
.legal { white-space: pre-line; }

/* Language switcher (privacy, index, 404): lang-switch.js fills it. */
.lang { display: flex; gap: 8px; margin: 0 4px 14px; }
.lang a { padding: 6px 14px; border-radius: 14px; background: var(--white);
  border: 1px solid var(--card-border); color: var(--ink); font-weight: 800; text-decoration: none; }
.lang a[aria-current] { background: var(--brand); color: var(--white); border-color: var(--brand); }

@keyframes nudge { 50% { transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) {
  .dots i, .panel-help .arrow { animation: none; opacity: 1; }
}
