:root { --bg: #2a1408; --card: #3d2010; --gold: #FFC94A; --saffron: #FF9933; --green: #2fbf71; --ink: #fff6e8; --muted: #d5b99f; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at 50% 0%, #5a2c14, var(--bg) 70%); color: var(--ink); font-family: 'Noto Sans Devanagari','Noto Sans Telugu','Noto Sans Kannada','Noto Sans Tamil','Noto Sans Malayalam', system-ui, sans-serif; }
[hidden] { display: none !important; }
.screen { min-height: 100dvh; padding: 56px 12px 64px; display: flex; flex-direction: column; align-items: center; }
.card { width: min(440px, 100%); background: var(--card); border: 1.5px solid rgba(255,201,74,.4); border-radius: 20px; padding: 18px; }
.logo { font-size: 32px; font-weight: 800; text-align: center; color: var(--gold); }
.sub { text-align: center; color: var(--muted); margin: 4px 0 14px; }
.how { display: grid; gap: 8px; font-size: 14px; line-height: 1.45; background: rgba(0,0,0,.2); border-radius: 14px; padding: 12px; }
.best-row { text-align: center; margin: 14px 0 0; color: var(--muted); }
.best-row b { color: var(--gold); }
button.primary { width: 100%; margin-top: 12px; padding: 13px; font: inherit; font-weight: 800; font-size: 17px; color: #2a1408; background: linear-gradient(180deg, #FFD466, var(--saffron)); border: 0; border-radius: 14px; cursor: pointer; box-shadow: 0 4px 0 #b3661a; }
button.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #b3661a; }
button.ghost { width: 100%; margin-top: 10px; padding: 10px; font: inherit; font-weight: 700; color: var(--gold); background: transparent; border: 1.5px solid rgba(255,201,74,.5); border-radius: 14px; cursor: pointer; }
button.ghost.sm { width: auto; padding: 8px 12px; font-size: 13px; margin: 0; }
button.ghost:disabled { opacity: .4; }
.fine { font-size: 12px; color: var(--muted); margin: 12px 0 0; line-height: 1.45; }

button.primary.alt { background: linear-gradient(180deg, #ffb066, #d9772b); box-shadow: 0 4px 0 #8f4a14; }
button.primary.blue { background: linear-gradient(180deg, #7fc3ff, #2f7fd6); box-shadow: 0 4px 0 #1b4f8f; color: #06203d; }
.aka { text-align: center; color: var(--gold); font-size: 13px; margin: 2px 0 0; }
.prow { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.prow input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.25); color: inherit; }
.lbl { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.card .fine.c { text-align: center; }

/* ── the game: a folding wooden board (two trays with 7 carved cups each) and loose tamarind seeds ── */
.game { padding-top: 46px; gap: 8px; }
.board-wrap { position: relative; width: min(96vw, 640px); }
#board { position: relative; padding: 0 0 2px; filter: drop-shadow(0 14px 18px rgba(0,0,0,.55)); }
.tray { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(3px, 1.2vw, 8px); padding: clamp(8px, 2.4vw, 16px); border-radius: clamp(18px, 5vw, 30px);
  background:
    repeating-linear-gradient(92deg, rgba(90,40,8,.10) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #d0812f 0%, #b8691f 55%, #9a5216 100%);
  box-shadow: inset 0 2px 0 rgba(255,220,160,.45), inset 0 -4px 8px rgba(70,28,4,.45), 0 3px 0 #6d3a10; }
.hinge { height: 5px; margin: 0 6%; border-radius: 3px; background: linear-gradient(#5a300c, #3a1e08); }
.pit { position: relative; aspect-ratio: 1; border-radius: 50%; cursor: default;
  background: radial-gradient(circle at 50% 38%, #8d4712 0%, #a55a1c 42%, #c47a34 78%, #d78d45 100%);
  box-shadow: inset 0 9px 12px rgba(50,20,2,.7), inset 0 -3px 5px rgba(255,205,140,.35), 0 1px 0 rgba(255,225,170,.5); }
.pit .seeds { position: absolute; inset: 0; }
.pit .num { position: absolute; left: 50%; bottom: -1px; transform: translate(-50%, 55%); font-size: clamp(10px, 2.8vw, 13px); font-weight: 800; color: #ffe9c4; text-shadow: 0 1px 2px #000; pointer-events: none; z-index: 3; }
.pit.can { cursor: pointer; box-shadow: inset 0 9px 12px rgba(50,20,2,.7), 0 0 0 3px rgba(255,201,74,.95), 0 0 14px 3px rgba(255,201,74,.55); animation: canPulse 1.2s ease-in-out infinite alternate; }
.pit.bounce { animation: pitBounce .22s ease-out; }
.pit.hot { box-shadow: inset 0 9px 12px rgba(50,20,2,.7), 0 0 0 3px #7ee0a9, 0 0 16px 4px rgba(126,224,169,.6); }
@keyframes canPulse { to { box-shadow: inset 0 9px 12px rgba(50,20,2,.7), 0 0 0 3px rgba(255,201,74,.6), 0 0 6px 1px rgba(255,201,74,.3); } }
@keyframes pitBounce { 40% { transform: scale(1.07); } }

/* a tamarind seed: dark, glossy, flat, with a lighter rim */
.seed { position: absolute; width: 33%; height: 23%; transform: translate(-50%, -50%) rotate(var(--r, 0deg)); border-radius: 50% / 46%;
  background: radial-gradient(ellipse at 34% 28%, #8b6470 0%, #4a2a33 34%, #24121a 72%, #170a10 100%);
  box-shadow: 0 1.5px 1.5px rgba(0,0,0,.65), inset 0 0 0 1px rgba(120,80,90,.35); }
.seed::after { content: ''; position: absolute; inset: 22% 18%; border-radius: 50%; border: 1px solid rgba(190,150,160,.25); }
.seed.pop { animation: seedPop .2s ease-out; }
@keyframes seedPop { from { transform: translate(-50%, -190%) rotate(var(--r, 0deg)) scale(1.15); opacity: .2; } }

/* seeds in hand while sowing */
.hand { position: absolute; z-index: 6; width: clamp(34px, 9vw, 52px); aspect-ratio: 1; margin: calc(clamp(34px, 9vw, 52px) / -2) 0 0 calc(clamp(34px, 9vw, 52px) / -2); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #e0a86a, #a86526); border: 2px solid #ffe2b0; box-shadow: 0 8px 14px rgba(0,0,0,.55); display: grid; place-items: center;
  transition: left .16s ease-out, top .16s ease-out; }
.hand b { font-size: clamp(14px, 3.6vw, 19px); color: #2a1408; }

/* captured seeds, kept loose on the table beside each player */
.store { display: flex; align-items: center; gap: 10px; width: min(96vw, 640px); padding: 4px 10px; border-radius: 16px; border: 1.5px solid transparent; transition: background .2s, border-color .2s; }
.store.turn { background: rgba(255,201,74,.12); border-color: rgba(255,201,74,.55); }
.store .who { flex: 0 0 auto; max-width: 30%; font-weight: 800; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store .pile { position: relative; flex: 1; height: 46px; }
.store .pile .seed { width: 4.6%; height: 30%; }
.store .cnt { flex: 0 0 auto; min-width: 34px; text-align: right; font-size: 22px; color: var(--gold); }
.store .cnt.bump { animation: pitBounce .3s; }
.msg { min-height: 24px; text-align: center; font-weight: 700; color: var(--gold); font-size: 14px; }
.row { display: flex; gap: 8px; justify-content: center; }
.toast { background: #1c1138; }
/* ── online ── */
button.primary.alt { background: linear-gradient(180deg, #7fe3c1, #2fbf71); box-shadow: 0 4px 0 #1c7f4a; }
.err { color: #ff8a92; min-height: 18px; font-size: 13px; margin-top: 8px; text-align: center; }
.code-in { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-weight: 800; }
.room-code { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 40px; font-weight: 900; letter-spacing: 8px; color: var(--gold); }
.room-code .kind { letter-spacing: 0; font-size: 13px; }
.kind { font: inherit; font-size: 12px; font-weight: 700; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: inherit; cursor: pointer; white-space: nowrap; }
.lobby-players { display: grid; gap: 6px; margin: 12px 0; }
.lrow { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.07); border-radius: 12px; padding: 8px 10px; }
.lrow.off { opacity: .45; } .lrow .tk { font-size: 22px; } .lrow b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: #2a0f1e; background: var(--gold); border-radius: 8px; padding: 2px 6px; }
.fine.c { text-align: center; }
.dock { position: fixed; right: 10px; bottom: 64px; z-index: 60; display: none; flex-direction: column; gap: 8px; }
.vg-online .dock { display: flex; }
.dock-btn { position: relative; width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,201,74,.6); background: #1c1138; font-size: 22px; cursor: pointer; padding: 0; box-shadow: 0 6px 16px rgba(0,0,0,.45); }
.unread { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
#hearts { position: fixed; right: 0; bottom: 0; width: 120px; height: 60vh; pointer-events: none; z-index: 65; overflow: hidden; }
.float-heart { position: absolute; bottom: 60px; font-size: 26px; opacity: 0; animation: heartFloat 2.4s ease-out forwards; }
@keyframes heartFloat { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 0), -55vh) scale(1.1) rotate(var(--rot, 0deg)); } }
.chat-panel { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 80; max-width: 460px; margin: 0 auto; background: var(--card); border: 2px solid rgba(255,201,74,.5); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 60vh; }
.chat-head { display: flex; justify-content: space-between; align-items: center; color: var(--gold); }
.chat-log { overflow-y: auto; min-height: 90px; display: flex; flex-direction: column; gap: 6px; }
.chat-empty { color: var(--muted); text-align: center; padding: 14px 0; font-size: 13px; }
.cmsg { display: flex; gap: 6px; align-items: flex-start; } .cmsg .tk { font-size: 20px; }
.cmsg .bub { background: rgba(255,255,255,.09); border-radius: 12px; padding: 5px 9px; font-size: 14px; overflow-wrap: anywhere; }
.cmsg.mine { flex-direction: row-reverse; } .cmsg.mine .bub { background: rgba(255,201,74,.18); }
.cmsg .bub b { display: block; font-size: 11px; color: var(--gold); }
.quick-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.quick-row button { flex: none; font: inherit; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 14px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.07); color: inherit; cursor: pointer; white-space: nowrap; }
.chat-in { display: flex; gap: 6px; } .chat-in input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.25); color: inherit; }
#chatPops { position: fixed; left: 10px; bottom: 132px; z-index: 66; display: flex; flex-direction: column; gap: 6px; pointer-events: none; max-width: min(300px, calc(100vw - 90px)); }
.chat-pop { display: flex; align-items: center; gap: 8px; background: rgba(28,17,56,.94); border: 1.5px solid rgba(255,213,74,.6); border-radius: 16px; padding: 6px 12px 6px 8px; box-shadow: 0 6px 18px rgba(0,0,0,.45); animation: chatPopLife 4.5s ease-out forwards; }
.chat-pop .tk { font-size: 24px; } .chat-pop b { display: block; font-size: 11px; color: var(--gold); } .chat-pop span.tx { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
@keyframes chatPopLife { 0% { opacity: 0; transform: translateY(14px) scale(.9); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px); } }

.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(10,3,14,.6); padding: 12px; }
.sheet-card { width: min(460px, 100%); background: var(--card); border: 2px solid var(--gold); border-radius: 22px; padding: 18px; text-align: center; animation: rise .3s ease-out; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet-icon { font-size: 44px; } .sheet-tag { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.sheet-card h2 { margin: 4px 0 6px; color: var(--gold); } .sheet-card p { margin: 0 0 8px; line-height: 1.5; }
.sheet-move { color: var(--muted); font-size: 13px; }
.once { text-align: center; font-size: 13px; color: var(--gold); margin: 12px 0 0; }
.once.done { background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px; color: var(--ink); line-height: 1.45; }
#toasts { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { border: 1.5px solid rgba(255,201,74,.6); border-radius: 12px; padding: 8px 14px; font-weight: 700; font-size: 14px; }
.ad-slot { width: min(440px, 100%); margin-top: 12px; }
.editions { display: grid; gap: 8px; }
.edition { text-align: left; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.18); color: inherit; font: inherit; cursor: pointer; }
.edition b { display: block; font-size: 15px; } .edition small { color: var(--muted); }
.edition.on { border-color: var(--gold); background: rgba(255,201,74,.14); }
.once { text-align: center; font-size: 13px; color: var(--gold); margin: 12px 0 0; }
.once.done { background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px; color: var(--ink); line-height: 1.45; }
button:disabled { opacity: .5; cursor: default; }
