* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top, #0d1d33 0%, #07111d 55%, #03070d 100%);
  color: #eaf4ff;
}

.game-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 12px 24px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 15, 27, 0.65);
  backdrop-filter: blur(6px);
}

.brand-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-btn {
  margin: 0;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 10px;
}

.game-area {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
  padding: 0 16px 24px;
}

.play-hud {
  display: grid;
}

.play-hud.slim-hud {
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 0;
  border: 1px solid rgba(120, 180, 255, 0.22);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  background: rgba(12, 28, 47, 0.92);
}

.hud-box {
  text-align: center;
}

.slim-hud .hud-box {
  border-right: 1px solid rgba(120, 180, 255, 0.18);
  padding: 12px 8px;
}

.slim-hud .hud-box:last-child {
  border-right: 0;
}

.hud-box .label {
  display: block;
  font-size: 11px;
  opacity: 0.75;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hud-box span:last-child {
  font-size: 22px;
  font-weight: bold;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0 0 16px 16px;
  border: 1px solid rgba(120, 180, 255, 0.18);
  border-top: 0;
  background: linear-gradient(to bottom, #071120 0%, #0b1e37 55%, #10161d 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.overlay {
  position: absolute;
  inset: 54px 16px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 13, 0.58);
  border-radius: 0 0 16px 16px;
}

.overlay.hidden {
  display: none;
}

.panel {
  width: min(520px, 94%);
  padding: 28px;
  border-radius: 18px;
  background: rgba(13, 27, 46, 0.94);
  border: 1px solid rgba(120, 180, 255, 0.22);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 30px;
}

.panel p {
  margin-bottom: 20px;
  line-height: 1.5;
  opacity: 0.9;
}

button {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin: 6px;
  background: linear-gradient(180deg, #57a8ff 0%, #2b73ff 100%);
  color: white;
}

button:hover {
  filter: brightness(1.06);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.store-list {
  display: grid;
  gap: 12px;
  text-align: left;
  margin: 16px 0;
}

.store-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.store-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
}

.store-message {
  min-height: 22px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .brand-controls {
    align-items: stretch;
  }

  .topbar-btn {
    width: 100%;
    justify-content: center;
  }

  .overlay {
    inset: 54px 16px 24px 16px;
  }

  .panel {
    width: min(96%, 520px);
    padding: 20px;
  }

  .store-row {
    align-items: flex-start;
  }

  .store-item-info {
    align-items: flex-start;
  }
}
