/* ==========================================================================
   XX1.LOL — the game
   Tokens from main.css. The board is the page; everything else is a sheet.
   ========================================================================== */

.play { padding: 1.25rem 0 3rem; }
.play-wrap { width: 100%; max-width: 440px; margin: 0 auto; padding: 0 1.25rem; position: relative; z-index: 2; }

.play-top { display: flex; align-items: center; justify-content: space-between; margin: 0 0 1rem; }
.play-meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-3); }
.play-meta b { color: var(--text-2); font-weight: 500; }
.streak {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.7rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--rule); font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-2);
}
.streak b { color: var(--ink); font-weight: 600; }
.streak.hot { border-color: var(--rule-green); color: #bff0cc; }

.total { display: flex; align-items: baseline; justify-content: center; gap: 0.3rem; margin: 0.25rem 0 1rem; font-family: var(--font-display); font-weight: 800; font-size: 4.5rem; line-height: 1; color: var(--ink); transition: color var(--t-fast); font-variant-numeric: tabular-nums; }
.total small { font-family: var(--font-mono); font-size: 1rem; color: var(--text-3); font-weight: 500; }
.total.hit { color: var(--green); }
.total.bust { color: var(--red); }

.boardwrap { border-radius: 28px; padding: 0.9rem; touch-action: none; user-select: none; -webkit-user-select: none; }
.board { position: relative; aspect-ratio: 1 / 1; }
.board .grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 0.6rem; height: 100%; }
.board .tile {
  position: relative; z-index: 1; display: grid; place-items: center; border-radius: 18px;
  background: var(--surface-2); border: 1px solid var(--rule);
  font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 11vw, 3rem); color: var(--text);
  transition: background 120ms var(--ease), color 120ms var(--ease), transform 120ms var(--ease), border-color 120ms var(--ease);
  cursor: pointer;
}
.board .tile.on { background: var(--green); color: var(--green-ink); border-color: var(--green); transform: scale(1.04); }
.board .tile.bust { background: var(--red); color: #fff; border-color: var(--red); transform: scale(1.0); }
.board .tile.locked { background: var(--green-deep); color: var(--green-ink); border-color: var(--green-deep); transform: none; }
.board svg.path { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.board svg.path polyline { fill: none; stroke: var(--green-ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.5; }
.board.bust svg.path polyline { stroke: #4a0c09; }
.board.disabled .tile { cursor: default; }

.under { min-height: 3.4rem; margin-top: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; }
.hint { font-size: 0.9rem; color: var(--text-3); margin: 0; }
.hint.bad { color: #ff8a84; }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.9rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--rule); font-size: 0.9rem; font-weight: 600; color: var(--ink);
}
.chip.best { border-color: var(--rule-green); color: #bff0cc; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.actions { display: flex; gap: 0.6rem; width: 100%; }
.actions .btn-green, .actions .btn-ghost { flex: 1; justify-content: center; padding: 0.95rem 1rem; font-size: 0.95rem; border-radius: 14px; }

/* result card (inline, after lock-in) */
.outcome { margin-top: 1.25rem; border-radius: 24px; padding: 1.4rem 1.3rem; text-align: center; }
.outcome h2 { font-size: 3rem; margin: 0; }
.outcome .verdict { margin: 0.35rem 0 1rem; color: var(--text-2); font-size: 0.95rem; }
.outcome .emo { font-size: 1.4rem; line-height: 1.3; letter-spacing: 2px; white-space: pre; font-family: ui-monospace, monospace; margin: 0 auto 1rem; }
.outcome .btn-green { width: 100%; justify-content: center; padding: 0.95rem; font-size: 0.95rem; border-radius: 14px; }
.outcome .copied { margin: 0.6rem 0 0; font-size: 0.85rem; color: #bff0cc; min-height: 1.2em; }
.outcome .mini-stats { display: flex; justify-content: space-around; margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); }
.outcome .mini-stats b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; line-height: 1; color: var(--ink); }
.outcome .mini-stats span { font-size: 0.72rem; color: var(--text-3); }
.outcome .next { margin: 1rem 0 0; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-3); }
.outcome .next b { color: var(--text-2); font-weight: 500; }

/* ad slot: empty and hidden until ads are turned on */
.ad { margin-top: 1rem; min-height: 0; }
.ad[data-ads="off"] { display: none; }

/* sheets */
dialog.sheet {
  border: 1px solid var(--rule); border-radius: 24px; padding: 0; max-width: 420px; width: calc(100% - 2rem);
  background: #121214; color: var(--text); box-shadow: 0 40px 100px rgba(0,0,0,0.7);
}
dialog.sheet::backdrop { background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); }
.sheet-in { padding: 1.5rem 1.4rem 1.6rem; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.sheet-top h2 { font-size: 1.9rem; margin: 0; }
.sheet-x { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--rule); color: var(--text-2); display: grid; place-items: center; font-size: 0.9rem; }
.sheet-x:hover { color: var(--ink); border-color: var(--rule-2); }

.howto { display: grid; gap: 1rem; }
.howto .row { display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; align-items: center; }
.howto .row p { margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--text-2); }
.howto .row p b { color: var(--ink); font-weight: 600; }
.mini { display: grid; grid-template-columns: repeat(4, 1.35rem); gap: 0.2rem; }
.mini span { display: grid; place-items: center; height: 1.35rem; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--rule); font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; color: var(--text); }
.mini span.on { background: var(--green); color: var(--green-ink); border-color: var(--green); }
.mini span.bad { background: var(--red); color: #fff; border-color: var(--red); }
.howto .btn-green { width: 100%; justify-content: center; padding: 0.95rem; border-radius: 14px; font-size: 0.95rem; margin-top: 0.4rem; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin-bottom: 1.4rem; }
.stat-tile { text-align: center; padding: 0.9rem 0.3rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--rule); }
.stat-tile b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; line-height: 1; color: var(--ink); }
.stat-tile span { font-size: 0.68rem; color: var(--text-3); }
.dist h3 { font-family: var(--font-sans); font-weight: 600; font-size: 0.85rem; color: var(--text-2); margin: 0 0 0.6rem; }
.dist .row { display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.6rem; align-items: center; margin-bottom: 0.35rem; }
.dist .row .k { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-3); text-align: right; }
.dist .bar { height: 1.3rem; border-radius: 6px; background: var(--surface-2); min-width: 1.6rem; display: flex; align-items: center; justify-content: flex-end; padding-right: 0.4rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-2); }
.dist .bar.today { background: var(--green); color: var(--green-ink); }

@media (max-width: 380px) { .total { font-size: 3.8rem; } }
