:root {
  --bg: #f3efe6;
  --panel: #fffdf9;
  --ink: #1d2433;
  --muted: #6b7280;
  --border: #e3ddd0;
  --line: #2b3443;
  --accent: #24477a;
  --accent-soft: #dfe8f6;
  --cell-bg: #ffffff;
  --word-bg: #cfe0fa;
  --sel-bg: #ffd75e;
  --cross-bg: #eef3fb;
  --wrong: #cf3434;
  --reveal: #2c63b5;
  --pencil: #8b919c;
  --done-bg: #e3f4e4;
  --def-bg: #e4ddcd;
  --def-ink: #263044;
  --def-on: #b9d0f5;
  --key: #ffffff;
  --key-ink: #1d2433;
  --key-act: #e8e3d8;
  --shadow: 0 1px 2px rgba(30, 30, 40, .08), 0 4px 14px rgba(30, 30, 40, .06);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151b; --panel: #1b2029; --ink: #e8eaee; --muted: #9aa3b2; --border: #2b3240;
    --line: #6b7890; --accent: #7aa7ea; --accent-soft: #233650; --cell-bg: #232a35; --word-bg: #27446d;
    --sel-bg: #a8862a; --cross-bg: #222c3a; --wrong: #ff7070; --reveal: #8cb8ff; --pencil: #8790a0;
    --done-bg: #1f3a28; --key: #2a313d; --key-ink: #e8eaee; --key-act: #343c4a; --def-bg: #2b3240; --def-ink: #d3d9e3; --def-on: #33598f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151b; --panel: #1b2029; --ink: #e8eaee; --muted: #9aa3b2; --border: #2b3240;
  --line: #6b7890; --accent: #7aa7ea; --accent-soft: #233650; --cell-bg: #232a35; --word-bg: #27446d;
  --sel-bg: #a8862a; --cross-bg: #222c3a; --wrong: #ff7070; --reveal: #8cb8ff; --pencil: #8790a0;
  --done-bg: #1f3a28; --key: #2a313d; --key-ink: #e8eaee; --key-act: #343c4a; --def-bg: #2b3240; --def-ink: #d3d9e3; --def-on: #33598f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  position: fixed; inset: 0; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font: 16px/1.4 var(--pg-font);
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation; overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.screen {
  position: absolute; inset: 0; display: none; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.screen.active { display: flex; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Accueil ---------- */
.home-wrap { max-width: 720px; margin: 0 auto; padding: 28px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.home-head { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.home-head h1 { margin: 0; font-size: 34px; letter-spacing: -.5px; }
.home-head p { margin: 2px 0 0; }
.app-logo { width: 64px; height: 64px; flex: none; display: block; }
.card {
  border: none; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
}
.card b { font-size: 19px; }
.card small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.card .ic { width: 30px; height: 30px; color: var(--accent); }
.card.resume { background: var(--accent); color: #fff; }
.card.resume .ic, .card.resume small { color: rgba(255, 255, 255, .85); }
.newgame { flex-direction: column; align-items: stretch; }
.newgame h2 { margin: 0 0 4px; font-size: 19px; }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.levels button {
  border: 1.5px solid var(--border); background: var(--bg); border-radius: 12px; padding: 14px 12px; text-align: left;
}
.levels button b { display: block; font-size: 18px; }
.levels button small { color: var(--muted); font-size: 13px; }
.levels button:active, .card:active { transform: scale(.985); }
.home-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card.small { padding: 16px; }
.card.small b { font-size: 16px; }

/* ---------- Barre du haut ---------- */
.topbar {
  display: flex; align-items: center; gap: 4px; padding: 6px 8px; min-height: 60px;
  background: var(--panel); border-bottom: 1px solid var(--border); flex: none;
}
.icon-btn {
  width: 48px; height: 48px; border-radius: 12px; border: none; background: transparent;
  display: grid; place-items: center; flex: none;
}
.icon-btn:active { background: var(--key-act); }
.icon-btn.on { background: var(--accent); color: #fff; }
.icon-btn:disabled { opacity: .3; }
.g-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; padding-left: 4px; }
.g-title b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-meta { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.g-meta .ic { width: 15px; height: 15px; }
.tools { display: flex; gap: 2px; }

/* ---------- Jeu : mise en page ---------- */
.game-body { flex: 1; display: flex; min-height: 0; }
.board-col { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.side-col {
  width: 430px; display: flex; flex-direction: column; min-height: 0;
  background: var(--panel); border-left: 1px solid var(--border);
}
body.lefty .side-col { order: -1; border-left: none; border-right: 1px solid var(--border); }
#clues { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 12px; }
.def-card { background: var(--word-bg); border-radius: 14px; padding: 12px 14px; }
.def-card.cross { background: var(--cross-bg); }
.def-card .d-head { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.def-card p { margin: 4px 0 0; font-size: 19px; line-height: 1.3; }
.def-card.cross p { font-size: 16px; }
.d-tip { font-size: 14px; margin: auto 4px 0; }
body.bigclues .def-card p { font-size: 23px; }
body.bigclues .def-card.cross p { font-size: 19px; }

#banner {
  display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--accent-soft); flex: none; height: 70px;
}
#banner .icon-btn { width: 40px; height: 100%; color: var(--accent); }
#b-text {
  flex: 1; min-width: 0; height: 100%; border: none; border-radius: 10px; background: transparent; text-align: left;
  display: flex; gap: 10px; align-items: center; padding: 2px 4px; line-height: 1.2; overflow: hidden;
}
#b-text:active { background: rgba(127, 127, 127, .12); }
/* Pastille du sens : on la touche (ou toute la définition) pour passer d'un sens à l'autre. */
#b-num {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--panel); font-weight: 700; font-size: 20px; line-height: 1;
}
#b-clue { flex: 1; min-width: 0; font-size: 19px; font-weight: 500; overflow-wrap: break-word; }
#b-clue small { font-size: .72em; font-weight: 600; color: var(--muted); white-space: nowrap; }
.banned-list { max-height: 50vh; overflow-y: auto; margin: 8px 0; }
.banned-list div { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.banned-list div span { flex: 1; font-size: 15px; }
.banned-list div b { display: block; }
.banned-list .btn { height: 40px; padding: 0 12px; }

/* ---------- Grille ---------- */
#viewport { flex: 1; position: relative; overflow: hidden; touch-action: none; min-height: 0; }
#board {
  position: absolute; left: 0; top: 0; display: grid; transform-origin: 0 0; will-change: transform; --cell: 40px;
  outline: 2px solid var(--line);
}
#board.smooth { transition: transform .22s ease; }
.cell {
  width: var(--cell); height: var(--cell); position: relative;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.cell.on { background: var(--cell-bg); }
.cell.word { background: var(--word-bg); }
.cell.sel { background: var(--sel-bg); box-shadow: inset 0 0 0 2px var(--accent); }
.cell .ltr {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: calc(var(--cell) * .56);
}

/* Cases-définitions : une ou deux définitions (flèche vers la droite en haut, vers le bas en dessous). */
.cell.def {
  background: var(--def-bg); color: var(--def-ink); display: flex; flex-direction: column; cursor: pointer;
  font-family: var(--pg-font); font-stretch: 75%; font-weight: 500;
}
.cell.def .q {
  flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
  padding: 0 calc(var(--cell) * .06); font-size: calc(var(--cell) * .16);
}
.cell.def .q + .q { border-top: 1px solid var(--line); }
.cell.def .q span { display: block; width: 100%; text-align: center; line-height: 1.06; overflow-wrap: normal; hyphens: manual; }
.cell.def .q.brk span { overflow-wrap: anywhere; hyphens: auto; }
/* Sélection : seulement la couleur, jamais la graisse (le texte garderait sinon une autre taille). */
.cell.def .q.active { background: var(--def-on); }
.cell.def .q.cross { background: var(--cross-bg); }
.cell.def .q.filled:not(.active) { color: var(--muted); }
.cell.def .q.reported span { font-style: italic; text-decoration: line-through; text-decoration-color: var(--wrong); }

.arr { position: absolute; width: calc(var(--cell) * .2); height: calc(var(--cell) * .2); color: var(--line); pointer-events: none; z-index: 1; }
.arr svg { display: block; width: 100%; height: 100%; fill: currentColor; overflow: visible; }
.arr .st { fill: none; stroke: currentColor; stroke-width: 1.5; }
.arr-r { left: 0; top: 50%; transform: translateY(-50%); }
.arr-r.half { top: 25%; }
.arr-d { top: 0; left: 50%; transform: translateX(-50%); }
.arr-rd { left: 0; top: 4%; }
.arr-dr { top: 0; left: 4%; }
.cell.pencil .ltr { color: var(--pencil); font-weight: 400; font-style: italic; }
.cell.wrong .ltr { color: var(--wrong); }
.cell.wrong::after {
  content: ''; position: absolute; inset: 0; opacity: .55;
  background: linear-gradient(to top right, transparent calc(50% - 1px), var(--wrong) calc(50% - 1px), var(--wrong) calc(50% + 1px), transparent calc(50% + 1px));
}
.cell.revealed .ltr { color: var(--reveal); }
.cell.revealed::before {
  content: ''; position: absolute; top: 0; right: 0; border-style: solid;
  border-width: 0 calc(var(--cell) * .24) calc(var(--cell) * .24) 0; border-color: transparent var(--reveal) transparent transparent;
}
#board.done .cell.on { background: var(--done-bg); }
#board.done .cell.def .q { background: transparent; color: var(--def-ink); }
#board.paused { filter: blur(14px); }
#ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

#pause-overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; cursor: pointer; }
#pause-overlay .ic { width: 64px; height: 64px; color: var(--accent); }
#pause-overlay p { font-size: 18px; font-weight: 600; }

.alts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#alts {
  position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 180px);
  background: var(--panel); padding: 6px 8px; border-radius: 14px; box-shadow: var(--shadow);
}
.alts .lbl { font-size: 13px; color: var(--muted); padding: 0 4px; }
.alts button {
  min-width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--key);
  font-size: 20px; font-weight: 700; padding: 0 8px;
}
.alts button.first { border-color: var(--accent); background: var(--accent-soft); }
.alts button.more { font-size: 14px; font-weight: 500; }

/* ---------- Panneau de saisie ---------- */
#input-panel { flex: none; border-top: 1px solid var(--border); padding-bottom: 6px; }
.tabs { display: flex; gap: 4px; padding: 6px 8px 0; }
.tabs button {
  flex: 1; height: 40px; border: none; border-radius: 10px; background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: 15px;
}
.tabs button .ic { width: 20px; height: 20px; }
.tabs button[data-mode="hide"] { flex: 0 0 48px; }
.tabs button.on { background: var(--accent-soft); color: var(--accent); }
#input-panel.collapsed .tabs button[data-mode="hide"] .ic { transform: rotate(180deg); }
#kbd { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.krow { display: flex; gap: 5px; justify-content: center; }
.key {
  flex: 1 1 0; max-width: 60px; height: 54px; border: none; border-radius: 9px; padding: 0;
  background: var(--key); color: var(--key-ink); font-size: 22px; font-weight: 600;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .22), 0 0 0 1px var(--border);
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.key.grow { flex: 3 1 0; max-width: none; }
.pick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 8px; }
.pick .key { max-width: none; }
.key .ic { width: 22px; height: 22px; }
.key.tool { flex: 1.45 1 0; max-width: 100px; flex-direction: column; gap: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: 0; }
.key.tool span { line-height: 1; }
.key.act { background: var(--key-act); }
.key.help, .key.draft { background: var(--accent-soft); color: var(--accent); box-shadow: 0 1px 0 rgba(0, 0, 0, .22), 0 0 0 1.5px var(--accent); }
.key.draft.on { background: var(--accent); color: var(--panel); }
.key.down { transform: translateY(1px); filter: brightness(.88); }
#penpanel { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
#pen-alts { min-height: 44px; }
#pad {
  width: 100%; height: 210px; border-radius: 14px; background: var(--cell-bg); touch-action: none;
  box-shadow: inset 0 0 0 2px var(--border); display: block;
}

/* ---------- Portrait / petits écrans ---------- */
@media (orientation: portrait), (max-width: 900px) {
  .game-body { flex-direction: column; }
  .side-col { width: auto; border-left: none; border-top: 1px solid var(--border); }
  body.lefty .side-col { order: 0; border-right: none; }
  #clues { display: none; } /* le bandeau au-dessus de la grille suffit */
  #kbd, #penpanel { max-width: 760px; width: 100%; margin: 0 auto; }
  /* Grille 10 × 14 : on laisse un maximum de hauteur à la grille. */
  .key { max-width: 74px; height: 50px; }
  .key.tool { max-width: 110px; }
  #kbd { gap: 6px; padding: 8px 6px 4px; }
  .krow { gap: 5px; }
  .topbar { min-height: 54px; padding: 3px 4px; }
  .side-col { border-top: none; }
  #banner { border-top: 1px solid var(--border); }
}
/* Paysage : le bandeau (définition, mot précédent / suivant, signalement) passe dans la colonne
   de droite, au-dessus de la définition croisée ; la grille gagne toute la hauteur. */
body.side-banner #banner { border-radius: 14px; height: auto; align-items: flex-start; padding: 8px 6px; }
body.side-banner #banner .icon-btn { height: 48px; }
body.side-banner #b-text { height: auto; align-items: flex-start; }
body.side-banner #b-clue { font-size: 20px; }
body.side-banner.bigclues #b-clue { font-size: 23px; }
body.side-banner #d-cur { display: none; }
@media (max-width: 560px) {
  .tools .icon-btn { width: 42px; }
  .key { font-size: 21px; }
}

/* ---------- Menus, modales, toasts ---------- */
.popover {
  position: fixed; z-index: 30; background: var(--panel); border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
  padding: 8px 12px 12px; width: min(330px, calc(100vw - 16px));
}
.pop-sec { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 8px 2px 6px; }
.pop-row { display: flex; gap: 6px; }
.pop-row button {
  flex: 1; height: 48px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg); font-weight: 600; font-size: 16px;
}
.pop-row button:active, .pop-flag:active { background: var(--key-act); }
.pop-flag {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; margin-top: 12px; padding: 0 6px;
  border: none; border-top: 1px solid var(--border); background: transparent; color: var(--muted); font-weight: 600;
}
.pop-flag .ic { width: 20px; height: 20px; }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 22, .45); display: grid; place-items: center; padding: 16px; }
.modal-box {
  background: var(--panel); border-radius: 20px; padding: 22px; width: min(460px, 100%); max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35); position: relative;
}
.modal-box h2 { margin: 0 0 8px; font-size: 22px; }
.modal-box p { margin: 0 0 12px; color: var(--muted); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.btn {
  height: 48px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); font-weight: 600;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--wrong); }
