/* Design Tokens & Theme Variables */
:root {
  --bg-primary: #05060b;
  --bg-secondary: rgba(13, 16, 27, 0.85);
  --bg-tertiary: rgba(22, 28, 48, 0.95);
  
  --color-text-main: #f5f8ff;
  --color-text-muted: #7d889b;
  
  --neon-cyan: #00f0ff;
  --neon-purple: #a855f7;
  --neon-gold: #ffbd00;
  --neon-green: #39ff14;
  --neon-red: #ff3366;
  
  --border-glass: rgba(0, 240, 255, 0.12);
  --shadow-neon-cyan: 0 0 15px rgba(0, 240, 255, 0.45);
  --shadow-neon-gold: 0 0 20px rgba(255, 189, 0, 0.55);
  --shadow-neon-purple: 0 0 15px rgba(168, 85, 247, 0.45);
  
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  
  --transition-speed: 0.18s;
}

/* Global Reset & Base Style */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.hidden {
  display: none !important;
}

body {
  background-color: var(--bg-primary);
  /* Cyberpunk Tech Grid Background */
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    radial-gradient(at 5% 5%, rgba(168, 85, 247, 0.18) 0px, transparent 45%),
    radial-gradient(at 95% 95%, rgba(0, 240, 255, 0.12) 0px, transparent 45%);
  background-size: 32px 32px, 32px 32px, 100% 100%, 100% 100%;
  color: var(--color-text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* App Container with Tech frame feel */
#game-container {
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 15px;
  padding-left: calc(15px + env(safe-area-inset-left));
  padding-right: calc(15px + env(safe-area-inset-right));
  position: relative;
}

/* Header */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(13, 16, 27, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  margin-bottom: 15px;
  box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.03), 0 4px 20px rgba(0,0,0,0.5);
  position: relative;
}

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

.logo-icon {
  font-size: 2rem;
  text-shadow: var(--shadow-neon-cyan);
  animation: pulse-glow 2s infinite alternate;
}

.logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(45deg, var(--neon-cyan), #ffffff, var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 12px rgba(0, 240, 255, 0.25);
  font-family: var(--font-mono);
}

.header-controls {
  display: flex;
  gap: 10px;
}

.control-btn {
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-main);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition-speed);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}

.control-btn:hover {
  background: var(--neon-purple);
  border-color: var(--neon-purple);
  color: #fff;
  box-shadow: var(--shadow-neon-purple);
  transform: translateY(-2px);
}

.control-btn.secondary:hover {
  background: var(--neon-red);
  border-color: var(--neon-red);
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.5);
}

/* Stats Board Display (Tech Dashboard) */
.stats-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-speed);
  box-shadow: 0 8px 25px rgba(0,0,0,0.4), inset 0 0 15px rgba(0, 240, 255, 0.05);
}

/* Cyber corner brackets on status cards */
.stat-card::before, .stat-card::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--neon-cyan);
  border-style: solid;
  pointer-events: none;
}
.stat-card::before {
  top: -1px; left: -1px;
  border-width: 2.5px 0 0 2.5px;
  border-top-left-radius: 6px;
}
.stat-card::after {
  bottom: -1px; right: -1px;
  border-width: 0 2.5px 2.5px 0;
  border-bottom-right-radius: 6px;
}

.balance-card {
  text-align: center;
  background: linear-gradient(135deg, rgba(13, 16, 27, 0.95), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(168, 85, 247, 0.4);
}
.balance-card::before, .balance-card::after {
  border-color: var(--neon-purple);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  font-weight: 600;
}

.stat-value {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--neon-gold);
  text-shadow: var(--shadow-neon-gold);
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

.coin-unit {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-main);
  opacity: 0.8;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card.mini {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-sub-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* Layout Wrapper for Columns */
.layout-wrapper {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  flex-grow: 1;
}

/* Left Column: Mining Area */
.mining-area {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mining-visual {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 25px rgba(0, 240, 255, 0.05);
}

/* Add a radar/circuit line overlay to the mining background */
.mining-visual::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle, transparent 40%, rgba(5,6,11,0.5) 100%),
              repeating-radial-gradient(circle, rgba(0, 240, 255, 0.02) 0px, rgba(0, 240, 255, 0.02) 2px, transparent 2px, transparent 40px);
  pointer-events: none;
}

/* Particle Container */
#click-effect-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.coin-wrapper {
  position: relative;
  width: 190px;
  height: 190px;
  margin-bottom: 25px;
  z-index: 5;
}

