/* Jacob Bros: an original 8-bit Yerushalayim. All pixel art is drawn in code. */

:root {
  --sky: #4f90e0;
  --brick: #c84c0c;
  --brick-light: #fcbcb0;
  --brick-dark: #7c2c00;
  --gold: #f2b632;
  --gold-dark: #b07a14;
  --gold-light: #ffe08a;
  --green: #00a800;
  --green-light: #80d010;
  --green-dark: #005800;
  --ink: #20140c;
  --paper: #fff6dc;
  --paper-dim: #f1e3bb;
  --text: #1b1208;
  --muted: #5b4a33;
  --under: #241a12;
  --white: #ffffff;
  --px: 4px;

  --font-pixel: "Press Start 2P", ui-monospace, monospace;
  --font-body: "Pixelify Sans", ui-rounded, system-ui, sans-serif;

  /* Kotel-tunnel stone, 16x16 */
  --tile-under: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect width='16' height='16' fill='%232b2016'/%3E%3Crect width='16' height='1' fill='%23352819'/%3E%3Crect y='8' width='16' height='1' fill='%23352819'/%3E%3Crect y='7' width='16' height='1' fill='%23170f09'/%3E%3Crect y='15' width='16' height='1' fill='%23170f09'/%3E%3Crect x='9' width='1' height='7' fill='%23170f09'/%3E%3Crect x='3' y='8' width='1' height='7' fill='%23170f09'/%3E%3C/svg%3E");
  /* Jerusalem stone paving, 16x16 */
  --tile-ground: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect width='16' height='16' fill='%23a88a58'/%3E%3Crect width='8' height='7' fill='%23d6bc86'/%3E%3Crect x='9' width='7' height='7' fill='%23ccb07a'/%3E%3Crect y='8' width='3' height='7' fill='%23dcc490'/%3E%3Crect x='4' y='8' width='7' height='7' fill='%23d6bc86'/%3E%3Crect x='12' y='8' width='4' height='7' fill='%23ccb07a'/%3E%3Crect width='8' height='1' fill='%23e7d3a3'/%3E%3Crect x='9' width='7' height='1' fill='%23e7d3a3'/%3E%3Crect x='4' y='8' width='7' height='1' fill='%23e7d3a3'/%3E%3C/svg%3E");
  /* Pomegranate, 10x11 */
  --rimon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 11' shape-rendering='crispEdges'%3E%3Cg fill='%237c0f1f'%3E%3Crect x='3' width='1' height='1'/%3E%3Crect x='5' width='1' height='1'/%3E%3Crect x='7' width='1' height='1'/%3E%3Crect x='3' y='1' width='5' height='1'/%3E%3C/g%3E%3Cpath fill='%23df2a40' d='M2 2h6v1h1v1h1v4H9v1H8v1H2V9H1V8H0V4h1V3h1z'/%3E%3Cg fill='%23ff8f9c'%3E%3Crect x='3' y='3' width='1' height='1'/%3E%3Crect x='2' y='4' width='2' height='1'/%3E%3Crect x='2' y='5' width='1' height='1'/%3E%3C/g%3E%3Cg fill='%239a1428'%3E%3Crect x='9' y='4' width='1' height='4'/%3E%3Crect x='8' y='7' width='1' height='2'/%3E%3Crect x='3' y='9' width='4' height='1'/%3E%3Crect x='3' y='10' width='3' height='1'/%3E%3C/g%3E%3C/svg%3E");
  --rimon-gray: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 11' shape-rendering='crispEdges'%3E%3Cpath fill='%236f6a7b' d='M2 2h6v1h1v1h1v4H9v1H8v1H2V9H1V8H0V4h1V3h1z'/%3E%3Cg fill='%235d5868'%3E%3Crect x='3' width='1' height='1'/%3E%3Crect x='5' width='1' height='1'/%3E%3Crect x='7' width='1' height='1'/%3E%3Crect x='3' y='1' width='5' height='1'/%3E%3C/g%3E%3C/svg%3E");
}

