/* Duel & party games: rps, battleship, hangman, numberguess, truthdare, wordchain */
.g-rps, .g-battleship, .g-hangman, .g-numberguess, .g-truthdare, .g-wordchain { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.g-rps [hidden], .g-battleship [hidden], .g-hangman [hidden], .g-numberguess [hidden], .g-truthdare [hidden], .g-wordchain [hidden] { display: none !important; }
.g-rps .banner.mine, .g-battleship .banner.mine, .g-hangman .banner.mine, .g-numberguess .banner.mine, .g-truthdare .banner.mine, .g-wordchain .banner.mine { color: var(--accent); box-shadow: var(--glow); }
.g-rps .banner.over, .g-battleship .banner.over, .g-hangman .banner.over, .g-numberguess .banner.over, .g-truthdare .banner.over, .g-wordchain .banner.over { color: var(--warn); border-color: var(--warn); }
.g-rps .timer.urgent, .g-battleship .timer.urgent, .g-hangman .timer.urgent, .g-numberguess .timer.urgent, .g-truthdare .timer.urgent, .g-wordchain .timer.urgent { color: var(--bad); border-color: var(--bad); }
.g-rps .mid, .g-battleship .mid, .g-hangman .mid, .g-numberguess .mid, .g-truthdare .mid, .g-wordchain .mid { min-height: 32px; justify-content: space-between; font-size: 13px; }
.g-rps .chip, .g-battleship .chip, .g-hangman .chip, .g-numberguess .chip, .g-truthdare .chip, .g-wordchain .chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; }
.g-rps .chip.turn, .g-numberguess .chip.turn, .g-truthdare .chip.turn, .g-wordchain .chip.turn { color: var(--accent); border-color: var(--accent); background: var(--panel-2); font-weight: 800; box-shadow: var(--glow); }
.g-numberguess .chip.dead, .g-wordchain .chip.dead { opacity: .45; text-decoration: line-through; }
.g-numberguess .inp, .g-wordchain .inp, .g-hangman .inp { min-height: 44px; }