.coin-glow {
  position: absolute;
  top: -10px;
  left: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 189, 0, 0.45) 0%, rgba(168, 85, 247, 0.1) 45%, transparent 70%);
  animation: pulse-glow 2s infinite alternate;
  pointer-events: none;
}

.main-coin {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.15s;
  touch-action: manipulation;
  background: linear-gradient(135deg, #ffe066 0%, #b8860b 100%);
  box-shadow: 
    0 18px 40px rgba(255, 189, 0, 0.4),
    0 8px 15px rgba(0, 0, 0, 0.6),
    inset 0 -10px 20px rgba(0, 0, 0, 0.45),
    inset 0 10px 20px rgba(255, 255, 255, 0.45);
  border: 4px solid #d4af37;
}

.main-coin:hover {
  transform: translateY(-5px) scale(1.04);
  box-shadow: 
    0 25px 45px rgba(255, 189, 0, 0.5),
    0 10px 22px rgba(0, 0, 0, 0.5),
    inset 0 -10px 20px rgba(0, 0, 0, 0.45),
    inset 0 10px 20px rgba(255, 255, 255, 0.45);
}

.coin-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #fff3a8 5%, #ffd700 50%, #8b6508 100%);
}

.coin-symbol {
  font-size: 6.5rem;
  font-weight: 800;
  color: #704f00;
  text-shadow: 
    2px 2px 0px rgba(255, 255, 255, 0.6), 
    -2px -2px 0px rgba(0, 0, 0, 0.45),
    0 0 15px rgba(255, 215, 0, 0.5);
  animation: shine-symbol 4s infinite ease-in-out;
}

.main-coin.clicking {
  animation: coin-bounce-active 0.06s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transition: none !important;
}

@keyframes coin-bounce-active {
  0% { transform: scale(1.04) translateY(-5px); }
  50% { transform: scale(0.88) translateY(4px); }
  100% { transform: scale(1.04) translateY(-5px); }
}

.click-instruction {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-align: center;
  animation: float-text 2s infinite alternate ease-in-out;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Buff Indicator */
.buff-container {
  display: flex;
  align-items: center;
  gap: 15px;
  background: linear-gradient(90deg, rgba(255, 51, 102, 0.25), rgba(255, 189, 0, 0.08));
  border: 1px solid rgba(255, 51, 102, 0.35);
  border-radius: 12px;
  padding: 12px 18px;
  backdrop-filter: blur(10px);
  animation: border-pulse 1s infinite alternate;
}

.buff-icon {
  font-size: 1.7rem;
  animation: shake 0.6s infinite;
}

.buff-info {
  flex-grow: 1;
}

.buff-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ff3366;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(255, 51, 102, 0.3);
}

.buff-progress-bar {
  background: rgba(255, 255, 255, 0.1);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}

.buff-progress {
  background: linear-gradient(90deg, var(--neon-red), var(--neon-gold));
  height: 100%;
  width: 100%;
  transition: width 0.1s linear;
}

/* Hacker Console Logs with Scanline Layer */
.console-log-wrapper {
  position: relative;
  background: #040509;
  border: 1px solid rgba(0, 255, 102, 0.25);
  border-radius: 14px;
  padding: 12px 15px;
  box-shadow: inset 0 0 20px rgba(0, 255, 102, 0.08), 0 5px 15px rgba(0,0,0,0.6);
  overflow: hidden;
}

/* Scanline Effect Overlay */
.console-log-wrapper::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%), 
              linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.05));
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.85;
}

.console-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(0, 255, 102, 0.15);
  padding-bottom: 6px;
  position: relative;
  z-index: 3;
}

.console-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.console-dot.green { background-color: var(--neon-green); box-shadow: 0 0 5px var(--neon-green); }
.console-dot.yellow { background-color: var(--neon-gold); box-shadow: 0 0 5px var(--neon-gold); }
.console-dot.red { background-color: var(--neon-red); box-shadow: 0 0 5px var(--neon-red); }

.console-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--neon-green);
  margin-left: 5px;
  opacity: 0.85;
  letter-spacing: 1px;
}

.console-log-content {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--neon-green);
  text-shadow: 0 0 5px rgba(57, 255, 20, 0.45);
  height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
  opacity: 0.95;
  background: transparent;
  padding-right: 5px;
  position: relative;
  z-index: 3;
}

