/**
 * Bomb Maze v1.4.0 — Readable Stylesheet
 * Responsive game layout, menu, HUD, dialogs, controls, and effects.
 * Copyright © Krishna Apps.
 */

:root {
  --bg: #171535;
  --panel: rgba(25, 22, 58, .86);
  --panel-2: rgba(45, 39, 92, .78);
  --line: rgba(255, 255, 255, .13);
  --text: #f8f7ff;
  --muted: #c7c2e8;
  --cyan: #62e9ff;
  --pink: #ff5ea8;
  --yellow: #ffd95e;
  --green: #78f0ad;
  --danger: #ff626f;
  --radius: 22px;
  --shadow: 0 18px 70px rgba(4, 3, 20, .45);
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

body {
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus,
button:focus-visible {
  outline: none;
}

button:focus-visible {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

canvas:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.fatal-noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: #171535;
  color: white;
  z-index: 999;
}

.app,
.screen {
  position: fixed;
  inset: 0;
}

.screen {
  min-width: 280px;
}

.glass-panel {
  background: linear-gradient(145deg, rgba(62, 54, 126, .68), rgba(19, 17, 49, .85));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.game-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .3));
}

/* Loader */
.loading-screen {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #453a9f 0, transparent 34%), radial-gradient(circle at 75% 70%, #b72a80 0, transparent 35%), #171535;
}

.loading-screen::before {
  content: "";
  position: absolute;
  inset: -40%;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 42px 42px;
  transform: perspective(500px) rotateX(55deg) translateY(25%);
  animation: gridFlow 8s linear infinite;
}

.loading-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .55;
  animation: floatOrb 5s ease-in-out infinite alternate;
}

.orb-a {
  width: 140px;
  height: 140px;
  background: #62e9ff;
  left: 8%;
  top: 12%;
}

.orb-b {
  width: 110px;
  height: 110px;
  background: #ff5ea8;
  right: 10%;
  bottom: 12%;
  animation-delay: -2s;
}

.orb-c {
  width: 70px;
  height: 70px;
  background: #ffd95e;
  right: 18%;
  top: 16%;
  animation-delay: -3s;
}

.loader-card {
  z-index: 1;
  width: min(470px, calc(100vw - 36px));
  padding: 38px 34px 32px;
  border-radius: 30px;
  text-align: center;
}

.loading-logo {
  width: 132px;
  height: 132px;
  animation: logoPulse 1.8s ease-in-out infinite;
}

.loader-card h1 {
  margin: 5px 0 0;
  font-size: clamp(2.1rem, 7vw, 3.25rem);
  letter-spacing: -.06em;
}

.loader-card .subtitle {
  margin: -3px 0 28px;
  font-weight: 800;
  letter-spacing: .38em;
  text-transform: uppercase;
  font-size: .77rem;
  color: var(--cyan);
}

.progress-wrap {
  text-align: left;
}

.progress-bar {
  height: 15px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .27);
  border: 1px solid rgba(255, 255, 255, .12);
  overflow: hidden;
}

.progress-bar span {
  position: relative;
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--pink), var(--yellow));
  box-shadow: 0 0 18px rgba(98, 233, 255, .75);
  transition: width .08s linear;
  will-change: width;
  overflow: hidden;
}

.progress-bar span::after {
  content: "";
  position: absolute;
  inset: -4px -35px;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .7) 48%, transparent 70%);
  animation: loaderShine .9s linear infinite;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: .9rem;
}

.progress-meta strong {
  color: white;
  min-width: 45px;
}

.loading-error {
  color: #ffd2d7;
  background: rgba(255, 70, 90, .12);
  border: 1px solid rgba(255, 100, 120, .3);
  border-radius: 12px;
  padding: 10px;
}

/* Menu */
.menu-screen {
  overflow: auto;
  background: #15132f;
  touch-action: pan-y;
}

.menu-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.menu-shell {
  position: relative;
  z-index: 2;
  width: min(1080px, 100%);
  min-height: 100%;
  margin: auto;
  padding:
    max(24px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.menu-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 14px;
}

.menu-brand h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.6rem);
  letter-spacing: -.07em;
  line-height: .9;
}

.menu-brand p {
  margin: 8px 0 0;
  color: var(--cyan);
  text-transform: uppercase;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .38em;
}

