@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url('/fonts/orbitron-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-outer: #03040a;
  --bg-game: #070913;
  --cyan: #00f0ff;
  --magenta: #ff2a85;
  --amber: #ffb800;
  --purple: #9d4edd;
  --text-main: #f0f6ff;
  --text-muted: #7a8ba8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-outer);
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

/* Outer desktop backdrop */
.stage {
  width: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(0, 240, 255, 0.08), transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(255, 42, 133, 0.06), transparent 60%),
    var(--bg-outer);
}

/* Portrait-first game container */
.game-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  max-width: 480px;
  background-color: var(--bg-game);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.9), 0 0 1px 1px rgba(0, 240, 255, 0.15);
}

@media (min-width: 520px) {
  .game-shell {
    height: min(calc(100dvh - 76px), 860px);
    border-radius: 28px;
    border: 1px solid rgba(0, 240, 255, 0.2);
  }
}

@media (min-width: 768px) {
  .stage {
    padding-bottom: 106px;
  }

  .game-shell {
    height: min(calc(100dvh - 122px), 840px);
  }
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Minimalist Top HUD */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: max(14px, env(safe-area-inset-top)) 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  z-index: 10;
}

.hud-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.score-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.score-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.score-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.score-value {
  font-family: 'Orbitron', monospace;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.45);
}

.multiplier-badge {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.14);
  border: 1px solid rgba(0, 240, 255, 0.5);
  color: var(--cyan);
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.multiplier-badge.hot {
  background: rgba(255, 42, 133, 0.22);
  border-color: var(--magenta);
  color: #ff7eb6;
  box-shadow: 0 0 12px rgba(255, 42, 133, 0.4);
}

.best-score {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.hud-controls {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 16, 32, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn:hover {
  border-color: rgba(0, 240, 255, 0.5);
  background: rgba(16, 24, 48, 0.85);
}

/* Overdrive Bar */
.overdrive-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.overdrive-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.overdrive-meta .active-text {
  color: var(--amber);
  text-shadow: 0 0 10px rgba(255, 184, 0, 0.8);
  animation: pulseText 0.4s ease-in-out infinite alternate;
}

@keyframes pulseText {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

.overdrive-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.overdrive-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), #7b61ff, var(--magenta));
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.65);
  transition: width 0.08s linear;
}

.overdrive-fill.hyper {
  background: linear-gradient(90deg, #fff3b0, var(--amber), var(--magenta));
  box-shadow: 0 0 18px rgba(255, 184, 0, 0.9);
}

/* Overlays (Start, Pause, Game Over) */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(48px, env(safe-area-inset-top)) 24px max(34px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 45%, rgba(7, 9, 19, 0.55), rgba(4, 6, 14, 0.88));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-top {
  margin-top: 8vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.game-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(34px, 10vw, 46px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.05;
  background: linear-gradient(180deg, #ffffff 10%, var(--cyan) 65%, #3a86ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(0, 240, 255, 0.45));
}

.game-subtitle {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--magenta);
  text-shadow: 0 0 12px rgba(255, 42, 133, 0.5);
}

/* Stats Card on Game Over */
.stats-card {
  width: 100%;
  max-width: 340px;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(13, 19, 38, 0.82);
  border: 1px solid rgba(0, 240, 255, 0.22);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-item.full {
  grid-column: 1 / -1;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-val {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.stat-val.big {
  font-size: 36px;
  color: var(--cyan);
  text-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
}

.new-best-pill {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 184, 0, 0.18);
  border: 1px solid var(--amber);
  color: var(--amber);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(255, 184, 0, 0.45);
}

/* Social Share Section */
.share-section {
  width: 100%;
  max-width: 356px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.share-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.share-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 54px;
  padding: 8px 2px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(13, 19, 38, 0.78);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.share-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.share-btn span {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  opacity: 0.92;
}

.share-btn:active {
  transform: scale(0.92);
}

.share-btn.fb {
  border-color: rgba(24, 119, 242, 0.45);
  color: #60a5fa;
  box-shadow: 0 0 12px rgba(24, 119, 242, 0.18);
}
.share-btn.fb:hover {
  background: rgba(24, 119, 242, 0.2);
  border-color: #1877f2;
}

.share-btn.x {
  border-color: rgba(255, 255, 255, 0.35);
  color: #f8fafc;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.12);
}
.share-btn.x:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #ffffff;
}

.share-btn.threads {
  border-color: rgba(192, 132, 252, 0.45);
  color: #e9d5ff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.18);
}
.share-btn.threads:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: #c084fc;
}

.share-btn.ig {
  border-color: rgba(225, 48, 108, 0.5);
  color: #f472b6;
  box-shadow: 0 0 12px rgba(225, 48, 108, 0.2);
}
.share-btn.ig:hover {
  background: linear-gradient(135deg, rgba(245, 133, 41, 0.2), rgba(221, 42, 123, 0.24), rgba(129, 52, 175, 0.22));
  border-color: #e1306c;
}

.share-btn.wa {
  border-color: rgba(37, 211, 102, 0.45);
  color: #4ade80;
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.18);
}
.share-btn.wa:hover {
  background: rgba(37, 211, 102, 0.2);
  border-color: #25d366;
}

.share-btn.reddit {
  border-color: rgba(255, 69, 0, 0.45);
  color: #fb923c;
  box-shadow: 0 0 12px rgba(255, 69, 0, 0.18);
}
.share-btn.reddit:hover {
  background: rgba(255, 69, 0, 0.2);
  border-color: #ff4500;
}

/* Pause Overlay Layout with 300x250 Ad Slot */
#pauseOverlay {
  gap: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

#pauseOverlay .overlay-top {
  margin-top: 4vh;
}

/* Game Over Scrollable Layout & 300x250 Ad Slot */
#gameOverOverlay {
  justify-content: flex-start;
  gap: 14px;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

#gameOverOverlay .overlay-top {
  margin-top: 8px;
  gap: 6px;
}

