:root {
  color-scheme: dark;
  --bg: #111416;
  --panel: #1b2125;
  --panel-2: #222a2f;
  --text: #eef4f2;
  --muted: #9aaba6;
  --line: #354147;
  --source: #59d98e;
  --relay: #55a9ff;
  --target: #ffd166;
  --jammer: #ff5c7a;
  --ghost: rgba(85, 169, 255, 0.15);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(85, 169, 255, 0.13), transparent 28rem),
    linear-gradient(145deg, #111416, #162024 52%, #101315);
  color: var(--text);
}

button {
  font: inherit;
}

a {
  color: inherit;
}

.home-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0;
}

.home-header {
  margin-bottom: 20px;
}

.home-header h1 {
  font-size: clamp(2.6rem, 7vw, 5.8rem);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.game-tile {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(27, 33, 37, 0.92);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.game-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(238, 244, 242, 0.48);
  background: rgba(34, 42, 47, 0.96);
}

.tile-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.game-tile strong {
  display: block;
  font-size: clamp(1.6rem, 3.8vw, 2.7rem);
  line-height: 0.95;
}

.game-tile span:last-of-type {
  max-width: 36ch;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 650;
}

.game-tile svg {
  width: 100%;
  max-height: 98px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.game-tile line,
.game-tile path {
  fill: none;
  stroke: currentColor;
  stroke-width: 8;
}

.game-tile circle {
  fill: currentColor;
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 4;
}

.signal-tile {
  color: var(--source);
}

.cafe-tile {
  color: #f4a261;
}

.orbital-tile {
  color: #7ddaff;
}

.snake-tile {
  color: #c4df7a;
}

.invaders-tile {
  color: #ff6b8a;
}

.pong-tile {
  color: #eef4f2;
}

.maze-tile {
  color: #ffe14d;
}

.tetris-tile {
  color: #7ddaff;
}

.coming-soon-shell {
  width: min(920px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  align-content: center;
  gap: 16px;
}

.coming-soon-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: rgba(27, 33, 37, 0.92);
  box-shadow: var(--shadow);
}

.coming-soon-panel p:last-child {
  max-width: 48ch;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.cafe-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.cafe-game,
.cafe-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 33, 37, 0.92);
  box-shadow: var(--shadow);
}

.cafe-game {
  padding: 24px;
  min-width: 0;
}

.cafe-accent {
  color: #f4a261;
}

.home-link.compact {
  min-width: 86px;
  display: grid;
  place-items: center;
  padding: 0 14px;
}

.cafe-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.cafe-hud div {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(34, 42, 47, 0.78);
  padding: 10px 12px;
}

.cafe-hud span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.cafe-hud strong {
  display: block;
  margin-top: 5px;
  font-size: 1.15rem;
}

.customer-rail {
  min-height: 184px;
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.customer-card,
.no-customers {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #242b2f;
  padding: 13px;
}

.no-customers {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 850;
}

.customer-head {
  display: grid;
  gap: 4px;
}

.customer-head strong {
  font-size: 0.98rem;
}

.customer-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.order-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.order-row span,
.ingredient-chip {
  min-width: 30px;
  border-radius: 999px;
  padding: 5px 8px;
  color: #141719;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.coffee {
  background: #8d5a3b;
}

.milk {
  background: #f4efe3;
}

.foam {
  background: #d7f3ff;
}

.cocoa {
  background: #c17c42;
}

.patience {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #12191d;
}

.patience span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f4a261;
}

.counter {
  display: grid;
  grid-template-columns: minmax(230px, 0.75fr) minmax(0, 1fr);
  gap: 14px;
}

.cup-panel,
.station-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 25, 29, 0.74);
  padding: 16px;
}

.cup-stack {
  min-height: 190px;
  border: 1px dashed rgba(238, 244, 242, 0.28);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  gap: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.empty-cup {
  margin: auto;
  color: var(--muted);
  font-weight: 850;
}

.cup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.cup-actions button,
.ingredient-grid button,
.cafe-controls button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font-weight: 850;
  cursor: pointer;
}

.ingredient-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ingredient-grid button {
  min-height: 92px;
  display: grid;
  place-items: center;
  gap: 4px;
}

.ingredient-grid button span {
  color: var(--muted);
  font-size: 0.86rem;
}

.ingredient-grid button strong {
  font-size: 1.7rem;
}

.cafe-controls {
  margin-top: 14px;
}

.recipe-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.recipe-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: rgba(34, 42, 47, 0.68);
}

.recipe-list strong,
.recipe-list span {
  display: block;
}

.recipe-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.orbital-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.orbital-game,
.orbital-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 33, 37, 0.92);
  box-shadow: var(--shadow);
}

.orbital-game {
  min-width: 0;
  padding: 24px;
}

