@font-face {
  font-family: 'Bungee';
  src: url('bungee.woff2') format('woff2');
  font-display: swap;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  background: #123d2c;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ================= THEMES ================= */
.theme-classic {
  --ink: #f6f1e2;
  --ink-dim: #c7d6cb;
  --bar: rgba(8, 30, 21, .55);
  --bar-line: rgba(255, 255, 255, .08);
  --btn: rgba(255, 255, 255, .1);
  --btn-hover: rgba(255, 255, 255, .18);
  --accent: #f2c14e;
  --accent-ink: #2b2006;
  --panel: #fbf7ea;
  --panel-ink: #24302a;
  --panel-muted: #5f6d64;
  --panel-line: #e3dcc6;
  --primary: #1f6b4a;
  --primary-ink: #fff;

  --face-a: #fffef8; --face-b: #f7f0de; --face-c: #ebe0c3;
  --side1: #e2d6b6; --side2: #cbbb92; --back: #1f7552; --back2: #145238;
  --tile-shadow: rgba(0, 0, 0, .38);
  --tile-shadow-up: rgba(0, 0, 0, .5);
  --dim: rgba(28, 44, 34, .34);
  --sel-face: #fff1b8;
  --sel-ring: #f0a92b;
  --hint-ring: #29c3e8;
  --label-ink: #6d5a3a;

  --s-red: #c41a2b; --s-green: #13804a; --s-blue: #1f4fa0; --s-ink: #1c2230;
  --s-pink: #e2508a; --s-purple: #7b4bb3; --s-gold: #e5a800; --s-brown: #6d4320;
  --s-sky: #2f8fd0; --s-orange: #ea6f17;
}
.theme-classic.table-jade {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 80% 70% at 50% 45%, #2e8463 0%, #1d6248 55%, #113b2b 100%);
}
.theme-classic.table-walnut {
  --back: #8a2b22; --back2: #5e1a14;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.004 .09' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .06 0 0 0 0 .02 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23w)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 85% 75% at 50% 45%, #7a4a2a 0%, #55301a 60%, #2e190c 100%);
}

.theme-atomic {
  --ink: #2a2f33;
  --ink-dim: #4c5a58;
  --bar: rgba(251, 243, 223, .82);
  --bar-line: rgba(42, 47, 51, .14);
  --btn: rgba(42, 47, 51, .08);
  --btn-hover: rgba(42, 47, 51, .15);
  --accent: #e2602b;
  --accent-ink: #fff;
  --panel: #fbf3df;
  --panel-ink: #2a2f33;
  --panel-muted: #5d6662;
  --panel-line: #e6d9b8;
  --primary: #e2602b;
  --primary-ink: #fff;

  --face-a: #fffaf0; --face-b: #fbf1da; --face-c: #f1e2bf;
  --side1: #efdcb2; --side2: #d9c08c; --back: #e2602b; --back2: #2f3a40;
  --tile-shadow: rgba(30, 40, 44, .38);
  --tile-shadow-up: rgba(30, 40, 44, .5);
  --dim: rgba(40, 70, 66, .30);
  --sel-face: #ffe2c9;
  --sel-ring: #e2602b;
  --hint-ring: #1aa58f;
  --label-ink: #8a5a2e;

  --s-red: #d9481c; --s-green: #138a78; --s-blue: #2f4a5c; --s-ink: #2a2f33;
  --s-pink: #e8507a; --s-purple: #6a5aa8; --s-gold: #eba51c; --s-brown: #6b4a2e;
  --s-sky: #2b9bb3; --s-orange: #e2602b;

  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.35' stroke-width='2'%3E%3Cellipse cx='60' cy='60' rx='26' ry='9'/%3E%3Cellipse cx='60' cy='60' rx='26' ry='9' transform='rotate(60 60 60)'/%3E%3Cellipse cx='60' cy='60' rx='26' ry='9' transform='rotate(-60 60 60)'/%3E%3C/g%3E%3Ccircle cx='60' cy='60' r='4' fill='%23e2602b' fill-opacity='.45'/%3E%3Cg stroke='%232a2f33' stroke-opacity='.10' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M190 170v-22M190 170v22M190 170h-22M190 170h22M190 170l-14-14M190 170l14 14M190 170l14-14M190 170l-14 14'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.4'%3E%3Ccircle cx='200' cy='50' r='3'/%3E%3Ccircle cx='40' cy='200' r='2.5'/%3E%3Ccircle cx='120' cy='120' r='2'/%3E%3C/g%3E%3Cpath d='M95 215 q25 -30 55 -8' stroke='%23e2602b' stroke-opacity='.22' stroke-width='5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 85% 75% at 50% 42%, #c4ebdc 0%, #9fd6c2 55%, #7fc0aa 100%);
}
.display { font-family: 'Georgia', 'Times New Roman', serif; letter-spacing: .01em; }
.theme-atomic .display { font-family: 'Bungee', 'Arial Black', sans-serif; letter-spacing: .02em; font-weight: 400; }

/* ================= APP GRID ================= */
#app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "hud" "stage" "tools";
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#hud {
  grid-area: hud;
  display: flex; align-items: center; gap: 14px;
  padding: 8px 14px;
  background: var(--bar);
  border-bottom: 1px solid var(--bar-line);
  backdrop-filter: blur(6px);
  min-height: 58px;
  z-index: 5;
}
.hud-title {
  font-size: 20px; font-weight: 700; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.theme-atomic .hud-title { font-family: 'Bungee', 'Arial Black', sans-serif; font-weight: 400; color: #e2602b; }
.hud-stats { display: flex; gap: 8px; }
.stat {
  display: flex; flex-direction: column; align-items: center;
  min-width: 84px; padding: 3px 10px; border-radius: 10px;
  background: var(--btn);
}
.stat .k { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-dim); font-weight: 600; }
.stat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
#statMoves.zero .v { color: #ff9b7a; }
.theme-atomic #statMoves.zero .v { color: #c0391b; }

.iconbtn {
  width: 46px; height: 46px; flex: none;
  border: 0; border-radius: 12px; background: var(--btn);
  display: grid; place-items: center;
}
.iconbtn:hover { background: var(--btn-hover); }
.iconbtn svg, .tool svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

#stage { grid-area: stage; position: relative; overflow: hidden; z-index: 1; isolation: isolate; }
#board { position: absolute; left: 0; top: 0; }

#tools {
  grid-area: tools;
  display: flex; justify-content: center; gap: 10px;
  padding: 8px 12px 10px;
  background: var(--bar);
  border-top: 1px solid var(--bar-line);
  backdrop-filter: blur(6px);
  z-index: 5;
}
.tool {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 128px; height: 54px; padding: 0 18px;
  border: 0; border-radius: 14px;
  background: var(--btn);
  font-size: 18px; font-weight: 700;
  transition: background .15s, transform .1s;
}
.tool:hover { background: var(--btn-hover); }
.tool:active { transform: scale(.96); }
.tool:disabled { opacity: .4; cursor: default; transform: none; }
.badge {
  position: absolute; top: -6px; right: -4px;
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 14px; line-height: 24px; text-align: center; font-weight: 800;
}
.badge.pen { font-size: 12px; }

