/* Ο Παππούς — large-print Sudoku */
:root {
  --paper: #f4efe4;
  --paper-2: #efe6d4;
  --ink: #1a1714;
  --ink-soft: #3a342e;
  --line: #1a1714;
  --line-thin: #6a6158;
  --given: #1a1714;
  --user: #163f73;
  --accent: #6b2c4a;
  --accent-2: #8a3a5c;
  --gold: #e8c56b;
  --sel: #f3d38a;
  --same: #f6e6b8;
  --peer: #efe2c6;
  --ok: #1f6b3a;
  --err-bg: #f8d2c8;
  --err-ink: #8a1f14;
  --btn: #ffffff;
  --shadow: 0 8px 24px rgba(26,23,20,.12);
  --radius: 16px;
  --pad: clamp(12px, 2.4vw, 28px);
  --cell: clamp(34px, 8.8vw, 76px);
  --digit: clamp(24px, 5.8vw, 48px);
  --ui: clamp(20px, 2.6vw, 28px);
  --title: clamp(36px, 6.4vw, 60px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--paper); color: var(--ink); }
body {
  font-family: "Segoe UI", "Helvetica Neue", "Noto Sans", "DejaVu Sans", Arial, sans-serif;
  font-size: var(--ui);
  line-height: 1.45;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(107,44,74,.08), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(232,197,107,.14), transparent 46%),
    var(--paper);
  min-height: 100%;
  color: var(--ink);
}
button, input { font: inherit; }
a { color: var(--accent); }
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--pad);
}
header.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 12px;
}
.brand h1 {
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", "Noto Serif", serif;
  font-size: var(--title);
  font-weight: 700;
  margin: 0;
  letter-spacing: .01em;
  line-height: 1.05;
}
.brand .tag {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: clamp(18px, 2.3vw, 26px);
}
.lang {
  display: flex;
  gap: 8px;
  align-items: center;
}
.lang button, .chip, .btn, .num {
  border: 2px solid var(--ink);
  background: var(--btn);
  color: var(--ink);
  border-radius: 12px;
  cursor: pointer;
  min-height: 56px;
}
.lang button {
  min-width: 56px;
  padding: 8px 14px;
  font-weight: 700;
}
.lang button[aria-pressed="true"], .chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.lead {
  margin: 8px 0 18px;
  max-width: 40em;
  color: var(--ink-soft);
  font-size: clamp(17px, 2vw, 22px);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
  align-items: center;
}
.chip {
  padding: 8px 16px;
  font-weight: 700;
  min-height: 64px;
}
.btn {
  padding: 10px 16px;
  font-weight: 700;
  min-height: 64px;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset;
}
.btn:hover, .chip:hover, .num:hover, .lang button:hover { background: var(--paper-2); }
.lang button[aria-pressed="true"]:hover, .chip[aria-pressed="true"]:hover { background: #2a2420; color: var(--paper); }
.btn:focus-visible, .chip:focus-visible, .num:focus-visible, .cell:focus-visible, .lang button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn-accent {
  background: var(--accent);
  color: #fff8f2;
  border-color: #4a1d32;
}
.btn-accent:hover { background: var(--accent-2); color: #fff; }
.btn:disabled, .num:disabled, .chip:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.play {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (min-width: 860px) {
  .play { grid-template-columns: minmax(0, auto) 280px; justify-content: center; gap: 24px; }
  :root { --cell: 60px; --digit: 38px; }
}
@media (min-width: 1100px) {
  :root { --cell: 72px; --digit: 46px; }
}
.board-wrap {
  width: min(100%, calc(var(--cell) * 9 + 20px));
  margin: 0 auto;
}
.board {
  display: grid;
  grid-template-columns: repeat(9, var(--cell));
  grid-template-rows: repeat(9, var(--cell));
  width: calc(var(--cell) * 9);
  border: 4px solid var(--line);
  background: #fffdf8;
  box-shadow: var(--shadow);
  user-select: none;
  touch-action: manipulation;
}
.cell {
  width: var(--cell);
  height: var(--cell);
  border: 1px solid var(--line-thin);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--digit);
  font-weight: 700;
  background: #fffdf8;
  color: var(--user);
  padding: 0;
  margin: 0;
  border-radius: 0;
  cursor: pointer;
  line-height: 1;
}
.cell:nth-child(9n+1) { border-left: none; }
.cell:nth-child(n):nth-child(-n+9) { border-top: none; }
.cell:nth-child(3n) { border-right: 3px solid var(--line); }
.cell:nth-child(9n) { border-right: none; }
.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 3px solid var(--line); }
.cell.given { color: var(--given); font-weight: 800; cursor: default; }
.cell.sel { background: var(--sel); }
.cell.peer { background: var(--peer); }
.cell.same { background: var(--same); }
.cell.err { background: var(--err-bg); color: var(--err-ink); }
.cell.ok  { background: #d7efdc; }
.side { display: flex; flex-direction: column; gap: 12px; }
.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.num {
  min-height: 76px;
  font-size: clamp(28px, 5.2vw, 42px);
  font-weight: 800;
  background: #fff;
}
.status {
  min-height: 1.6em;
  font-weight: 700;
  color: var(--ink-soft);
}
.status.good { color: var(--ok); }
.status.bad { color: var(--err-ink); }
.paybox, .note, .modal-card {
  background: #fffdf8;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.paybox h2, .modal-card h2 { margin: 0 0 8px; font-size: clamp(22px, 3vw, 30px); }
.paybox p, .note p, .modal-card p { margin: 0 0 10px; }
.note {
  margin-top: 28px;
  font-size: clamp(15px, 1.7vw, 18px);
  color: var(--ink-soft);
  box-shadow: none;
  border-color: #c9bfae;
  background: transparent;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(26,23,20,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 20;
}
.modal[hidden] { display: none; }
.modal-card { max-width: 32rem; width: 100%; }
.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.thanks-card { max-width: 40rem; margin: 8vh auto; }

/* pay button wrap fix */
a.btn { display: inline-block; text-decoration: none; text-align: center; }
.paybox .btn, .modal-card .btn, .thanks-card .btn {
  width: 100%;
  white-space: normal;
  line-height: 1.3;
  padding: 12px 16px;
}
.paybox p a:not(.btn) { display: inline-block; margin-top: 6px; }

.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.btn.contrast {
  min-height: 64px;
  padding: 10px 16px;
  font-weight: 800;
  border-width: 3px;
}
.btn-new { font-size: 1.08em; font-weight: 800; padding: 12px 22px; }
.stats {
  margin: 0 0 14px;
  font-weight: 700;
  font-size: clamp(18px, 2.2vw, 24px);
  color: var(--ink-soft);
}
.tools { display: flex; flex-direction: column; gap: 8px; }
.tools[hidden] { display: none; }
#btn-tools { width: 100%; }

/* High contrast — large, obvious, no pale greys */
html.hc {
  --paper: #000000;
  --paper-2: #000000;
  --ink: #ffffff;
  --ink-soft: #ffffff;
  --line: #ffffff;
  --line-thin: #ffffff;
  --given: #ffffff;
  --user: #ffe14d;
  --accent: #ffe14d;
  --accent-2: #ffe14d;
  --gold: #ffe14d;
  --sel: #0033aa;
  --same: #222222;
  --peer: #111111;
  --ok: #00e676;
  --err-bg: #9b0000;
  --err-ink: #ffffff;
  --btn: #000000;
  --shadow: none;
}
html.hc, html.hc body {
  background: #000 !important;
  color: #fff;
}
html.hc .board, html.hc .cell, html.hc .paybox, html.hc .modal-card, html.hc .note, html.hc .chat-panel {
  background: #000;
  color: #fff;
  border-color: #fff;
}
html.hc .btn, html.hc .chip, html.hc .num, html.hc .lang button, html.hc .chat-listen, html.hc #chat-send, html.hc #chat-close, html.hc #chat-mic, html.hc #chat-contrast, html.hc #chat-fs-pay {
  background: #000;
  color: #fff;
  border: 3px solid #fff;
}
html.hc .chip[aria-pressed="true"],
html.hc .lang button[aria-pressed="true"],
html.hc .btn.contrast[aria-pressed="true"],
html.hc #chat-contrast[aria-pressed="true"] {
  background: #fff;
  color: #000;
}
html.hc .btn-accent, html.hc a.btn-accent {
  background: #ffe14d;
  color: #000;
  border-color: #fff;
}
html.hc .btn-accent:hover { background: #fff; color: #000; }
html.hc a { color: #ffe14d; }
html.hc .cell.given { color: #fff; }
html.hc .cell.sel { background: #0033aa; color: #fff; }
html.hc .cell.err { background: #9b0000; color: #fff; }
html.hc .cell.ok { background: #004d1a; color: #fff; }
html.hc .status.good { color: #00e676; }
html.hc .status.bad { color: #ff8a80; }

/* Chat — large type, high contrast, phone-friendly */
.chat-launch { margin: 0 0 16px; }
.chat-launch .btn {
  min-height: 72px;
  font-size: clamp(22px, 2.8vw, 30px);
  padding: 14px 28px;
  width: 100%;
  max-width: 28rem;
}
.chat-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: none;
  background: var(--paper);
  color: var(--ink);
  border-top: none;
  box-shadow: var(--shadow);
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
}
.chat-panel[hidden] { display: none; }
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.chat-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
}
.chat-head #chat-close {
  min-height: 56px;
  font-size: 22px;
  padding: 8px 16px;
}
.chat-log {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 180px;
  max-height: none;
  padding: 6px 2px 10px;
  font-size: 22px;
  line-height: 1.4;
  -webkit-overflow-scrolling: touch;
}
.chat-turn { margin: 0 0 10px; display: flex; flex-direction: column; align-items: flex-start; }
.chat-user { align-items: flex-end; }
.chat-bubble {
  max-width: 95%;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 22px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-user .chat-bubble {
  background: var(--ink);
  color: var(--paper);
}
.chat-listen {
  margin: 6px 0 4px;
  min-height: 52px;
  padding: 8px 16px;
  font-size: 22px;
  font-weight: 700;
  border: 2px solid var(--ink);
  background: var(--btn);
  color: var(--ink);
  border-radius: 12px;
  cursor: pointer;
}
.chat-listen.on { background: var(--ink); color: var(--paper); }
.chat-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.chat-label { font-size: 22px; font-weight: 700; }
.chat-compose {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.chat-compose #chat-input {
  flex: 1 1 12rem;
  width: auto;
  min-width: 0;
}
#chat-input {
  width: 100%;
  min-height: 72px;
  font-size: 22px;
  line-height: 1.35;
  padding: 12px 14px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}
#chat-mic {
  flex: 0 0 auto;
  min-width: 7.5rem;
  min-height: 72px;
  font-size: 22px;
  font-weight: 800;
  padding: 8px 14px;
  line-height: 1.15;
  white-space: normal;
}
#chat-mic[hidden] { display: none !important; }
#chat-mic.on {
  flex: 1 1 100%;
  background: var(--ink);
  color: var(--paper);
  animation: chat-mic-pulse 1.1s ease-in-out infinite;
}
@keyframes chat-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--ink); }
  50% { box-shadow: 0 0 0 6px var(--ink); }
}
.chat-mic-msg {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
.chat-mic-msg[hidden] { display: none; }
#chat-send {
  width: 100%;
  min-height: 72px;
  font-size: 24px;
  font-weight: 800;
}
.chat-note {
  margin: 10px 0 0;
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink-soft);
  white-space: pre-wrap;
}
@media (min-width: 800px) {
  .chat-panel {
    inset: auto 20px 20px auto;
    width: min(540px, 92vw);
    height: auto;
    border: 3px solid var(--ink);
    border-radius: 16px;
    max-height: min(80vh, 740px);
  }
  .chat-launch .btn { width: auto; }
}
body.chat-open { overflow: hidden; }

html.hc .chat-panel,
html.hc .chat-bubble,
html.hc #chat-input {
  background: #000;
  color: #fff;
  border-color: #fff;
}
html.hc .chat-user .chat-bubble {
  background: #fff;
  color: #000;
  border-color: #fff;
}
html.hc .chat-listen {
  background: #000;
  color: #fff;
  border: 3px solid #fff;
}
html.hc .chat-listen.on {
  background: #fff;
  color: #000;
}
html.hc #chat-mic {
  background: #000;
  color: #fff;
  border: 3px solid #fff;
}
html.hc #chat-mic.on {
  background: #ffe14d;
  color: #000;
  border-color: #fff;
  animation: chat-mic-pulse-hc 1.1s ease-in-out infinite;
}
@keyframes chat-mic-pulse-hc {
  0%, 100% { box-shadow: 0 0 0 0 #ffe14d; }
  50% { box-shadow: 0 0 0 7px #ffe14d; }
}
html.hc .chat-mic-msg { color: #ffe14d; }
html.hc .chat-note { color: #fff; }

/* Subscriber full-screen chat + locked upsell */
.chat-launch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.chat-fs-lock {
  appearance: none;
  background: none;
  border: none;
  padding: 4px 0;
  margin: 0;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
  min-height: 44px;
}
.chat-fs-lock[hidden] { display: none; }
.chat-fs-upsell {
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.4;
  max-width: 28rem;
}
.chat-fs-upsell[hidden] { display: none; }
.chat-fs-upsell .btn {
  margin-top: 10px;
  min-height: 64px;
  font-size: 22px;
  width: 100%;
  max-width: 28rem;
}
.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
#chat-contrast { display: none; }
#chat-contrast[hidden] { display: none; }

body.chat-fs, html.chat-fs { overflow: hidden; }
body.chat-fs .chat-panel,
html.chat-fs .chat-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: none;
  border: none;
  border-radius: 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
}
body.chat-fs .chat-head h2 {
  font-size: clamp(28px, 4vw, 40px);
}
body.chat-fs #chat-close,
body.chat-fs #chat-contrast {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  font-size: 24px;
  font-weight: 800;
  padding: 8px 16px;
}
body.chat-fs #chat-contrast[hidden] { display: none; }
body.chat-fs .chat-log,
body.chat-fs .chat-bubble,
body.chat-fs .chat-label,
body.chat-fs .chat-note {
  font-size: clamp(24px, 3.2vw, 32px);
}
body.chat-fs .chat-listen,
body.chat-fs #chat-mic,
body.chat-fs #chat-send {
  min-height: 84px;
  font-size: 26px;
  font-weight: 800;
}
body.chat-fs #chat-input {
  min-height: 96px;
  font-size: 26px;
}
body.chat-fs .chat-mic-msg { font-size: 22px; }
@media (min-width: 800px) {
  body.chat-fs .chat-panel,
  html.chat-fs .chat-panel {
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: none;
    border: none;
    border-radius: 0;
  }
  body.chat-fs .chat-launch .btn { width: auto; }
}
html.hc .chat-fs-lock { color: #ffe14d; }
html.hc .chat-fs-upsell { color: #fff; }

.legal-links {
  margin: 10px 0 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}
.legal-links a { color: var(--ink); text-decoration: underline; }
.legal-footer {
  margin: 16px 0 8px;
  font-size: 20px;
}
.legal-page { max-width: 42rem; }
.legal-page h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 16px; }
.legal-page h2 { font-size: clamp(24px, 3vw, 32px); margin: 28px 0 12px; }
.legal-page p, .legal-page li {
  font-size: 22px;
  line-height: 1.45;
  margin: 0 0 12px;
}
.legal-page .back-home {
  display: inline-block;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--ink);
}
.legal-page .operator {
  margin-top: 28px;
  font-weight: 700;
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}
html.hc .legal-links a, html.hc .legal-page a { color: #ffe14d; }
html.hc .legal-page .operator { border-color: #fff; }