.orbital-accent {
  color: #7ddaff;
}

.orbital-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.orbital-hud div {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(34, 42, 47, 0.78);
  padding: 10px 12px;
}

.orbital-hud span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.orbital-hud strong {
  display: block;
  margin-top: 5px;
  font-size: 1.08rem;
}

#orbitalCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 960 / 560;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11161b;
}

.orbital-controls {
  margin-top: 14px;
}

.snake-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.snake-game,
.snake-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 33, 37, 0.92);
  box-shadow: var(--shadow);
}

.snake-game {
  min-width: 0;
  padding: 24px;
}

.snake-accent {
  color: #c4df7a;
}

.snake-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.snake-hud div {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(34, 42, 47, 0.78);
  padding: 10px 12px;
}

.snake-hud span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.snake-hud strong {
  display: block;
  margin-top: 5px;
  font-size: 1.08rem;
}

.snake-board-wrap {
  display: grid;
  place-items: center;
  border: 1px solid #59624b;
  border-radius: 8px;
  background:
    linear-gradient(145deg, #272f24, #121611),
    #121611;
  padding: 16px;
}

#snakeCanvas {
  display: block;
  width: min(100%, 520px);
  aspect-ratio: 1;
  border: 8px solid #20281d;
  border-radius: 6px;
  background: #87966b;
  image-rendering: pixelated;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    0 14px 40px rgba(0, 0, 0, 0.28);
}

.snake-controls {
  margin-top: 14px;
}

.dpad {
  width: min(260px, 100%);
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dpad button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font-weight: 850;
}

.dpad [data-dir="up"] {
  grid-column: 2;
}

.dpad [data-dir="left"] {
  grid-column: 1;
}

.dpad [data-dir="down"] {
  grid-column: 2;
}

.dpad [data-dir="right"] {
  grid-column: 3;
  grid-row: 2;
}

.invaders-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.invaders-game,
.invaders-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 33, 37, 0.92);
  box-shadow: var(--shadow);
}

.invaders-game {
  min-width: 0;
  padding: 24px;
}

.invaders-accent {
  color: #ff6b8a;
}

.invaders-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.invaders-hud div {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(34, 42, 47, 0.78);
  padding: 10px 12px;
}

.invaders-hud span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.invaders-hud strong {
  display: block;
  margin-top: 5px;
  font-size: 1.08rem;
}

#invadersCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 900 / 620;
  border: 1px solid #3d4750;
  border-radius: 8px;
  background: #070a0f;
  image-rendering: pixelated;
}

.invaders-controls {
  margin-top: 14px;
}

.mobile-fire {
  width: min(420px, 100%);
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mobile-fire button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font-weight: 850;
}

.pong-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.pong-game,
.pong-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 33, 37, 0.92);
  box-shadow: var(--shadow);
}

.pong-game {
  min-width: 0;
  padding: 24px;
}

.pong-accent {
  color: #eef4f2;
}

.pong-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pong-hud div {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(34, 42, 47, 0.78);
  padding: 10px 12px;
}

.pong-hud span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.pong-hud strong {
  display: block;
  margin-top: 5px;
  font-size: 1.08rem;
}

#pongCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 900 / 520;
  border: 1px solid #3d4750;
  border-radius: 8px;
  background: #06090d;
  image-rendering: pixelated;
}

.pong-controls {
  margin-top: 14px;
}

.maze-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.maze-game,
.maze-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 33, 37, 0.92);
  box-shadow: var(--shadow);
}

.maze-game {
  min-width: 0;
  padding: 24px;
}

.maze-accent {
  color: #ffe14d;
}

.maze-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.maze-hud div {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(34, 42, 47, 0.78);
  padding: 10px 12px;
}

.maze-hud span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.maze-hud strong {
  display: block;
  margin-top: 5px;
  font-size: 1.08rem;
}

#mazeCanvas {
  display: block;
  width: min(100%, 570px);
  aspect-ratio: 570 / 630;
  margin: 0 auto;
  border: 1px solid #3344b8;
  border-radius: 8px;
  background: #05070d;
  image-rendering: pixelated;
}

.maze-controls {
  margin-top: 14px;
}

.tetris-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.tetris-game,
.tetris-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 33, 37, 0.92);
  box-shadow: var(--shadow);
}

.tetris-game {
  min-width: 0;
  padding: 24px;
}

.tetris-accent {
  color: #7ddaff;
}

.tetris-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.tetris-hud div {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(34, 42, 47, 0.78);
  padding: 10px 12px;
}

.tetris-hud span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.tetris-hud strong {
  display: block;
  margin-top: 5px;
  font-size: 1.08rem;
}

.tetris-stage {
  display: grid;
  grid-template-columns: 120px 300px 120px;
  gap: 14px;
  justify-content: center;
  align-items: start;
}

