/* styles.css - Cyber Raider Neubrutalist Arcade Aesthetic for Vibe Crush (@vibevibefun) */

:root {
  /* Vibe Cyber & Neubrutalist Palette */
  --vibe-cyan: #00F5D4;
  --vibe-purple: #A855F7;
  --vibe-gold: #FACC15;
  --vibe-blue: #38BDF8;
  --vibe-red: #F43F5E;
  --cream-card: #FFFDF8;
  --cream-card-dark: #F5EEDB;
  --charcoal-ink: #18181B;
  --charcoal-surface: #27272A;
  --matrix-green: #10B981;

  /* Text & Border */
  --text-dark: #18181B;
  --text-muted: #6B7280;
  --text-light: #F9FAFB;
  --border-thick: 2.5px solid #18181B;
  --shadow-3d: 0 4px 0 #18181B;
  --shadow-3d-lg: 0 7px 0 #18181B;

  /* Board sizing: Mobile-first responsive with zero overflow */
  --board-size: min(94vw, calc(100dvh - 350px), 430px);
  --tile-size: calc(var(--board-size) / 8);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
}

body {
  background-color: #0b0d17;
  color: var(--text-light);
  font-family: 'Fredoka', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-height: 100dvh;
}

/* Particles Canvas */
#particlesCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 250;
}

/* ==========================================================================
   Animated Cyber-Citadel Skyline Environment (Backdrop)
   ========================================================================== */
.cyber-skyline-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Deep Futuristic Twilight Gradient */
.sky-cyber-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #090a12 0%,
    #131124 25%,
    #1d143a 50%,
    #2c154a 75%,
    #3b1859 90%,
    #4a154b 100%
  );
  opacity: 0.96;
}

/* Ambient Holographic Glow */
.cyber-skyline-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 280px;
  background: radial-gradient(circle at 50% 100%, rgba(168, 85, 247, 0.25) 0%, rgba(0, 245, 212, 0.12) 40%, transparent 75%);
  pointer-events: none;
}

/* Hologram Grid Laser Arcs across Sky */
.sky-hologram-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 140px;
  pointer-events: none;
}

.hologram-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120px;
  opacity: 0.8;
}

.cyber-pylon {
  position: absolute;
  top: 0;
  width: 6px;
  height: 140px;
  background: linear-gradient(180deg, #18181b 0%, #27272a 100%);
  border-left: 1.5px solid var(--vibe-cyan);
}

.cyber-pylon.pylon-left { left: 6%; }
.cyber-pylon.pylon-right { right: 8%; }

.pylon-beacon {
  position: absolute;
  top: 25px;
  left: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--vibe-cyan);
  box-shadow: 0 0 12px var(--vibe-cyan);
  animation: beaconPulse 1.8s infinite alternate;
}

@keyframes beaconPulse {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1; filter: brightness(1.4); }
}

/* Citadel Horizon & Distant Towers */
.citadel-horizon {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 75px;
  background: #111218;
  border-top: 4px solid var(--vibe-purple);
  box-shadow: 0 -4px 20px rgba(168, 85, 247, 0.3);
}

.neon-speedline {
  position: absolute;
  top: 25px;
  left: 0;
  width: 200%;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--vibe-cyan) 0px, var(--vibe-cyan) 30px, transparent 30px, transparent 60px);
  animation: speedlineMove 2.2s linear infinite;
}

@keyframes speedlineMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-60px); }
}

.citadel-silhouettes {
  position: absolute;
  bottom: 75px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 0 10px;
  opacity: 0.35;
}

.tower {
  background: #18142a;
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-bottom: none;
}

.tower.t-1 { width: 34px; height: 50px; }
.tower.t-2 { width: 44px; height: 75px; }
.tower.t-main {
  width: 70px;
  height: 95px;
  position: relative;
  border-color: var(--vibe-cyan);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
}

.hologram-logo {
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--vibe-cyan);
  text-shadow: 0 0 8px var(--vibe-cyan);
  animation: logoGlow 2s infinite alternate;
}

@keyframes logoGlow {
  0% { opacity: 0.7; }
  100% { opacity: 1; text-shadow: 0 0 14px var(--vibe-cyan); }
}

.tower.t-3 { width: 38px; height: 60px; }
.tower.t-4 { width: 28px; height: 45px; }

/* ==========================================================================
   App Main Layout Container
   ========================================================================== */
