:root {
  --bg: #f4ecdc;
  --bg2: #ece1cb;
  --card: #fbf6ea;
  --ink: #2b2118;
  --muted: #8a7a66;
  --line: #d9cbb0;
  --slot: #fdf9ef;
  --slot-line: #cbbb9c;
  --tile: #fff8e6;
  --tile-edge: #d8c49a;
  --tile-ink: #2b2118;
  --me: #1c8580;
  --me-soft: #d3ebe6;
  --opp: #d2572f;
  --opp-soft: #f7dccf;
  --gold: #dba11c;
  --gold-soft: #f8e7b4;
  --hint: #9a8f7f;
  --bad: #c0392b;
  --sel: #f6e6a6;
  --shadow: 0 2px 0 rgba(60, 40, 10, 0.18), 0 6px 14px rgba(60, 40, 10, 0.12);
  --serif: ui-serif, 'Noto Serif', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1814;
    --bg2: #26201a;
    --card: #2a231c;
    --ink: #f1e7d6;
    --muted: #a39480;
    --line: #40362b;
    --slot: #3d3328;
    --slot-line: #6a5a45;
    --tile: #ecdfc2;
    --tile-edge: #b9a67e;
    --tile-ink: #2b2118;
    --me: #35b3ac;
    --me-soft: #1d3d3b;
    --opp: #ee7a52;
    --opp-soft: #4a2a1e;
    --gold: #e9b93c;
    --gold-soft: #4a3c15;
    --hint: #8c8273;
    --bad: #e2574a;
    --sel: #5a4d24;
    --shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 6px 14px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 var(--sans);
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }

#app {
  position: relative;
  max-width: 520px;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

/* ---------- общее ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  font-weight: 600;
  transition: transform 0.12s var(--spring), background 0.2s, opacity 0.2s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.95); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); box-shadow: var(--shadow); }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: 0.4; pointer-events: none; box-shadow: none; }
.btn.wide { width: 100%; }

.icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 24px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: transform 0.12s var(--spring), background 0.2s;
}
.icon:active { transform: scale(0.88); background: var(--bg2); }

h1, h2, h3 { font-family: var(--serif); margin: 0; font-weight: 700; }
.muted { color: var(--muted); }

/* ---------- вход ---------- */
.login { align-items: center; justify-content: center; text-align: center; padding: 32px; gap: 18px; }
.logo { display: flex; gap: 5px; justify-content: center; }
.logo span {
  width: 38px;
  height: 44px;
  display: grid;
  place-items: center;
  font: 700 24px var(--serif);
  color: var(--tile-ink);
  background: var(--tile);
  border-radius: 8px;
  border-bottom: 3px solid var(--tile-edge);
  box-shadow: var(--shadow);
}
.login form { display: flex; gap: 8px; width: 100%; max-width: 320px; }
.login input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
  user-select: text;
  -webkit-user-select: text;
}

/* ---------- список партий ---------- */
.lobby { overflow-y: auto; padding-left: 16px; padding-right: 16px; gap: 14px; }
.lobby .head { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; }
.lobby .head h1 { font-size: 30px; letter-spacing: 0.01em; }
.tally {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.tally .n { font: 700 40px/1 var(--serif); }
.tally .me .n { color: var(--me); }
.tally .opp .n { color: var(--opp); }
.tally .sep { font: 700 28px var(--serif); color: var(--muted); }
.tally .sub { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.lobby h3 { font-size: 15px; color: var(--muted); font-family: var(--sans); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 6px; }
.gcard {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  transition: transform 0.14s var(--spring), border-color 0.2s;
}
.gcard:active { transform: scale(0.97); }
.gcard.myturn { border-color: var(--me); box-shadow: inset 4px 0 0 var(--me); }
.gcard .state { font-weight: 700; }
.gcard.myturn .state { color: var(--me); }
.gcard .sc { font: 700 22px var(--serif); grid-row: span 2; }
.gcard .meta { font-size: 13px; color: var(--muted); }
.gcard .bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--bg2); overflow: hidden; margin-top: 4px; }
.gcard .bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; transition: width 0.6s ease; }
.lobby .foot { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 20px; margin-top: auto; }
.lobby .foot .btn { flex: 1; font-size: 14px; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 18px 0; }