html[lang="he"] {
  --font-pixel: "Rubik", system-ui, sans-serif;
  --font-body: "Rubik", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--under) var(--tile-under) repeat;
  background-size: 48px 48px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px dashed var(--white); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 50;
  background: var(--gold); color: var(--ink); padding: 10px 14px;
  font-family: var(--font-pixel); font-size: 11px; text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- shared pixel pieces ---------- */

.panel {
  background: var(--paper);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink),
    calc(var(--px) * -1) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink),
    inset 0 calc(var(--px) * -1) 0 0 var(--paper-dim);
}

.btn {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 13px; line-height: 1; letter-spacing: .02em;
  text-decoration: none; text-transform: uppercase;
  color: var(--white);
  background: var(--brick);
  padding: 14px 18px 12px;
  border: 0; cursor: pointer;
  box-shadow:
    0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink),
    inset 4px 4px 0 0 var(--brick-light), inset -4px -4px 0 0 var(--brick-dark);
  text-shadow: 2px 2px 0 var(--ink);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(2px); }
.btn-small { font-size: 11px; padding: 12px 14px 10px; }
.btn-play {
  background: var(--green); font-size: 12px; margin-inline-end: 4px;
  box-shadow:
    0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink),
    inset 4px 4px 0 0 var(--green-light), inset -4px -4px 0 0 var(--green-dark);
}
.btn-play.is-disabled {
  background: #8a8a9a; cursor: default; font-size: 10px;
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink),
    inset 4px 4px 0 0 #b5b5c4, inset -4px -4px 0 0 #5a5a6a;
}
.btn-play.is-disabled:hover { transform: none; }
.btn-quiet {
  background: var(--paper-dim); color: var(--text); text-shadow: none; font-size: 10px;
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink),
    inset 4px 4px 0 0 #fffaf0, inset -4px -4px 0 0 #cdbb8e;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body); font-size: 16px; font-weight: 600; line-height: 1;
  padding: 8px 12px;
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 0 var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.chip:hover { background: var(--gold-light); }
.chip[aria-pressed="true"] {
  background: var(--gold);
  box-shadow: inset 3px 3px 0 0 var(--gold-dark);
  transform: translate(3px, 3px);
}
.chip-sprite { display: inline-block; }
.chip-sprite .sprite { height: 24px; width: auto; }

.sprite { display: block; width: 100%; height: auto; image-rendering: pixelated; -webkit-user-drag: none; user-select: none; }

.tag { font-size: 14px; font-weight: 600; line-height: 1; padding: 5px 8px; background: var(--gold-light); border: 2px solid var(--ink); }
.tag-age { background: #cfe6ff; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- the stage (game) ---------- */

.stage { position: relative; background: var(--sky); outline: none; }
.screen {
  position: relative;
  height: 100svh;
  min-height: 460px;
  max-height: 920px;
  overflow: hidden;
}
#game {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  image-rendering: pixelated;
  touch-action: none;
}