.mascot-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 18px;
  border-radius: 18px;
  margin: 5px 0 18px;
  width: max-content;
  max-width: 100%;
}

.mascot-card>div:last-child {
  display: flex;
  flex-direction: column;
}

.mascot-card span {
  color: var(--muted);
  font-size: .87rem;
}

.mascot-orb {
  width: 47px;
  height: 47px;
  border-radius: 50%;
  position: relative;
  flex: none;
  background: radial-gradient(circle at 32% 27%, #6879ee, #252353 68%);
  border: 3px solid white;
  box-shadow: 0 0 18px rgba(98, 233, 255, .4);
}

.mascot-orb .eye {
  position: absolute;
  top: 14px;
  width: 7px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
}

.mascot-orb .left {
  left: 11px;
}

.mascot-orb .right {
  right: 11px;
}

.mascot-orb .smile {
  position: absolute;
  width: 17px;
  height: 8px;
  border-bottom: 3px solid white;
  border-radius: 50%;
  left: 12px;
  top: 25px;
}

.mascot-orb .spark {
  position: absolute;
  right: -11px;
  top: -11px;
  color: var(--yellow);
  font-size: 22px;
  animation: spin 3s linear infinite;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.menu-btn {
  position: relative;
  min-height: 106px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 16px 15px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(54, 47, 107, .76), rgba(26, 23, 64, .92));
  box-shadow: 0 9px 24px rgba(7, 5, 28, .25);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.menu-btn::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  right: -35px;
  bottom: -50px;
  transition: transform .25s ease;
}

.menu-btn:hover {
  transform: translateY(-4px);
  border-color: rgba(98, 233, 255, .55);
  box-shadow: 0 15px 36px rgba(7, 5, 28, .4), 0 0 22px rgba(98, 233, 255, .08);
}

.menu-btn:active {
  transform: translateY(1px) scale(.985);
}

.menu-btn:hover::after {
  transform: scale(1.45);
}

.menu-btn>span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .1);
  color: var(--cyan);
  font-weight: 900;
  margin-bottom: 8px;
}

.menu-btn b {
  display: block;
  font-size: 1.04rem;
}

.menu-btn small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-btn.primary {
  background: linear-gradient(135deg, #3a85ff, #8254e8);
  border-color: rgba(255, 255, 255, .24);
}

.menu-btn.primary>span {
  background: white;
  color: #5f58dc;
}

.menu-btn.accent {
  background: linear-gradient(135deg, #cf347b, #7a3ccf);
}

.menu-footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, .55);
  font-size: .78rem;
}

/* Game */
.game-screen {
  display: flex;
  flex-direction: column;
  background: #0d0c20;
}

.hud {
  min-height: 76px;
  padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(27, 24, 64, .98), rgba(18, 16, 44, .96));
  border-bottom: 1px solid var(--line);
  z-index: 5;
}

.hud-player {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 150px;
}

.hud-player .avatar {
  width: 43px;
  height: 43px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 25%, #9d9cff, #3d3c8b 65%);
  border: 2px solid white;
  box-shadow: 0 0 14px rgba(98, 233, 255, .25);
}

.hud-player>div:last-child {
  display: flex;
  flex-direction: column;
}

.hud-player strong {
  font-size: .88rem;
}

.hud-player span {
  font-size: .68rem;
  color: var(--cyan);
}

.hud-stat {
  min-width: 68px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 13px;
  text-align: center;
}

.hud-stat small {
  display: block;
  color: var(--muted);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.hud-stat b {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.hud-pills {
  display: flex;
  gap: 5px;
}

.hud-pills span {
  padding: 8px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  font-size: .78rem;
  white-space: nowrap;
}

.active-powers {
  display: flex;
  gap: 5px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.power-chip {
  position: relative;
  min-width: 40px;
  height: 40px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .09);
  display: grid;
  place-items: center;
  font-size: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
}

.power-chip i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--cyan);
}

.icon-btn {
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 13px;
  background: rgba(255, 255, 255, .07);
  cursor: pointer;
  font-weight: 900;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, .13);
}

.game-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0d0c20;
}

#gameCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
  image-rendering: auto;
}