.app-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: env(safe-area-inset-top, 8px) 12px env(safe-area-inset-bottom, 12px);
  z-index: 10;
  flex: 1;
  justify-content: space-between;
}

.top-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* ==========================================================================
   Top Status Bar (Tactile Neubrutalist)
   ========================================================================== */
.vibe-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Tactile 3D Neubrutalist Pills */
.tactile-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--cream-card);
  color: var(--text-dark);
  font-weight: 800;
  font-size: 0.85rem;
  border: 2px solid var(--charcoal-ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--charcoal-ink);
  cursor: default;
  transition: transform 0.1s;
}

.tactile-pill .pill-icon {
  font-size: 1rem;
}

.energy-pill {
  background: #fef08a;
}

.gem-pill {
  background: #e0f2fe;
}

/* Live Interactive Cyber Radio Pill */
.radio-pill {
  background: #18181b;
  color: #fff;
  border: 2px solid #3f3f46;
  box-shadow: 0 3px 0 #000;
  cursor: pointer;
  padding: 5px 11px;
  gap: 6px;
  transition: all 0.15s;
}

.radio-pill:hover {
  background: #27272a;
  border-color: var(--vibe-cyan);
}

.radio-pill:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #000;
}

.radio-badge {
  background: var(--vibe-cyan);
  color: #000;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

#stationNameDisplay {
  font-size: 0.78rem;
  font-weight: 700;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radio-arrow {
  font-size: 0.7rem;
  color: var(--vibe-cyan);
}

.radio-anim {
  display: inline-block;
  animation: radioNote 1.4s ease-in-out infinite alternate;
}

@keyframes radioNote {
  0% { transform: rotate(-8deg) scale(0.95); }
  100% { transform: rotate(10deg) scale(1.15); }
}

.topbar-right {
  display: flex;
  gap: 5px;
}

.tactile-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--cream-card);
  color: var(--text-dark);
  border: 2px solid var(--charcoal-ink);
  box-shadow: 0 3px 0 var(--charcoal-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tactile-icon-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--charcoal-ink);
}

/* ==========================================================================
   Tactile Cards Dashboard Grid
   ========================================================================== */
.vibe-dashboard-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

.dash-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Base Tactile Card */
.tactile-card {
  background: var(--cream-card);
  color: var(--text-dark);
  border: 2.5px solid var(--charcoal-ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--charcoal-ink);
  padding: 8px 10px;
  transition: transform 0.12s, box-shadow 0.12s;
  position: relative;
}

/* Best Score Card */
.best-score-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #27272a;
  color: #fff;
  border-color: #18181b;
  padding: 6px 10px;
}

.star-icon-3d {
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 4px rgba(250, 204, 21, 0.6));
}

.best-meta {
  display: flex;
  flex-direction: column;
}

.best-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.best-num {
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.1;
  color: #fef08a;
}

/* Raider Bounty Stamp Card (Exact Tactile Ticket Feature) */
.ticket-stamp-card {
  cursor: pointer;
  background: #fffdf8;
  border-color: #18181b;
  padding: 7px 9px;
}

.ticket-stamp-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 0 var(--charcoal-ink);
}

.ticket-stamp-card:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--charcoal-ink);
}

.ticket-header {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #18181b;
}

.ticket-sub {
  font-size: 0.72rem;
  font-weight: 700;
  color: #4b5563;
  margin: 2px 0 4px;
}

.ticket-stamp-slots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.stamp-hole {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.8px solid #9ca3af;
  background: #f3f4f6;
  display: inline-block;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stamp-hole.punched {
  background: var(--vibe-gold);
  border-color: #ca8a04;
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.85);
  transform: scale(1.15);
}

/* Free Viber Reward Card */
.viber-reward-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #18181b;
  color: #fff;
  border-color: #27272a;
  padding: 6px 9px;
  cursor: pointer;
}

.reward-viber-icon {
  font-size: 1.4rem;
}

.reward-text {
  display: flex;
  flex-direction: column;
}

.reward-subtitle {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--vibe-cyan);
}

.reward-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
}

/* Right Column: Daily Surge Card */
.market-event-card {
  background: var(--vibe-gold);
  color: #18181b;
  border-color: #18181b;
  padding: 8px 10px;
  box-shadow: 0 5px 0 #18181b;
}

.market-badge-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.market-tag-pill {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #78350f;
}

.market-icon-basket {
  font-size: 1.3rem;
}

.market-headline {
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.15;
  margin: 3px 0 4px;
}