.hud {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  max-width: 1100px; margin: 0 auto;
  font-family: var(--font-pixel);
  color: var(--white);
  text-shadow: 2px 2px 0 var(--ink);
  pointer-events: none;
}
.hud-cell { display: flex; flex-direction: column; gap: 6px; text-align: center; }
.hud-label { font-size: 9px; }
.hud-value { font-size: 12px; display: inline-flex; justify-content: center; align-items: center; gap: 4px; }
.hud-coin { width: 8px; height: 12px; background: var(--gold); border: 2px solid var(--ink); box-shadow: inset 2px 0 0 #fff0b0; }
.lang-toggle {
  pointer-events: auto;
  font-family: "Rubik", system-ui, sans-serif; font-weight: 700; font-size: 14px; line-height: 1;
  padding: 8px 10px 7px;
  color: var(--ink); text-shadow: none;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 0 var(--ink);
  cursor: pointer;
}
.lang-toggle:hover { background: var(--gold-light); }

/* select screen */
.select {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  padding: 72px 16px 28px;
  text-align: center;
  background: linear-gradient(transparent 55%, rgba(40, 25, 10, .35));
}
.select[hidden] { display: none; }

.title-board {
  margin: 0;
  padding: .3em .5em .24em;
  font-family: "Press Start 2P", monospace;
  font-weight: 400;
  font-size: clamp(30px, 8vw, 72px);
  line-height: 1.08;
  color: var(--gold-light);
  text-shadow: .07em .07em 0 var(--ink);
  direction: ltr;
  background:
    radial-gradient(circle at 9px 9px, var(--brick-light) 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 9px) 9px, var(--brick-light) 3px, transparent 4px),
    radial-gradient(circle at 9px calc(100% - 9px), var(--brick-dark) 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), var(--brick-dark) 3px, transparent 4px),
    var(--brick);
  box-shadow:
    0 -5px 0 0 var(--ink), 0 5px 0 0 var(--ink), -5px 0 0 0 var(--ink), 5px 0 0 0 var(--ink),
    inset 5px 5px 0 0 var(--brick-light), inset -5px -5px 0 0 var(--brick-dark),
    10px 10px 0 0 rgba(0, 0, 0, .25);
  display: flex; flex-direction: column;
}
.title-line { display: block; }
.title-line:nth-child(2) { color: var(--white); }
.title-dot { color: var(--gold); }

.tagline, .select-title, .keys {
  margin: 0;
  font-family: var(--font-pixel);
  color: var(--white);
  text-shadow: 2px 2px 0 var(--ink);
}
.tagline { font-size: clamp(9px, 2.4vw, 13px); line-height: 1.6; }
.select-title { font-size: clamp(14px, 3.6vw, 22px); font-weight: 400; margin-top: 10px; }

.pick { display: flex; justify-content: center; align-items: flex-end; gap: clamp(6px, 2.6vw, 28px); margin-top: 4px; }
.pick-bro {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 8px 4px 0; border: 0; background: none; cursor: pointer;
}
.pick-sprite { width: 64px; display: block; transition: transform .1s steps(2); }
.pick-bro:hover .pick-sprite, .pick-bro:focus-visible .pick-sprite { transform: translateY(-6px); }
.pick-name {
  font-family: var(--font-pixel); font-size: 9px; line-height: 1.2;
  padding: 5px 6px 4px;
  color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink);
  white-space: nowrap;
}
.pick-bro:hover .pick-name, .pick-bro:focus-visible .pick-name { background: var(--gold); }
.pick-bro.chosen .pick-sprite { animation: hop .32s steps(5); }
@keyframes hop { 50% { transform: translateY(-40px); } }

.howto {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px;
  counter-reset: step;
}
.howto li {
  counter-increment: step;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 16px; font-weight: 600;
  padding: 6px 10px;
  background: var(--paper); border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 0 rgba(0, 0, 0, .3);
}
.howto li::before {
  content: counter(step);
  font-family: "Press Start 2P", monospace; font-size: 9px;
  color: var(--white); background: var(--brick);
  padding: 4px 5px 3px;
}
.rimon { width: 20px; height: 22px; display: inline-block; image-rendering: pixelated; background: var(--rimon) center / contain no-repeat; }
.keys { font-size: 10px; line-height: 1.6; margin-top: 4px; }
.to-list {
  font-family: var(--font-pixel); font-size: 10px; line-height: 1.6;
  color: var(--gold-light); text-shadow: 2px 2px 0 var(--ink);
}