.stage-banner {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  padding: 10px 28px;
  border-radius: 999px;
  background: rgba(18, 16, 44, .88);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  animation: bannerIn .55s cubic-bezier(.2, 1.4, .4, 1);
  text-align: center;
  pointer-events: none;
}

.stage-banner small {
  display: block;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 900;
  font-size: .61rem;
}

.stage-banner strong {
  font-size: 1.04rem;
}

.combo-display {
  position: absolute;
  right: 24px;
  top: 24px;
  font-size: clamp(1.4rem, 4vw, 2.5rem);
  font-weight: 1000;
  font-style: italic;
  text-shadow: 0 5px 15px rgba(0, 0, 0, .4);
  pointer-events: none;
}

.combo-pop {
  animation: comboPop .65s ease both;
}

.damage-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, transparent 35%, rgba(255, 30, 70, .7));
}

.damage-overlay.flash {
  animation: damageFlash .38s ease;
}

.mobile-controls {
  display: none;
  min-height: 178px;
  padding: 10px max(18px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: linear-gradient(180deg, #171535, #111027);
  border-top: 1px solid var(--line);
}

.move-cluster,
.action-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.dpad {
  width: 154px;
  height: 154px;
  display: grid;
  grid-template: repeat(3, 1fr)/repeat(3, 1fr);
  gap: 3px;
  padding: 7px;
  border-radius: 50%;
  touch-action: none;
  background: radial-gradient(circle, rgba(91, 83, 176, .38), rgba(21, 19, 54, .92) 70%);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, .3), 0 9px 22px rgba(0, 0, 0, .24);
}

.touch-btn {
  border: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(145deg, rgba(78, 70, 150, .86), rgba(35, 31, 79, .97));
  border-radius: 14px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .1), 0 4px 10px rgba(0, 0, 0, .22);
  font-weight: 1000;
  touch-action: none;
}

.joystick-pad .touch-btn {
  pointer-events: none;
  transition: transform .08s ease, filter .08s ease, background .08s ease;
}

.touch-btn:active,
.touch-btn.pressed {
  transform: scale(.92);
  filter: brightness(1.35);
  background: linear-gradient(145deg, rgba(98, 233, 255, .65), rgba(66, 58, 145, .98));
}

.dpad .up {
  grid-area: 1/2;
  border-radius: 18px 18px 10px 10px;
}

.dpad .left {
  grid-area: 2/1;
  border-radius: 18px 10px 10px 18px;
}

.dpad .center {
  grid-area: 2/2;
  color: var(--cyan);
  opacity: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}

.dpad .right {
  grid-area: 2/3;
  border-radius: 10px 18px 18px 10px;
}

.dpad .down {
  grid-area: 3/2;
  border-radius: 10px 10px 18px 18px;
}

.joystick-knob {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: transform .08s ease;
  background: radial-gradient(circle at 35% 28%, #8b91ff, #3a397e 70%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
}

.joystick-knob[data-dir="up"] {
  transform: translateY(-7px);
}

.joystick-knob[data-dir="down"] {
  transform: translateY(7px);
}

.joystick-knob[data-dir="left"] {
  transform: translateX(-7px);
}

.joystick-knob[data-dir="right"] {
  transform: translateX(7px);
}

.control-hint {
  color: rgba(255, 255, 255, .62);
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.action-pad {
  justify-content: center;
}

.action-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 112px;
}

.touch-btn.bomb {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 25%, #ff8cc2, #d32d79 45%, #7e1b57);
  border: 0;
  box-shadow: 0 11px 25px rgba(0, 0, 0, .3), inset 0 3px 4px rgba(255, 255, 255, .2);
}

.touch-btn.bomb span {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
}

.touch-btn.bomb small {
  font-size: .68rem;
  letter-spacing: .12em;
}

.touch-btn.remote {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(145deg, #53e5ff, #5268db);
  font-size: 1.5rem;
}

/* Modals */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 6, 22, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn .2s ease;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: min(86vh, 850px);
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 30px;
  border-radius: 28px;
  background: linear-gradient(150deg, #322d6b, #171535 66%);
  border: 1px solid rgba(255, 255, 255, .15);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
  animation: modalIn .28s cubic-bezier(.2, 1.15, .3, 1);
}

.modal-panel.large {
  width: min(880px, 100%);
}

.modal-panel.closing {
  animation: modalOut .18s ease forwards;
}

.modal-x {
  position: absolute;
  right: 15px;
  top: 15px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .07);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #5c7dff, #ba3caf);
  font-size: 1.75rem;
  box-shadow: 0 10px 25px rgba(71, 55, 180, .3);
}

.modal-panel h2 {
  margin: 13px 0 17px;
  font-size: clamp(1.65rem, 5vw, 2.25rem);
  letter-spacing: -.045em;
}

.modal-body {
  color: var(--muted);
  line-height: 1.55;
}

.modal-body p {
  margin: 0 0 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 23px;
}

.action-btn {
  min-height: 44px;
  border-radius: 14px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .075);
  cursor: pointer;
  font-weight: 800;
}