.console-log-content div {
  white-space: normal;
  word-break: break-all;
  line-height: 1.45;
}

/* Right Column: Shop Area (Console Terminal Grid) */
.shop-area {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 20px;
  backdrop-filter: blur(12px);
  height: max-content;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(0, 240, 255, 0.05);
}

.shop-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--color-text-muted);
  padding: 10px 5px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-speed);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-main);
}

.tab-btn.active {
  background: var(--bg-tertiary);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
  transform: translateY(-1px);
}

/* Buy Qty Multiplier Selector (Arcade Toggle style) */
.buy-qty-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 12, 22, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 15px;
  font-size: 0.85rem;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.selector-label {
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.selector-buttons {
  display: flex;
  gap: 5px;
}

.qty-btn {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  transition: all 0.15s;
}

.qty-btn:hover {
  color: var(--color-text-main);
  background: rgba(255, 255, 255, 0.05);
}

.qty-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 240, 255, 0.03));
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Shop Upgrade Items Container */
.shop-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Custom Scrollbar */
.shop-list::-webkit-scrollbar,
.console-log-content::-webkit-scrollbar {
  width: 6px;
}

.shop-list::-webkit-scrollbar-track,
.console-log-content::-webkit-scrollbar-track {
  background: transparent;
}

.shop-list::-webkit-scrollbar-thumb,
.console-log-content::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.15);
  border-radius: 3px;
}

.shop-list::-webkit-scrollbar-thumb:hover,
.console-log-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.35);
}

/* Upgrade Card design (Interactive game panel) */
.upgrade-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(16, 20, 34, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all var(--transition-speed);
  position: relative;
  overflow: visible;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.upgrade-item:hover:not(.locked):not(.disabled) {
  background: rgba(26, 32, 54, 0.85);
  border-color: var(--neon-cyan);
  box-shadow: 0 6px 18px rgba(0, 240, 255, 0.12);
  transform: translateY(-2.5px);
}

/* Float Animation on icon hover */
.upgrade-item:hover:not(.locked):not(.disabled) .upgrade-icon {
  animation: bounce-icon 0.6s ease-in-out infinite alternate;
}

.upgrade-item.locked {
  cursor: not-allowed;
  opacity: 0.3;
  background: rgba(8, 9, 14, 0.8);
  border-color: rgba(255,255,255,0.03);
}

.upgrade-item.disabled:not(.locked) {
  border-color: rgba(255, 255, 255, 0.05);
}

.upgrade-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.04), 0 3px 6px rgba(0,0,0,0.3);
}

.upgrade-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.upgrade-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.upgrade-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: keep-all;
}

.upgrade-effect {
  font-size: 0.72rem;
  color: var(--neon-green);
  font-weight: 800;
  font-family: var(--font-mono);
  margin-top: 1px;
  text-shadow: 0 0 5px rgba(57, 255, 20, 0.2);
}

.upgrade-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.upgrade-qty {
  font-size: 0.72rem;
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-weight: 800;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 1px 7px;
  border-radius: 5px;
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.25);
}

/* Buy Button (Neon game trigger) */
.buy-button {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--color-text-muted);
  padding: 5px 8px;
  width: 85px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: all 0.15s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.buy-button.active {
  background: linear-gradient(135deg, rgba(255, 189, 0, 0.15), rgba(168, 85, 247, 0.05));
  border: 1px solid var(--neon-gold);
  color: var(--neon-gold);
  box-shadow: 0 0 10px rgba(255, 189, 0, 0.2);
}

.buy-button.active:hover {
  background: var(--neon-gold);
  color: #05060b;
  box-shadow: var(--shadow-neon-gold);
  font-weight: 800;
  transform: translateY(-1px);
}

.buy-button:active {
  transform: translateY(1px);
}

.buy-cost {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.buy-unit {
  font-size: 0.58rem;
  font-weight: 800;
  opacity: 0.85;
}

/* Stats Tab Details Panel */
.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
}

.stats-row span:last-child {
  font-family: var(--font-mono);
  color: var(--neon-cyan);
  font-weight: 700;
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.15);
}

.danger-btn {
  background: rgba(255, 51, 102, 0.08);
  border: 1px solid var(--neon-red);
  color: var(--neon-red);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  margin-top: 15px;
  transition: all var(--transition-speed);
}

.danger-btn:hover {
  background: var(--neon-red);
  color: var(--color-text-main);
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
}