/* in-game buttons */
.ingame { position: absolute; z-index: 5; top: 64px; left: 0; right: 0; pointer-events: none; }
.ingame[hidden] { display: none; }
.change-bro {
  pointer-events: auto;
  position: absolute; top: 0; inset-inline-start: max(14px, env(safe-area-inset-left));
  display: inline-flex; align-items: flex-end; gap: 8px;
  padding: 6px 10px 6px 8px;
  font-family: var(--font-pixel); font-size: 9px; line-height: 1.2;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: 3px 3px 0 0 var(--ink);
  cursor: pointer;
}
.change-bro .sprite { width: 32px; }
.change-bro:hover { background: var(--gold-light); }
.zone-tabs {
  pointer-events: auto;
  position: absolute; top: 0; inset-inline-end: max(14px, env(safe-area-inset-right));
  display: flex; gap: 6px;
  max-width: calc(100% - 170px);
  overflow-x: auto;
  padding: 2px 4px 6px;
  scrollbar-width: none;
}
.zone-tab {
  font-family: var(--font-pixel); font-size: 9px; line-height: 1.2; white-space: nowrap;
  padding: 7px 8px 6px;
  color: var(--white); background: rgba(32, 20, 12, .72);
  border: 2px solid var(--ink); cursor: pointer;
}
.zone-tab[aria-current="true"] { background: var(--brick); }
.zone-tab:hover { background: var(--brick-dark); }