/* ---------- партия ---------- */
/* --cell объявлен здесь, а не в :root: var() подставляется там, где свойство объявлено,
   поэтому размеры поля (--w, --h), заданные из JS на .game, иначе бы не учлись. */
.game {
  align-items: center;
  --w: 11;
  --h: 13;
  --cell: min(calc((min(100vw, 520px) - 14px) / var(--w)), calc((100dvh - 300px) / var(--h)));
}
.top {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr auto 1fr 40px;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 4px;
}
.score {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 14px;
  background: var(--me-soft);
  overflow: hidden;
  transition: box-shadow 0.3s, transform 0.3s var(--spring);
}
.score.opp { background: var(--opp-soft); }
.score .who { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score .pts { font: 700 22px/1 var(--serif); color: var(--me); }
.score.opp .pts { color: var(--opp); }
.score.turn { box-shadow: 0 0 0 2px var(--me); transform: scale(1.03); }
.score.opp.turn { box-shadow: 0 0 0 2px var(--opp); }
.bag { text-align: center; font-size: 11px; line-height: 1.15; color: var(--muted); min-width: 44px; }
.bag b { display: block; font: 700 17px/1 var(--serif); color: var(--ink); }

.status { height: 24px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.status.mine { color: var(--me); }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.7); opacity: 0.35; } }

.boardwrap { flex: 1; display: grid; place-items: center; width: 100%; min-height: 0; }
.board {
  display: grid;
  grid-template-columns: repeat(var(--w), var(--cell));
  grid-auto-rows: var(--cell);
  touch-action: none;
}
.cell, .blk { position: relative; }
.cell {
  margin: 1px;
  border-radius: calc(var(--cell) * 0.18);
  background: var(--slot);
  box-shadow: inset 0 0 0 1px var(--slot-line);
  display: grid;
  place-items: center;
  font: 700 calc(var(--cell) * 0.56) / 1 var(--serif);
  color: var(--tile-ink);
  transition: background 0.18s, box-shadow 0.18s;
  will-change: transform;
}
.cell .num {
  position: absolute;
  top: 1px;
  left: 3px;
  font: 600 calc(var(--cell) * 0.24) / 1 var(--sans);
  color: var(--muted);
  pointer-events: none;
}
.cell .ltr { pointer-events: none; }
.cell.gold { background: var(--gold-soft); box-shadow: inset 0 0 0 1.5px var(--gold); }
.cell.gold:not(.has):not(.draft)::after {
  content: '×3';
  font: 700 calc(var(--cell) * 0.3) / 1 var(--sans);
  color: var(--gold);
}
.cell.inword { background: var(--sel); }
.cell.cur { box-shadow: inset 0 0 0 2.5px var(--ink); }
.cell.over { box-shadow: inset 0 0 0 3px var(--me); transform: scale(1.12); z-index: 2; }
.cell.has { color: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18); }
.cell.has .num { color: rgba(255, 255, 255, 0.75); }
.cell.me { background: var(--me); }
.cell.opp { background: var(--opp); }
.cell.hint, .cell.reveal { background: var(--hint); }
.cell.bad { background: var(--bad); }
.cell.draft {
  background: var(--tile);
  color: var(--tile-ink);
  box-shadow: inset 0 -3px 0 var(--tile-edge), 0 2px 6px rgba(60, 40, 10, 0.25);
  z-index: 1;
}
.cell.draft .num { color: var(--muted); }
.cell.has.inword { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 0 0 2px var(--sel); }
.cell.has.cur { box-shadow: inset 0 0 0 2.5px var(--ink); }
.cell.glow { z-index: 3; }
.hintmode .cell:not(.has):not(.draft) { animation: breathe 1s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: inset 0 0 0 2px var(--gold); } }

