:root {
  --bg: #0e1b2c; --ink: #f3f6fb; --dim: #94a3b8;
  --board: #1d4ed8; --hole: #0b1422;
  --p0: #f43f5e; --p1: #facc15;
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: var(--ink); background: radial-gradient(circle at 50% -20%, #1e3a5f, var(--bg) 60%); background-attachment: fixed; }
.app { max-width: 560px; margin: 0 auto; padding: 22px 16px 40px; }
header { text-align: center; margin-bottom: 16px; }
h1 { margin: 0; font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 900; letter-spacing: -.02em; }
h1::first-letter { color: var(--p0); }
.tag { margin: 6px 0 0; color: var(--dim); }
.card { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); border-radius: 20px; padding: 22px 18px; }
.card[hidden], section[hidden] { display: none; }
label { display: block; color: var(--dim); font-size: .9rem; margin-bottom: 6px; }
input { width: 100%; font: inherit; font-size: 1.1rem; padding: 12px 14px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .25); color: var(--ink); outline: none; }
input:focus { border-color: var(--p1); }
#code { text-transform: uppercase; letter-spacing: .25em; text-align: center; font-weight: 800; }
button { font: inherit; font-weight: 800; font-size: 1.02rem; padding: 12px 16px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .16); background: transparent; color: var(--ink); cursor: pointer; }
button.primary { background: var(--p1); border-color: var(--p1); color: #1a1205; }
button:disabled { opacity: .5; cursor: default; }
.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.row { display: flex; gap: 10px; }
.row input { flex: 1; }
.status { min-height: 1.3em; color: var(--p1); text-align: center; margin: 12px 0 0; }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 12px; }
.side { display: flex; align-items: center; gap: 8px; font-size: 1rem; min-width: 0; padding: 6px 10px; border-radius: 999px; border: 2px solid transparent; }
.side b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side.right { justify-content: flex-end; }
.side.active { border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .06); }
.turn { font-weight: 800; color: var(--dim); text-align: center; font-size: .95rem; }
.disc { display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex: none; }
.p0 { background: var(--p0); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.p1 { background: var(--p1); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.board-wrap { background: var(--board); border-radius: 18px; padding: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .4), inset 0 -6px 0 rgba(0, 0, 0, .2); }
.board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cell { aspect-ratio: 1; border-radius: 50%; background: var(--hole); border: 0; padding: 0; box-shadow: inset 0 4px 6px rgba(0, 0, 0, .6); cursor: pointer; transition: background .15s; }
.cell.p0, .cell.p1 { animation: drop .35s cubic-bezier(.3, 1.4, .6, 1); }
.cell.win { outline: 4px solid #fff; outline-offset: -4px; }
.board.mine .cell:hover { background: #16243a; }
.board:not(.mine) .cell { cursor: default; }
@keyframes drop { from { transform: translateY(-260%); } }
.hint { text-align: center; color: var(--dim); }
.hint b { color: var(--p1); letter-spacing: .15em; font-size: 1.3rem; }
.foot { text-align: center; color: var(--dim); font-size: .78rem; margin-top: 18px; }
