:root {
  --bb-bg: #060913;
  --bb-panel: #151014;
  --bb-panel-strong: #211316;
  --bb-border: rgba(177, 18, 18, 0.32);
  --bb-text: #f7fbff;
  --bb-muted: #b9adb0;
  --bb-red: #8b0000;
  --bb-red-bright: #b11212;
  --bb-red-glow: rgba(177, 18, 18, 0.45);
  --bb-gray-title: #b8bcc2;
  --bb-green: #9ad98f;
  --bb-gold: #f3d74c;
  --bb-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--bb-text);
  background: var(--bb-bg);
}

button,
input {
  font: inherit;
}

button,
.game-header__link,
.game-card {
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--bb-red-bright);
  outline-offset: 3px;
}

.brick-blast-page {
  height: 100vh;
  overflow: hidden;
}

.game-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100vh;
  padding: 14px;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(36, 14, 18, 0.86), rgba(6, 9, 19, 0.94)),
    repeating-linear-gradient(90deg, rgba(177, 18, 18, 0.045) 0 1px, transparent 1px 56px);
}

.game-header,
.scorebar {
  width: min(1380px, 100%);
  margin: 0 auto;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.game-header h1 {
  margin: 0;
  color: var(--bb-gray-title);
  font-size: clamp(1.75rem, 4vw, 3.35rem);
  line-height: 1;
  letter-spacing: 0;
}

.arcade-title {
  margin: 0;
  max-width: 100%;
  color: var(--bb-red-bright);
  font-size: clamp(2rem, 4.2vw, 3.55rem);
  line-height: 0.95;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 0 0 28px var(--bb-red-glow), 0 8px 34px rgba(0, 0, 0, 0.5);
}

.game-header__eyebrow,
.games-landing__eyebrow,
.game-panel__eyebrow,
.game-card__kicker {
  margin: 0 0 4px;
  color: var(--bb-red-bright);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-header__eyebrow {
  font-size: clamp(1rem, 2.2vw, 1.55rem);
  letter-spacing: 0.1em;
  text-shadow: 0 0 20px var(--bb-red-glow);
}

.games-landing__eyebrow {
  color: var(--bb-muted);
}

.game-header__link,
.game-card {
  color: var(--bb-text);
  text-decoration: none;
}

.game-header__link {
  border: 1px solid var(--bb-border);
  border-radius: 6px;
  padding: 10px 14px;
  background: rgba(16, 24, 38, 0.74);
}

.game-header__link:hover,
.game-card:hover {
  transform: translateY(-2px);
  border-color: rgba(177, 18, 18, 0.8);
}

.scorebar {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr)) minmax(190px, 1.45fr);
  gap: 8px;
}

.scorebar__item {
  min-width: 0;
  border: 1px solid var(--bb-border);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(16, 24, 38, 0.82);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.scorebar__item span {
  display: block;
  margin-bottom: 2px;
  color: var(--bb-muted);
  font-size: 0.74rem;
}

.scorebar__item strong {
  display: block;
  overflow: hidden;
  color: var(--bb-text);
  font-size: clamp(0.88rem, 2vw, 1.12rem);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  width: min(1380px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(177, 18, 18, 0.34);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 0%, rgba(177, 18, 18, 0.18), transparent 44%), #08070b;
  box-shadow: var(--bb-shadow);
}

.game-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  background: #07101f;
}

.game-shell.is-playing .play-stage,
.game-shell.is-playing .game-canvas {
  cursor: none;
}

.game-panel {
  position: absolute;
  z-index: 3;
  width: min(440px, calc(100% - 32px));
  border: 1px solid rgba(177, 18, 18, 0.52);
  border-radius: 8px;
  padding: 24px;
  background: rgba(21, 16, 20, 0.95);
  box-shadow: var(--bb-shadow);
}

.game-panel--compact {
  text-align: center;
}

.game-panel h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 5vw, 2.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.game-panel p {
  margin: 0 0 18px;
  color: var(--bb-muted);
  line-height: 1.5;
}

.name-form {
  display: grid;
  gap: 10px;
}

.name-form label {
  color: var(--bb-text);
  font-weight: 750;
}

.name-form input {
  width: 100%;
  border: 1px solid var(--bb-border);
  border-radius: 6px;
  padding: 12px;
  color: var(--bb-text);
  background: #07101f;
}

.form-error {
  min-height: 1.3em;
  margin: 0;
  color: #ffb8b8;
}

button {
  border: 1px solid rgba(255, 214, 214, 0.18);
  border-radius: 6px;
  padding: 11px 14px;
  color: #fff6f6;
  font-weight: 850;
  background: var(--bb-red-bright);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(139, 0, 0, 0.28);
}

button:hover {
  transform: translateY(-1px);
  background: #c81818;
}

.touch-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: none;
  gap: 8px;
}

.touch-controls button {
  min-width: 74px;
  opacity: 0.82;
}

.is-hidden {
  display: none;
}

.games-landing {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(34, 12, 16, 0.92), rgba(6, 9, 19, 0.98)),
    repeating-linear-gradient(0deg, rgba(177, 18, 18, 0.045) 0 1px, transparent 1px 42px);
}

.games-landing__shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(32px, 8vw, 76px) 0;
}

.games-landing__intro {
  max-width: 720px;
  margin-bottom: 32px;
}

.games-landing__intro p:last-child {
  max-width: 560px;
  color: var(--bb-muted);
  font-size: 1.1rem;
  line-height: 1.55;
}

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

.game-card {
  display: grid;
  min-height: 220px;
  align-content: end;
  gap: 10px;
  border: 1px solid var(--bb-border);
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(145deg, rgba(177, 18, 18, 0.2), transparent 54%),
    rgba(21, 16, 20, 0.86);
  box-shadow: var(--bb-shadow);
}

.game-card__title {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.game-card__copy {
  color: var(--bb-muted);
  line-height: 1.45;
}

.game-card__score {
  color: var(--bb-text);
  font-weight: 800;
  line-height: 1.35;
}

.game-card__action {
  color: var(--bb-green);
  font-weight: 850;
}

@media (max-width: 760px) {
  .game-shell {
    padding: 10px;
    gap: 8px;
  }

  .game-header h1 {
    font-size: 1.85rem;
  }

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

  .scorebar__item--wide {
    grid-column: 1 / -1;
  }

  .touch-controls {
    display: flex;
  }

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

  .game-panel {
    padding: 18px;
  }
}

@media (max-width: 420px) {
  .arcade-title {
    font-size: clamp(1.72rem, 8vw, 2.25rem);
    white-space: normal;
  }

  .game-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .scorebar__item {
    padding: 7px 8px;
  }
}