.action-btn.primary {
  background: linear-gradient(135deg, #547eff, #9c48dc);
  border-color: rgba(255, 255, 255, .22);
}

.action-btn.danger {
  background: linear-gradient(135deg, #d93667, #9e2857);
}

.action-btn:hover {
  filter: brightness(1.15);
}

.settings-tabs {
  display: flex;
  gap: 5px;
  overflow: auto;
  margin: -4px 0 18px;
  padding-bottom: 5px;
}

.settings-tabs button {
  flex: 1;
  min-width: 105px;
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
}

.settings-tabs button.active {
  background: rgba(98, 233, 255, .16);
  color: var(--cyan);
}

.settings-grid {
  display: grid;
  gap: 10px;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(130px, 1fr);
  gap: 16px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .045);
  border-radius: 14px;
}

.setting-row label {
  color: white;
  font-weight: 700;
  font-size: .88rem;
}

.setting-row small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}

.setting-row input[type=range] {
  width: 100%;
  accent-color: #6fe7ff;
}

.setting-row select {
  width: 100%;
  background: #242052;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 10px;
  padding: 8px;
  color: white;
}

.toggle {
  justify-self: end;
  position: relative;
  width: 48px;
  height: 28px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #4b4766;
  cursor: pointer;
  transition: .2s;
}

.toggle span::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  left: 4px;
  top: 4px;
  transition: .2s;
}

.toggle input:checked+span {
  background: #5a8cff;
}

.toggle input:checked+span::after {
  transform: translateX(20px);
}

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

.info-card {
  padding: 13px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .07);
}

.info-card b {
  display: block;
  color: white;
  margin-bottom: 4px;
}

.info-card small {
  color: var(--muted);
}

.achievement-card {
  opacity: .5;
}

.achievement-card.unlocked {
  opacity: 1;
  background: rgba(255, 217, 94, .08);
  border-color: rgba(255, 217, 94, .22);
}

.level-button {
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  cursor: pointer;
}

.level-button.locked {
  opacity: .35;
  cursor: not-allowed;
}

.level-button strong {
  display: block;
}

.level-button small {
  color: var(--muted);
}

.result-score {
  font-size: clamp(2.5rem, 10vw, 4.4rem);
  font-weight: 1000;
  text-align: center;
  color: white;
  letter-spacing: -.06em;
  margin: 5px 0 16px;
  text-shadow: 0 0 30px rgba(98, 233, 255, .25);
}

.result-breakdown {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.result-breakdown div {
  padding: 10px 12px;
  background: rgba(255, 255, 255, .05);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
}

.new-record {
  color: var(--yellow);
  font-weight: 900;
  text-align: center;
  animation: logoPulse 1s ease-in-out infinite;
}

/* Enhanced How to Play and Credits */
.how-hero {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(84, 126, 255, .18), rgba(255, 94, 168, .12));
  border: 1px solid rgba(255, 255, 255, .09);
  margin-bottom: 14px;
}

.how-hero-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: radial-gradient(circle at 32% 25%, #ff87be, #d32d79 48%, #65204d);
  font-size: 2rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .25);
}

.how-hero h3 {
  margin: 0 0 4px;
  color: white;
  font-size: 1.2rem;
}

.how-hero p {
  margin: 0;
  color: var(--muted);
}

.how-section-title {
  margin: 18px 0 9px;
  color: white;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.how-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.how-step {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, .07);
}

.how-step span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0 auto 7px;
  border-radius: 11px;
  background: rgba(98, 233, 255, .13);
  color: var(--cyan);
  font-weight: 1000;
}

.how-step b {
  display: block;
  color: white;
  font-size: .86rem;
}

