/* Shared look for all games: big readable text, high contrast, large tap targets (all ages). */
:root {
  --bg: #14183a; --panel: #1f2552; --panel2: #2a3170; --ink: #ffffff; --muted: #b9c0f0;
  --accent: #ffc93d; --good: #37d67a; --bad: #ff6b6b; --radius: 16px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { display: flex; flex-direction: column; align-items: center; overflow: auto; -webkit-tap-highlight-color: transparent; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.topbar { width: 100%; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; background: rgba(0,0,0,.2); font-size: 18px; }
.topbar .title { font-weight: 800; }
.pill { background: var(--panel); padding: 6px 12px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.tools { display: flex; gap: 8px; }
/* 44px minimum tap targets — easier for small fingers and older hands */
.tbtn { background: var(--panel2); padding: 8px 14px; border-radius: 12px; font-weight: 700; font-size: 17px; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.tbtn:hover { filter: brightness(1.15); }

.main { flex: 1; width: 100%; max-width: 760px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 16px; }
.prompt { font-size: clamp(18px, 3.4vw, 24px); color: var(--muted); text-align: center; margin: 0; }
.big-btn { background: var(--accent); color: #1a1a1a; font-weight: 800; font-size: 22px; padding: 14px 30px; border-radius: 999px; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.ghost-btn { background: transparent; border: 2px solid var(--muted); color: var(--ink); font-weight: 700; font-size: 18px; padding: 10px 22px; border-radius: 999px; }

.overlay { position: fixed; inset: 0; background: rgba(10,12,35,.85); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.overlay[hidden] { display: none; }
.overlay .box { background: var(--panel); border-radius: 24px; padding: 28px; max-width: 440px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.overlay h2 { margin: 0 0 8px; font-size: 30px; }
.overlay p { color: var(--muted); font-size: 18px; line-height: 1.5; }
.stars { font-size: 44px; letter-spacing: 6px; margin: 6px 0 10px; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.diff { display: flex; gap: 8px; justify-content: center; margin: 14px 0; }
.diff button { background: var(--panel2); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 17px; }
.diff button[aria-pressed="true"] { background: var(--accent); color: #1a1a1a; }

.feedback { min-height: 30px; font-size: 20px; font-weight: 700; text-align: center; }
.feedback.good { color: var(--good); } .feedback.bad { color: var(--bad); }
.hint-box { background: rgba(255,201,61,.12); border: 2px dashed var(--accent); padding: 10px 14px; border-radius: 12px; font-size: 18px; text-align: center; }
.hint-box[hidden] { display: none; }
@keyframes shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-8px) } 75% { transform: translateX(8px) } }
.shake { animation: shake .3s; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }
.pop { animation: pop .25s ease-out; }
@media (prefers-reduced-motion: reduce) { .shake, .pop { animation: none; } }

/* Phones: a little less padding so boards fit without scrolling, but text and buttons stay large. */
@media (max-width: 480px), (max-height: 680px) {
  .topbar { padding: 6px 10px; font-size: 17px; gap: 6px; }
  .main { padding: 10px; gap: 12px; }
  .ghost-btn { padding: 10px 18px; min-height: 44px; }
}
.ghost-btn, .big-btn { min-height: 48px; }
