.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 270px);
  gap: 1rem;
  align-items: start;
}

.game-leaderboard {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background:
    linear-gradient(180deg, rgba(200, 245, 66, 0.04), transparent 35%),
    rgba(0, 0, 0, 0.38);
  padding: 1.05rem 1rem 1.15rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.game-shell__stage {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 1.15rem;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 70% 0%, rgba(106, 74, 50, 0.35), transparent 55%),
    #12171f;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  align-self: start;
  line-height: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.game-shell__stage::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(200, 245, 66, 0.06);
}

#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 540;
  touch-action: none;
  cursor: crosshair;
  vertical-align: top;
  -webkit-user-select: none;
  user-select: none;
}

.game-pause-btn {
  position: absolute;
  top: max(0.65rem, env(safe-area-inset-top, 0px));
  right: max(0.65rem, env(safe-area-inset-right, 0px));
  z-index: 3;
  min-height: 44px;
  min-width: 44px;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: rgba(8, 10, 9, 0.92);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.game-pause-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.game-pause-btn.is-next {
  background: color-mix(in srgb, var(--accent) 28%, rgba(8, 10, 9, 0.92));
  color: #0b0d0c;
  border-color: var(--accent);
  font-size: 0.92rem;
  padding-inline: 1.1rem;
}

.game-pause-btn.is-paused {
  border-color: color-mix(in srgb, var(--accent) 70%, white);
}

.game-audio-gear {
  position: absolute;
  top: calc(max(0.65rem, env(safe-area-inset-top, 0px)) + 3.15rem);
  right: max(0.65rem, env(safe-area-inset-right, 0px));
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}

.game-audio-gear__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: rgba(8, 10, 9, 0.92);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.game-audio-gear__btn:hover,
.game-audio-gear.is-open .game-audio-gear__btn {
  border-color: var(--accent);
  color: var(--accent);
}

.game-audio-gear.is-quiet .game-audio-gear__btn {
  opacity: 0.72;
}

.game-audio-gear__icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.game-audio-gear__panel {
  width: min(16.5rem, calc(100vw - 1.5rem));
  padding: 0.85rem 0.9rem 0.95rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: rgba(8, 10, 9, 0.96);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-family: var(--font-body, system-ui, sans-serif);
}

.game-audio-gear__title {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
}

.game-audio-gear__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.55rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.game-audio-gear__row:last-child {
  margin-bottom: 0;
}

.game-audio-gear__row-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.game-audio-gear__toggle {
  min-width: 3.1rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.game-audio-gear__toggle.is-off {
  border-color: color-mix(in srgb, var(--line) 80%, transparent);
  background: transparent;
  color: var(--muted);
}

.game-audio-gear__slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.game-audio-gear__slider:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.game-audio-gear__value {
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 2.4rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.game-fs-btn {
  position: absolute;
  top: max(0.65rem, env(safe-area-inset-top, 0px));
  left: max(0.65rem, env(safe-area-inset-left, 0px));
  z-index: 3;
  min-height: 44px;
  min-width: 44px;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: rgba(8, 10, 9, 0.92);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.game-fs-btn__icon {
  display: grid;
  place-items: center;
  line-height: 0;
}

.game-fs-btn__icon[hidden] {
  display: none !important;
}

.game-fs-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.game-fs-btn:hover {
  border-color: var(--accent);
}

html.game-fs-lock,
body.game-fs-lock {
  overflow: hidden;
  touch-action: none;
}

/* Pełny ekran: gra wyśrodkowana, min. 75% ekranu; ulepszenia na dole */
.game-shell.is-game-fs,
.game-shell:fullscreen,
.game-shell:-webkit-full-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  width: 100%;
  height: 100%;
  height: 100svh;
  max-width: none;
  margin: 0;
  padding:
    max(0.2rem, env(safe-area-inset-top, 0px))
    max(0.2rem, env(safe-area-inset-right, 0px))
    max(0.2rem, env(safe-area-inset-bottom, 0px))
    max(0.2rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(75%, 1fr) minmax(0, 25%);
  gap: 0.3rem;
  background: #0a0c0b;
  border-radius: 0;
  align-items: stretch;
  justify-items: stretch;
  overflow: hidden;
}

.game-shell.is-game-fs .game-leaderboard,
.game-shell:fullscreen .game-leaderboard,
.game-shell:-webkit-full-screen .game-leaderboard {
  display: none !important;
}

.game-shell.is-game-fs .game-shell__stage,
.game-shell:fullscreen .game-shell__stage,
.game-shell:-webkit-full-screen .game-shell__stage {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  align-self: stretch;
  justify-self: stretch;
  border-radius: 0.65rem;
  overflow: hidden;
  line-height: 0;
  background: #12171f;
}

.game-shell.is-game-fs #game-canvas,
.game-shell:fullscreen #game-canvas,
.game-shell:-webkit-full-screen #game-canvas {
  /* Wyśrodkowany contain — wypełnia stage, nic nie ucina z prawej */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 960 / 540;
  object-fit: contain;
  /* wymuś skalowanie od środka, nie od lewego górnego */
  margin: 0;
}

.game-shell.is-game-fs .game-shell__side,
.game-shell:fullscreen .game-shell__side,
.game-shell:-webkit-full-screen .game-shell__side {
  position: relative;
  z-index: 6;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  padding: 0.35rem 0.4rem 0.4rem;
  border-radius: 0.75rem;
  background:
    linear-gradient(180deg, rgba(200, 245, 66, 0.06), transparent 50%),
    rgba(0, 0, 0, 0.88);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
  align-self: end;
}

.game-shell.is-game-fs .upgrades__head,
.game-shell:fullscreen .upgrades__head,
.game-shell:-webkit-full-screen .upgrades__head {
  display: none;
}

.game-shell.is-game-fs .upgrades__list,
.game-shell:fullscreen .upgrades__list,
.game-shell:-webkit-full-screen .upgrades__list {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  padding: 0.1rem 0.15rem 0.2rem;
  scrollbar-width: thin;
}

.game-shell.is-game-fs .upgrade,
.game-shell:fullscreen .upgrade,
.game-shell:-webkit-full-screen .upgrade {
  flex: 0 0 auto;
  width: min(42vw, 150px);
  scroll-snap-align: start;
  min-height: 58px;
  padding: 0.55rem 0.6rem;
}

.game-shell.is-game-fs .upgrade__desc,
.game-shell:fullscreen .upgrade__desc,
.game-shell:-webkit-full-screen .upgrade__desc {
  display: none;
}

.game-shell.is-game-fs .game-shovel-btn,
.game-shell:fullscreen .game-shovel-btn,
.game-shell:-webkit-full-screen .game-shovel-btn {
  bottom: max(0.45rem, env(safe-area-inset-bottom, 0px));
}

/* W FS tylko ikona — nie zasłania ulepszeń ani gry */
.game-shell.is-game-fs .game-fs-btn,
.game-shell:fullscreen .game-fs-btn,
.game-shell:-webkit-full-screen .game-fs-btn {
  top: max(0.4rem, env(safe-area-inset-top, 0px));
  left: max(0.4rem, env(safe-area-inset-left, 0px));
  min-width: 44px;
  min-height: 44px;
  padding: 0.55rem;
  gap: 0;
}

.game-shell.is-game-fs .game-fs-btn__label,
.game-shell:fullscreen .game-fs-btn__label,
.game-shell:-webkit-full-screen .game-fs-btn__label {
  display: none;
}

.game-shell.is-game-fs .game-pause-btn.is-next,
.game-shell:fullscreen .game-pause-btn.is-next,
.game-shell:-webkit-full-screen .game-pause-btn.is-next {
  left: auto;
  right: max(0.4rem, env(safe-area-inset-right, 0px));
  width: auto;
  max-width: min(52%, 11rem);
}

.game-shovel-btn {
  position: absolute;
  left: max(0.65rem, env(safe-area-inset-left, 0px));
  bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
  z-index: 3;
  min-height: 52px;
  min-width: 88px;
  padding: 0.55rem 0.85rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, #c4a574 55%, var(--line));
  background:
    linear-gradient(180deg, rgba(196, 165, 116, 0.22), transparent 55%),
    rgba(8, 10, 9, 0.92);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  cursor: pointer;
  display: grid;
  gap: 0.1rem;
  justify-items: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow: hidden;
}

.game-shovel-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  transform: scaleY(var(--cd, 0));
  transform-origin: bottom;
  pointer-events: none;
  transition: transform 0.15s linear;
}

.game-shovel-btn > * {
  position: relative;
  z-index: 1;
}

.game-shovel-btn__label {
  font-size: 0.95rem;
}

.game-shovel-btn__cd {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}

.game-shovel-btn.is-ready {
  border-color: var(--accent);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.35),
    0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.game-shovel-btn.is-ready .game-shovel-btn__cd {
  color: var(--accent);
}

.game-shovel-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.game-shovel-btn.is-locked {
  opacity: 0.9;
  border-color: color-mix(in srgb, #888 40%, var(--line));
  background:
    linear-gradient(180deg, rgba(80, 80, 80, 0.2), transparent 55%),
    rgba(8, 10, 9, 0.92);
  cursor: not-allowed;
}

.game-shovel-btn.is-locked::before {
  transform: scaleY(1);
  background: rgba(0, 0, 0, 0.55);
}

.game-shovel-btn__lock {
  display: grid;
  place-items: center;
  color: #c4c4c4;
  line-height: 0;
}

.game-shovel-btn__lock[hidden] {
  display: none !important;
}

.game-shovel-btn.is-locked .game-shovel-btn__cd {
  color: #b0b0b0;
}

.game-shovel-btn.is-locked .game-shovel-btn__label {
  color: #c8c8c8;
}

.game-shell__side {
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background:
    linear-gradient(180deg, rgba(200, 245, 66, 0.04), transparent 40%),
    rgba(0, 0, 0, 0.38);
  padding: 1.05rem 0.95rem;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.upgrades__head h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  letter-spacing: -0.03em;
}
.upgrades__head p {
  margin: 0 0 0.95rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.upgrades__list {
  display: grid;
  gap: 0.55rem;
}

.upgrade {
  display: grid;
  gap: 0.15rem;
  text-align: left;
  padding: 0.75rem 0.8rem;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.upgrade:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: rgba(200, 245, 66, 0.07);
  transform: translateY(-1px);
}
.upgrade:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.upgrade.is-max {
  opacity: 0.7;
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
}
.upgrade__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
}
.upgrade__desc {
  color: var(--muted);
  font-size: 0.78rem;
}
.upgrade__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

/* —— Game over overlay —— */
.game-over-ui {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  box-sizing: border-box;
  overflow: hidden;
  background:
    radial-gradient(80% 70% at 50% 40%, rgba(90, 28, 18, 0.45), transparent 70%),
    rgba(4, 5, 4, 0.72);
  pointer-events: auto;
  animation: game-over-in 0.35s var(--ease) both;
}

@keyframes game-over-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.game-over-ui[hidden] {
  display: none !important;
}

.game-over-ui__card {
  position: relative;
  width: min(92%, 320px);
  max-height: calc(100% - 0.5rem);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 0.9rem 0.8rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, #e0a85a 28%, var(--line));
  background:
    linear-gradient(165deg, rgba(42, 28, 18, 0.55) 0%, transparent 42%),
    linear-gradient(180deg, #16140f 0%, #0e100d 100%);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 230, 180, 0.08);
  text-align: center;
  animation: game-over-card-in 0.4s var(--ease) both;
}

@keyframes game-over-card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.game-over-ui__glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 60%;
  background: radial-gradient(ellipse at center, rgba(200, 245, 66, 0.1), transparent 65%);
  pointer-events: none;
}

.game-over-ui__eyebrow {
  position: relative;
  margin: 0 0 0.2rem;
  color: #e0a85a;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.game-over-ui__title {
  position: relative;
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  background: linear-gradient(180deg, #fff6e8 20%, #e0a85a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.game-over-ui__stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0 0 0.75rem;
}

.game-over-ui__stat {
  padding: 0.45rem 0.25rem 0.4rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
}

.game-over-ui__stat-val {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1.1;
}

.game-over-ui__stat-lbl {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.game-over-ui__form {
  position: relative;
  display: grid;
  gap: 0.35rem;
  text-align: left;
}

.game-over-ui__label {
  display: block;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e0a85a;
  line-height: 1.2;
}

.game-over-ui__input {
  display: block;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, #e0a85a 25%, var(--line));
  background: rgba(0, 0, 0, 0.4);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.game-over-ui__input::placeholder {
  color: rgba(154, 168, 154, 0.55);
}

.game-over-ui__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 245, 66, 0.15);
}

.game-over-ui__input:disabled {
  opacity: 0.65;
}

.game-over-ui__msg {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

.game-over-ui__msg[hidden] {
  display: none !important;
}

.game-over-ui__msg.is-error {
  color: #ff8a7a;
}

.game-over-ui__actions {
  position: relative;
  display: grid;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.game-over-ui__btn {
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: -0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.game-over-ui__btn--primary {
  background: linear-gradient(180deg, #d8ff6a, var(--accent));
  color: #10140c;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(200, 245, 66, 0.2);
}

.game-over-ui__btn--ghost {
  background: transparent;
  border-color: color-mix(in srgb, #e0a85a 35%, var(--line));
  color: #f0d9a8;
}

.game-over-ui__btn:disabled {
  opacity: 0.7;
  cursor: default;
  box-shadow: none;
}

.game-over-ui.is-saved .game-over-ui__btn--primary {
  background: color-mix(in srgb, var(--accent) 35%, #1a1e14);
  color: var(--accent);
}

/* —— Leaderboard —— */
.leaderboard__head h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.leaderboard__head p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.leaderboard__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.leaderboard__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leaderboard__table th,
.leaderboard__table td {
  padding: 0.55rem 0.45rem;
  text-align: left;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.leaderboard__table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.leaderboard__table td:first-child,
.leaderboard__table th:first-child {
  width: 2.2rem;
  color: var(--accent);
  font-weight: 800;
}

.leaderboard__table tbody tr:hover td {
  background: rgba(200, 245, 66, 0.04);
}

/* —— Mobile —— */
@media (max-width: 900px) {
  .game-section {
    padding-block: 2.25rem;
  }

  .game-section .container {
    padding-inline: 0.75rem;
    max-width: 100%;
  }

  .game-section .lead {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .game-shell {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .game-shell__stage {
    border-radius: 0.9rem;
  }

  .game-shell__side {
    min-height: 0;
    padding: 0.85rem 0.8rem;
    border-radius: 0.9rem;
  }

  .upgrades__head h3 {
    font-size: 1rem;
  }

  .upgrades__head p {
    margin-bottom: 0.7rem;
    font-size: 0.78rem;
  }

  .upgrades__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .upgrade {
    padding: 0.7rem 0.65rem;
    min-height: 44px;
  }

  .upgrade__name {
    font-size: 0.84rem;
  }

  .upgrade__desc {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .game-pause-btn {
    top: max(0.5rem, env(safe-area-inset-top, 0px));
    right: max(0.5rem, env(safe-area-inset-right, 0px));
    min-height: 48px;
    padding: 0.7rem 1.05rem;
    font-size: 0.95rem;
  }

  .game-audio-gear {
    top: calc(max(0.5rem, env(safe-area-inset-top, 0px)) + 3.4rem);
    right: max(0.5rem, env(safe-area-inset-right, 0px));
  }

  .game-audio-gear__btn {
    width: 48px;
    height: 48px;
  }

  .game-fs-btn {
    top: max(0.5rem, env(safe-area-inset-top, 0px));
    left: max(0.5rem, env(safe-area-inset-left, 0px));
    min-height: 48px;
    padding: 0.65rem 0.95rem;
    font-size: 0.9rem;
  }

  .game-shovel-btn {
    min-height: 56px;
    min-width: 96px;
    padding: 0.65rem 0.95rem;
  }

  .game-section .rules {
    font-size: 0.88rem;
    gap: 0.45rem;
  }

  .game-section .rules li {
    padding: 0.6rem 0.75rem;
  }
}

@media (max-width: 520px) {
  .game-section .container {
    padding-inline: 0;
  }

  .game-section .eyebrow,
  .game-section .section__title,
  .game-section .lead {
    padding-inline: 0.7rem;
  }

  .game-shell__stage {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .game-shell__side {
    margin-inline: 0.55rem;
  }

  .upgrades__head p {
    display: none;
  }

  .upgrade__desc {
    display: none;
  }

  .upgrades__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upgrade__meta {
    font-size: 0.72rem;
  }

  .game-pause-btn.is-next {
    left: max(0.5rem, env(safe-area-inset-left, 0px));
    right: max(0.5rem, env(safe-area-inset-right, 0px));
    width: auto;
    text-align: center;
  }

  .game-section .rules {
    margin-inline: 0.55rem;
  }
}

/* Landscape phone: gra + ulepszenia obok */
@media (max-width: 900px) and (orientation: landscape) {
  .game-shell {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 200px);
    align-items: stretch;
  }

  #game-canvas {
    max-height: min(82vh, 480px);
    width: auto;
    max-width: 100%;
    margin-inline: auto;
  }

  .upgrades__list {
    grid-template-columns: 1fr;
    max-height: min(78vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .upgrade__desc {
    display: none;
  }

  .game-section .lead,
  .game-section .rules {
    display: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .upgrade:hover:not(:disabled) {
    transform: none;
  }

  .game-pause-btn:hover {
    color: var(--ink);
  }

  .game-pause-btn.is-next:hover {
    color: #0b0d0c;
  }

  .game-fs-btn:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  }

  .game-fs-btn.is-active:hover {
    border-color: var(--accent);
  }
}