.market-time-left {
  font-size: 0.68rem;
  font-weight: 800;
  color: #78350f;
  display: flex;
  gap: 3px;
  align-items: center;
}

/* Leaders Button */
.leaders-card-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fdfbf7;
  cursor: pointer;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
}

.leaders-card-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--charcoal-ink);
}

.trophy-gold-3d {
  font-size: 1.3rem;
}

.leaders-meta {
  display: flex;
  flex-direction: column;
}

.leaders-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
}

.leaders-cta {
  font-size: 0.88rem;
  font-weight: 900;
  color: #18181b;
}

/* ==========================================================================
   Sector Selector Banner (Chunky Cyber-Pill)
   ========================================================================== */
.sector-selector-banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

.sector-arrow-btn {
  width: 38px;
  height: 48px;
  border-radius: 12px;
  background: #18181b;
  color: #fff;
  border: 2px solid #27272a;
  box-shadow: 0 4px 0 #000;
  font-size: 1.1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s;
}

.sector-arrow-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #000;
}

.sector-center-card {
  flex: 1;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #fff;
  border: 2.5px solid #18181b;
  border-radius: 14px;
  box-shadow: 0 4px 0 #18181b;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.1s;
}

.sector-center-card:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
}

.sector-center-card:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #18181b;
}

.sector-node-icon {
  font-size: 1.4rem;
}

.sector-text-content {
  display: flex;
  flex-direction: column;
}

.sector-tag-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #c4b5fd;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sector-main-title {
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
}

.sector-sub-target {
  font-size: 0.68rem;
  font-weight: 700;
  color: #a7f3d0;
}

/* ==========================================================================
   Mode & Difficulty Selector
   ========================================================================== */
.mode-tabs {
  display: flex;
  gap: 5px;
  width: 100%;
}

.mode-tab {
  flex: 1;
  text-align: center;
  padding: 5px 6px;
  background: #27272a;
  border: 1.8px solid #3f3f46;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #d4d4d8;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 0 #18181b;
}

.mode-tab.active {
  background: var(--vibe-cyan);
  color: #18181b;
  border-color: #18181b;
  box-shadow: 0 3px 0 #18181b;
}

.diff-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #18181b;
  border: 1.8px solid #27272a;
  border-radius: 10px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #a1a1aa;
}

.diff-pills {
  display: flex;
  gap: 4px;
}

.diff-pill {
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
  color: #71717a;
  transition: all 0.15s;
}

.diff-pill.active {
  background: var(--matrix-green);
  color: #fff;
  box-shadow: 0 1px 0 #000;
}

/* ==========================================================================
   Active Game Score & Moves HUD
   ========================================================================== */
.hud-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
}

.hud-item {
  background: var(--cream-card);
  border: 2px solid var(--charcoal-ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--charcoal-ink);
  padding: 4px 6px;
  text-align: center;
  color: var(--text-dark);
}

.hud-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 800;
}

.hud-value {
  font-size: 1.05rem;
  font-weight: 900;
  color: #18181b;
  line-height: 1.1;
}

.hud-value.highlight {
  color: #7c3aed;
}

.hud-value.moves {
  color: #059669;
}

/* Progress bar */
.progress-container {
  width: 100%;
  height: 8px;
  background: #18181b;
  border: 1.5px solid #27272a;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--vibe-cyan), var(--vibe-purple));
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Objective Bar */
.objective-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: #d1d5db;
  font-weight: 700;
}

.combo-badge {
  display: none;
  background: var(--vibe-red);
  color: #fff;
  border: 1.5px solid #18181b;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.68rem;
  font-weight: 900;
  animation: badgePop 0.3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePop {
  0% { transform: scale(0.6); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   In-Game Booster Buttons (Tactile Neubrutalist)
   ========================================================================== */
.boosters-bar {
  display: flex;
  gap: 8px;
  width: 100%;
}

.btn-booster {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--cream-card);
  color: var(--text-dark);
  border: 2px solid var(--charcoal-ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--charcoal-ink);
  padding: 5px 6px;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
  transition: all 0.1s;
}

.btn-booster:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--charcoal-ink);
}

.btn-booster.active {
  background: #fef08a;
  border-color: #ca8a04;
  transform: translateY(1px);
}

.booster-count {
  background: #18181b;
  color: #fff;
  border-radius: 999px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: 900;
}

/* ==========================================================================
   Board Frame & High-Definition Viber Tokens (Character Medallions)
   ========================================================================== */