.how-step small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .72rem;
}

.control-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.control-chip {
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .07);
  font-size: .78rem;
  color: var(--muted);
}

.control-chip kbd {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 25px;
  padding: 0 6px;
  margin-right: 5px;
  border-radius: 7px;
  background: #f5f2ff;
  color: #29234f;
  font: 800 .72rem ui-monospace, monospace;
  box-shadow: 0 2px 0 #aaa4ca;
}

.tip-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tip-list li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  color: var(--muted);
}

.tip-list b {
  color: var(--yellow);
}

.credit-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(84, 126, 255, .14), rgba(255, 94, 168, .09));
  border: 1px solid rgba(255, 255, 255, .09);
}

.credit-brand {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 13px;
}

.credit-logo {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, #5c7dff, #ba3caf);
  font-size: 1.45rem;
}

.credit-brand b {
  display: block;
  color: white;
  font-size: 1.1rem;
}

.credit-brand small {
  color: var(--muted);
}

.credit-links {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.credit-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  color: white;
  text-decoration: none;
}

.credit-link:hover {
  background: rgba(255, 255, 255, .11);
}

.credit-link span {
  color: var(--cyan);
  font-weight: 800;
}

.level-select-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.level-page-label {
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}

.level-page-label b {
  display: block;
  color: white;
  font-size: 1rem;
}

.level-jump {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 10px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .045);
}

.level-jump input {
  min-width: 0;
  flex: 1;
  background: #242052;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 10px;
  padding: 9px;
  color: white;
}

/* Toasts and overlays */
.toast-stack {
  position: fixed;
  right: max(15px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  width: min(340px, calc(100vw - 30px));
  padding: 12px 15px;
  border-radius: 16px;
  background: rgba(29, 26, 65, .95);
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: 0 14px 35px rgba(0, 0, 0, .35);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastIn .32s cubic-bezier(.2, 1.2, .35, 1), toastOut .28s ease 3.2s forwards;
}

.toast .toast-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .09);
  font-size: 1.2rem;
}

.toast b {
  display: block;
}

.toast small {
  color: var(--muted);
}

.fps-counter {
  position: fixed;
  left: 9px;
  bottom: 8px;
  z-index: 20;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .55);
  font: 12px ui-monospace, monospace;
  pointer-events: none;
}

.audio-gate {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(28, 25, 65, .94);
  padding: 11px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  cursor: pointer;
  animation: bannerIn .4s ease;
}

/* Accessibility states */
body.large-text {
  font-size: 118%;
}

body.high-contrast {
  --panel: #080812;
  --panel-2: #111123;
  --muted: #fff;
}

body.high-contrast .menu-btn,
body.high-contrast .modal-panel,
body.high-contrast .hud {
  border-color: white;
}

body.colorblind {
  --cyan: #58d7ff;
  --pink: #ff8b2d;
  --yellow: #fff05f;
  --green: #26e0a2;
  --danger: #ff3d57;
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: .001ms !important;
}

@keyframes loaderShine {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(120%);
  }
}

@keyframes gridFlow {
  to {
    transform: perspective(500px) rotateX(55deg) translateY(25%) translateX(42px);
  }
}

@keyframes floatOrb {
  to {
    transform: translate(30px, -25px) scale(1.12);
  }
}

@keyframes logoPulse {
  50% {
    transform: scale(1.045);
    filter: drop-shadow(0 0 24px rgba(98, 233, 255, .45));
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(.95);
  }
}

@keyframes modalOut {
  to {
    opacity: 0;
    transform: translateY(12px) scale(.97);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(30px) scale(.96);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(35px);
  }
}

@keyframes bannerIn {
  from {
    opacity: 0;
    transform: translate(-50%, -18px) scale(.9);
  }
}

@keyframes comboPop {
  0% {
    opacity: 0;
    transform: scale(.6) rotate(-8deg);
  }

  35% {
    opacity: 1;
    transform: scale(1.2) rotate(3deg);
  }

  100% {
    opacity: 0;
    transform: translateY(-30px) scale(.95);
  }
}

@keyframes damageFlash {

  0%,
  100% {
    opacity: 0;
  }

  30% {
    opacity: 1;
  }
}

