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

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background: #08030f;
  font-family: Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
}

.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(220, 33, 111, 0.18), transparent 32%),
    rgba(0, 0, 0, 0.64);
}

.logo {
  font-size: 0.95rem;
  letter-spacing: 6px;
  opacity: 0.74;
}

.explore-button,
.small-button {
  border: 1px solid rgba(255, 255, 255, 0.72);
  color: #fff;
  background: rgba(0, 0, 0, 0.34);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.explore-button {
  min-width: 170px;
  padding: 13px 18px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.8rem;
}

.explore-button:hover,
.small-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

h1 {
  font-size: clamp(2.15rem, 7vw, 4.75rem);
  letter-spacing: 4px;
  line-height: 0.95;
}

p {
  max-width: 600px;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.45;
  opacity: 0.84;
}

.line {
  width: 60px;
  height: 2px;
  background: #fff;
  opacity: 0.52;
}

.game-shell {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 2, 8, 0.88);
}

.game-shell.is-open {
  display: flex;
}

.game-panel {
  width: min(1120px, 100%);
  color: #fff;
}

.game-topbar,
.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #0b0611;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.game-topbar {
  padding: 12px 14px;
  border-bottom: 0;
}

.game-brand {
  letter-spacing: 5px;
  font-size: 0.8rem;
  opacity: 0.78;
}

.game-actions {
  display: flex;
  gap: 8px;
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.character-select {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: #0b0611;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.character-select.is-hidden {
  display: none;
}

.character-option {
  flex: 1;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  text-align: left;
  padding: 9px 12px;
}

.character-option:hover {
  background: rgba(255, 255, 255, 0.14);
}

.character-option span,
.character-option small {
  display: block;
}

.character-option span {
  font-size: 0.92rem;
}

.character-option small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.66);
}

.canvas-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #14051d;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.game-message {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100% - 32px));
  min-height: 0;
  transform: translate(-50%, -50%);
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(5, 3, 10, 0.78);
  text-align: center;
  line-height: 1.45;
  letter-spacing: 0.3px;
  display: none;
}

.game-message.is-visible {
  display: block;
}

.game-footer {
  padding: 10px 14px;
  border-top: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.74);
}

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

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

.touch-controls button {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
  pointer-events: auto;
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .game-shell {
    padding: 8px;
  }

  .game-topbar,
  .game-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-footer {
    display: none;
  }

  .character-select {
    flex-direction: column;
  }

  .touch-controls {
    display: flex;
  }

  .small-button {
    min-height: 32px;
    padding: 0 10px;
  }
}