.board-wrapper {
  position: relative;
  width: var(--board-size);
  height: var(--board-size);
  background: #18181b;
  border: 3.5px solid #18181b;
  border-radius: 20px;
  box-shadow: 0 8px 0 #09090b, 0 18px 30px rgba(0, 0, 0, 0.7);
  padding: 5px;
  overflow: hidden;
  touch-action: none;
  margin: 4px 0 2px;
}

.board-grid {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 3px;
}

/* Individual Slot */
.tile-slot {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 3D Viber Medallion Token Tile */
.tile {
  width: 94%;
  height: 94%;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.14s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(24, 24, 27, 0.85);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.55),
    inset 0 2px 2px rgba(255, 255, 255, 0.65),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3);
  will-change: transform, opacity;
  overflow: hidden;
}

/* 3D Glass Dome Highlight on Top of Tile */
.tile::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 2px;
  right: 2px;
  height: 42%;
  border-radius: 9px 9px 40% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 4;
}

/* Circular High-Res Viber Character Avatar Portrait */
.tile-avatar {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  background-size: 135%;
  background-position: center 30%;
  background-repeat: no-repeat;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: 2;
  pointer-events: none;
  transform: translateZ(0);
}

/* Hover & Selected Tile */
.tile:hover {
  transform: scale(1.05);
}

.tile.selected {
  transform: scale(1.15);
  outline: 3px solid var(--vibe-cyan);
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.95), 0 5px 0 #000;
  z-index: 10;
  animation: tileSelectedPulse 0.7s infinite alternate;
}

@keyframes tileSelectedPulse {
  0% { transform: scale(1.1); }
  100% { transform: scale(1.18); }
}

.tile.hammer-target {
  outline: 3px dashed var(--vibe-red);
  animation: tileSelectedPulse 0.5s infinite alternate;
}

.tile.hint-pulse {
  animation: tileHintBounce 0.6s infinite alternate ease-in-out;
  outline: 2.5px solid var(--vibe-gold);
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.9);
  z-index: 9;
}

@keyframes tileHintBounce {
  0% { transform: scale(1); }
  100% { transform: scale(1.14); }
}

/* Cascade & Drop Animations */
.tile.tile-drop {
  animation: tileCascade 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

@keyframes tileCascade {
  0% { transform: translateY(-26px) scale(0.8); opacity: 0; }
  75% { transform: translateY(2px) scale(1.02); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Pop Animation on Match */
.tile.pop {
  animation: tilePopEffect 0.16s forwards ease-out;
  pointer-events: none;
}

@keyframes tilePopEffect {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.22); filter: brightness(1.3); opacity: 0.9; }
  100% { transform: scale(0.1); opacity: 0; }
}

/* Special Power Badges */
.power-badge {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  border: 1.5px solid #fff;
  z-index: 8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  animation: badgePulse 1s infinite alternate;
}

@keyframes badgePulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.2); }
}

.power-line {
  background: var(--vibe-gold);
  color: #000;
}

.power-bomb {
  background: var(--vibe-red);
  color: #fff;
}

.power-rainbow {
  background: linear-gradient(135deg, #ef4444, #3b82f6, #10b981);
  color: #fff;
}

/* Ice Overlay */
.ice-overlay {
  position: absolute;
  inset: -1px;
  border-radius: 12px;
  background: rgba(186, 230, 253, 0.55);
  border: 2px solid #7dd3fc;
  backdrop-filter: blur(2px);
  z-index: 5;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.8);
}

.ice-overlay::after {
  content: '❄';
  font-size: 14px;
  color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Announcer Banner ("SWEET!", "TASTY!", "FRENZY!") */
.announcer-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 4px 0 #18181b, 0 0 20px var(--vibe-cyan);
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  animation: announcePop 0.85s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes announcePop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-8deg); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(3deg); }
  75% { opacity: 1; transform: translate(-50%, -60%) scale(1.05) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(0.8); }
}

/* ==========================================================================
   Big Playful "Tap to raid" Call to Action
   ========================================================================== */
.tap-to-play-text {
  margin: 3px 0 1px;
  text-align: center;
}

.tap-to-play-text span {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  text-shadow: 0 3px 0 #18181b, 0 6px 12px rgba(0, 0, 0, 0.8);
  display: inline-block;
  animation: tapBounce 1.5s infinite alternate ease-in-out;
}

@keyframes tapBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

/* ==========================================================================
   Career Bar & Bottom Controls
   ========================================================================== */