@media (max-width: 780px) {
  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hud {
    min-height: 66px;
    gap: 5px;
    padding-top: max(6px, env(safe-area-inset-top));
  }

  .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .hud-player {
    min-width: 0;
    flex: 1;
  }

  .hud-player .avatar {
    width: 36px;
    height: 36px;
  }

  .hud-player strong {
    font-size: .74rem;
  }

  .hud-player span {
    font-size: .58rem;
  }

  .hud-stat {
    min-width: 55px;
    padding: 6px 6px;
  }

  .desktop-stat {
    display: none;
  }

  .hud-pills {
    position: absolute;
    top: 66px;
    left: 8px;
    z-index: 5;
    pointer-events: none;
  }

  .hud-pills span {
    background: rgba(18, 16, 44, .82);
    backdrop-filter: blur(5px);
  }

  .active-powers {
    position: absolute;
    top: 66px;
    right: 8px;
    justify-content: flex-end;
    pointer-events: none;
  }

  .power-chip {
    background: rgba(18, 16, 44, .82);
  }

  .mobile-controls {
    display: flex;
  }
}

@media (max-width: 480px) {
  .how-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .how-hero-icon {
    margin: auto;
  }

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

  .level-select-toolbar {
    align-items: stretch;
  }

  .level-select-toolbar .action-btn {
    padding: 0 12px;
  }

  .menu-shell {
    padding: 18px 14px;
  }

  .menu-brand .game-logo {
    width: 72px;
    height: 72px;
  }

  .menu-grid {
    gap: 8px;
  }

  .menu-btn {
    min-height: 94px;
    padding: 12px;
    border-radius: 16px;
  }

  .menu-btn>span {
    margin-bottom: 5px;
  }

  .menu-btn small {
    font-size: .7rem;
  }

  .mascot-card {
    width: 100%;
  }

  .modal-panel {
    padding: 25px 18px 20px;
    border-radius: 22px;
  }

  .help-grid,
  .achievement-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .setting-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .toggle {
    justify-self: start;
  }

  .modal-actions .action-btn {
    flex: 1;
  }

  .dpad {
    width: 142px;
    height: 142px;
  }

  .touch-btn.bomb {
    width: 98px;
    height: 98px;
  }

  .mobile-controls {
    min-height: 164px;
  }

  .control-hint {
    font-size: .58rem;
  }
}

@media (orientation: landscape) and (max-height: 650px) and (pointer: coarse) {
  .hud {
    min-height: 54px;
  }

  .hud-player .avatar {
    width: 34px;
    height: 34px;
  }

  .hud-pills,
  .active-powers {
    top: 55px;
  }

  .mobile-controls {
    position: absolute;
    inset: 54px 0 0;
    pointer-events: none;
    background: transparent;
    border: 0;
    padding: 8px 18px;
    align-items: flex-end;
  }

  .move-cluster,
  .action-pad {
    pointer-events: auto;
    opacity: .9;
  }

  .dpad {
    width: 132px;
    height: 132px;
  }

  .touch-btn.bomb {
    width: 94px;
    height: 94px;
  }

  .action-buttons {
    min-height: 96px;
  }

  .control-hint {
    background: rgba(18, 16, 44, .72);
    padding: 3px 7px;
    border-radius: 8px;
  }

  .game-viewport {
    position: absolute;
    inset: 54px 0 0;
  }

  .combo-display {
    top: 52px;
  }
}

@media (min-width: 1000px) {
  .menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .menu-btn {
    min-height: 116px;
  }
}

/* --------------------------------------------------------------------------
   Bomb Maze HUD 2.0 and mobile game layout
   -------------------------------------------------------------------------- */
.game-screen {
  position: fixed;
}

.hud {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(176px, auto) auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(31, 27, 75, .99), rgba(17, 15, 43, .98)),
    radial-gradient(circle at 12% 0, rgba(98, 233, 255, .14), transparent 35%);
  box-shadow: 0 8px 28px rgba(4, 3, 20, .34);
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hud-logo {
  width: 50px;
  height: 50px;
  flex: none;
  object-fit: cover;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .28), 0 0 20px rgba(98, 233, 255, .14);
}

.hud-player-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hud-player-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .92rem;
}

.hud-player-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cyan);
  font-size: .68rem;
}

