/* Light, playful theme with a Persian palette (pomegranate, saffron,
   pistachio, tile turquoise, plum). Depth comes from a same-colour darker
   "bottom edge" on tiles and buttons, not from black outlines. */
:root {
  --bg: #fbf6ef;
  --ink: #2a2140;
  --muted: #6b6283;     /* 5.3:1 on --bg */
  --surface: #ffffff;
  --sunk: #f3ece2;
  --line: #e8dfd2;

  /* Colours that carry white text are dark enough for at least 4.5:1. */
  --pomegranate: #d43d43;
  --pomegranate-d: #a52a30;
  --saffron: #f7b538;   /* always paired with dark text */
  --saffron-d: #cf8f17;
  --pistachio: #8cc56b; /* decorative only */
  --pistachio-d: #3f7a26;
  --turquoise: #0e817b;
  --turquoise-d: #095c57;
  --plum: #6a4bc9;
  --plum-d: #4b31a3;

  --radius: 22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: Vazirmatn, Tahoma, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%237b5cd6' stroke-opacity='0.07' stroke-width='1.4'%3E%3Cpath d='M40 10l9 21 21 9-21 9-9 21-9-21-21-9 21-9z'/%3E%3Cpath d='M18 18h44v44H18z' transform='rotate(45 40 40)'/%3E%3C/g%3E%3C/svg%3E");
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  min-height: 100vh;
}

.loading { text-align: center; color: var(--muted); margin-top: 40vh; }

h1, h2, h3 { margin: 0; }
h1 { font-size: 1.45rem; font-weight: 900; }
h2 { font-size: 1.1rem; font-weight: 800; }
p { margin: 0; line-height: 1.85; }
.muted { color: var(--muted); font-size: .9rem; }
.center { text-align: center; }

.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 48px; height: 48px; border-radius: 16px; flex: none; display: grid; place-items: center;
  font-size: 1.5rem; background: var(--pomegranate); box-shadow: 0 5px 0 var(--pomegranate-d);
  transform: rotate(-6deg);
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(42, 33, 64, 0.06);
}

