/* Puzzle Palace: the look every page shares (top bar, buttons, cards, the end-of-puzzle box). */
:root {
  --bg: #f6f1ff;
  --panel: #ffffff;
  --ink: #2b2140;
  --muted: #6f6488;
  --line: #e4dcf3;
  --accent: #7c4dff;
  --accent-dark: #5b2fd6;
  --good: #2fb36b;
  --bad: #e5484d;
  --gold: #ffc83d;
  --display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--body); background: radial-gradient(ellipse 90% 40% at 50% 0%, #e6dbff, var(--bg)) var(--bg); padding-bottom: 72px; }
[hidden] { display: none !important; }
button { font-family: inherit; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-bottom: 2px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.home-link { font: 1.15rem var(--display); color: var(--accent); text-decoration: none; white-space: nowrap; }
.top h1 { flex: 1; min-width: 0; margin: 0; font: 1.25rem var(--display); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { border: 0; background: none; font-size: 1.25rem; cursor: pointer; min-width: 44px; min-height: 44px; border-radius: 12px; }
.icon-btn:hover { background: var(--line); }

/* buttons */
.btn { border: 2px solid var(--line); background: #fff; color: var(--ink); border-radius: 14px; padding: 10px 16px; min-height: 44px; cursor: pointer;
  font: 1rem var(--display); letter-spacing: .02em; box-shadow: 0 3px 0 var(--line); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.btn.go { background: var(--accent); border-color: var(--accent-dark); color: #fff; box-shadow: 0 3px 0 var(--accent-dark); }
.btn.on { background: #ece4ff; border-color: var(--accent); color: var(--accent-dark); }
.btn:disabled { opacity: .5; cursor: default; }
:is(.btn, .icon-btn, .tile-btn, a, input, select):focus-visible { outline: 3px solid #ff8a3d; outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 9px 14px; min-height: 42px; cursor: pointer; font: 800 .95rem var(--body); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* the stats strip under the top bar: timer, score, best */
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.stat { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 12px; font-weight: 800; }
.stat b { font-family: var(--display); font-weight: 400; color: var(--accent-dark); margin-left: 4px; }
.card { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 14px; margin: 12px 0; }
.help { color: var(--muted); font-weight: 600; line-height: 1.45; margin: 8px 0; }
.msg { font-weight: 800; min-height: 1.4em; margin: 8px 0; }

/* the end-of-puzzle box */
.done { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(30, 20, 60, .45); padding: 16px; }
.done-box { background: #fff; border-radius: 22px; padding: 22px; max-width: 360px; width: 100%; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.3); animation: pop .3s ease-out; }
.done-box .big { font-size: 3rem; }
.done-box h2 { font: 1.6rem var(--display); margin: 6px 0; }
.done-box p { font-weight: 700; color: var(--muted); }
.done-box .row { justify-content: center; margin-top: 12px; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; z-index: 60; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .done-box, .confetti { animation: none !important; } .confetti { display: none; } }
/* the language picker sits above the bottom edge */
.club-lang { bottom: 12px !important; }