.clue {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  min-height: 62px;
}
.cluebox {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 7px 12px;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.cluebox .q { font-size: 15px; line-height: 1.25; font-weight: 600; }
.cluebox .p { font: 600 12px var(--sans); color: var(--muted); letter-spacing: 0.14em; margin-top: 2px; }
.cluebox .p b { color: var(--ink); letter-spacing: 0.04em; margin-right: 8px; }

.rack {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  min-height: 62px;
  touch-action: none;
}
.tile {
  --t: min(48px, calc((min(100vw, 520px) - 56px) / var(--rack, 6)));
  width: var(--t);
  height: calc(var(--t) * 1.08);
  border-radius: 10px;
  background: var(--tile);
  color: var(--tile-ink);
  font: 700 calc(var(--t) * 0.56) / 1 var(--serif);
  display: grid;
  place-items: center;
  box-shadow: inset 0 -4px 0 var(--tile-edge), var(--shadow);
  transition: transform 0.16s var(--spring), opacity 0.16s, box-shadow 0.16s;
  touch-action: none;
}
.tile:active { transform: translateY(2px) scale(0.96); }
.tile.pick { transform: translateY(-8px); box-shadow: inset 0 -4px 0 var(--tile-edge), 0 0 0 2.5px var(--me), var(--shadow); }
.tile.swap { transform: translateY(-8px) rotate(-4deg); box-shadow: inset 0 -4px 0 var(--tile-edge), 0 0 0 2.5px var(--gold), var(--shadow); }
.tile.ghost { opacity: 0.16; box-shadow: inset 0 0 0 1.5px var(--tile-edge); background: none; pointer-events: none; }
.tile.fly {
  position: fixed;
  left: 0;
  top: 0;
  margin: 0;
  z-index: 50;
  pointer-events: none;
  transition: none;
}
.tile.drag { box-shadow: inset 0 -4px 0 var(--tile-edge), 0 14px 26px rgba(40, 25, 5, 0.35); }

.actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.5fr;
  gap: 6px;
  padding: 4px 8px 10px;
}
.actions .btn { min-height: 44px; padding: 0 6px; font-size: 14px; border-radius: 13px; }

/* ---------- слои ---------- */
#layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.float { position: absolute; font: 800 18px var(--sans); text-shadow: 0 1px 0 var(--bg); white-space: nowrap; }
.float.me { color: var(--me); }
.float.opp { color: var(--opp); }
.float.bad { color: var(--bad); }
.float.gold { color: var(--gold); font-size: 22px; }
.confetto { position: absolute; top: -40px; font: 700 22px var(--serif); will-change: transform; }

#toasts {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 64px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 70;
}
.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow);
  max-width: 88vw;
  text-align: center;
}
.toast.gold { background: var(--gold); color: #2b2118; }

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 4, 0.45);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 82dvh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  user-select: none;
}
.sheet::before { content: ''; width: 40px; height: 4px; border-radius: 2px; background: var(--line); align-self: center; margin-bottom: 4px; flex: none; }
.sheet h2 { font-size: 22px; }
.sheet p { margin: 0; }
.sheet ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.sheet .row { display: flex; gap: 8px; }
.sheet .row .btn { flex: 1; }
.cl h3 { font: 600 13px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 8px 0 2px; }
.cl button { display: grid; grid-template-columns: 28px 1fr auto; gap: 6px; width: 100%; text-align: left; padding: 8px 6px; border-radius: 10px; font-size: 15px; }
.cl button:active { background: var(--bg2); }
.cl button b { color: var(--muted); font-weight: 700; }
.cl button i { font-style: normal; color: var(--muted); font-size: 12px; }
.cl button.done { color: var(--muted); text-decoration: line-through; }
.result { text-align: center; padding: 8px 0; }
.result .big { font: 700 34px var(--serif); }
.result .sc { font: 700 44px/1.1 var(--serif); margin: 6px 0; }
.result .sc .m { color: var(--me); }
.result .sc .o { color: var(--opp); }

