:root {
  color-scheme: dark;
  --ink: #f7fbff;
  --muted: #a9b7c5;
  --glass: rgba(6, 12, 20, 0.74);
  --line: rgba(255, 255, 255, 0.16);
  --pink: #ff3d8a;
  --cyan: #35e4ff;
  --lime: #b7ff45;
  --gold: #ffd05a;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #071018;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 320px;
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 61, 138, 0.19), transparent 30%),
    radial-gradient(circle at 88% 10%, rgba(53, 228, 255, 0.16), transparent 28%),
    #071018;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

.hud {
  position: absolute;
  inset: 18px 18px auto 18px;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(300px, 1fr) 176px;
  align-items: start;
  gap: 14px;
  pointer-events: none;
}

.brand,
.stats,
.mini-map,
.banner {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  color: #061018;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1;
}

.brand p,
.stats span,
.banner small {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 1px;
  border-radius: 8px;
  overflow: hidden;
}

.stats div {
  min-height: 72px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.035);
}

.stats strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-map {
  width: 176px;
  height: 176px;
  border-radius: 8px;
  overflow: hidden;
}

#minimap {
  width: 176px;
  height: 176px;
  display: block;
}

.banner {
  position: absolute;
  left: 50%;
  bottom: 34px;
  display: grid;
  gap: 2px;
  min-width: min(420px, calc(100vw - 36px));
  max-width: calc(100vw - 36px);
  padding: 14px 18px;
  border-radius: 8px;
  opacity: 0;
  text-align: center;
  transform: translate(-50%, 24px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
  pointer-events: none;
}

.banner.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.banner span {
  font-weight: 800;
  font-size: 18px;
}

.touch-controls {
  position: absolute;
  inset: auto 18px 18px 18px;
  display: none;
  align-items: end;
  justify-content: space-between;
  pointer-events: none;
}

.touch-controls button {
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 12, 20, 0.72);
  color: var(--ink);
  font-weight: 900;
  pointer-events: auto;
  touch-action: none;
}

.touch-pad {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.touch-pad div {
  display: flex;
  gap: 8px;
}

.touch-controls .boost {
  width: 82px;
  color: #061018;
  background: linear-gradient(135deg, var(--gold), var(--lime));
}

@media (hover: none), (pointer: coarse) {
  .touch-controls {
    display: flex;
  }
}

@media (max-width: 760px) {
  .hud {
    inset: 10px 10px auto 10px;
    grid-template-columns: 1fr 112px;
    gap: 8px;
  }

  .brand {
    min-height: 58px;
    padding: 9px 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .brand h1 {
    font-size: 17px;
  }

  .stats {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 3;
  }

  .stats div {
    min-height: 54px;
    padding: 8px 10px;
  }

  .stats strong {
    font-size: 15px;
  }

  .mini-map,
  #minimap {
    width: 112px;
    height: 112px;
  }

  .banner {
    bottom: 106px;
  }
}
