.brick-hero {
  min-height: auto;
  padding-bottom: 42px;
}

.brick-emblem {
  flex: 0 1 360px;
  position: relative;
  min-height: 300px;
  display: grid;
  place-items: center;
}

.brick-emblem::before {
  content: "";
  position: absolute;
  width: min(78vw, 330px);
  aspect-ratio: 1;
  border: 2px solid rgba(120, 255, 154, 0.46);
  transform: rotate(-9deg);
  box-shadow: 0 0 42px rgba(120, 255, 154, 0.16), inset 0 0 34px rgba(66, 232, 255, 0.12);
}

.brick-emblem span {
  position: relative;
  font-size: clamp(110px, 19vw, 180px);
  filter: drop-shadow(0 22px 24px rgba(0, 0, 0, 0.38)) drop-shadow(0 0 26px rgba(255, 79, 163, 0.3));
  animation: brickFloat 3.4s infinite ease-in-out;
}

@keyframes brickFloat {
  0%,
  100% {
    transform: translateY(0) rotate(3deg);
  }

  50% {
    transform: translateY(-10px) rotate(-4deg);
  }
}

.brick-game {
  width: min(calc(100% - 40px), 1040px);
  max-width: 1040px;
  margin: 0 auto 92px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)), var(--panel);
  box-shadow: 10px 10px 0 var(--shadow), 0 0 42px rgba(66, 232, 255, 0.12);
}

.brick-settings {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.brick-settings label {
  color: var(--cyan);
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  line-height: 1.4;
  text-transform: uppercase;
}

.brick-select-wrapper {
  position: relative;
  flex: 0 0 184px;
  display: block;
}

.brick-select-wrapper::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 9px;
  height: 9px;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
  filter: drop-shadow(0 0 6px rgba(66, 232, 255, 0.35));
}

#brick-difficulty {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  min-height: 50px;
  padding: 0 48px 0 16px;
  border: 2px solid var(--cyan);
  border-radius: 6px;
  background: linear-gradient(135deg, #111022, #151329);
  color: var(--ink);
  font: 600 15px "Poppins", sans-serif;
  box-shadow: 5px 5px 0 var(--shadow), 0 0 22px rgba(66, 232, 255, 0.18);
  cursor: pointer;
}

#brick-difficulty:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

#brick-difficulty:focus {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

#brick-difficulty option {
  background: #151329;
  color: var(--ink);
}

.brick-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 124px), 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.hud-tile {
  min-width: 0;
  min-height: 74px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(8, 7, 20, 0.38);
  display: grid;
  place-items: center;
}

.hud-tile span {
  color: var(--cyan);
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  line-height: 1.4;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.hud-tile strong {
  color: var(--yellow);
  font-family: "Press Start 2P", cursive;
  font-size: clamp(16px, 2.6vw, 26px);
  line-height: 1.2;
}

.brick-arena {
  position: relative;
  width: min(100%, 720px);
  margin: 0 auto;
  aspect-ratio: 36 / 23;
  border: 2px solid rgba(66, 232, 255, 0.68);
  border-radius: 8px;
  overflow: hidden;
  background: #0f0e1d;
  box-shadow: 8px 8px 0 var(--shadow), 0 0 28px rgba(66, 232, 255, 0.18);
}

.brick-arena.shake {
  animation: brickShake 0.24s steps(2, end);
}

#brick-board {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(145deg, #111022, #17152b);
  background-size: 30px 30px, 30px 30px, auto;
}

.game-overlay {
  position: absolute;
  inset: 0;
  padding: clamp(18px, 4vw, 28px);
  display: grid;
  place-content: center;
  gap: 12px;
  background: rgba(8, 7, 20, 0.68);
  backdrop-filter: blur(3px);
  color: var(--muted);
  text-align: center;
}

.game-overlay.hidden {
  display: none;
}

.game-overlay h2 {
  color: var(--yellow);
  font-family: "Press Start 2P", cursive;
  font-size: clamp(20px, 4vw, 34px);
  line-height: 1.3;
  text-shadow: 3px 3px 0 var(--shadow);
}

.game-overlay p {
  max-width: 36ch;
  margin: 0 auto;
  color: var(--muted);
}

.game-overlay .overlay-score {
  color: var(--green);
  font-family: "Press Start 2P", cursive;
  font-size: 13px;
  line-height: 1.5;
}

.brick-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.brick-actions .btn {
  margin-top: 0;
}

.btn-secondary {
  border-color: rgba(66, 232, 255, 0.62);
  background: linear-gradient(135deg, rgba(66, 232, 255, 0.3), rgba(255, 255, 255, 0.08));
  color: var(--ink);
}

.btn-secondary::after {
  content: "";
  margin-left: 0;
}

.brick-touch {
  width: min(100%, 190px);
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: repeat(2, 84px);
  justify-content: center;
  gap: 10px;
}

.brick-touch button {
  width: 84px;
  height: 58px;
  border: 2px solid rgba(255, 216, 77, 0.58);
  border-radius: 8px;
  background: rgba(8, 7, 20, 0.58);
  color: var(--ink);
  font-size: 22px;
  box-shadow: 5px 5px 0 var(--shadow), 0 0 18px rgba(255, 216, 77, 0.12);
  cursor: pointer;
}

.brick-touch button:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--shadow);
}

@keyframes brickShake {
  0%,
  100% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(4px, -3px);
  }

  50% {
    transform: translate(-3px, 4px);
  }

  75% {
    transform: translate(3px, 2px);
  }
}

@media (max-width: 830px) {
  .brick-hero {
    flex-direction: column;
    padding-top: 44px;
    padding-bottom: 35px;
    gap: 28px;
    text-align: center;
  }

  .brick-hero .hero-content p:last-child {
    margin-bottom: 0;
  }

  .brick-emblem {
    width: min(100%, 320px);
    flex-basis: auto;
    min-height: 264px;
  }

  .brick-emblem::before {
    width: min(54vw, 230px);
  }

  .brick-emblem span {
    font-size: clamp(80px, 18vw, 116px);
  }

  .brick-game {
    width: min(calc(100% - 40px), 1040px);
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 560px) {
  .brick-game {
    width: min(calc(100% - 32px), 1040px);
    margin-left: auto;
    margin-right: auto;
    padding: 18px;
  }

  .brick-hud {
    grid-template-columns: repeat(2, 1fr);
  }

  .brick-settings {
    align-items: stretch;
    flex-direction: column;
  }

  .brick-select-wrapper {
    flex-basis: auto;
  }

  .brick-actions .btn {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .brick-hud {
    grid-template-columns: 1fr;
  }
}