/* ---------- сканворд: клетки-вопросы ---------- */
.qc {
  position: relative;
  margin: 1px;
  border-radius: calc(var(--cell) * 0.14);
  background: var(--bg2);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 2px 2px 2px 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, opacity 0.3s;
}
.qc .qt {
  font: 600 calc(var(--cell) * 0.165) / 1.12 var(--sans);
  color: var(--ink);
  text-align: center;
  overflow-wrap: anywhere;
  hyphens: auto;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  pointer-events: none;
}
.qc .arr {
  position: absolute;
  font: 700 calc(var(--cell) * 0.26) / 1 var(--sans);
  color: var(--me);
  pointer-events: none;
}
.qc .arr.r { right: 0; top: 50%; transform: translateY(-50%); }
.qc .arr.b { bottom: -1px; left: 50%; transform: translateX(-50%); }
.qc .arr.l { left: 0; top: 50%; transform: translateY(-50%); }
.qc .arr.t { top: -1px; left: 50%; transform: translateX(-50%); }
.qc.on { background: var(--sel); box-shadow: inset 0 0 0 2px var(--gold); }
.qc.done { opacity: 0.45; }
.qc.done .qt { text-decoration: line-through; }

/* ---------- таймер ---------- */
.status .clock { font-variant-numeric: tabular-nums; }
.timer { width: calc(100% - 32px); height: 4px; border-radius: 2px; background: var(--bg2); overflow: hidden; opacity: 0; transition: opacity 0.3s; }
.timer.on { opacity: 1; }
.timer i { display: block; height: 100%; background: var(--me); transform-origin: left; transition: transform 0.25s linear, background 0.3s; }
.timer.opp i { background: var(--opp); }
.timer.low i { background: var(--bad); }
.timer.low:not(.opp) { animation: tickpulse 1s ease-in-out infinite; }
@keyframes tickpulse { 50% { opacity: 0.55; } }

/* ---------- заставка «Начать» ---------- */
.boardwrap { position: relative; }
.veil { position: absolute; inset: 0; display: none; place-items: center; pointer-events: none; }
.veiled .veil { display: grid; }
.veilcard {
  pointer-events: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
  animation: pop 0.45s var(--spring) both;
}
.veilcard b { font: 700 24px var(--serif); }
.veilcard span { color: var(--muted); font-size: 13px; text-align: center; }
.veilcard .btn { min-width: 160px; }
@keyframes pop { from { opacity: 0; transform: scale(0.8) translateY(10px); } }
.veiled .board .cell { background: var(--slot); box-shadow: inset 0 0 0 1px var(--slot-line); }
.veiled .board .cell .num { opacity: 0; }
.veiled .board { filter: saturate(0.6); opacity: 0.55; }
.actions .btn.start { grid-column: 1 / -1; }

/* буквы рубашкой вверх */
.tile.back {
  background: repeating-linear-gradient(45deg, var(--tile-edge) 0 4px, var(--tile) 4px 9px);
  box-shadow: inset 0 -4px 0 var(--tile-edge), var(--shadow);
  opacity: 0.7;
  pointer-events: none;
}

