:root {
  color-scheme: light dark;
  --surface: light-dark(#ffffff,#0d1117);
  --panel: light-dark(#f6f8fa,#151b23);
  --border: light-dark(#d1d9e0,#3d444d);
  --ink: light-dark(#1f2328,#f0f6fc);
  --muted: light-dark(#59636e,#a5aeb9);
  --link: light-dark(#0969da,#4493f8);
  --accent: light-dark(#116329,#7ee787);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 15px/1.5 system-ui, sans-serif; }
main { width: min(100% - 28px, 456px); margin: clamp(18px, 6vh, 58px) auto; }
.back { color: var(--link); font-size: 13px; text-decoration: none; }
.back:hover { text-decoration: underline; }
h1 { font-size: clamp(35px, 9vw, 56px); letter-spacing: -.065em; line-height: 1; margin: 13px 0 8px; }
.intro { color: var(--muted); margin: 0; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 20px 0 10px; }
.controls label { display: grid; gap: 3px; color: var(--muted); font-size: 13px; }
.controls :is(select,button) { padding: 6px 9px; min-height: 38px; color: var(--ink); background: var(--panel); border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 15px; }
#reset { margin-left: auto; cursor: pointer; }
.game { border: 1px solid var(--border); border-radius: 12px; padding: clamp(7px, 2.7vw, 14px); background: var(--panel); }
#languages { color: var(--muted); margin: 0 0 8px; font-size: 12px; }
#board { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 5px; }
.tile {
  --top: #e5ebf4; --bottom: #b6c2d3; --shape: 25%;
  display: grid; place-items: center; min-width: 0; padding: 0; aspect-ratio: 1;
  border: 1px solid #0d111733; border-radius: var(--shape); cursor: pointer; color: #24292f;
  background: linear-gradient(145deg,var(--top),var(--bottom));
  box-shadow: inset 0 2px #ffffff9c, inset 0 -3px #00000021;
  font: 700 clamp(13px,4vw,23px)/1 system-ui, sans-serif;
}
.tile img { width: 58%; height: 58%; object-fit: contain; pointer-events: none; }
.tile[aria-pressed="true"] { outline: 2px solid var(--link); outline-offset: 1px; }
.tile.is-match { animation: pop .22s ease-out both; }
.tile.is-falling { animation: drop .22s ease-out both; }
.tile:focus-visible, button:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
@keyframes pop { 55% { scale: .74; opacity: .65; } }
@keyframes drop { from { translate: 0 -8px; opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .tile { animation: none !important; } }
footer { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 10px; font-size: 13px; }
footer strong { color: var(--accent); white-space: nowrap; }
