* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

:root {
  --bg-deep: #070d18;
  --bg-card: rgba(13, 22, 40, 0.9);
  --cyan-bright: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.45);
  --neon-magenta: #ff007f;
  --neon-orange: #ff9900;
  --text-main: #f0f6fc;
  --text-muted: #8b9bb4;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  font-family: var(--font-family);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 920px;
  background: radial-gradient(circle at 50% 15%, #102444 0%, #070d18 85%);
  overflow: hidden;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.85);
  border-left: 1px solid rgba(0, 240, 255, 0.12);
  border-right: 1px solid rgba(0, 240, 255, 0.12);
}

#game-container::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 1;
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 18px 20px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 10;
  pointer-events: none;
}

.hud-left .brand-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--cyan-bright);
  text-shadow: 0 0 8px var(--cyan-glow);
  display: block;
  margin-bottom: 2px;
}

.hud-left .game-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.hud-right {
  display: flex;
  gap: 12px;
}

.score-box {
  background: rgba(13, 25, 48, 0.82);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 6px 14px;
  text-align: right;
  backdrop-filter: blur(8px);
  min-width: 76px;
}

.score-box.sub {
  border-color: rgba(139, 155, 180, 0.25);
  background: rgba(10, 18, 34, 0.6);
}

.score-box .label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.score-box.sub .label {
  color: #6d7f99;
}

.score-box .value {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: var(--cyan-bright);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-shadow: 0 0 10px var(--cyan-glow);
}

.score-box .value small {
  font-size: 11px;
  margin-left: 2px;
  color: var(--text-muted);
}

.score-box.sub .value {
  color: #c0cee0;
  font-size: 18px;
  text-shadow: none;
}

/* Modals */
.overlay-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 13, 24, 0.84);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 24px;
}

.overlay-screen.active {
  opacity: 1;
  pointer-events: auto;
}

.overlay-screen.hidden {
  display: none;
}

.screen-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 240, 255, 0.12);
}

.cyber-badge, .result-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--cyan-bright);
  border: 1px solid var(--cyan-bright);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
  background: rgba(0, 240, 255, 0.08);
}

.result-badge {
  color: var(--neon-magenta);
  border-color: var(--neon-magenta);
  background: rgba(255, 0, 127, 0.08);
  box-shadow: 0 0 14px rgba(255, 0, 127, 0.35);
}

.title-logo {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 1;
  color: #ffffff;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.title-logo span {
  color: var(--cyan-bright);
}

.guide-text {
  font-size: 13.5px;
  line-height: 1.7;
  color: #baccdb;
  margin-bottom: 26px;
}

.controls-hint {
  font-size: 11px;
  color: #687e9c;
  margin-top: 14px;
}

.cyber-btn {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #070d18;
  background: linear-gradient(135deg, #00f0ff 0%, #0099ff 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.4);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  outline: none;
}

.cyber-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0, 240, 255, 0.55);
}

.cyber-btn:active {
  transform: translateY(1px);
}

.final-score-wrap {
  margin: 18px 0 16px;
}

.result-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.result-number {
  font-size: 60px;
  font-weight: 900;
  color: #fff;
  line-height: 1.05;
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

.result-number .unit {
  font-size: 26px;
  color: var(--cyan-bright);
  margin-left: 4px;
}

.new-record {
  font-size: 12px;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
  margin-top: 4px;
}

.rank-eval {
  font-size: 13.5px;
  color: #a3b8d4;
  margin-bottom: 24px;
  min-height: 22px;
}