#gameOverOverlay .stats-card {
  margin-top: 6px;
  padding: 12px 14px;
  gap: 8px;
}

#gameOverOverlay .stat-val.big {
  font-size: 30px;
}

#gameOverOverlay .thumb-zone {
  gap: 12px;
  padding-bottom: 8px;
}

.ad-slot {
  width: 300px;
  min-height: 250px;
  margin: 0 auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(13, 19, 38, 0.72);
  border: 1px solid rgba(0, 240, 255, 0.16);
  overflow: hidden;
}

/* Lower-Third Thumb Zone */
.thumb-zone {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-bottom: 2vh;
}

.cue-text {
  font-size: 13px;
  font-weight: 500;
  color: #b7c8e6;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
}

.cue-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: slideCue 1.6s ease-in-out infinite;
}

@keyframes slideCue {
  0%, 100% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
}

.primary-btn {
  width: 100%;
  max-width: 300px;
  height: 60px;
  border-radius: 18px;
  border: none;
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #050814;
  background: linear-gradient(135deg, #5efcff 0%, var(--cyan) 50%, #3a86ff 100%);
  box-shadow:
    0 8px 28px rgba(0, 240, 255, 0.4),
    inset 0 2px 1px rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.primary-btn:active {
  transform: scale(0.96);
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.35);
}

.secondary-btn {
  width: 100%;
  max-width: 300px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 22, 44, 0.7);
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease;
}

.secondary-btn:active {
  transform: scale(0.96);
}

.share-native-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: rgba(0, 240, 255, 0.35);
  color: var(--cyan);
}

.share-native-btn:hover {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.12);
}

/* How To Play Guide Card */
.guide-card {
  width: 100%;
  max-width: 340px;
  margin-top: 12px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(13, 19, 38, 0.86);
  border: 1px solid rgba(0, 240, 255, 0.24);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: start;
}

.guide-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guide-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-icon.cyan {
  background: rgba(0, 240, 255, 0.14);
  border: 1px solid rgba(0, 240, 255, 0.45);
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.22);
}

.guide-icon.magenta {
  background: rgba(255, 42, 133, 0.14);
  border: 1px solid rgba(255, 42, 133, 0.45);
  color: var(--magenta);
  box-shadow: 0 0 14px rgba(255, 42, 133, 0.22);
}

.guide-icon.amber {
  background: rgba(255, 184, 0, 0.14);
  border: 1px solid rgba(255, 184, 0, 0.45);
  color: var(--amber);
  box-shadow: 0 0 14px rgba(255, 184, 0, 0.22);
}

.guide-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.guide-heading {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
}

.guide-desc {
  font-size: 12px;
  line-height: 1.4;
  color: #b7c8e6;
}

.guide-desc strong {
  color: #ffffff;
  font-weight: 700;
}

.ad-slot iframe {
  display: block;
  width: 300px;
  height: 250px;
  border: 0;
}

/* First-screen Cookie Notice & Language Dropdown */
.cookie-notice {
  max-width: 290px;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  color: var(--text-muted);
  opacity: 0.9;
}

.cookie-notice.eu {
  max-width: 320px;
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(11, 16, 32, 0.78);
  border: 1px solid rgba(0, 240, 255, 0.18);
  font-size: 10.5px;
  line-height: 1.45;
  color: #b7c8e6;
  opacity: 0.96;
}

.lang-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
  max-width: 210px;
}

.lang-globe,
.lang-chevron {
  position: absolute;
  pointer-events: none;
  color: var(--cyan);
}

.lang-globe {
  inset-inline-start: 14px;
  opacity: 0.9;
}

.lang-chevron {
  inset-inline-end: 14px;
  opacity: 0.85;
}

.lang-select {
  width: 100%;
  height: 44px;
  padding-block: 0;
  padding-inline: 40px 38px;
  border-radius: 14px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: rgba(11, 16, 32, 0.85);
  color: var(--text-main);
  font-family: 'Inter', 'Noto Sans TC', 'Noto Sans SC', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans Thai', 'Noto Sans Devanagari', 'Noto Sans Arabic', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
  user-select: auto;
  -webkit-user-select: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lang-select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}

.lang-select option {
  background-color: #0b1020;
  color: #f0f6ff;
}

/* Floating Bottom Ad Bar (320x50 mobile / 728x90 desktop, gameplay only) */
.floating-ad-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px max(5px, env(safe-area-inset-bottom));
  background: rgba(3, 4, 10, 0.88);
  border-top: 1px solid rgba(0, 240, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.floating-ad-bar.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(100%);
}

.floating-ad-slot {
  width: 320px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
}

.floating-ad-slot iframe {
  display: block;
  border: 0;
}

@media (min-width: 768px) {
  .floating-ad-bar {
    padding: 6px 12px;
  }

  .floating-ad-slot {
    width: 728px;
    height: 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cue-dot,
  .overdrive-meta .active-text {
    animation: none;
  }
}