/* Game tiles on the home screen */
.game-tile {
  position: relative; width: 100%; text-align: right; font: inherit; color: #fff; cursor: pointer;
  border: none; border-radius: var(--radius); padding: 20px 18px;
  display: flex; align-items: center; gap: 14px;
  background: var(--plum); box-shadow: 0 6px 0 var(--plum-d);
  transition: transform .08s, box-shadow .08s;
}
.game-tile:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--plum-d); }
.game-tile .glyph {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none;
  font-size: 1.7rem; background: rgba(255, 255, 255, 0.2);
}
.game-tile h2 { font-size: 1.2rem; margin-bottom: 2px; }
.game-tile p { font-size: .92rem; }
.game-tile.soon { background: var(--sunk); color: var(--muted); box-shadow: none; cursor: default; }
.game-tile.soon .glyph { background: #fff; }
.game-tile .badge {
  position: absolute; top: 12px; left: 12px; font-size: .72rem; padding: 2px 10px; border-radius: 99px;
  background: #fff; color: var(--muted);
}

input, textarea, select {
  width: 100%; font: inherit; font-size: 1rem; padding: 13px 15px; color: var(--ink);
  background: var(--sunk); border: 2px solid transparent; border-radius: 14px;
}
textarea { resize: none; min-height: 110px; line-height: 1.8; }
input::placeholder, textarea::placeholder { color: #a99fbd; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--plum); background: #fff; }
input.code { text-transform: uppercase; letter-spacing: .35em; text-align: center; direction: ltr; font-weight: 800; }
input.code::placeholder { letter-spacing: normal; font-weight: 400; }

/* Buttons: solid colour with a darker same-hue edge that presses down */
.btn {
  font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; color: #fff;
  padding: 13px 18px; border-radius: 16px; border: none;
  background: var(--pomegranate); box-shadow: 0 5px 0 var(--pomegranate-d);
  transition: transform .08s, box-shadow .08s, opacity .2s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--pomegranate-d); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.alt { background: var(--turquoise); box-shadow: 0 5px 0 var(--turquoise-d); }
.btn.alt:active { box-shadow: 0 2px 0 var(--turquoise-d); }
.btn.gold { background: var(--saffron); color: #3a2a05; box-shadow: 0 5px 0 var(--saffron-d); }
.btn.ghost { background: var(--sunk); color: var(--ink); box-shadow: 0 4px 0 var(--line); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn.small { padding: 7px 14px; font-size: .85rem; border-radius: 12px; box-shadow: 0 3px 0 var(--line); }
.icon-btn {
  font: inherit; width: 44px; height: 44px; border-radius: 14px; cursor: pointer; color: var(--ink);
  background: var(--surface); border: none; box-shadow: 0 4px 0 var(--line); font-size: 1.05rem;
}

.code-box {
  font-size: 2.1rem; font-weight: 900; letter-spacing: .3em; direction: ltr; text-align: center;
  color: var(--plum); background: var(--sunk); border-radius: 16px; padding: 6px 12px;
}

.players { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.player { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 16px; background: var(--sunk); }
.player.me { background: #efe9ff; }
.player.off { opacity: .45; }
.player .name { flex: 1; font-weight: 700; }
.avatar {
  width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; flex: none;
  font-weight: 900; color: #fff; font-size: .95rem;
}
.pill { font-size: .75rem; padding: 2px 10px; border-radius: 99px; background: #fff; color: var(--muted); white-space: nowrap; font-weight: 700; }
.pill.host { background: var(--saffron); color: #3a2a05; }
.pill.good { background: var(--pistachio-d); color: #fff; }
.pill.plus { background: var(--plum); color: #fff; }

.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.settings label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 700; color: var(--muted); }

.round-tag { font-size: .85rem; color: var(--plum); font-weight: 800; }
.question-panel { background: var(--plum); color: #fff; box-shadow: 0 6px 0 var(--plum-d); }
.question-panel .round-tag { color: #fff; opacity: .95; }
.question { font-size: 1.3rem; font-weight: 900; line-height: 1.9; }

.timer-ring { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.timer { font-size: 1.4rem; font-weight: 900; direction: ltr; font-variant-numeric: tabular-nums; }
.timer.low { color: #ffd0d2; }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--saffron); border-radius: 99px; transition: width .25s linear; }

.answer-card {
  border-radius: 18px; padding: 16px; background: var(--surface);
  box-shadow: 0 1px 0 var(--line), 0 8px 20px rgba(42, 33, 64, 0.06);
  display: flex; flex-direction: column; gap: 12px;
}
.answer-card .text { font-size: 1.08rem; font-weight: 700; line-height: 1.9; }
.answer-card.mine { background: var(--sunk); box-shadow: none; }
.answer-card.done { box-shadow: inset 0 0 0 2px var(--pistachio); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .88rem; font-weight: 700; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 12px;
  background: var(--sunk); border: none; box-shadow: 0 3px 0 var(--line);
}
.chip .avatar { width: 24px; height: 24px; font-size: .75rem; border-radius: 8px; }
.chip.on { background: var(--turquoise); color: #fff; box-shadow: 0 3px 0 var(--turquoise-d); }
.chip.used:not(.on) { opacity: .45; }

.reveal-author { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--plum); }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin-top: 8px; flex-shrink: 0; }
.podium .step {
  flex: 1 1 0; max-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  padding: 12px 6px; border-radius: 18px 18px 8px 8px; background: var(--sunk); text-align: center; line-height: 1.5;
}
/* the staircase comes from top padding, so steps always grow to fit their content */
.podium .step.p1 { padding-top: 30px; background: var(--saffron); box-shadow: 0 5px 0 var(--saffron-d); }
.podium .step.p2 { padding-top: 16px; }
.podium .step.p3 { padding-top: 6px; }
.podium .medal { font-size: 1.6rem; }

.offline { background: #ffe3e4; color: var(--pomegranate-d); text-align: center; padding: 6px; border-radius: 12px; font-size: .9rem; margin-bottom: 12px; }

.rules { color: var(--muted); font-size: .9rem; margin: 10px 0 0; padding-inline-start: 20px; line-height: 1.9; }
details summary { cursor: pointer; font-weight: 800; }

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(140px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 16px;
  transition: transform .25s; max-width: calc(100% - 32px); text-align: center; z-index: 10;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* --- multi-game additions ------------------------------------------------ */
.game-tile.teal { background: var(--turquoise); box-shadow: 0 6px 0 var(--turquoise-d); }
.game-tile.teal:active { box-shadow: 0 2px 0 var(--turquoise-d); }

.segmented { display: flex; gap: 6px; background: var(--sunk); padding: 5px; border-radius: 16px; }
.segmented button {
  flex: 1; font: inherit; font-weight: 800; font-size: .92rem; color: var(--muted); cursor: pointer;
  border: none; background: transparent; padding: 10px 8px; border-radius: 12px;
}
.segmented button.on { background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--line); }
.segmented button:disabled { cursor: default; }
.chip:disabled { cursor: default; }

/* footer: bug report + sponsor */
.footer { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.bug-card, .sponsor-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius);
  text-decoration: none; transition: transform .08s, box-shadow .08s;
}
.bug-card:active, .sponsor-card:active { transform: translateY(3px); }
.card-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-body b { font-size: 1rem; }
.card-arrow { flex: none; font-size: 1.2rem; font-weight: 900; opacity: .7; }

.bug-card { background: var(--surface); color: var(--ink); box-shadow: 0 5px 0 var(--line); }
.bug-card:active { box-shadow: 0 2px 0 var(--line); }
.bug-card .card-body > span { font-size: .82rem; color: var(--muted); }
.bug-card [dir="ltr"] { color: var(--plum); font-weight: 700; }
.bug-icon {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.5rem; background: #ffe3e4; transform: rotate(-8deg);
}

/* sponsor card in the sponsor's own colours: near-black with its green */
.sponsor-card { background: #121212; color: #fff; box-shadow: 0 5px 0 #000; position: relative; overflow: hidden; }
.sponsor-card:active { box-shadow: 0 2px 0 #000; }
.sponsor-card::after {
  content: ""; position: absolute; left: -50px; bottom: -70px; width: 170px; height: 170px; border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 187, 71, 0.32), transparent 70%); pointer-events: none;
}
.sponsor-logo {
  flex: none; width: 50px; height: 50px; border-radius: 14px; background: #2a2a2a; display: grid; place-items: center;
  overflow: hidden; font-weight: 900; color: #4cbb47; font-size: 1.4rem;
}
.sponsor-logo img { width: 42px; height: 42px; object-fit: contain; }
.sponsor-label { font-size: .72rem; color: #4cbb47; font-weight: 800; }
.sponsor-card b { font-size: 1.05rem; }
.sponsor-card .card-arrow { color: #4cbb47; opacity: 1; position: relative; z-index: 1; }

.made { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 2px; }

/* اسم فامیل */
.letter-panel { background: var(--turquoise); color: #fff; box-shadow: 0 6px 0 var(--turquoise-d); }
.letter-panel .round-tag { color: #fff; }
.letter-panel .timer.low { color: #fff1b8; }
.letter-badge {
  flex: none; width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center;
  font-size: 2.6rem; font-weight: 900; background: #fff; color: var(--turquoise-d);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.12); transform: rotate(-4deg);
}
.stop-banner { background: var(--saffron); color: #3a2a05; border-radius: 14px; padding: 10px 14px; text-align: center; font-weight: 700; }
.stop-banner[hidden] { display: none; }

.ef-form { gap: 10px; }
.ef-field { display: flex; align-items: center; gap: 10px; }
.ef-label { flex: none; width: 64px; font-weight: 800; font-size: .95rem; color: var(--plum); }
.ef-field input { flex: 1; padding: 11px 13px; }
.ef-mark { flex: none; width: 18px; text-align: center; font-weight: 900; }
.ef-mark.good { color: var(--pistachio-d); }
.ef-mark.bad { color: var(--pomegranate); }

.ef-col { gap: 8px; padding: 14px 16px; }
.ef-col h2 { color: var(--plum); font-size: 1rem; }
.ef-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 14px; background: var(--sunk); }
.ef-row .avatar { width: 28px; height: 28px; font-size: .8rem; border-radius: 9px; }
.ef-text { flex: 1; font-weight: 700; overflow-wrap: anywhere; }
.ef-row.bad .ef-text { text-decoration: line-through; color: var(--muted); }
.pill.no { background: var(--pomegranate); color: #fff; }
.vote {
  font: inherit; font-size: .85rem; cursor: pointer; border: none; border-radius: 10px; padding: 4px 9px;
  background: #fff; box-shadow: 0 2px 0 var(--line); white-space: nowrap;
}
.vote.on { background: var(--pomegranate); color: #fff; box-shadow: 0 2px 0 var(--pomegranate-d); }
.pts { flex: none; min-width: 40px; text-align: center; font-weight: 900; border-radius: 10px; padding: 3px 8px; font-size: .9rem; }
.pts.p20 { background: var(--saffron); color: #3a2a05; }
.pts.p10 { background: var(--plum); color: #fff; }
.pts.p5 { background: var(--turquoise); color: #fff; }
.pts.p0 { background: #fff; color: var(--muted); }

/* --- home filters & catalog ---------------------------------------------- */
.filters { display: flex; flex-direction: column; gap: 8px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; font: inherit; font-weight: 800; font-size: .9rem; color: var(--ink); cursor: pointer;
  border: none; border-radius: 99px; padding: 8px 14px; background: var(--surface); box-shadow: 0 3px 0 var(--line);
  white-space: nowrap;
}
.fchip.small { font-size: .8rem; padding: 6px 12px; font-weight: 700; }
.fchip.on { background: var(--ink); color: #fff; box-shadow: 0 3px 0 #000; }
.game-tile.gold { background: var(--saffron); box-shadow: 0 6px 0 var(--saffron-d); color: #3a2a05; }
.game-tile.red { background: var(--pomegranate); box-shadow: 0 6px 0 var(--pomegranate-d); }
.tile-cats { font-size: .82rem !important; font-weight: 700; margin-top: 2px; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tile-meta span { font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.22); font-weight: 700; white-space: nowrap; }
.game-tile.soon .tile-meta span { background: #fff; }

/* --- room code (tap to copy) ---------------------------------------------- */
button.code-box {
  font-family: inherit; border: none; cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  box-shadow: 0 4px 0 var(--line); transition: transform .08s, box-shadow .08s;
}
button.code-box:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.code-copy { font-size: 1.2rem; letter-spacing: 0; color: var(--muted); }
.card-body .mail { text-align: right; color: var(--plum); font-weight: 700; font-size: .82rem; }
.segmented { flex-wrap: wrap; }
.segmented button { min-width: 30%; }

/* --- هم‌فکر ----------------------------------------------------------------- */
.prompt-panel { background: var(--saffron); color: #3a2a05; box-shadow: 0 6px 0 var(--saffron-d); }
.prompt-panel .round-tag { color: #6b4a00; }
.prompt-panel .bar { background: rgba(0, 0, 0, 0.12); }
.prompt-panel .bar > i { background: #fff; }
.prompt-panel .timer.low { color: var(--pomegranate-d); }
.prompt-note { font-size: .9rem; font-weight: 600; }
.hf-form { gap: 10px; }
.hf-num {
  flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--saffron); color: #3a2a05; font-weight: 900;
}
.hf-groups { display: flex; flex-wrap: wrap; gap: 10px; }
.hf-group {
  font: inherit; display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 10px 12px 10px 10px; border-radius: 16px; border: none; background: var(--surface);
  color: var(--ink); box-shadow: 0 4px 0 var(--line); text-align: right;
}
.hf-group:disabled { cursor: default; }
.hf-group.mine { box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--saffron); }
.hf-group.picked { background: var(--plum); color: #fff; box-shadow: 0 4px 0 var(--plum-d); }
.hf-texts { font-weight: 800; }
.hf-count {
  min-width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--saffron); color: #3a2a05; font-weight: 900; font-size: .85rem;
}
.hf-group.picked .hf-count { background: #fff; color: var(--plum-d); }

.pts, .pill.plus { direction: ltr; unicode-bidi: isolate; }
.answer-card .pts.p0 { background: var(--sunk); }

/* --- version badge & what's new popup ------------------------------------- */
.ver {
  font-size: .62rem; font-weight: 700; color: var(--muted); background: var(--sunk);
  padding: 1px 6px; border-radius: 99px; vertical-align: middle; direction: ltr; display: inline-block;
}
.news-btn {
  position: relative; flex: none; font: inherit; font-size: .82rem; font-weight: 800; color: var(--ink); cursor: pointer;
  border: none; border-radius: 99px; padding: 8px 12px; background: var(--surface); box-shadow: 0 3px 0 var(--line);
}
.news-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.news-dot {
  position: absolute; top: -2px; left: -2px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--pomegranate); box-shadow: 0 0 0 2px var(--bg);
}
.modal-overlay {
  position: fixed; inset: 0; z-index: 20; background: rgba(42, 33, 64, 0.35);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px;
  opacity: 0; transition: opacity .2s;
}
.modal-overlay.show { opacity: 1; }
.modal {
  width: 100%; max-width: 448px; max-height: 80vh; overflow: auto; background: var(--surface);
  border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 6px 0 var(--line), 0 20px 50px rgba(42, 33, 64, 0.25);
  transform: translateY(30px); transition: transform .2s;
}
.modal-overlay.show .modal { transform: translateY(0); }
@media (min-width: 600px) { .modal-overlay { align-items: center; } }
.changelog { display: flex; flex-direction: column; gap: 12px; }
.cl-entry { background: var(--sunk); border-radius: 16px; padding: 12px 14px; }
.cl-entry.latest { background: #efe9ff; }
.cl-ver { font-size: .8rem; font-weight: 900; color: var(--plum); }
.cl-entry ul { margin: 6px 0 0; padding-inline-start: 18px; line-height: 1.9; font-size: .92rem; }

/* --- ضرب‌المثل گمشده --------------------------------------------------------- */
.zb-panel { background: var(--pomegranate); color: #fff; box-shadow: 0 6px 0 var(--pomegranate-d); }
.zb-panel .round-tag { color: #fff; }
.zb-panel .timer.low { color: #fff1b8; }
.half-card {
  border-radius: var(--radius); padding: 20px 18px; text-align: center; background: var(--surface);
  box-shadow: 0 6px 0 var(--line); display: flex; flex-direction: column; gap: 8px;
  background-image: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(123, 92, 214, 0.05) 14px 28px);
}
.half-card.loner { box-shadow: 0 6px 0 var(--plum-d); background-color: #efe9ff; }
.half-tag { font-size: .8rem; font-weight: 800; color: var(--plum); }
.half-text { font-size: 1.45rem; font-weight: 900; line-height: 1.8; }
.half-text .dots { color: var(--muted); font-weight: 400; }
.loner-note { font-size: .88rem; color: var(--plum-d); font-weight: 700; }
.zb-warn { background: #ffe3e4; color: var(--pomegranate-d); border-radius: 12px; padding: 8px 12px; font-size: .88rem; font-weight: 700; }
.zb-warn[hidden] { display: none; }
.hint-card {
  font: inherit; width: 100%; display: flex; align-items: center; gap: 12px; text-align: right; cursor: pointer;
  border: none; border-radius: 18px; padding: 14px; background: var(--surface); color: var(--ink);
  box-shadow: 0 4px 0 var(--line);
}
.hint-card .card-body > span { font-size: .95rem; color: var(--ink); line-height: 1.8; }
.hint-card.on { background: var(--turquoise); color: #fff; box-shadow: 0 4px 0 var(--turquoise-d); }
.hint-card.on .card-body > span { color: #fff; }
.pick-mark { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sunk); font-weight: 900; }
.hint-card.on .pick-mark { background: #fff; color: var(--turquoise-d); }
.loner-card { background: #efe9ff; }

/* gold tile and its pills carry dark text */
.game-tile.gold .tile-meta span { background: rgba(0, 0, 0, 0.1); }
.game-tile.soon .tile-meta span { color: var(--ink); }

/* --- تندوتیز ----------------------------------------------------------------- */
.game-tile.green { background: var(--pistachio-d); box-shadow: 0 6px 0 #2a5419; }
.game-tile.green:active { box-shadow: 0 2px 0 #2a5419; }
.tz-panel { background: var(--ink); color: #fff; box-shadow: 0 6px 0 #000; }
.tz-panel .round-tag { color: #fff; }
.tz-name { font-weight: 900; background: rgba(255, 255, 255, 0.14); padding: 3px 10px; border-radius: 99px; }
.tz-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; min-height: 280px; justify-content: center; }
.tz-count {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 6rem; font-weight: 900;
  color: var(--ink); background: rgba(251, 246, 239, 0.88); border-radius: var(--radius); pointer-events: none;
}
.tz-count[hidden] { display: none; }
.tz-pad, .tz-tap { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.tz-pad {
  width: 100%; height: 260px; border: none; border-radius: 32px; cursor: pointer; font: inherit;
  font-size: 1.8rem; font-weight: 900; color: #fff; transition: background .05s;
}
.tz-pad.wait { background: var(--plum); box-shadow: 0 8px 0 var(--plum-d); }
.tz-pad.go { background: var(--pistachio-d); box-shadow: 0 8px 0 #2a5419; }
.tz-pad.burnt { background: var(--pomegranate); box-shadow: 0 8px 0 var(--pomegranate-d); }
.tz-big { width: 100%; font-size: 1.2rem; padding: 18px; touch-action: manipulation; }
.tz-track { position: relative; width: 100%; height: 70px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); overflow: hidden; }
.tz-target { position: absolute; left: 50%; top: 0; bottom: 0; width: 14%; transform: translateX(-50%); background: var(--saffron); }
.tz-needle { position: absolute; top: 6px; bottom: 6px; width: 6px; border-radius: 3px; background: var(--ink); transform: translateX(-50%); left: 50%; }
.tz-tap {
  width: 220px; height: 220px; border-radius: 50%; border: none; cursor: pointer; font: inherit; color: #fff;
  background: radial-gradient(circle at 35% 30%, #e86a6f, var(--pomegranate)); box-shadow: 0 10px 0 var(--pomegranate-d);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.tz-tap b { font-size: 3.6rem; line-height: 1.1; }
.tz-tap.pop { animation: tzpop .12s; }
@keyframes tzpop { 50% { transform: scale(.94); } }
.tap-bars { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.tap-bar { display: grid; grid-template-columns: 70px 1fr 34px; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; }
.tap-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tap-bar div { height: 12px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.tap-bar i { display: block; height: 100%; border-radius: 99px; transition: width .3s; }
.tz-clock {
  font-size: 4.5rem; font-weight: 900; direction: ltr; font-variant-numeric: tabular-nums; color: var(--ink);
  background: var(--surface); border-radius: 28px; padding: 18px 30px; box-shadow: 0 6px 0 var(--line); transition: filter .4s, opacity .4s;
}
.tz-clock.hidden-time { filter: blur(10px); opacity: .5; }
.tz-mine { text-align: center; font-weight: 900; font-size: 1.1rem; background: var(--surface); border-radius: 16px; padding: 10px; box-shadow: 0 4px 0 var(--line); }
.tz-mine[hidden] { display: none; }
.tz-medal { width: 22px; text-align: center; }

/* --- wallet ------------------------------------------------------------------ */
.head-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.coin-chip {
  position: relative; font: inherit; font-size: .85rem; color: #3a2a05; cursor: pointer; border: none;
  border-radius: 99px; padding: 8px 12px; background: var(--saffron); box-shadow: 0 3px 0 var(--saffron-d);
}
.coin-chip b { font-weight: 900; }
.coin-chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--saffron-d); }
.coin-dot {
  position: absolute; top: -2px; left: -2px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--pomegranate); box-shadow: 0 0 0 2px var(--bg);
}
.coin-dot[hidden] { display: none; }
.avatar.emoji-av { font-size: 1.1rem; }
.modal.wallet { max-height: 86vh; }
.w-h { font-size: .95rem; margin: 4px 0 0; color: var(--plum); }
.daily-card, .task-row, .pack {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--sunk);
}
.daily-card { background: #fff3d6; }
.daily-card.done { background: var(--sunk); }
.daily-card .card-body > span, .task-row .card-body > span, .pack .card-body > span { font-size: .82rem; color: var(--muted); }
.task-bar { height: 8px; border-radius: 99px; background: #fff; overflow: hidden; margin-top: 6px; }
.task-bar i { display: block; height: 100%; background: var(--turquoise); border-radius: 99px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shop-item {
  font: inherit; color: var(--ink); cursor: pointer; border: none; border-radius: 16px; padding: 12px 6px;
  background: var(--sunk); display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; font-size: .85rem;
}
.shop-item.owned { background: #efe9ff; }
.shop-item.equipped { background: var(--plum); color: #fff; box-shadow: 0 4px 0 var(--plum-d); }
.shop-emoji { font-size: 2rem; line-height: 1.2; }
.shop-price { font-size: .78rem; font-weight: 800; }
.packs { display: flex; flex-direction: column; gap: 10px; }
.pack { font: inherit; color: var(--ink); cursor: pointer; border: none; text-align: right; box-shadow: 0 4px 0 var(--line); background: var(--surface); }
.pack-price { flex: none; font-weight: 900; background: var(--saffron); color: #3a2a05; padding: 6px 12px; border-radius: 12px; }
.invite-hero {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 16px;
  border-radius: 18px; background: #e3f4f3;
}
.invite-hero span:last-child { font-size: .88rem; color: var(--muted); }
.invite-link { font-size: .9rem !important; letter-spacing: 0 !important; }
.invite-link [dir="ltr"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- coin icon, coin chip, version button ------------------------------------ */
.coin-ic { width: 1.25em; height: 1.25em; vertical-align: -0.28em; flex: none; }
.coin-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface); color: var(--ink);
  box-shadow: 0 3px 0 var(--line); padding: 7px 12px 7px 10px; font-size: .95rem;
}
.coin-chip .coin-ic { width: 22px; height: 22px; vertical-align: 0; }
.coin-chip:active { box-shadow: 0 1px 0 var(--line); }
.w-title { display: inline-flex; align-items: center; gap: 6px; }
.w-title .coin-ic { width: 26px; height: 26px; vertical-align: 0; }
button.ver {
  position: relative; font-family: inherit; border: none; cursor: pointer; font-size: .66rem; font-weight: 800;
  color: var(--plum-d); background: #efe9ff; padding: 2px 8px; border-radius: 99px; vertical-align: middle;
}
button.ver:active { transform: translateY(1px); }
button.ver .news-dot { top: -3px; left: -3px; width: 8px; height: 8px; }
.btn.gold .coin-ic, .pack-price .coin-ic { vertical-align: -0.3em; }

/* --- تندوتیز: new challenges & podium ---------------------------------------- */
.tz-double { background: var(--saffron); color: #3a2a05; border-radius: 10px; padding: 4px 10px; font-weight: 900; align-self: flex-start; }
.seed-field {
  position: relative; width: 100%; height: 260px; border-radius: 28px; overflow: hidden;
  background: #fff3ef; box-shadow: inset 0 0 0 2px #f6d6cf; transition: opacity .15s;
}
.seed-field.covered .seed { opacity: 0; }
.seed-field.gone { opacity: 0; height: 0; box-shadow: none; }
.seed {
  position: absolute; width: 18px; height: 24px; margin: -12px 0 0 -9px; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 30%, #ff8a8f, var(--pomegranate) 65%); box-shadow: 0 2px 0 var(--pomegranate-d);
}
.seed-answer { display: flex; align-items: center; justify-content: center; gap: 8px; }
.seed-answer[hidden] { display: none; }
.seed-answer b { min-width: 90px; text-align: center; font-size: 3rem; font-weight: 900; }
.seed-step {
  font: inherit; font-weight: 900; font-size: 1.1rem; width: 52px; height: 52px; border-radius: 16px; border: none; cursor: pointer;
  background: var(--surface); color: var(--ink); box-shadow: 0 4px 0 var(--line); touch-action: manipulation;
}
.seed-step:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.dye-swatch { width: 220px; height: 220px; border-radius: 50%; background: var(--sunk); box-shadow: 0 8px 0 rgba(0, 0, 0, 0.12); transition: transform .2s; }
.dye-swatch.shown { transform: scale(1.04); }
.dye-pick { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.dye-pick[hidden] { display: none; }
.dye-preview { width: 150px; height: 150px; border-radius: 50%; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12); }
#dyeRange {
  -webkit-appearance: none; appearance: none; width: 100%; height: 34px; border-radius: 99px; padding: 0;
  background: linear-gradient(90deg, hsl(0,78%,52%), hsl(60,78%,52%), hsl(120,78%,52%), hsl(180,78%,52%), hsl(240,78%,52%), hsl(300,78%,52%), hsl(359,78%,52%));
  direction: ltr;
}
#dyeRange::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 4px solid var(--ink); }
#dyeRange::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid var(--ink); }
.dye-dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); vertical-align: middle; }
.dye-dot.big { width: 32px; height: 32px; }
.bold-grid { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.bold-num {
  font: inherit; font-size: 1.6rem; font-weight: 900; aspect-ratio: 1; border-radius: 18px; border: none; cursor: pointer;
  background: var(--surface); color: var(--ink); box-shadow: 0 4px 0 var(--line); touch-action: manipulation;
}
.bold-num.on { background: var(--plum); color: #fff; box-shadow: 0 4px 0 var(--plum-d); transform: translateY(-2px); }
.tz-truth { text-align: center; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tz-next {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border-radius: 18px; padding: 12px 14px; box-shadow: 0 4px 0 var(--line); font-weight: 700;
}
.tz-next #timer { font-variant-numeric: tabular-nums; direction: ltr; display: inline-block; }
.tz-next .btn { flex: none; }

/* --- social layer ------------------------------------------------------------ */
.player.reveal { animation: reveal-in .5s both cubic-bezier(.2, .9, .3, 1.3); }
@keyframes reveal-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.predict { background: #efe9ff; }
.titles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.title-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 12px 8px;
  border-radius: 16px; background: var(--sunk);
}
.title-emoji { font-size: 1.8rem; }
.title-who { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .88rem; }
.title-who .avatar { width: 24px; height: 24px; font-size: .75rem; border-radius: 8px; }

/* --- engine games: quiz / write-vote / polls ---------------------------------- */
.game-switch { display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow-y: auto; padding: 2px; }
.quiz-panel { background: var(--plum); color: #fff; box-shadow: 0 6px 0 var(--plum-d); }
.quiz-panel .round-tag, .wv-panel .round-tag, .poll-panel .round-tag { color: #fff; }
.wv-panel { background: var(--pomegranate); color: #fff; box-shadow: 0 6px 0 var(--pomegranate-d); }
.poll-panel { background: var(--turquoise); color: #fff; box-shadow: 0 6px 0 var(--turquoise-d); }
.quiz-panel .timer.low, .wv-panel .timer.low, .poll-panel .timer.low { color: #fff1b8; }
.quiz-big { display: block; font-size: 2.4rem; text-align: center; letter-spacing: .08em; line-height: 1.6; }
.quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.quiz-opts[hidden] { display: none; }
.quiz-opt {
  font: inherit; font-weight: 800; font-size: 1.02rem; text-align: right; cursor: pointer; color: var(--ink);
  border: none; border-radius: 16px; padding: 15px 16px; background: var(--surface); box-shadow: 0 4px 0 var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; line-height: 1.7; touch-action: manipulation;
}
.quiz-opt:disabled { cursor: default; }
.quiz-opt.on { background: var(--plum); color: #fff; box-shadow: 0 4px 0 var(--plum-d); }
.quiz-opt.result.right { background: #e6f4dd; box-shadow: inset 0 0 0 2px var(--pistachio-d); }
.quiz-opt.result.wrong { background: #ffe3e4; }
.quiz-who { display: inline-flex; gap: 2px; flex-wrap: wrap; }
.quiz-who .avatar { width: 24px; height: 24px; font-size: .72rem; border-radius: 8px; }
.quiz-ready { text-align: center; font-size: 1.6rem; font-weight: 900; color: var(--muted); padding: 30px 0; }
.quiz-ready[hidden] { display: none; }
.quiz-note { background: #fff3d6; border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.who-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.who-btn {
  font: inherit; font-weight: 800; cursor: pointer; border: none; border-radius: 16px; padding: 14px 8px; color: var(--ink);
  background: var(--surface); box-shadow: 0 4px 0 var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.dilemma { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.dil-opt {
  font: inherit; font-weight: 900; font-size: 1.05rem; cursor: pointer; border: none; border-radius: 18px; padding: 18px 14px;
  background: var(--surface); color: var(--ink); box-shadow: 0 5px 0 var(--line); line-height: 1.7;
}
.dil-opt.on { background: var(--turquoise); color: #fff; box-shadow: 0 5px 0 var(--turquoise-d); }
.dil-or { text-align: center; font-weight: 900; color: var(--muted); }
.pct-bar { height: 18px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.pct-bar i { display: block; height: 100%; background: var(--turquoise); border-radius: 99px; }
.big-num { font-size: 2rem; color: var(--plum); }
.rank-opt { position: relative; }
.rank-no { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: #fff; color: var(--plum-d); }
.rank-list { margin: 0; padding-inline-start: 24px; line-height: 2.1; font-weight: 800; }

/* --- cup / league ------------------------------------------------------------- */
.cup-panel { background: #fff8e8; }
.cup-list { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.cup-list li { font-weight: 800; }
.cup-list li span { display: inline-block; }
.cup-x { font: inherit; border: none; background: transparent; color: var(--pomegranate); cursor: pointer; margin-inline-start: 8px; font-weight: 900; }
.cup-hero { background: var(--saffron); color: #3a2a05; box-shadow: 0 6px 0 var(--saffron-d); }
.cup-hero .round-tag { color: #5c3a00; }
.cup-hero .muted { color: #5c3a00; }
.cup-trophy { font-size: 3.4rem; line-height: 1.1; animation: cup-pop .8s both cubic-bezier(.2, .9, .3, 1.4); }
@keyframes cup-pop { from { transform: scale(.3) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
.cup-next-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: 0 4px 0 var(--line); }
.cup-result { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--sunk); font-weight: 700; }
.cup-winner { color: var(--plum-d); }

/* --- frames, supporter badge, gifts -------------------------------------------- */
.avatar { position: relative; }
.avatar.fr_saffron { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--saffron); }
.avatar.fr_rose { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pomegranate); }
.avatar.fr_tile { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--turquoise), 0 0 0 6px var(--plum); }
.avatar.fr_rainbow { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #e5484d, 0 0 0 4px #f7b538, 0 0 0 5px #8cc56b, 0 0 0 6px #20b2aa, 0 0 0 7px #7b5cd6; }
.frame-demo { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: #fff; margin: 6px 0; }
.frame-demo.fr_saffron { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--saffron); }
.frame-demo.fr_rose { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pomegranate); }
.frame-demo.fr_tile { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--turquoise), 0 0 0 6px var(--plum); }
.frame-demo.fr_rainbow { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #e5484d, 0 0 0 4px #f7b538, 0 0 0 5px #8cc56b, 0 0 0 6px #20b2aa, 0 0 0 7px #7b5cd6; }
.sup-badge { position: absolute; bottom: -5px; left: -5px; font-size: .65rem; font-style: normal; line-height: 1; }
.tip-pack { background: #fff3d6; }
.gift-btn { font: inherit; border: none; background: transparent; cursor: pointer; font-size: 1.15rem; padding: 2px 4px; flex: none; }
