* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #f6f8ff;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  background: radial-gradient(120% 130% at 50% 38%, #1b1430, #07090e);
  user-select: none;
  -webkit-user-select: none;
}

button {
  font: inherit;
}

#stage {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #14161c;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.65), 0 0 0 4px #05060a;
  font-size: 16px;
}

canvas#game {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===== HUD оверлеем ===== */
.hud {
  position: absolute;
  top: 0.9em;
  z-index: 5;
  display: flex;
  gap: 0.6em;
  pointer-events: none;
}

.hud.tl {
  left: 1em;
}

.hud.tr {
  right: 1em;
}

.pill {
  font-size: 1.1em;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.6em;
  padding: 0.25em 0.7em;
  text-shadow: 0 0.1em 0 rgba(0, 0, 0, 0.6);
}

.pill.big {
  font-size: 1.5em;
  color: #fbbf24;
}

.banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 36%;
  z-index: 6;
  text-align: center;
  font-size: 4em;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0.06em 0.06em 0 rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.banner.hidden {
  display: none;
}

/* ===== тач: движение слева, действия справа ===== */
.touch {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  display: none;
  justify-content: space-between;
  padding: 0 1em 0.9em;
  pointer-events: none;
}

@media (pointer: coarse) {
  .touch {
    display: flex;
  }
}

.tgroup {
  display: flex;
  gap: 0.7em;
}

.touch button {
  pointer-events: auto;
  width: 4.2em;
  height: 3.4em;
  font-size: 1.3em;
  font-weight: 900;
  border-radius: 50%;
  border: 3px solid #101218;
  background: linear-gradient(180deg, rgba(108, 192, 255, 0.85), rgba(22, 104, 201, 0.85));
  color: #fff;
  touch-action: none;
  box-shadow: 0 0.3em 0 rgba(0, 0, 0, 0.5);
}

.touch button:active {
  transform: translateY(0.14em);
  filter: brightness(1.3);
}

/* ===== оверлеи ===== */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 14, 0.6);
}

.overlay.hidden {
  display: none;
}

.panel-box {
  width: min(88%, 24em);
  padding: 1.6em 1.8em;
  text-align: center;
  background: #232833;
  border: 4px solid #101218;
  box-shadow: 0.6em 0.6em 0 rgba(0, 0, 0, 0.5);
  display: grid;
  gap: 0.9em;
  max-height: 92%;
  overflow-y: auto;
}

.panel-box.slim {
  width: auto;
}

.panel-box h2 {
  font-size: 1.9em;
  color: #fbbf24;
  letter-spacing: 0.04em;
}

.ov-text {
  font-size: 0.95em;
  color: #b9c0cc;
}

.btn {
  font-size: 1.05em;
  font-weight: 800;
  padding: 0.55em 1.5em;
  border: 3px solid #101218;
  cursor: pointer;
  background: #2c3340;
  color: #fff;
  box-shadow: 0 0.3em 0 #101218;
}

.btn:active {
  transform: translateY(0.16em);
  box-shadow: 0 0.08em 0 #101218;
}

.btn-primary {
  background: #fbbf24;
  color: #101218;
}

.hint {
  font-size: 0.8em;
  color: #8d95a3;
}

.note {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.85em;
  color: #fbbf24;
}

.note:empty {
  display: none;
}

.gg-guest {
  position: fixed;
  right: 8px;
  bottom: 6px;
  z-index: 50;
  max-width: 70%;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(10, 6, 24, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d9d4ec;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