.mini-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.72);
  padding: 10px;
}

.mini-panel h2 {
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

#tetrisCanvas,
#holdCanvas,
#nextCanvas {
  display: block;
  border: 1px solid #3d4750;
  border-radius: 8px;
  background: #070a0f;
  image-rendering: pixelated;
}

#tetrisCanvas {
  width: 300px;
  max-width: 100%;
  aspect-ratio: 1 / 2;
}

#holdCanvas,
#nextCanvas {
  width: 100%;
}

.tetris-controls {
  margin-top: 14px;
}

.game-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.game-board,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 33, 37, 0.92);
  box-shadow: var(--shadow);
}

.game-board {
  min-width: 0;
  padding: 24px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--source);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.level-select,
.controls {
  display: flex;
  gap: 8px;
}

.level-select button,
.controls button,
.home-link {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.level-select button {
  width: 42px;
}

.level-select button.active {
  border-color: var(--source);
  background: rgba(89, 217, 142, 0.18);
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.hud div {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(34, 42, 47, 0.78);
  padding: 11px 13px;
}

.hud span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.hud strong {
  display: block;
  margin-top: 5px;
  font-size: 1.05rem;
}

.map-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #12191d;
  background-size: 34px 34px;
}

#signalMap {
  display: block;
  width: 100%;
  aspect-ratio: 920 / 560;
  min-height: 320px;
}

.controls {
  margin-top: 14px;
}

.controls button,
.controls .home-link {
  flex: 1 1 0;
  padding: 0 14px;
}

.controls .home-link {
  display: grid;
  place-items: center;
}

.controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.side-panel {
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.side-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.rule-list {
  display: grid;
  gap: 10px;
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.rule-list div {
  display: flex;
  gap: 9px;
  align-items: center;
}

.legend {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.legend.source {
  background: var(--source);
}

.legend.relay {
  background: var(--relay);
}

.legend.target {
  background: var(--target);
}

.legend.jammer {
  background: var(--jammer);
}

.event-log {
  flex: 1;
  min-height: 220px;
  margin: 0;
  padding: 14px 0 0 20px;
  overflow: auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.event-log li {
  margin-bottom: 8px;
}

.link {
  stroke: rgba(238, 244, 242, 0.22);
  stroke-width: 3;
}

.link.live {
  stroke: var(--source);
  stroke-width: 5;
  filter: drop-shadow(0 0 8px rgba(89, 217, 142, 0.55));
}

.range {
  fill: var(--ghost);
  stroke: rgba(85, 169, 255, 0.42);
  stroke-dasharray: 7 8;
}

.jammer-range {
  fill: rgba(255, 92, 122, 0.12);
  stroke: rgba(255, 92, 122, 0.38);
  stroke-dasharray: 5 7;
}

.node {
  cursor: pointer;
}

.node circle.core {
  stroke: rgba(255, 255, 255, 0.62);
  stroke-width: 3;
}

.node text {
  fill: var(--text);
  font-size: 17px;
  font-weight: 850;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.node .label {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.node.inactive circle.core {
  fill: #26323a;
}

.node.active circle.core {
  fill: var(--relay);
  filter: drop-shadow(0 0 12px rgba(85, 169, 255, 0.65));
}

.node.connected circle.core,
.node.source circle.core {
  fill: var(--source);
  filter: drop-shadow(0 0 14px rgba(89, 217, 142, 0.72));
}

.node.target circle.core {
  fill: var(--target);
}

.node.target.connected circle.core {
  fill: var(--source);
}

.node.jammer {
  cursor: default;
}

.node.jammer circle.core {
  fill: var(--jammer);
}

.blocked {
  opacity: 0.36;
}

@media (max-width: 900px) {
  .game-shell,
  .cafe-shell,
  .orbital-shell,
  .snake-shell,
  .invaders-shell,
  .pong-shell,
  .maze-shell,
  .tetris-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    min-height: 0;
  }

  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .game-shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .game-board,
  .side-panel {
    padding: 16px;
  }

  .game-header {
    flex-direction: column;
  }

  .hud {
    grid-template-columns: 1fr;
  }

  .cafe-hud,
  .orbital-hud,
  .snake-hud,
  .invaders-hud,
  .pong-hud,
  .maze-hud,
  .tetris-hud,
  .counter {
    grid-template-columns: 1fr;
  }

  .tetris-stage {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .mini-panel {
    width: min(100%, 300px);
  }

  .customer-rail {
    grid-template-columns: 1fr;
  }

  .controls {
    flex-direction: column;
  }

  .tile-grid {
    grid-template-columns: 1fr;
  }

  .game-tile {
    min-height: 210px;
  }
}