.hud-main-stats,
.hud-resources,
.hud-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-main-stats .hud-stat {
  min-width: 66px;
  height: 50px;
  display: grid;
  place-content: center;
  padding: 5px 9px;
  background: linear-gradient(145deg, rgba(71, 63, 139, .42), rgba(255, 255, 255, .035));
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .06);
}

.hud-main-stats .time-stat {
  min-width: 76px;
}

.hud-main-stats .hud-stat small {
  font-size: .56rem;
}

.hud-main-stats .hud-stat b {
  font-size: .98rem;
}

.hud-resources span {
  min-width: 54px;
  height: 50px;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-content: center;
  column-gap: 5px;
  padding: 5px 7px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .085);
  box-shadow: inset 0 1px rgba(255, 255, 255, .05);
}

.hud-resources i {
  color: var(--yellow);
  font-style: normal;
  font-size: .84rem;
}

.hud-resources b {
  font-size: .84rem;
  font-variant-numeric: tabular-nums;
}

.hud-resources small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: .48rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.hud-actions {
  justify-content: flex-end;
}

.hud-actions .icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(79, 71, 151, .58), rgba(35, 31, 79, .96));
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 5px 12px rgba(0, 0, 0, .2);
}

.hud-actions .icon-btn:active {
  transform: scale(.94);
  filter: brightness(1.2);
}

.active-powers:empty {
  display: none;
}