/* Golden Coin Event Target (Holographic space capsule) */
.golden-coin {
  position: fixed;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10000;
  animation: rotate-gold 6s linear infinite;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  touch-action: none;
  overflow: visible;
}

.golden-coin-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #fff6cc 0%, #ffbd00 50%, #d48a00 100%);
  border: 3px solid #ffffff;
  box-shadow: 
    0 0 25px #ffbd00,
    0 0 45px rgba(255, 189, 0, 0.5),
    inset 0 3px 5px #ffffff,
    inset 0 -3px 5px rgba(0, 0, 0, 0.3);
  position: relative;
}

.golden-coin-symbol {
  font-size: 2.5rem;
  font-weight: 800;
  color: #704f00;
  text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.8);
  line-height: 1;
}

.golden-coin-tag {
  position: absolute;
  bottom: -6px;
  background: linear-gradient(135deg, var(--neon-red), #e6005c);
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1.5px solid #ffffff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
  animation: flash-tag 0.6s infinite alternate ease-in-out;
  letter-spacing: 0.8px;
  font-family: var(--font-main);
}

.golden-coin:hover {
  transform: scale(1.12);
}

.golden-coin:active {
  transform: scale(1.25);
}

/* Floating Click Effect Text */
.click-effect {
  position: absolute;
  color: var(--neon-gold);
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  pointer-events: none;
  z-index: 100;
  animation: float-up-fade 0.8s ease-out forwards;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6), 0 0 10px rgba(255,189,0,0.5);
}

.click-effect.golden {
  color: var(--neon-cyan);
  text-shadow: 0 2px 4px rgba(0,0,0,0.6), 0 0 12px var(--neon-cyan);
  font-size: 1.55rem;
}

/* Particle Explosion */
.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9;
  animation: explode-particle 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

/* Welcome Dialog Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 5, 9, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  background: #0f121f;
  border: 2px solid rgba(168, 85, 247, 0.45);
  border-radius: 20px;
  padding: 35px 30px;
  max-width: 460px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-neon-purple), 0 10px 50px rgba(0, 0, 0, 0.8);
  animation: zoom-in-fade 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 21px;
  pointer-events: none;
}

.modal-content h2 {
  font-size: 1.6rem;
  margin-bottom: 18px;
  color: var(--neon-cyan);
  text-shadow: var(--shadow-neon-cyan);
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

.modal-content p {
  font-size: 0.95rem;
  color: #adb6c4;
  line-height: 1.65;
  margin-bottom: 18px;
}

.modal-buttons {
  margin-top: 25px;
}

.modal-btn {
  background: linear-gradient(45deg, var(--neon-cyan), var(--neon-purple));
  color: white;
  border: none;
  padding: 12px 35px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-speed);
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
  letter-spacing: 1px;
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.65);
}

/* Mobile Nav Elements & Footer for Desktop */
.mobile-nav {
  display: none;
}

.game-footer {
  text-align: center;
  padding: 15px 0 0 0;
  border-top: 1px solid var(--border-glass);
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.game-footer a {
  color: var(--neon-cyan);
  text-decoration: none;
}

.game-footer a:hover {
  text-decoration: underline;
}

/* CSS Keyframe Animations */
@keyframes pulse-glow {
  from {
    filter: drop-shadow(0 0 5px rgba(255, 189, 0, 0.35));
  }
  to {
    filter: drop-shadow(0 0 18px rgba(255, 189, 0, 0.75));
  }
}

@keyframes border-pulse {
  from { border-color: rgba(255, 51, 102, 0.35); }
  to { border-color: rgba(255, 51, 102, 0.85); box-shadow: 0 0 12px rgba(255, 51, 102, 0.35); }
}

@keyframes float-text {
  from { transform: translateY(0); opacity: 0.75; }
  to { transform: translateY(-6px); opacity: 1; }
}

@keyframes float-up-fade {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-85px) scale(0.75) rotate(6deg);
    opacity: 0;
  }
}

@keyframes explode-particle {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0);
    opacity: 0;
  }
}

