/* Maze — clean, high-contrast, senior-friendly, mobile-first. No frameworks.
 * Shares the look of the Sudoku / Word Search apps. */
:root {
  --bg: #f4f1ea; --panel: #fffdf7; --ink: #1f2430; --line: #2b2f3a;
  --thin: #b9c0cc; --accent: #2563eb; --ok: #15803d; --bad: #dc2626;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 820px; margin: 0 auto; padding: 14px 14px 40px; }

header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
header h1 { font-size: 1.5rem; margin: 0; letter-spacing: .5px; }
header .sub { flex: 1 1 100%; color: #6b7280; font-size: .92rem; margin: 2px 0 8px; }
.spacer { flex: 1; }
.iconbtn {
  border: 1px solid var(--thin); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font-size: .95rem; cursor: pointer; min-height: 40px;
}

.toolbar { display: flex; align-items: center; gap: 10px; margin: 8px 0 10px; flex-wrap: wrap; }
.toolbar select, .toolbar button {
  min-height: 44px; border-radius: 10px; border: 1px solid var(--thin);
  background: var(--panel); color: var(--ink); font-size: 1rem; padding: 0 14px; cursor: pointer;
}
#newBtn { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.meta { margin-left: auto; display: flex; gap: 16px; font-variant-numeric: tabular-nums; }
.meta b { font-weight: 700; }

.hintbar { color: #6b7280; font-size: .88rem; margin: 0 0 10px; text-align: center; }

.canvaswrap { display: flex; justify-content: center; }
#board {
  background: var(--panel); border: 3px solid var(--line); border-radius: 6px;
  touch-action: none; user-select: none; -webkit-user-select: none; max-width: 100%;
}

.status { text-align: center; min-height: 26px; margin: 12px 0; font-weight: 600; }
.status.win { color: var(--ok); font-size: 1.1rem; }

.actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 4px 0; }
.actions button {
  min-height: 48px; border-radius: 10px; border: 1px solid var(--thin);
  background: var(--panel); color: var(--ink); font-size: .95rem; cursor: pointer; padding: 0 16px;
}

body.large .wrap { max-width: 1400px; }
body.large header h1 { font-size: 1.8rem; }

/* book cross-promo */
.book { background: var(--panel); border: 1px solid var(--thin); border-radius: var(--radius);
  padding: 16px; margin: 22px 0 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.book h3 { margin: 0 0 4px; font-size: 1.05rem; }
.book p { margin: 0; color: #555; font-size: .92rem; }
.book .maze-ico { width: 54px; height: 54px; flex: none; border: 2px solid var(--line); border-radius: 8px;
  background:
    linear-gradient(var(--line),var(--line)) 20% 0/2px 60% no-repeat,
    linear-gradient(var(--line),var(--line)) 20% 60%/45% 2px no-repeat,
    linear-gradient(var(--line),var(--line)) 64% 30%/2px 70% no-repeat,
    linear-gradient(var(--line),var(--line)) 40% 30%/2px 45% no-repeat; }

.crosslinks { text-align: center; margin: 8px 0 0; font-size: .9rem; }
.crosslinks a { color: #6b7280; text-decoration: none; margin: 0 4px; }
.crosslinks a:hover { text-decoration: underline; }

footer { text-align: center; color: #8a8f9a; font-size: .82rem; margin-top: 16px; }
footer .links a { color: #6b7280; text-decoration: none; margin: 0 6px; }
footer .links a:hover { text-decoration: underline; }
.privacy { margin-top: 6px; }

/* print: only the maze + title */
@media print {
  body { background: #fff; }
  .toolbar, .actions, .book, .crosslinks, footer, header .sub, .hintbar,
  #langBtn, #largeBtn, .meta, .status { display: none !important; }
  .wrap { max-width: none; }
  header h1 { text-align: center; }
  #board { border-color: #000; }
}

@media (max-width: 420px) {
  header h1 { font-size: 1.3rem; }
}
