@font-face { font-family: Vazirmatn; src: url(/web/Vazirmatn-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(/web/Vazirmatn-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --sky1: #4fa3d9; --sky2: #bfe6ff; --paper: #fffaf0; --edge: #e7d9b8; --ink: #173a4f;
  --soft: #4d6b7d; --gold: #f5b400; --green: #2e9d5b; --bad: #c62828; --star: #fff1c2;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Vazirmatn, Tahoma, sans-serif; color: var(--ink);
  background: linear-gradient(180deg, var(--sky1), var(--sky2) 60%, #e9f7ff) fixed;
  -webkit-tap-highlight-color: transparent;
}
.top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; max-width: 520px; margin: 0 auto; }
.top img { border-radius: 10px; }
.brand { font-weight: 700; font-size: 26px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.timer { margin-inline-start: auto; font-weight: 700; font-size: 20px; color: #fff; background: rgba(0,0,0,.18); padding: 2px 12px; border-radius: 999px; }
main { max-width: 520px; margin: 0 auto; padding: 0 12px 32px; }

.card { background: var(--paper); border: 2px solid var(--edge); border-radius: 18px; padding: 16px; margin: 12px 0; box-shadow: 0 4px 0 rgba(0,0,0,.08); }
.card h1 { font-size: 22px; margin: 0 0 8px; }
.card h2 { font-size: 18px; margin: 0 0 6px; }
.card p { margin: 6px 0; line-height: 1.8; }
.big { font-size: 18px; font-weight: 700; }
.muted { color: var(--soft); font-size: 14px; }
.ltr { direction: ltr; unicode-bidi: isolate; letter-spacing: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px;
  background: var(--green); color: #fff; font: inherit; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 #1f6e40; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #1f6e40; }
.btn.alt { background: #6a1b9a; box-shadow: 0 4px 0 #4a1170; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--edge); }
.btn.small { min-height: 42px; font-size: 15px; padding: 0 14px; }
.btn.big { width: 100%; font-size: 20px; min-height: 56px; margin: 8px 0; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.link { display: block; text-align: center; margin-top: 12px; color: var(--ink); }

.play { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 4px; }
.title { color: #fff; font-size: 20px; margin: 0; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.riddle { background: var(--star); border: 2px solid var(--gold); border-radius: 14px; padding: 8px 12px; margin: 0; font-weight: 700; text-align: center; }
.grid { display: grid; direction: rtl; gap: 3px; margin: 6px 0; }
.cell { background: #fff; border: 2px solid var(--edge); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cell.star { background: var(--star); border-color: var(--gold); }
.cell.open { background: var(--green); border-color: #1f6e40; color: #fff; animation: pop .25s ease-out; }
.cell.star.open { background: var(--gold); border-color: #b98700; color: var(--ink); }
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }
.word { min-height: 40px; font-size: 26px; font-weight: 700; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.toast { min-height: 24px; font-weight: 700; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }
.toast.good { color: #0f5132; }
.toast.bad { color: var(--bad); }
.wheel { position: relative; border-radius: 50%; background: rgba(255,255,255,.55); border: 3px solid rgba(255,255,255,.9); touch-action: none; user-select: none; -webkit-user-select: none; }
.wheel svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wheel polyline { fill: none; stroke: var(--gold); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.letter { position: absolute; border-radius: 50%; background: #fff; border: 3px solid var(--edge); display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--ink); transition: left .25s, top .25s; pointer-events: none; }
.letter.on { background: var(--gold); border-color: #b98700; }
.extras { color: var(--soft); font-size: 14px; text-align: center; }

.results { list-style: none; padding: 0; margin: 8px 0; }
.results li { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; }
.results li:nth-child(odd) { background: rgba(0,0,0,.04); }
.results li.you { background: var(--star); font-weight: 700; }
.results .rank { font-weight: 700; color: var(--soft); }
.results .time { color: var(--soft); direction: ltr; }
.results small { color: var(--soft); font-weight: 400; }

.count { font-weight: 700; color: #8a4b00; }
.word.ok, .word.bad { display: inline-block; padding: 2px 16px; border-radius: 20px; }
.word.ok { background: #2e7d4f; }
.word.bad { background: #b3473f; }
.replaybar { height: 8px; border-radius: 4px; background: rgba(0,0,0,.08); overflow: hidden; margin: 10px 0; direction: ltr; }
.replaybar span { display: block; height: 100%; background: var(--gold); transition: width .3s; }
.profile { text-align: center; }
.profile .stats { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.profile .stats li { background: #fff; border: 2px solid var(--edge); border-radius: 12px; padding: 6px 10px; min-width: 76px; display: flex; flex-direction: column; }
.profile .stats span { color: var(--soft); font-size: 13px; }
.profile h2 { margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { background: var(--star); border: 2px solid var(--gold); border-radius: 999px; padding: 2px 10px; font-size: 14px; }
.bosses { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.bosses figure { margin: 0; width: 76px; font-size: 13px; }
.bosses img, .bosses .noimg { width: 64px; height: 64px; object-fit: contain; display: block; margin: 0 auto 2px; font-size: 44px; line-height: 64px; }
.nest { font-size: 34px; letter-spacing: 6px; background: #fff; border: 2px solid var(--edge); border-radius: 14px; padding: 6px; }
.raid { text-align: center; }
.raid .hp { height: 14px; border-radius: 7px; background: rgba(0,0,0,.08); overflow: hidden; margin: 8px 0; direction: ltr; }
.raid .hp span { display: block; height: 100%; background: linear-gradient(90deg, #c62828, #ef6c00); border-radius: 7px; }
.greeting { text-align: center; }
.greeting .emoji { font-size: 56px; margin: 0; line-height: 1.2; }
.pulse { text-align: center; }
.pulse select { font: inherit; padding: 6px 10px; border: 2px solid var(--edge); border-radius: 10px; background: #fff; color: var(--ink); }
.provinces { list-style: none; padding: 0; margin: 6px 0 0; text-align: start; }
.provinces li { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 10px; }
.provinces li:nth-child(odd) { background: rgba(0,0,0,.04); }
.provinces li.me { background: var(--star); font-weight: 700; }
.install { text-align: center; }
.code p { font-size: 14px; }
.codebox { font: inherit; font-size: 28px; font-weight: 700; letter-spacing: 6px; direction: ltr; padding: 6px 18px; border: 2px dashed var(--gold);
  border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; }
.codebox[data-copied]::after { content: " ✓"; color: var(--green); letter-spacing: 0; }
.meanings summary { font-weight: 700; cursor: pointer; }
.meanings li { margin: 4px 0; line-height: 1.8; }
