/* Daily puzzle pages. Board colours follow Pocket Logic's riso palette. */
:root {
  --r0: #FFAABC; --r1: #7BE7E4; --r2: #E3BA74; --r3: #C7D7FF; --r4: #76E3AB;
  --r5: #D7ACE3; --r6: #FFBDA5; --r7: #75CCFF; --r8: #D5DE8F;
  --ink: #1B1E3C; --cell: #FFFFFF; --given: #ECEFF3; --err: #E03153;
  --sun: #FFD23F; --sun-rim: #C16300; --moon: #3B6CF0;
  --queens: #7B57C8; --zip: #009A94; --tango: #F7B83D;
}
@media (prefers-color-scheme: dark) {
  :root {
    --r0: #F594A3; --r1: #5DDAE0; --r2: #D7A75B; --r3: #B0C6FF; --r4: #6EC1A2;
    --r5: #C99BD3; --r6: #FFB296; --r7: #52BAF4; --r8: #C9C876;
    --cell: #1E2139; --given: #33375A; --moon: #5A80F2;
    --queens: #AB93ED; --zip: #49C7C0; --tango: #FAC053;
  }
}

.day-head { padding: 20px 0 8px; }
.day-head h1 { font-size: clamp(30px, 8vw, 48px); margin: 0 0 8px; text-wrap: balance; }
.day-head p { margin: 0; color: var(--muted); font-size: 17px; max-width: 60ch; }
.kicker { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--game); margin-bottom: 8px; }

.play-area { display: grid; gap: 20px; padding: 16px 0 36px; }
@media (min-width: 820px) { .play-area { grid-template-columns: minmax(0, 520px) 1fr; align-items: start; } }

.game-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 14px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.timer { font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.size { font-size: 13px; font-weight: 700; color: var(--muted); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tools button, .btn2 { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.tools button:active, .btn2:active { transform: scale(.97); }
.tools button[disabled] { opacity: .45; cursor: default; }

.stage { position: relative; }
.board { position: relative; width: 100%; max-width: 100%; aspect-ratio: 1; user-select: none; -webkit-user-select: none; touch-action: none; cursor: pointer; }
.board canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Start cover and win panel */
.cover { position: absolute; inset: -4px; z-index: 5; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cover .btn { font-size: 18px; min-height: 56px; padding: 0 32px; border: 0; cursor: pointer; font-family: inherit; }
.win { display: none; margin-top: 14px; padding: 16px; border-radius: 16px; background: color-mix(in srgb, var(--game) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--game) 40%, var(--line)); }
.win.show { display: block; animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.win h3 { margin: 0 0 4px; font-size: 22px; font-weight: 900; }
.win p { margin: 0 0 10px; color: var(--muted); font-size: 16px; }
.name-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.name-form[hidden] { display: none; }
.name-form input { flex: 1 1 160px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-size: 16px; }
.name-form .btn { border: 0; cursor: pointer; font-family: inherit; min-height: 44px; }
.msg { font-size: 14px; color: var(--muted); min-height: 1.2em; }

/* Side column: leaderboard, app */
.side { display: grid; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; }
.panel h2 { margin: 0 0 10px; }
.lb { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; font-variant-numeric: tabular-nums; }
.lb li { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
.lb li:last-child { border-bottom: 0; }
.lb .rk { color: var(--muted); font-weight: 700; }
.lb .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .me { background: color-mix(in srgb, var(--game) 14%, transparent); border-radius: 8px; }
.lb-note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.app { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.app img { width: 64px; height: 64px; border-radius: 16px; }
.app p { margin: 0 0 8px; font-size: 15px; color: var(--muted); }
.app strong { color: var(--fg); }

.daynav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 4px 0 28px; }
.daynav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 700; text-decoration: none; font-size: 15px; }
.daynav .ghost { visibility: hidden; }

details.answer { margin-top: 8px; max-width: 360px; }
details.answer summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.answer .board { max-width: 320px; pointer-events: none; }

/* Archive and hub */
.cal { display: grid; gap: 28px; }
.cal h3 { margin: 0 0 10px; font-size: 18px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 460px; }
.days a, .days span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; font-weight: 700; font-size: 15px; text-decoration: none; border: 1px solid var(--line); background: var(--surface); }
.days span { border: 0; background: none; }
.days a.done { background: var(--game); color: #fff; border-color: transparent; }
.days a.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.dow { font-size: 12px !important; color: var(--muted); font-weight: 700 !important; }
.hub { display: grid; gap: 14px; }
@media (min-width: 720px) { .hub { grid-template-columns: repeat(3, 1fr); } }
.hub a { display: block; padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; border-top: 6px solid var(--game); }
.hub h3 { margin: 0 0 4px; font-size: 22px; font-weight: 900; }
.hub p { margin: 0; color: var(--muted); font-size: 15px; }
.hub .mini { margin-top: 14px; max-width: 240px; }
.hub .mini svg { display: block; }
.daily-strip { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 14px; }