.toast {
  position: absolute; z-index: 6;
  left: 50%; top: 116px;
  width: min(560px, calc(100% - 32px));
  margin: 0; padding: 12px 16px;
  font-size: 17px; text-align: center;
  background: var(--paper); color: var(--text);
  border: 3px solid var(--ink); box-shadow: 4px 4px 0 0 rgba(0, 0, 0, .35);
  transform: translate(-50%, 10px); opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.fade {
  position: absolute; inset: 0; z-index: 8;
  background: #000; opacity: 0; pointer-events: none;
  transition: opacity .3s steps(6);
}
.fade.on { opacity: 1; }

/* touch controls (phones and tablets) */
.pad { display: none; }
.stage.touch .screen { height: min(calc(100svh - 150px), 140vw); min-height: 300px; }
.stage.touch .pad {
  display: flex; justify-content: space-between; align-items: center;
  height: 150px;
  padding: 0 max(22px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(22px, env(safe-area-inset-right));
  background: #3b2c1d var(--tile-under) repeat; background-size: 48px 48px;
  border-top: 4px solid var(--ink);
  user-select: none; -webkit-user-select: none; touch-action: none;
  direction: ltr;
}
.stage.touch:not(.playing) .pad > * { opacity: .4; }
.joy {
  position: relative; width: 132px; height: 92px;
  display: grid; place-items: center;
  background: rgba(255, 246, 220, .14);
  border: 3px solid rgba(255, 246, 220, .5);
  border-radius: 46px;
  touch-action: none;
}
.joy::before, .joy::after {
  content: "◀"; position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: rgba(255, 246, 220, .6); left: 12px;
}
.joy::after { content: "▶"; left: auto; right: 12px; }
.joy-knob {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--paper); border: 4px solid var(--ink);
  box-shadow: inset -5px -5px 0 0 var(--paper-dim);
}
.jump-btn {
  width: 96px; height: 96px; border-radius: 50%;
  font-family: var(--font-pixel); font-size: 12px;
  color: var(--white); text-shadow: 2px 2px 0 var(--ink);
  background: var(--brick);
  border: 4px solid var(--ink);
  box-shadow: inset 6px 6px 0 0 var(--brick-light), inset -6px -6px 0 0 var(--brick-dark), 0 6px 0 0 var(--ink);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.jump-btn.down { transform: translateY(5px); box-shadow: inset 6px 6px 0 0 var(--brick-dark), 0 1px 0 0 var(--ink); }

/* game popup */
.game-pop {
  width: min(460px, calc(100vw - 40px));
  max-height: calc(100svh - 40px);
  padding: 0; border: 0; overflow: auto; color: var(--text);
}
.game-pop::backdrop { background: rgba(5, 8, 25, .6); }
.game-pop[open] { animation: pop .18s steps(3); }
@keyframes pop { from { transform: scale(.85); } to { transform: scale(1); } }
.pop-screen {
  position: relative; aspect-ratio: 16 / 9;
  background: var(--sky); border-bottom: 4px solid var(--ink);
  display: grid; place-items: center; overflow: hidden;
}
.pop-screen::before { content: attr(data-emoji); font-size: 64px; }
.pop-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pop-title { margin: 16px 18px 0; font-family: var(--font-pixel); font-weight: 400; font-size: 15px; line-height: 1.5; }
.pop-other { margin: 4px 18px 0; color: var(--muted); font-weight: 600; font-family: "Rubik", system-ui, sans-serif; }
.pop-blurb { margin: 10px 18px 12px; }
.game-pop .card-tags { margin: 0 18px; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 20px 22px 22px; }

/* ---------- sections (the Kotel tunnels) ---------- */

main { padding: 0 16px; border-top: 4px solid var(--ink); }
.section { max-width: 1100px; margin: 0 auto; padding: 56px 0 24px; }
.section-title {
  margin: 0 0 24px;
  font-family: var(--font-pixel); font-weight: 400;
  font-size: clamp(18px, 4.6vw, 32px); line-height: 1.3;
  text-align: center;
  color: #ffe9b8;
  text-shadow: 4px 4px 0 var(--brick);
}
.section-sub { margin: -8px auto 28px; max-width: 620px; text-align: center; color: #e9dcc0; }

.from-banner { padding: 16px 20px; margin: 0 4px 28px; text-align: center; background: var(--gold-light); }
.from-banner p { margin: 0; }
.from-title { font-family: var(--font-pixel); font-size: 12px; line-height: 1.6; margin-bottom: 8px !important; }

.filters { display: flex; flex-direction: column; gap: 14px; padding: 18px; margin: 0 4px 20px; }
.search input {
  width: 100%;
  font: inherit; font-size: 18px;
  padding: 12px 14px;
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: inset 3px 3px 0 0 #d9d2bf;
  border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
.search input:focus-visible { outline: 3px dashed var(--brick); outline-offset: 2px; }
.filter-group { display: flex; gap: 10px; overflow-x: auto; padding: 2px 6px 8px 2px; scrollbar-width: thin; }
.filter-group[hidden] { display: none; }

.results-count { margin: 0 4px 16px; font-family: var(--font-pixel); font-size: 10px; color: #e9dcc0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; padding: 0 4px; }

.card { position: relative; display: flex; flex-direction: column; }
.card-next::before {
  content: attr(data-next);
  position: absolute; z-index: 2; top: -14px; inset-inline-start: 14px;
  font-family: var(--font-pixel); font-size: 9px;
  padding: 6px 8px 5px;
  background: var(--green-light); color: var(--ink);
  border: 3px solid var(--ink);
}
.card-screen {
  position: relative; aspect-ratio: 16 / 10;
  background: var(--sky); border-bottom: 4px solid var(--ink);
  overflow: hidden; display: grid; place-items: center;
}
.card-screen::before { content: attr(data-emoji); font-size: 64px; filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, .25)); }
.card-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card-type {
  position: absolute; inset-inline-end: 8px; bottom: 8px;
  width: 34px; height: 34px; display: grid; place-items: center; font-size: 18px;
  background: var(--paper); border: 3px solid var(--ink);
}
.card-soon .card-screen { background: #6c6c8c; }
.card-soon .card-screen::before { opacity: .35; }
.soon-block {
  position: absolute; top: 14px; inset-inline-start: 14px;
  width: 40px; height: 40px;
  background: #b9b4c8 var(--rimon-gray) center / 22px 24px no-repeat;
  image-rendering: pixelated;
  box-shadow: inset 0 0 0 2px var(--ink), inset 4px 4px 0 #e2def0, inset -4px -4px 0 #7d7890;
}

.card-body { padding: 16px 16px 8px; flex: 1; }
.card-title { margin: 0; font-family: var(--font-pixel); font-weight: 400; font-size: 13px; line-height: 1.5; }
.card-other { margin: 6px 0 0; font-family: "Rubik", system-ui, sans-serif; font-weight: 600; color: var(--muted); }
.card-blurb { margin: 10px 0 12px; font-size: 17px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px 18px; }
.card-bros { display: flex; align-items: flex-end; gap: 6px; }
.by-bro { width: 32px; align-self: flex-end; padding: 0; border: 0; background: none; cursor: pointer; }
.by-bro:hover { transform: translateY(-3px); }

.empty { padding: 28px; text-align: center; margin: 0 4px; }
.empty-title { font-family: var(--font-pixel); font-size: 13px; line-height: 1.6; }
.link-btn { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; font-weight: 600; }

/* ---------- bro cards ---------- */

.bro-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 24px; padding: 0 4px; }
.bro-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 20px 14px 18px; border: 0; cursor: pointer; text-align: center;
}
.bro-card:hover .bro-card-sprite { transform: translateY(-6px); }
.bro-card-sprite, .bro-dialog-sprite {
  width: 64px; height: 104px; padding: 10px 12px 0;
  display: flex; align-items: flex-end;
  background: linear-gradient(var(--sky) 70%, #d2e3ec);
  border: 3px solid var(--ink);
  border-bottom: 10px solid #d6bc86;
  box-sizing: content-box;
  transition: transform .1s steps(2);
}
.bro-card-text { display: flex; flex-direction: column; gap: 6px; }
.bro-card-title { font-family: var(--font-pixel); font-size: 9px; color: var(--brick); }
.bro-card-name { font-family: var(--font-pixel); font-size: 13px; line-height: 1.4; }
.bro-card-count { font-size: 15px; color: var(--muted); }

/* ---------- bro dialog ---------- */

.bro-dialog {
  width: min(520px, calc(100vw - 40px));
  max-height: calc(100svh - 40px);
  padding: 24px 22px 22px; border: 0; color: var(--text); overflow: auto;
}
.bro-dialog::backdrop { background: rgba(5, 8, 25, .7); }
.bro-dialog[open] { animation: pop .18s steps(3); }
.dialog-close {
  position: absolute; top: 10px; inset-inline-end: 10px;
  width: 36px; height: 36px;
  background: var(--brick); color: var(--white);
  border: 3px solid var(--ink); cursor: pointer;
  font-family: "Press Start 2P", monospace; font-size: 12px;
}
.bro-dialog-head { display: flex; gap: 18px; align-items: center; margin-inline-end: 40px; }
.bro-dialog-sprite { flex: none; }
.bro-dialog-title { margin: 0 0 8px; font-family: var(--font-pixel); font-size: 9px; color: var(--brick); }
.bro-dialog-name { margin: 0; font-family: var(--font-pixel); font-weight: 400; font-size: 16px; line-height: 1.4; }
.bro-dialog-gh { display: inline-block; margin-top: 6px; font-weight: 600; }
.bro-dialog-bio { margin: 18px 0 10px; }
.bro-dialog-facts { margin: 0 0 16px; padding-inline-start: 20px; }
.bro-dialog-sub { margin: 0 0 10px; font-family: var(--font-pixel); font-size: 10px; }
.bro-dialog-builds { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }

/* ---------- footer ---------- */

.footer {
  position: relative; margin-top: 64px;
  background: linear-gradient(var(--sky), #b2d4f0 70%, #efe3c8);
  color: var(--white);
  border-top: 4px solid var(--ink);
}
.footer-inner {
  max-width: 640px; margin: 0 auto;
  padding: 48px 16px 64px;
  text-align: center;
  text-shadow: 2px 2px 0 var(--ink);
}
.footer-inner p { margin: 0 0 12px; }
.footer-title { font-family: var(--font-pixel); font-size: clamp(12px, 3.2vw, 18px); line-height: 1.6; }
.footer-inner a { color: var(--gold-light); font-weight: 600; }
.ground { height: 64px; background: var(--tile-ground) 0 0 / 48px 48px repeat; image-rendering: pixelated; border-top: 3px solid var(--ink); }

/* ---------- Hebrew ---------- */

html[lang="he"] body { font-size: 17px; }
html[lang="he"] .hud-label { font-size: 13px; font-weight: 700; }
html[lang="he"] .hud-value { font-size: 15px; font-weight: 800; }
html[lang="he"] .tagline { font-size: clamp(14px, 3.4vw, 19px); font-weight: 700; }
html[lang="he"] .select-title { font-size: clamp(22px, 5vw, 32px); font-weight: 800; }
html[lang="he"] .pick-name { font-size: 14px; font-weight: 700; }
html[lang="he"] .keys, html[lang="he"] .to-list { font-size: 15px; font-weight: 700; }
html[lang="he"] .change-bro, html[lang="he"] .zone-tab { font-size: 14px; font-weight: 700; }
html[lang="he"] .jump-btn { font-size: 18px; font-weight: 800; }
html[lang="he"] .btn { font-size: 17px; font-weight: 800; }
html[lang="he"] .btn-quiet { font-size: 15px; }
html[lang="he"] .section-title { font-size: clamp(26px, 6vw, 42px); font-weight: 800; }
html[lang="he"] .card-title, html[lang="he"] .pop-title { font-size: 20px; font-weight: 800; }
html[lang="he"] .bro-card-title, html[lang="he"] .bro-dialog-title, html[lang="he"] .bro-dialog-sub { font-size: 14px; font-weight: 700; }
html[lang="he"] .bro-card-name, html[lang="he"] .bro-dialog-name { font-size: 20px; font-weight: 800; }
html[lang="he"] .results-count, html[lang="he"] .empty-title, html[lang="he"] .from-title,
html[lang="he"] .footer-title, html[lang="he"] .card-next::before { font-size: 15px; font-weight: 800; }

/* ---------- responsive ---------- */

@media (min-width: 720px) {
  .hud-label { font-size: 11px; }
  .hud-value { font-size: 14px; }
  .pick-sprite { width: 96px; }
  .pick-name { font-size: 10px; }
}
@media (min-height: 820px) and (min-width: 900px) {
  .pick-sprite { width: 128px; }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .select { gap: 10px; padding-top: 64px; }
  .howto li { font-size: 14px; padding: 5px 8px; }
  .grid { grid-template-columns: 1fr; }
  .bro-cards { grid-template-columns: 1fr 1fr; gap: 18px; }
  .bro-card-sprite { width: 64px; height: 104px; }
  .bro-card-name { font-size: 11px; }
  .ingame { top: 58px; }
  .change-bro { padding: 4px; }
  .change-bro span { display: none; }
  .change-bro .sprite { width: 24px; }
  .zone-tabs { inset-inline-start: 56px; max-width: none; }
  .toast { top: 108px; font-size: 15px; }
}
@media (max-width: 520px) {
  .select { justify-content: flex-start; gap: 8px; padding-top: 74px; }
  .title-board { font-size: 26px; }
  .stage.touch .tagline { display: none; }
  .select-title { margin-top: 4px; }
  .pick { gap: 4px; }
  .pick-bro { padding: 6px 0 0; gap: 6px; }
  .pick-name { font-size: 7px; padding: 4px 4px 3px; }
  html[lang="he"] .pick-name { font-size: 12px; }
  .howto { gap: 6px; margin-top: 4px; }
  .howto li { font-size: 13px; padding: 4px 7px; }
}
@media (max-height: 560px) {
  .select { gap: 6px; padding-top: 56px; }
  .title-board { font-size: clamp(22px, 5vw, 40px); }
  .howto, .tagline { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