/* ---------- rps */
.g-rps .duel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g-rps .side { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; text-align: center; transition: box-shadow .2s, border-color .2s; min-width: 0; }
.g-rps .side.won { border-color: var(--good); box-shadow: 0 0 0 2px color-mix(in srgb, var(--good) 55%, transparent); }
.g-rps .nm { font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-rps .sc { font-size: 30px; font-weight: 800; line-height: 1.2; color: var(--accent); }
.g-rps .hand { font-size: 56px; line-height: 1.3; min-height: 76px; display: flex; align-items: center; justify-content: center; }
.g-rps .side.won .hand { animation: duel-pop .45s ease; }
.g-rps .st { font-size: 12px; min-height: 18px; }
.g-rps .picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.g-rps .mv { flex-direction: column; gap: 0; min-height: 84px; font-size: 14px; }
.g-rps .mv .ic { font-size: 34px; line-height: 1.3; }
.g-rps .mv.sel { background: var(--accent); color: var(--accent-ink); border-color: transparent; opacity: 1; box-shadow: var(--glow); }
.g-rps .mv:disabled:not(.sel) { opacity: .4; }
.g-rps .hist { flex-wrap: wrap; justify-content: center; gap: 6px; }
.g-rps .hist .chip { min-height: 32px; padding: 0 12px; font-size: 12px; color: var(--ink); border-color: var(--good); }
.g-rps .hist .chip.draw { color: var(--sub); border-color: var(--line); }

/* ---------- battleship */
.g-battleship .info { min-height: 22px; font-size: 13px; }
.g-battleship .bwrap { display: flex; flex-direction: column; gap: 8px; padding: 8px; align-items: stretch; }
.g-battleship .bwrap .bt { font-weight: 800; font-size: 14px; }
.g-battleship .bwrap.mini .bs-board { width: 72%; margin-inline: auto; }
.g-battleship .bs-board { direction: ltr; display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(10, 1fr); gap: 2px; width: 100%; aspect-ratio: 1; padding: 2px; border-radius: 10px; background: var(--line); transition: box-shadow .2s; }
.g-battleship .bs-board.armed { box-shadow: var(--glow); }
.g-battleship .c { min-width: 0; min-height: 0; width: 100%; height: 100%; aspect-ratio: 1; padding: 0; margin: 0; border: 0; border-radius: 3px; background: #2f6fa8; color: #fff; font-size: 14px; font-weight: 800; line-height: 1; display: flex; align-items: center; justify-content: center; font-family: system-ui, sans-serif; position: relative; }
.g-battleship .bwrap.mini .c { font-size: 11px; }
.g-battleship button.c { cursor: pointer; }
.g-battleship button.c:disabled { cursor: default; opacity: 1; }
.g-battleship .enemy.armed button.c:not(:disabled):active { background: #4a8bc8; }
.g-battleship .c.ship { background: #64748b; }
.g-battleship .c.miss { background: #1e4a78; color: #cfe6ff; }
.g-battleship .c.hit { background: #dc2626; color: #fff; }
.g-battleship .c.sunk { background: #7f1d1d; color: #fecaca; }
.g-battleship .c.last { outline: 2px solid var(--warn); outline-offset: -2px; z-index: 1; }
.g-battleship .fleet { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; direction: ltr; }
.g-battleship .ship { display: inline-flex; gap: 2px; }
.g-battleship .ship i { width: 12px; height: 12px; border-radius: 3px; background: #64748b; display: block; }
.g-battleship .ship.sunk { opacity: .5; }
.g-battleship .ship.sunk i { background: #dc2626; }

/* ---------- hangman */
.g-hangman .stage { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; }
.g-hangman .gal { color: var(--ink); width: 100%; max-width: 170px; }
.g-hangman .gal svg { display: block; width: 100%; height: auto; max-height: 190px; color: var(--ink); fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.g-hangman .gal svg circle { stroke: var(--bad); }
.g-hangman .slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 46px; direction: rtl; }
.g-hangman .sl { width: 36px; height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; border-bottom: 3px solid var(--line); border-radius: 4px 4px 0 0; background: var(--panel-2); }
.g-hangman .sl.hit { color: var(--good); border-bottom-color: var(--good); }
.g-hangman .sl.dim { color: var(--sub); border-bottom-color: var(--bad); }
.g-hangman .info, .g-hangman .score, .g-hangman .rounds { text-align: center; font-size: 13px; }
.g-hangman .wordbox { flex-wrap: nowrap; }
.g-hangman .wordbox .btn { flex: none; }
.g-hangman .kb { direction: rtl; display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.g-hangman .k { min-width: 0; min-height: 44px; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 700; font-size: 17px; }
.g-hangman .k:active:not(:disabled) { transform: scale(.94); }
.g-hangman .k:disabled { opacity: .4; cursor: default; }
.g-hangman .k.ok { background: var(--good); color: #052e1c; border-color: transparent; opacity: 1; }
.g-hangman .k.no { background: var(--bad); color: #3b0606; border-color: transparent; opacity: .55; text-decoration: line-through; }

/* ---------- numberguess */
.g-numberguess .rangebox, .g-wordchain .reqbox { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; }
.g-numberguess .range { font-size: 34px; font-weight: 800; color: var(--accent); line-height: 1.3; }
.g-numberguess .guessrow .inp, .g-wordchain .guessrow .inp { flex: 1; min-width: 0; }
.g-numberguess .guessrow .btn, .g-wordchain .guessrow .btn { flex: none; min-height: 44px; }
.g-numberguess .tries { flex-wrap: wrap; justify-content: center; gap: 6px; }
.g-numberguess .hist { gap: 6px; max-height: 40vh; overflow-y: auto; }
.g-numberguess .hrow { display: grid; grid-template-columns: 1fr 56px auto; align-items: center; gap: 10px; min-height: 40px; padding: 6px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-inline-start-width: 4px; }
.g-numberguess .hrow .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-numberguess .hrow .n { font-weight: 800; text-align: center; font-size: 17px; }
.g-numberguess .hrow .res { font-size: 13px; font-weight: 700; color: var(--sub); }
.g-numberguess .hrow.high { border-inline-start-color: var(--bad); }
.g-numberguess .hrow.high .res { color: var(--bad); }
.g-numberguess .hrow.low { border-inline-start-color: var(--warn); }
.g-numberguess .hrow.low .res { color: var(--warn); }
.g-numberguess .hrow.hit { border-color: var(--good); border-inline-start-color: var(--good); box-shadow: 0 0 0 1px var(--good) inset; }
.g-numberguess .hrow.hit .res { color: var(--good); }
.g-numberguess .hrow.skip { opacity: .6; }

/* ---------- truthdare */
.g-truthdare .wheel { flex-wrap: wrap; justify-content: center; gap: 8px; }
.g-truthdare .card { text-align: center; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; border-width: 2px; min-height: 140px; justify-content: center; }
.g-truthdare .card.truth { border-color: #38bdf8; }
.g-truthdare .card.dare { border-color: #f97316; }
.g-truthdare .kind { font-weight: 800; font-size: 14px; letter-spacing: .5px; display: inline-block; align-self: center; padding: 2px 16px; border-radius: 14px; background: var(--panel-2); }
.g-truthdare .card.truth .kind { color: #38bdf8; }
.g-truthdare .card.dare .kind { color: #f97316; }
.g-truthdare .txt { font-size: 18px; font-weight: 700; line-height: 1.9; overflow-wrap: anywhere; }
.g-truthdare .card.pop { animation: duel-pop .4s ease; }
.g-truthdare .choose { gap: 10px; }
.g-truthdare .choose .btn { min-height: 56px; font-size: 18px; }
.g-truthdare .acts { flex-wrap: wrap; justify-content: center; }
.g-truthdare .acts .btn { flex: 1 1 130px; }

/* ---------- wordchain */
.g-wordchain .req { font-size: 44px; font-weight: 800; line-height: 1.3; color: var(--accent); }
.g-wordchain .plist { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; }
.g-wordchain .challenge, .g-wordchain > .btn { width: 100%; }
.g-wordchain .words { gap: 6px; max-height: 42vh; overflow-y: auto; }
.g-wordchain .wrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 6px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.g-wordchain .wrow:first-child { border-color: var(--accent); }
.g-wordchain .wrow .w { font-weight: 800; font-size: 17px; overflow-wrap: anywhere; }
.g-wordchain .wrow .who { font-size: 12px; flex: none; }
.g-wordchain .wrow.struck .w { text-decoration: line-through; color: var(--bad); }
.g-wordchain .wrow.struck { opacity: .6; }

@keyframes duel-pop { 0% { transform: scale(.85); opacity: .4; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@media (max-width: 360px) { .g-hangman .k { font-size: 15px; } .g-hangman .sl { width: 30px; } }