/* ---------- уровень и удаление ---------- */
.gcard { position: relative; }
.gcard .state { display: flex; align-items: center; gap: 8px; }
.lvl { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 7px; border-radius: 999px; background: var(--bg2); color: var(--muted); }
.lvl.easy { background: var(--me-soft); color: var(--me); }
.lvl.hard { background: var(--opp-soft); color: var(--opp); }
.gcard .del {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.gcard .del:active { background: var(--bad); color: #fff; }
.sheet .level {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.14s var(--spring);
}
.sheet .level:active { transform: scale(0.97); }
.sheet .level[disabled] { opacity: 0.45; }
.sheet .level b { font: 700 19px var(--serif); }
.sheet .level span { grid-column: 1; color: var(--muted); font-size: 14px; }
.sheet .level i { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-weight: 700; color: var(--me); }
.sheet .level.hard i { color: var(--opp); }

/* ---------- список вопросов: ответы и карандаш ---------- */
.clrow { display: flex; align-items: stretch; gap: 4px; }
.clrow > button:first-child { flex: 1; }
.cl .pen { display: grid; place-items: center; width: 40px; padding: 0; font-size: 18px; color: var(--muted); grid-template-columns: none; }
.cl strong { letter-spacing: 0.04em; }

/* ---------- админка ---------- */
.admin { padding-left: 14px; padding-right: 14px; }
.ahead { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 6px; padding: 10px 0 6px; }
.ahead h1 { font-size: 26px; }
.ahead .muted { font-size: 11px; font-variant-numeric: tabular-nums; }
.abody { flex: 1; overflow-y: auto; padding: 10px 0 20px; overscroll-behavior: contain; }
.seg { display: flex; background: var(--bg2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 36px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(40, 25, 5, 0.15); }
.seg.small button { min-height: 32px; font-size: 13px; padding: 0 8px; }
.note { margin: 2px 2px 10px; font-size: 13px; color: var(--muted); }
.agroup { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px 14px 10px; margin-bottom: 12px; }
.agroup h3 { font: 600 12px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 10px 0 2px; }
.arow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.agroup h3 + .arow { border-top: 0; }
.arow.wide { flex-wrap: wrap; }
.arow.wide .seg { flex-basis: 100%; }
.alabel { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.alabel span { font-size: 15px; }
.alabel small { font-size: 12px; color: var(--muted); }
.alabel small.def { color: var(--gold); }
.alabel small.online { color: var(--me); }
.arow.changed .alabel span::after { content: ' •'; color: var(--gold); }
.arow.dirty { background: linear-gradient(90deg, transparent, var(--sel) 50%, transparent); }
.stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; background: var(--bg2); font-size: 20px; font-weight: 700; touch-action: manipulation; transition: transform 0.1s; }
.stepper button:active { transform: scale(0.88); }
.stepper button[disabled] { opacity: 0.3; }
.stepper b { min-width: 42px; text-align: center; font: 700 18px var(--serif); font-variant-numeric: tabular-nums; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; transition: background 0.2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.25s var(--spring); }
.switch.on { background: var(--me); }
.switch.on i { transform: translateX(20px); }
.aexample { display: grid; gap: 6px; padding: 6px 0 2px; }
.aexample div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.aexample span { color: var(--muted); }
.aexample b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.asave { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 6px; padding: 10px 0 4px; background: linear-gradient(transparent, var(--bg) 30%); }
.asave .btn { padding: 0 6px; font-size: 14px; }
.adict .seg { margin-bottom: 8px; }
.drow { display: flex; gap: 8px; margin-bottom: 10px; }
.drow input, .sheet input, .sheet textarea, .apeople input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  user-select: text;
  -webkit-user-select: text;
}
.apeople input { max-width: 170px; }
.sheet textarea { height: auto; padding: 10px 12px; resize: none; }
.dlist { display: grid; gap: 6px; }
.ditem { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); transition: transform 0.12s var(--spring); }
.ditem:active { transform: scale(0.98); }
.ditem b { letter-spacing: 0.03em; }
.ditem span { color: var(--muted); font-size: 14px; }
.ditem i { font-style: normal; font-size: 11px; font-weight: 600; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: var(--gold-soft); color: var(--gold); }
.ditem.off { opacity: 0.55; }
.ditem.off b { text-decoration: line-through; }
.ditem.off i { background: var(--bg2); color: var(--muted); }
.ditem.added i { background: var(--me-soft); color: var(--me); }
.lobby .foot .btn { min-width: 30%; }

@media (prefers-reduced-motion: reduce) {
  .timer.low:not(.opp) { animation: none; }
  .status .dot, .hintmode .cell { animation: none; }
}
