/* EwrekaGames — single-player puzzle shell (solo.php + assets/js/solo/shell.js + SoloKit.numpad).
 * Shared by every puzzle. A puzzle's own board styles go in assets/css/games/<id>.css (auto-included). */

body.solo-page .content { max-width: 1240px; }
.solo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.solo-stage { min-height: 420px; gap: 10px; }
.solo-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 2px 4px 0; }
.solo-icon { width: 44px; height: 44px; border-radius: 12px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.solo-title { flex: 1; min-width: 0; }
.solo-title h1 { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.15; }
.solo-title small { display: block; min-height: 1.5em; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.solo-clock { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.solo-clock .ico { width: 16px; height: 16px; display: inline-grid; }
.solo-clock .ico svg { width: 16px; height: 16px; }
.solo-clock b { font-size: 17px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.solo-clock.paused b { color: var(--ink-3); }
.solo-board { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 12px; position: relative; }
.solo-board .loading-box { padding: 60px 0; }
.solo-pad { width: 100%; max-width: 560px; }
.solo-pad:empty { display: none; }

/* side card */
.solo-card { padding: 16px; display: grid; gap: 14px; }
.solo-card .bot-level { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.solo-card .bl-lbl { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.solo-card .seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.solo-card .seg:empty { flex-basis: 100%; min-height: 40px; }   /* levels are filled in by shell.js: keep their row (4 levels wrap under the label) */
.solo-card .seg button { height: 32px; min-width: 0; padding: 0 11px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.solo-card .seg button:hover { color: var(--ink); }
.solo-card .seg button.on { background: var(--surface); color: var(--brand); box-shadow: 0 1px 0 var(--line-2), 0 0 0 1px var(--line); }
.solo-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.solo-stats div { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; }
.solo-stats small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.solo-stats b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.solo-opts { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.solo-opts { min-height: 34px; }   /* reserved before the puzzle mounts (no layout shift when the hint / mistakes controls appear) */
.solo-opts.ready:not(:has(> :not(.hidden))) { display: none; }
.solo-card .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.solo-card .btn.wide { width: 100%; }
.solo-about { margin-top: 20px; padding: 22px; }
.solo-about h2 { margin: 0 0 8px; font-size: 20px; }
.solo-about p { color: var(--ink-2); line-height: 1.6; }
.solo-about .solo-tagline { font-weight: 600; color: var(--ink); }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { position: relative; width: 40px; height: 24px; border-radius: 12px; background: var(--surface-3, var(--line-2)); transition: background .2s; flex: none; }
.switch .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch input:checked + .sw { background: var(--brand); }
.switch input:checked + .sw::after { transform: translateX(16px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--brand); outline-offset: 2px; }

/* number pad (SoloKit.numpad) */
.numpad { display: grid; gap: 8px; width: 100%; }
.numpad .np-digits { display: grid; grid-template-columns: repeat(var(--np-cols, 9), minmax(0, 1fr)); gap: 6px; }
.numpad .np-tools { display: grid; grid-template-columns: repeat(var(--np-tools, 3), minmax(0, 1fr)); gap: 6px; }
.numpad button { height: 52px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 22px; box-shadow: var(--press); cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: transform .08s, box-shadow .08s, background .15s, color .15s, opacity .15s; touch-action: manipulation; }
.numpad button:active { transform: translateY(3px); box-shadow: none; }
.numpad button:disabled { opacity: .35; cursor: default; }
.numpad button.done { opacity: .35; }
.numpad .np-tools button { height: 46px; font-size: 13px; font-weight: 600; color: var(--ink-2); flex-direction: row; gap: 7px; }
.numpad .np-tools button .ico { width: 18px; height: 18px; }
.numpad .np-tools button.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.numpad.notes .np-digits button { color: var(--blue); font-size: 18px; }
.numpad .np-cnt { font-size: 10px; font-weight: 600; color: var(--ink-3); line-height: 1; }

/* daily puzzle (solo.php daily mode, shell.js DAILY) */
/* solved level: a small tick in the button's corner (takes no width, so long level names do not wrap) */
.solo-card .seg button.done { position: relative; }
.solo-card .seg button.done::after { content: "\2713"; position: absolute; top: 1px; right: 2px; font-size: 10px; line-height: 1; color: var(--good); font-weight: 800; }
.daily-days-wrap { display: grid; gap: 6px; }
.daily-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; min-height: 48px; }
.daily-days .dd { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; height: 48px; padding: 0 2px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); cursor: pointer; font: inherit; transition: background .15s, color .15s, border-color .15s; }
.daily-days .dd small { font-size: 10px; font-weight: 600; color: var(--ink-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: capitalize; }
.daily-days .dd b { font-size: 15px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.daily-days .dd:hover { color: var(--ink); border-color: var(--line-2); }
.daily-days .dd.on { background: var(--surface); border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.daily-days .dd.on small { color: var(--brand); }
.daily-days .dd.done::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.daily-days .dd:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.daily-sep { color: var(--ink-3); }
.daily-new { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--brand); color: var(--ink); font-size: 14px; font-weight: 600; }
.daily-new.hidden { display: none; }
.solo-card .daily-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.solo-card .daily-link .ico { width: 18px; height: 18px; display: inline-grid; }
.solo-card .daily-link .ico svg { width: 18px; height: 18px; }
.daily-guide .daily-lead { max-width: 70ch; }
.daily-guide .tips, .daily-guide p { max-width: 70ch; }
.daily-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.daily-levels { margin: 0; padding-left: 20px; max-width: 72ch; color: var(--ink-2); line-height: 1.7; }
.daily-levels li { margin: 0 0 8px; }

@media (max-width: 1080px) {
  .solo-grid { grid-template-columns: 1fr; }
  .solo-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
}
/* Daily page (no how-to card beside the side card): the side card uses the full width, level + days left, stats + buttons right. */
@media (min-width: 641px) and (max-width: 1080px) {
  .daily-page .solo-side { grid-template-columns: 1fr; }
  .daily-page .solo-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row dense; column-gap: 24px; align-items: start; }
  .daily-page .solo-card > .bot-level, .daily-page .solo-card > .daily-days-wrap { grid-column: 1; }
  .daily-page .solo-card > :not(.bot-level):not(.daily-days-wrap) { grid-column: 2; }
}
@media (max-width: 640px) {
  .solo-side { grid-template-columns: 1fr; }
  .solo-stage { padding: 8px; border-radius: 18px; }
  .solo-title h1 { font-size: 19px; }
  .solo-icon { width: 36px; height: 36px; border-radius: 10px; }
  .numpad button { height: 46px; font-size: 20px; border-radius: 10px; }
  .numpad .np-digits { gap: 4px; }
  .numpad .np-tools button { height: 42px; }
}
