/* The frame every Plunkday game shares: game bar, controls column, tries list, done bar, help and results dialogs.
   Each game adds its own file (drop.css, marble.css) for its board. --accent is the game's colour of the day. */
.game { display: grid; gap: 18px; padding: 4px 0 44px; }
.game-bar { position: relative; }
.game-id { display: grid; gap: 2px; }
.game-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--muted); text-decoration: none; font-size: .95rem; min-height: 44px; margin-bottom: 4px; justify-self: start; }
.game-back .ico { width: 18px; height: 18px; }
.game-back:hover { color: var(--ink); }
.game-id h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); margin: 0; font-weight: 800; letter-spacing: -.035em; }
.game-id p { margin: 0; color: var(--muted); }
.game-tools { position: absolute; right: 0; top: 0; display: flex; gap: 8px; }
@media (min-width: 900px) { .game-tools { top: auto; bottom: 4px; } }
.tool.sound .off { display: none; }
.tool.sound.muted .on { display: none; }
.tool.sound.muted .off { display: inline; }
.tool.sound.muted { color: var(--muted); }
.practice-note { margin: 0; font-size: .96rem; color: var(--muted); background: var(--paper); border-radius: 14px; padding: 10px 14px; }

.board { display: grid; gap: 20px; justify-items: center; }
@media (min-width: 900px) {
  .board { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: 40px; }
}
.controls { width: 100%; max-width: 32rem; justify-self: center; display: grid; gap: 16px; }

.actions { display: flex; gap: 10px; align-items: center; }
.actions .main { flex: 1; font-size: 1.1rem; min-height: 56px; }
.actions .main:not(:disabled) { animation: ready .5s var(--spring); }
@keyframes ready { from { transform: scale(.96); } }
.actions .ghost { min-height: 56px; padding: 0 18px; }
.tries-left { margin: -4px 0 0; color: var(--muted); font-size: .95rem; text-align: center; }
.tries-left.last { color: var(--danger); font-weight: 700; }
.game.is-done .actions, .game.is-done .tries-left { display: none; }

.done-bar { background: var(--paper); border-radius: 22px; padding: 18px; display: grid; gap: 12px; box-shadow: var(--shadow); border-top: 8px solid var(--accent, var(--ink)); animation: pop-in .4s var(--ease-out); }
.done-title { margin: 0; font: 800 1.35rem/1.15 var(--display); }
.done-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.done-actions .btn { flex: 1 1 10rem; }
.next { margin: 0; color: var(--muted); }
.next b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- tries ---------- */
.tries-wrap h2 { font-size: 1.15rem; margin-bottom: 10px; }
.tries { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tries li { display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 16px; padding: 8px; box-shadow: var(--shadow); }
.tries li.new { animation: row-in .3s var(--ease-out); }
@keyframes row-in { from { opacity: 0; transform: translateY(-6px); } }
.try-n { font: 800 .95rem/1 var(--display); color: var(--muted); min-width: 1.4ch; text-align: center; flex: none; }
.reuse { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; flex: none; color: var(--muted); margin-left: auto; }
.reuse:hover { border-color: var(--ink); color: var(--ink); }
.reuse .ico { width: 18px; height: 18px; }

/* ---------- results dialog ---------- */
.res-line { color: var(--muted); }
.res-h3 { font-size: 1rem; margin: 4px 0 0; font-family: var(--text); }
.res-share { display: flex; gap: 10px; flex-wrap: wrap; }
.res-share .btn { flex: 1 1 11rem; }
.res-more { display: flex; gap: 10px; flex-wrap: wrap; }
.res-more .btn { flex: 1; }

/* ---------- help dialog with small looping demos ---------- */
.hsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hstep { display: flex; gap: 14px; align-items: center; }
.hstep b { display: block; font-family: var(--display); font-size: 1.1rem; margin-bottom: 2px; }
.hdemo { width: 84px; height: 84px; flex: none; border-radius: 20px; background: var(--wall); position: relative; display: grid; place-items: center; overflow: hidden; }
.hnote { background: var(--wall); border-radius: 16px; padding: 12px 14px; }
.hkeys { color: var(--muted); font-size: .92rem; }

.fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 45; }