.career-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #18181b;
  border: 1.8px solid #27272a;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 800;
}

.rank-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fef08a;
}

.career-stats b {
  color: var(--vibe-cyan);
}

.bottom-controls {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.btn-secondary {
  background: var(--cream-card);
  color: var(--text-dark);
  border: 2px solid var(--charcoal-ink);
  box-shadow: 0 3px 0 var(--charcoal-ink);
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.1s;
}

.btn-secondary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--charcoal-ink);
}

.btn-primary {
  background: var(--vibe-cyan);
  color: #18181b;
  border: 2px solid var(--charcoal-ink);
  box-shadow: 0 3px 0 var(--charcoal-ink);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.1s;
  text-decoration: none;
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--charcoal-ink);
}

/* ==========================================================================
   Modals (Cream Sheets with 3D Depth)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 14px;
}

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

/* Cream Sheet */
.modal-card.danfo-sheet {
  background: #FFFDF8;
  color: var(--charcoal-ink);
  border: 3px solid var(--charcoal-ink);
  border-radius: 26px;
  width: 100%;
  max-width: 380px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 10px 0 var(--charcoal-ink);
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  padding: 0 0 20px 0;
}

.modal-overlay.active .modal-card.danfo-sheet {
  transform: translateY(0);
}

/* Scenic Banner with Sector Pill & Circular Close */
.scenic-banner {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: 22px 22px 0 0;
  border-bottom: 3px solid var(--charcoal-ink);
  overflow: hidden;
  background: linear-gradient(180deg, #1e1b4b 0%, #431407 50%, #7c3aed 80%, #a855f7 100%);
}

.scenic-area-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #4f46e5;
  color: #fff;
  border: 2px solid var(--charcoal-ink);
  box-shadow: 0 2.5px 0 var(--charcoal-ink);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.82rem;
  font-weight: 900;
  z-index: 10;
}

.circle-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: 2.5px solid var(--charcoal-ink);
  box-shadow: 0 3px 0 var(--charcoal-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  z-index: 10;
  transition: all 0.1s;
}

.circle-close-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--charcoal-ink);
}

.scenic-city-art {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.city-lock-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 2.5px solid var(--charcoal-ink);
  box-shadow: 0 3px 0 var(--charcoal-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

/* Sheet Content */
.danfo-sheet-content {
  padding: 16px 20px 0;
  text-align: center;
}

.sheet-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--charcoal-ink);
  margin-bottom: 2px;
}

.sheet-stamp-sub {
  font-size: 0.86rem;
  font-weight: 700;
  color: #4b5563;
  margin-bottom: 8px;
}

.sheet-stamp-holes {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 10px 0 16px;
}

.sheet-hole {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #4b5563;
  background: #f3f4f6;
  display: inline-block;
  transition: all 0.2s;
}

.sheet-hole.punched {
  background: var(--vibe-gold);
  border-color: #ca8a04;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.85);
  transform: scale(1.15);
}

/* Big Chunky Yellow Button */
.btn-danfo-cta {
  width: 100%;
  background: var(--vibe-gold);
  color: var(--charcoal-ink);
  border: 2.5px solid var(--charcoal-ink);
  border-radius: 16px;
  box-shadow: 0 5px 0 var(--charcoal-ink);
  padding: 12px;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.1s;
}

.btn-danfo-cta:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--charcoal-ink);
}

.sheet-divider {
  position: relative;
  margin: 14px 0 10px;
  text-align: center;
}

.sheet-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #d1d5db;
}

.sheet-divider span {
  position: relative;
  background: #FFFDF8;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #9ca3af;
  text-transform: uppercase;
}

.hurry-tag {
  font-size: 0.88rem;
  font-weight: 800;
  color: #4f46e5;
  margin-bottom: 10px;
}

/* Single-Tap Google Sign-in Pill */
.btn-google-pill {
  width: 100%;
  background: #18181b;
  color: #fff;
  border: 2.5px solid #18181b;
  border-radius: 999px;
  box-shadow: 0 4px 0 #000;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.1s;
}

.btn-google-pill:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #000;
}

.sheet-trust-caption {
  margin-top: 10px;
  font-size: 0.72rem;
  color: #6b7280;
  font-weight: 600;
  line-height: 1.3;
}

/* Nickname and Standard Modal Overhaul */
.modal-card:not(.danfo-sheet) {
  background: #FFFDF8;
  color: var(--charcoal-ink);
  border: 3px solid var(--charcoal-ink);
  border-radius: 26px;
  box-shadow: 0 10px 0 var(--charcoal-ink);
  padding: 22px;
  text-align: center;
  width: 100%;
  max-width: 380px;
}