/* ================= TILES ================= */
.tile {
  position: absolute;
  width: var(--tw); height: var(--th);
  border-radius: var(--tr);
  background: linear-gradient(150deg, var(--face-a) 0%, var(--face-b) 55%, var(--face-c) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.75),
    inset calc(var(--t1) * -.5) calc(var(--t1) * -.5) 0 0 rgba(140,115,70,.12),
    var(--t1) var(--t1) 0 0 var(--side1),
    var(--t2) var(--t2) 0 0 var(--side2),
    var(--t3) var(--t3) 0 0 var(--back),
    calc(var(--t3) + 1px) calc(var(--t3) + 1px) 0 0 var(--back2),
    calc(var(--t3) + 2px) calc(var(--t3) + 4px) calc(var(--t3) * 1.6) 0 var(--tile-shadow);
  cursor: pointer;
  transition: transform .14s ease-out, filter .14s;
  will-change: transform;
}
.tile.up {
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.75),
    inset calc(var(--t1) * -.5) calc(var(--t1) * -.5) 0 0 rgba(140,115,70,.12),
    var(--t1) var(--t1) 0 0 var(--side1),
    var(--t2) var(--t2) 0 0 var(--side2),
    var(--t3) var(--t3) 0 0 var(--back),
    calc(var(--t3) + 1px) calc(var(--t3) + 1px) 0 0 var(--back2),
    calc(var(--t3) * 1.6) calc(var(--t3) * 2) calc(var(--t3) * 2.2) 0 var(--tile-shadow-up);
}
.tile svg.f { position: absolute; inset: 4% 5% 3% 5%; width: 90%; height: 93%; pointer-events: none; }
.tile::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: var(--dim); opacity: 0; transition: opacity .2s; pointer-events: none;
}
.dim-on .tile.blocked::after { opacity: 1; }
.tile.blocked { cursor: default; }
.tile .lbl {
  position: absolute; left: 4%; top: 2%;
  font: 800 calc(var(--tw) * .2)/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--label-ink);
  font-style: normal; pointer-events: none;
}
.labels-off .tile .lbl { display: none; }
@media (hover: hover) and (pointer: fine) {
  .tile:not(.blocked):hover { filter: brightness(1.05) saturate(1.05); transform: translate(calc(var(--t1) * -.4), calc(var(--t1) * -.4)); }
}
.tile.sel {
  transform: translate(calc(var(--t3) * -.35), calc(var(--t3) * -.6)) !important;
  background: linear-gradient(150deg, #fffbe6 0%, var(--sel-face) 100%);
  z-index: 9000 !important;
}
.tile.sel::before, .tile.hint::before {
  content: ''; position: absolute; inset: calc(var(--t1) * -1.2); border-radius: calc(var(--tr) * 1.3);
  border: max(3px, calc(var(--tw) * .06)) solid var(--sel-ring);
  box-shadow: 0 0 calc(var(--tw) * .25) var(--sel-ring);
  pointer-events: none;
}
.tile.hint::before { border-color: var(--hint-ring); box-shadow: 0 0 calc(var(--tw) * .3) var(--hint-ring); animation: hintPulse 1s ease-in-out infinite; }
@keyframes hintPulse { 50% { opacity: .35; } }
.tile.shake { animation: shake .32s ease-in-out; }
@keyframes shake {
  20% { translate: -4px 0; } 40% { translate: 4px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; }
}
.tile.nudge { animation: nudge .25s ease-in-out; }
@keyframes nudge { 50% { translate: 0 2px; } }
.tile.gone { display: none; }

/* ================= OVERLAYS ================= */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(6, 18, 12, .5);
  animation: fadeIn .2s ease-out;
}
.theme-atomic .overlay { background: rgba(42, 47, 51, .42); }
@keyframes fadeIn { from { opacity: 0; } }
.panel {
  width: min(760px, 100%); max-height: 100%;
  display: flex; flex-direction: column;
  background: var(--panel); color: var(--panel-ink);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  animation: popIn .25s cubic-bezier(.2,1.3,.4,1);
  overflow: hidden;
}
.theme-atomic .panel { border: 3px solid #2a2f33; box-shadow: 8px 8px 0 #2a2f33; }
@keyframes popIn { from { transform: scale(.92); opacity: 0; } }
.panel.small { width: min(440px, 100%); padding: 26px 24px; }
.panel.center { text-align: center; }
.panel h2 { margin: 6px 0 8px; font-size: 28px; }
.panel h3 { margin: 18px 0 10px; font-size: 18px; }
.muted { color: var(--panel-muted); }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 0 14px; border-bottom: 1px solid var(--panel-line); }
.panel-head .close { background: transparent; color: var(--panel-ink); margin-left: auto; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tab {
  border: 0; background: none; padding: 12px 14px 13px;
  font-size: 17px; font-weight: 700; color: var(--panel-muted);
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.tab.on { color: var(--panel-ink); border-color: var(--primary); }
.panel-body { padding: 16px 18px 20px; overflow-y: auto; overscroll-behavior: contain; }
.tabpane { display: none; }
.tabpane.on { display: block; }
.help p { line-height: 1.5; margin: 0 0 12px; font-size: 17px; }

.btn {
  border: 0; border-radius: 12px; padding: 13px 18px; min-height: 50px;
  font-size: 17px; font-weight: 700;
  background: rgba(0,0,0,.07); color: var(--panel-ink);
}
.btn:hover { background: rgba(0,0,0,.12); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.subtle { background: transparent; text-decoration: underline; min-height: 40px; color: var(--panel-muted); }
.row-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.row-btns .btn { flex: 1 1 160px; }
.col-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.tabpane[data-pane="play"] .row-btns { margin-top: 2px; }

.layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lcard {
  border: 2px solid var(--panel-line); border-radius: 14px; background: #fff;
  padding: 8px 8px 10px; text-align: left; color: var(--panel-ink);
  display: flex; flex-direction: column; gap: 2px;
  transition: border-color .15s, transform .1s;
}
.theme-atomic .lcard { background: #fffaf0; }
.lcard:hover { border-color: var(--primary); }
.lcard:active { transform: scale(.97); }
.lcard.current { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.lcard canvas { width: 100%; height: 76px; display: block; margin-bottom: 4px; }
.lcard b { font-size: 17px; }
.lcard small { font-size: 14px; color: var(--panel-muted); }
.lcard .best { font-size: 14px; color: var(--primary); font-weight: 700; }
.theme-atomic .lcard .best { color: #c0501f; }

.setting {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 2px; border-bottom: 1px solid var(--panel-line); cursor: pointer;
}
.setting small { display: block; color: var(--panel-muted); font-size: 14px; margin-top: 2px; }
.setting input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  flex: none; width: 56px; height: 32px; border-radius: 16px; background: #c9c3b3; position: relative; transition: background .2s;
}
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.setting input:checked + .switch { background: var(--primary); }
.setting input:checked + .switch::after { transform: translateX(24px); }
.setting input:focus-visible + .switch { outline: 3px solid var(--accent); outline-offset: 2px; }
.seg { display: flex; background: rgba(0,0,0,.07); border-radius: 12px; padding: 3px; flex: none; }
.seg button { border: 0; background: none; padding: 9px 14px; border-radius: 9px; font-weight: 700; font-size: 16px; color: var(--panel-muted); }
.seg button.on { background: var(--primary); color: var(--primary-ink); }
.credit { text-align: center; margin: 18px 0 0; }
.credit a { color: var(--panel-muted); font-size: 15px; text-decoration: none; }
.credit a:hover { text-decoration: underline; }

table.stats { width: 100%; border-collapse: collapse; font-size: 17px; }
table.stats th, table.stats td { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--panel-line); }
table.stats th { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--panel-muted); }
table.stats td:first-child, table.stats th:first-child { text-align: left; font-weight: 700; }
table.stats td { font-variant-numeric: tabular-nums; }

/* Start */
#start { background: rgba(6, 18, 12, .35); }
.theme-atomic #start { background: rgba(42, 47, 51, .25); }
.start-card {
  width: min(720px, 100%); max-height: 100%; overflow-y: auto;
  background: var(--panel); color: var(--panel-ink);
  border-radius: 22px; padding: 22px 22px 20px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  animation: popIn .3s cubic-bezier(.2,1.3,.4,1);
}
.theme-atomic .start-card { border: 3px solid #2a2f33; box-shadow: 8px 8px 0 #2a2f33; }
.start-card h1 { font-size: clamp(30px, 6vw, 46px); margin: 6px 0 4px; }
.theme-atomic .start-card h1 { color: #e2602b; }
.start-card .sub { margin: 0 0 16px; color: var(--panel-muted); font-size: 18px; }
.logo-tiles { display: flex; justify-content: center; gap: 8px; }
.logo-tiles .lt {
  width: 52px; height: 68px; border-radius: 8px; padding: 4px;
  background: linear-gradient(150deg, var(--face-a), var(--face-c));
  box-shadow: 3px 3px 0 var(--side2), 5px 5px 0 var(--back), 6px 9px 10px rgba(0,0,0,.3);
}
.logo-tiles .lt:nth-child(1) { transform: rotate(-8deg) translateY(4px); }
.logo-tiles .lt:nth-child(3) { transform: rotate(8deg) translateY(4px); }
.big-btn {
  border: 0; border-radius: 16px; padding: 16px 40px; min-height: 64px;
  font-size: 23px; font-weight: 800;
  background: var(--primary); color: var(--primary-ink);
  box-shadow: 0 5px 0 rgba(0,0,0,.25);
  transition: transform .1s, filter .15s;
}
.big-btn:hover { filter: brightness(1.08); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.theme-atomic .big-btn { font-family: 'Bungee', 'Arial Black', sans-serif; font-weight: 400; box-shadow: 4px 4px 0 #2a2f33; }
.start-or { margin: 16px 0 8px; color: var(--panel-muted); font-size: 15px; }
.layout-grid.compact { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.layout-grid.compact .lcard canvas { height: 58px; }

/* Win */
.win-badge { width: 120px; height: 120px; margin: -6px auto 4px; }
.win-badge svg { width: 100%; height: 100%; }
#win h2 { font-size: 32px; }
.theme-atomic #win h2 { color: #e2602b; }
.win-time { font-size: 44px; font-weight: 800; margin: 0; font-variant-numeric: tabular-nums; }
#winBest { margin: 4px 0 8px; font-size: 18px; }
#winBest .rec { color: #c78a00; font-weight: 800; }
.theme-atomic #winBest .rec { color: #e2602b; }

#toast {
  position: fixed; left: 50%; bottom: 100px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0;
  max-width: min(92vw, 520px);
  padding: 12px 20px; border-radius: 14px;
  background: rgba(20, 26, 22, .92); color: #fff;
  font-size: 17px; font-weight: 600; text-align: center;
  pointer-events: none; transition: opacity .25s, transform .25s;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.theme-atomic #toast { background: #2a2f33; color: #fbf3df; }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 55; }

/* ================= RESPONSIVE ================= */
@media (max-width: 720px) {
  .tab { padding: 12px 10px 13px; font-size: 16px; }
  #hud { gap: 8px; padding: 6px 8px; min-height: 54px; }
  .hud-title { font-size: 17px; }
  .stat { min-width: 0; padding: 2px 8px; }
  .stat .k { font-size: 12px; letter-spacing: .03em; }
  .stat .v { font-size: 19px; }
  #tools { gap: 6px; padding: 6px 6px 8px; }
  .tool { flex: 1; min-width: 0; flex-direction: column; gap: 2px; height: 60px; padding: 0 4px; font-size: 14px; }
  .tool svg { width: 24px; height: 24px; }
  .badge { right: 6px; top: -4px; }
  #toast { bottom: 90px; }
}
@media (max-width: 420px) {
  .hud-title { display: none; }
  .hud-stats { flex: 1; justify-content: space-between; }
  .stat { flex: 1; }
}
/* phones in landscape: side rails instead of top/bottom bars */
@media (orientation: landscape) and (max-height: 540px) {
  #app {
    grid-template-rows: 1fr;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "hud stage tools";
  }
  #hud { flex-direction: column; justify-content: flex-start; border-bottom: 0; border-right: 1px solid var(--bar-line); padding: 8px 6px; min-height: 0; width: 104px; }
  .hud-title { flex: none; font-size: 14px; width: 100%; text-align: center; display: block; }
  .hud-stats { flex-direction: column; width: 100%; }
  .stat { min-width: 0; }
  .stat .k { font-size: 12px; }
  .stat .v { font-size: 19px; }
  #tools { flex-direction: column; border-top: 0; border-left: 1px solid var(--bar-line); padding: 8px 6px; width: 96px; justify-content: center; }
  .tool { flex: 1; max-height: 74px; min-width: 0; height: auto; flex-direction: column; gap: 2px; padding: 4px; font-size: 13px; }
  .tool svg { width: 24px; height: 24px; }
  .badge { right: 4px; top: 2px; }
  .panel-body { padding: 10px 14px 14px; }
  .start-card { padding: 14px 16px; }
  .start-card .sub { margin-bottom: 10px; }
  .logo-tiles { display: none; }
  #toast { bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .tile.hint::before { animation: none; }
}
