:root { --felt: #35654d; --dim: rgba(255,255,255,0.6); --accent: #ffd166; --slot: rgba(255,255,255,0.18); color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: var(--felt); color: #fff; font: 15px/1.4 system-ui, -apple-system, sans-serif; -webkit-text-size-adjust: 100%; }
.page { padding: 8px clamp(4px, 1.5vw, 12px) 24px; max-width: 720px; margin: 0 auto; }
.page__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.page__head h1 { font-size: 17px; margin: 0; }
.k-controls { display: flex; gap: 6px; align-items: center; }
.k-controls button { font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 8px; cursor: pointer; border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.08); color: #fff; }
.k-controls button.primary { background: var(--accent); color: #1a1a1a; border-color: transparent; font-weight: 700; }
.k-controls .gear { font-size: 16px; padding: 4px 9px; line-height: 1; }
.k-controls button:active { transform: translateY(1px); }

/* peaks board — cards absolutely positioned by the UI */
.tri-board { position: relative; margin: 4px auto 0; }
.tri-board .card { transition: box-shadow 120ms ease, filter 120ms ease; }
.tri-covered { filter: brightness(0.66) saturate(0.9); }
.tri-play { cursor: pointer; box-shadow: 0 0 0 2px var(--accent); }
.tri-play:hover { filter: brightness(1.06); }
.tri-hint { animation: triPulse 0.85s ease-in-out 2; box-shadow: 0 0 0 3px var(--accent); }
@keyframes triPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,209,102,0.2); } 50% { box-shadow: 0 0 0 7px rgba(255,209,102,0.5); } }

/* stock + waste */
.tri-stockwaste { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.tri-pile { display: flex; }
.tri-stock.tri-live { cursor: pointer; }
.tri-count { font-size: 12px; color: var(--dim); }
.tri-waste { margin-left: auto; }
.tri-slot { display: flex; align-items: center; justify-content: center; border: 1.5px dashed var(--slot); border-radius: 8px; font-size: 18px; color: var(--slot); }

.tri-msg { text-align: center; font-weight: 700; margin-top: 16px; }
.tri-win { font-size: 20px; color: var(--accent); }
.tri-stuck { font-size: 15px; color: var(--dim); }
.tri-nomoves { animation: triShake 0.42s ease; }
@keyframes triShake { 20% { transform: translateX(-4px); } 60% { transform: translateX(4px); } 100% { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .tri-hint, .tri-nomoves { animation: none; } }

/* score bar */
.tri-scorebar { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.tri-score { font-size: 16px; font-weight: 800; }
.tri-streak { font-size: 13px; font-weight: 700; color: var(--accent); }
.tri-best { font-size: 12px; color: var(--dim); margin-left: auto; }