.modal-header h2 {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--charcoal-ink);
  margin-bottom: 4px;
}

.nickname-input-group {
  margin: 16px 0;
  text-align: left;
}

.nickname-input {
  width: 100%;
  background: #fff;
  border: 2.5px solid var(--charcoal-ink);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--charcoal-ink);
  color: var(--charcoal-ink);
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  outline: none;
  margin-top: 6px;
}

.nickname-input:focus {
  border-color: var(--vibe-cyan);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

/* Star Rating in Win Modal */
.modal-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 2.2rem;
  color: var(--vibe-gold);
  filter: drop-shadow(0 2px 4px rgba(234, 179, 8, 0.5));
}

.modal-stats {
  background: #f8fafc;
  border: 2px solid var(--charcoal-ink);
  border-radius: 14px;
  padding: 10px;
  margin: 10px 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.unlocked-pfp {
  margin: 10px 0;
  padding: 12px;
  background: #faf5ff;
  border: 2px solid #c084fc;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pfp-preview {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  margin: 6px 0;
  border: 2.5px solid var(--vibe-purple);
  box-shadow: 0 4px 0 #6b21a8;
}

.btn-download-pfp {
  background: var(--vibe-purple);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: none;
  border: 1.5px solid #18181b;
  box-shadow: 0 2px 0 #18181b;
}

.btn-share-x {
  background: #000;
  color: #fff;
  padding: 10px;
  border-radius: 14px;
  border: 2px solid #18181b;
  box-shadow: 0 3px 0 #000;
  font-weight: 800;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-share-x:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #000;
}

/* Tutorial Slide */
.tutorial-slide {
  margin: 12px 0;
  background: #f8fafc;
  border: 2px solid var(--charcoal-ink);
  border-radius: 16px;
  padding: 12px;
  text-align: left;
}

.tutorial-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.tutorial-item:last-child {
  margin-bottom: 0;
}

.tutorial-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--vibe-cyan);
  color: #18181b;
  border: 2px solid var(--charcoal-ink);
  box-shadow: 0 2px 0 var(--charcoal-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
}

.tutorial-text h4 {
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--charcoal-ink);
  margin-bottom: 2px;
}

.tutorial-text p {
  font-size: 0.74rem;
  color: #4b5563;
  line-height: 1.25;
}

/* Saga Map Grid */
.saga-map-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 14px 0;
  padding: 6px;
}

.saga-stage-node {
  aspect-ratio: 1;
  border-radius: 14px;
  background: #f8fafc;
  border: 2px solid var(--charcoal-ink);
  box-shadow: 0 3px 0 var(--charcoal-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s;
  font-weight: 900;
  font-size: 0.95rem;
}

.saga-stage-node.locked {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.saga-stage-node.current {
  background: var(--vibe-cyan);
  border-color: #0d9488;
  transform: scale(1.06);
}

.saga-stage-node.cleared {
  background: #dcfce7;
  color: #15803d;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px;
}

.gallery-item {
  border-radius: 14px;
  border: 2px solid var(--charcoal-ink);
  box-shadow: 0 3px 0 var(--charcoal-ink);
  background: #fff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
}

.gallery-item span {
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 4px;
  color: #18181b;
}

/* Screen Shake Effect */
.shake {
  animation: boardShake 0.28s ease-in-out;
}

@keyframes boardShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 3px); }
  40% { transform: translate(4px, -3px); }
  60% { transform: translate(-3px, 2px); }
  80% { transform: translate(2px, -1px); }
}

/* Laser Beam Effect */
.laser-beam {
  position: absolute;
  background: linear-gradient(90deg, transparent, #00f5d4, #ffffff, #00f5d4, transparent);
  z-index: 25;
  pointer-events: none;
  animation: beamFlash 0.3s forwards;
}

.laser-beam.horizontal {
  left: 0;
  width: 100%;
  height: 8px;
}

.laser-beam.vertical {
  top: 0;
  height: 100%;
  width: 8px;
  background: linear-gradient(180deg, transparent, #00f5d4, #ffffff, #00f5d4, transparent);
}

@keyframes beamFlash {
  0% { opacity: 0; transform: scaleY(0.2); }
  50% { opacity: 1; transform: scaleY(2); }
  100% { opacity: 0; transform: scaleY(0.1); }
}