@keyframes zoom-in-fade {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes rotate-gold {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

@keyframes shine-symbol {
  0%, 100% {
    text-shadow: 
      2px 2px 0px rgba(255, 255, 255, 0.6), 
      -2px -2px 0px rgba(0, 0, 0, 0.45),
      0 0 10px rgba(255, 215, 0, 0.5);
  }
  50% {
    text-shadow: 
      2px 2px 0px rgba(255, 255, 255, 0.85), 
      -2px -2px 0px rgba(0, 0, 0, 0.5),
      0 0 25px rgba(255, 215, 0, 0.9),
      0 0 40px rgba(255, 189, 0, 0.65);
  }
}

@keyframes flash-tag {
  from {
    transform: scale(0.9);
    box-shadow: 0 2px 4px rgba(255, 51, 102, 0.4);
    filter: brightness(1);
  }
  to {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.8);
    filter: brightness(1.2);
  }
}

@keyframes bounce-icon {
  from { transform: translateY(0); }
  to { transform: translateY(-4.5px); }
}

/* RESPONSIVE LAYOUTS */
@media (max-width: 900px) {
  #game-container {
    padding: 10px;
  }
  
  .layout-wrapper {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* Mobile Screens (Touch layout override) */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }

  #game-container {
    min-height: calc(100dvh - 60px - env(safe-area-inset-bottom));
    padding-bottom: 10px;
    padding-top: env(safe-area-inset-top);
  }
  
  .layout-wrapper {
    display: block;
  }
  
  .mining-area {
    display: flex;
  }
  
  .shop-area {
    display: none;
    margin-top: 10px;
  }
  
  .mining-area.mobile-hidden,
  .shop-area.mobile-hidden {
    display: none !important;
  }
  
  .mining-area.visible {
    display: flex !important;
  }
  
  .shop-area.visible {
    display: flex !important;
  }

  .mining-visual {
    padding: 30px 10px;
    min-height: 300px;
  }
  
  .coin-wrapper {
    width: 150px;
    height: 150px;
  }
  
  .coin-symbol {
    font-size: 4.8rem;
  }

  /* Bottom Fixed Navigation Bar */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #0d0f17;
    border-top: 1px solid var(--border-glass);
    z-index: 990;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
  }
  
  .mobile-nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: all var(--transition-speed);
  }
  
  .mobile-nav-btn.active {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.03);
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
    border-top: 2px solid var(--neon-cyan);
  }
  
  .shop-list {
    max-height: 380px;
  }
}

/* Clicking Tap Shockwave Effect */
.shockwave {
  position: absolute;
  border: 2px solid var(--neon-cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99;
  transform: translate(-50%, -50%);
  animation: shockwave-expand 0.38s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes shockwave-expand {
  0% {
    width: 0;
    height: 0;
    opacity: 0.9;
    box-shadow: 0 0 10px var(--neon-cyan), inset 0 0 5px var(--neon-cyan);
  }
  100% {
    width: 150px;
    height: 150px;
    opacity: 0;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0), inset 0 0 15px rgba(0, 240, 255, 0);
  }
}

/* Physical Tossed Coin Particle */
.phys-coin {
  position: absolute;
  pointer-events: none;
  z-index: 95;
  font-size: 1.5rem;
  animation-duration: 0.8s;
  animation-fill-mode: forwards;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.throw-left-shallow { animation-name: toss-left-shallow; }
.throw-left-steep { animation-name: toss-left-steep; }
.throw-right-shallow { animation-name: toss-right-shallow; }
.throw-right-steep { animation-name: toss-right-steep; }

@keyframes toss-left-shallow {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(0.6); opacity: 1; }
  40% { transform: translate(-55px, -60px) rotate(140deg) scale(1.1); opacity: 1; }
  100% { transform: translate(-110px, 160px) rotate(280deg) scale(0.6); opacity: 0; }
}

@keyframes toss-left-steep {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(0.6); opacity: 1; }
  45% { transform: translate(-30px, -95px) rotate(180deg) scale(1.1); opacity: 1; }
  100% { transform: translate(-65px, 170px) rotate(360deg) scale(0.6); opacity: 0; }
}

@keyframes toss-right-shallow {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(0.6); opacity: 1; }
  40% { transform: translate(55px, -60px) rotate(-140deg) scale(1.1); opacity: 1; }
  100% { transform: translate(110px, 160px) rotate(-280deg) scale(0.6); opacity: 0; }
}

@keyframes toss-right-steep {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(0.6); opacity: 1; }
  45% { transform: translate(30px, -95px) rotate(-180deg) scale(1.1); opacity: 1; }
  100% { transform: translate(65px, 170px) rotate(-360deg) scale(0.6); opacity: 0; }
}