.big-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
.big-stats div { background: var(--bg); border-radius: 12px; padding: 10px; text-align: center; }
.big-stats b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.big-stats span { font-size: 13px; color: var(--muted); }

#busy { position: fixed; inset: 0; z-index: 58; display: grid; place-items: center; background: rgba(10, 14, 22, .25); }
#busy > div { background: var(--panel); border-radius: 18px; padding: 22px 28px; text-align: center; box-shadow: var(--shadow); }
#busy p { margin: 10px 0 0; font-weight: 600; }
#busy small { display: block; min-height: 1.3em; margin-top: 4px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.spin { display: inline-block; width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#toast {
  position: fixed; left: 50%; top: calc(76px + env(safe-area-inset-top)); transform: translate(-50%, -20px); z-index: 60;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 55; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Historique / Réglages ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--panel); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }
.stat table { width: 100%; font-size: 14px; border-collapse: collapse; margin-top: 4px; }
.stat td { padding: 2px 0; }
.stat td + td { text-align: right; font-variant-numeric: tabular-nums; }
.stat.wide { grid-column: 1 / -1; }
.filters { display: flex; gap: 8px; margin: 6px 0 12px; }
.filters button { height: 40px; padding: 0 16px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--panel); font-weight: 600; }
.filters button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.hist-item {
  display: flex; align-items: center; gap: 14px; background: var(--panel); border-radius: 14px; padding: 12px;
  box-shadow: var(--shadow); margin-bottom: 10px;
}
.hist-item canvas { width: 64px; height: 64px; flex: none; border-radius: 8px; background: var(--bg); }
.hist-item .info { flex: 1; min-width: 0; }
.hist-item .info b { font-size: 16px; }
.hist-item .info div { color: var(--muted); font-size: 14px; }
.hist-item .bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.hist-item .bar i { display: block; height: 100%; background: var(--accent); }
.hist-item .acts { display: flex; gap: 4px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: 2px; }
.badge.ok { background: var(--done-bg); color: #2c8a45; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

.set-group { margin: 20px 4px 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.set-row {
  display: flex; align-items: center; gap: 12px; background: var(--panel); padding: 14px 16px; min-height: 60px;
  border-bottom: 1px solid var(--border);
}
.set-row:first-of-type { border-radius: 14px 14px 0 0; }
.set-row .lbl { flex: 1; }
.set-row .lbl small { display: block; color: var(--muted); font-size: 13px; }
.set-row select { height: 40px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg); color: var(--ink); font: inherit; padding: 0 8px; }
.set-row input[type="range"] { width: 160px; }
.set-row.action { cursor: pointer; color: var(--accent); font-weight: 600; }
.set-row.action.danger { color: var(--wrong); }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--border); transition: background .15s; pointer-events: none; }
.switch span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

.train-letter { font-size: 64px; font-weight: 700; text-align: center; line-height: 1; margin: 6px 0 10px; color: var(--accent); }
#train-pad { width: 100%; height: 240px; border-radius: 14px; background: var(--cell-bg); box-shadow: inset 0 0 0 2px var(--border); touch-action: none; display: block; }
.train-res { text-align: center; min-height: 24px; margin-top: 8px; color: var(--muted); }

/* ---------- Bored Dev Playground (kit css/playground.css) ---------- */
:root {
  --pg-bg: var(--bg); --pg-surface: var(--panel); --pg-surface-2: var(--key-act);
  --pg-text: var(--ink); --pg-muted: var(--muted); --pg-line: var(--border);
  --pg-accent: var(--accent); --pg-accent-2: var(--sel-bg);
}
.pg-strip__in { width: min(688px, 100% - 32px); }
.home-foot { margin-top: 18px; text-align: center; }