.menu-btn.install {
  background: linear-gradient(135deg, #147f85, #4f59d7);
  border-color: rgba(98, 233, 255, .3);
}

.menu-btn.install>span {
  color: white;
  background: rgba(255, 255, 255, .15);
}

@media (max-width: 780px) {
  .hud {
    min-height: 0;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    grid-auto-flow: row;
    gap: 5px;
    padding: max(6px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) 6px max(7px, env(safe-area-inset-left));
  }

  .hud-brand {
    grid-column: 1 / 5;
    grid-row: 1;
    gap: 8px;
  }

  .hud-logo {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .hud-player-copy strong {
    font-size: .78rem;
  }

  .hud-player-copy span {
    font-size: .57rem;
  }

  .hud-actions {
    grid-column: 5 / 9;
    grid-row: 1;
    gap: 5px;
    justify-self: end;
  }

  .hud-actions .icon-btn {
    width: 39px;
    height: 39px;
    border-radius: 12px;
    font-size: .88rem;
  }

  .hud-main-stats,
  .hud-resources {
    display: contents;
  }

  .desktop-stat {
    display: none !important;
  }

  .hud-main-stats .hud-stat,
  .hud-resources span {
    min-width: 0;
    width: auto;
    height: 38px;
    padding: 3px 3px;
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(69, 61, 137, .42), rgba(255, 255, 255, .035));
    border: 1px solid rgba(255, 255, 255, .075);
  }

  .hud-main-stats .score-stat {
    grid-column: 1;
    grid-row: 2;
  }

  .hud-main-stats .level-stat {
    grid-column: 2;
    grid-row: 2;
  }

  .hud-main-stats .time-stat {
    grid-column: 3 / 5;
    grid-row: 2;
    min-width: 0;
  }

  .hud-main-stats .hud-stat small {
    font-size: .43rem;
    letter-spacing: .05em;
  }

  .hud-main-stats .hud-stat b {
    font-size: .73rem;
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hud-resources span {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    place-items: center;
    gap: 0;
  }

  .hud-resources span:nth-child(1) {
    grid-column: 5;
    grid-row: 2;
  }

  .hud-resources span:nth-child(2) {
    grid-column: 6;
    grid-row: 2;
  }

  .hud-resources span:nth-child(3) {
    grid-column: 7;
    grid-row: 2;
  }

  .hud-resources span:nth-child(4) {
    grid-column: 8;
    grid-row: 2;
  }

  .hud-resources i {
    display: none;
  }

  .hud-resources b {
    font-size: .72rem;
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hud-resources small {
    grid-column: auto;
    font-size: .39rem;
    line-height: 1;
    letter-spacing: .02em;
  }

  .active-powers {
    grid-column: 1 / -1;
    grid-row: 3;
    min-height: 0;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .active-powers::-webkit-scrollbar {
    display: none;
  }

  .power-chip {
    min-width: 31px;
    width: 31px;
    height: 29px;
    border-radius: 9px;
    font-size: .75rem;
  }

  .game-viewport {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
  }

  .mobile-controls {
    display: flex;
    position: absolute;
    z-index: 7;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 0;
    height: 154px;
    padding: 12px max(18px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    background: linear-gradient(180deg, rgba(13, 12, 32, 0), rgba(13, 12, 32, .62) 24%, rgba(15, 14, 39, .95) 100%);
    border-top: 0;
    pointer-events: none;
  }

  .move-cluster,
  .action-pad {
    pointer-events: auto;
  }

  .dpad {
    width: 128px;
    height: 128px;
    padding: 6px;
    background: radial-gradient(circle, rgba(96, 88, 190, .50), rgba(17, 16, 48, .88) 72%);
    backdrop-filter: blur(8px);
  }

  .touch-btn {
    backdrop-filter: blur(7px);
  }

  .touch-btn.bomb {
    width: 94px;
    height: 94px;
    box-shadow: 0 12px 27px rgba(0, 0, 0, .34), inset 0 3px 4px rgba(255, 255, 255, .22), 0 0 25px rgba(255, 94, 168, .15);
  }

  .touch-btn.bomb span {
    font-size: 1.8rem;
  }

  .touch-btn.bomb small {
    font-size: .62rem;
  }

  .action-buttons {
    min-height: 96px;
  }

  .control-hint {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(15, 14, 39, .72);
    font-size: .52rem;
    letter-spacing: .08em;
  }
}

@media (max-width: 380px) {
  .hud-logo {
    width: 38px;
    height: 38px;
  }

  .hud-actions .icon-btn {
    width: 36px;
    height: 36px;
  }

  .hud-player-copy strong {
    font-size: .72rem;
  }

  .hud-player-copy span {
    font-size: .52rem;
  }

  .dpad {
    width: 116px;
    height: 116px;
  }

  .touch-btn.bomb {
    width: 86px;
    height: 86px;
  }

  .mobile-controls {
    height: 140px;
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (orientation: landscape) and (max-height: 650px) and (pointer: coarse) {
  .hud {
    min-height: 52px;
    grid-template-columns: minmax(130px, 1fr) auto auto;
    grid-template-rows: 42px;
    padding-top: max(4px, env(safe-area-inset-top));
    padding-bottom: 4px;
  }

  .hud-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .hud-logo {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .hud-main-stats {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    gap: 4px;
  }

  .hud-main-stats .hud-stat {
    width: 54px;
    height: 36px;
    display: grid;
  }

  .hud-main-stats .time-stat {
    width: 68px;
  }

  .hud-resources,
  .active-powers {
    display: none !important;
  }

  .hud-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .hud-actions .icon-btn {
    width: 36px;
    height: 36px;
  }

  .mobile-controls {
    height: 128px;
    padding: 5px 18px max(5px, env(safe-area-inset-bottom));
  }

  .dpad {
    width: 108px;
    height: 108px;
  }

  .touch-btn.bomb {
    width: 82px;
    height: 82px;
  }

  .control-hint {
    display: none;
  }
}

@media (max-width: 780px) {
  .active-powers {
    position: static;
    top: auto;
    right: auto;
    pointer-events: auto;
  }
}

@media (orientation: landscape) and (max-height: 650px) and (pointer: coarse) {
  .mobile-controls {
    inset: auto 0 0;
  }

  .game-viewport {
    position: relative;
    inset: auto;
  }

  .combo-display {
    top: 14px;
  }
}

@media (min-width: 781px) {
  .hud-brand {
    grid-column: 1;
  }

  .hud-main-stats {
    grid-column: 2;
  }

  .hud-resources {
    grid-column: 3;
  }

  .active-powers {
    grid-column: 4;
  }

  .hud-actions {
    grid-column: 5;
  }
}

@media (orientation: landscape) and (max-height: 650px) and (pointer: coarse) {
  .mobile-controls {
    display: flex;
  }
}

@media (orientation: landscape) and (max-height: 650px) and (pointer: coarse) {
  .mobile-controls {
    min-height: 0;
  }
}

/* Buyer save-data dialogs */
.save-data-textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px;
  color: #ffffff;
  background: #12102a;
  border: 1px solid #615b8c;
  border-radius: 12px;
  resize: vertical;
  font: 500 0.82rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
