:root {
  --primary: #ff2a2a;
  --secondary: #ff8800;
  --accent: #00ffff;
  --bg-dark: #050510;
  --glass: rgba(20, 10, 10, 0.85);
  --glass-border: rgba(255, 50, 50, 0.3);
  --text-main: #eeeeee;
  --font-head: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: radial-gradient(circle at center, #1a0505 0%, #000 100%);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-body);
  color: var(--text-main);
  overflow: hidden;
  user-select: none;
}

#gameContainer {
  position: relative;
  width: 98vw;
  max-width: 1000px;
  aspect-ratio: 1.7 / 1;
  /* Increased height from 2/1 */
  border: 2px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 0 50px rgba(255, 0, 0, 0.2), inset 0 0 100px #000;
  overflow: hidden;
  background: #000;
  transition: all 0.3s ease;
}

#devInfoBtn {
  position: absolute;
  bottom: 15px;
  left: 15px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 110;
}

#devInfoBtn:hover {
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent));
  transform: scale(1.1);
}

#devModal {
  position: absolute;
  bottom: 80px;
  left: 20px;
  background: rgba(10, 10, 15, 0.95);
  border: 1px solid var(--accent);
  padding: 20px;
  border-radius: 8px;
  z-index: 200;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.1);
  font-family: var(--font-head);
  transition: opacity 0.3s;
}

#devModal h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 10px;
}

#devModal .highlight {
  color: #fff;
  text-shadow: 0 0 10px var(--accent);
}

#devModal.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Literal Fullscreen Experience */
#gameContainer:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameCanvas {
  display: block;
  background: #000;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Keeps aspect ratio clean in fullscreen */
}

/* --- Screens & Glassmorphism --- */
.screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 5, 5, 0.95), rgba(5, 0, 0, 0.98));
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  transition: opacity 0.3s ease;
}

.screen.hidden {
  opacity: 0;
  pointer-events: none;
  display: flex;
  /* Maintain flex layout but hidden visually */
}

/* --- Typography --- */
.screen h1 {
  font-family: var(--font-head);
  font-size: 5.5rem;
  font-weight: 900;
  background: linear-gradient(to bottom, #fff, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px var(--primary));
  margin-bottom: 0px;
  letter-spacing: -2px;
  transform: skewX(-5deg);
}

.screen h2 {
  font-family: var(--font-head);
  font-size: 3.5rem;
  color: var(--primary);
  text-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.menu-stats {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: #888;
  margin-bottom: 2.5rem;
  letter-spacing: 1px;
}

.menu-stats span {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
}

/* --- Buttons --- */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  width: 100%;
}

button {
  font-family: var(--font-head);
  background: linear-gradient(90deg, transparent 0%, rgba(255, 0, 0, 0.1) 50%, transparent 100%);
  border: 1px solid var(--primary);
  border-left: 4px solid var(--primary);
  border-right: 4px solid var(--primary);
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  width: 320px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

.farm-mini-btn {
  position: absolute;
  top: -15px;
  right: -20px;
  width: auto !important;
  padding: 6px 12px !important;
  font-size: 0.75rem !important;
  clip-path: none !important;
  background: linear-gradient(135deg, #2d5016 0%, #4a7c2c 100%) !important;
  border: 2px solid #5a9c3c !important;
  border-radius: 4px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 0 15px rgba(74, 124, 44, 0.5);
}

.farm-mini-btn:hover {
  transform: scale(1.1) rotate(3deg);
  background: linear-gradient(135deg, #4a7c2c 0%, #5a9c3c 100%) !important;
}

button:hover {
  background: var(--primary);
  color: #000;
  transform: scale(1.05) translateX(5px);
  box-shadow: 0 0 30px var(--primary);
}

button:active {
  transform: scale(0.98);
}

/* Secondary/Back Buttons */
.back-btn {
  margin-top: 30px;
  border-color: #666;
  color: #aaa;
  width: auto;
  min-width: 200px;
}

.back-btn:hover {
  background: #666;
  box-shadow: 0 0 15px #666;
}

/* UI Elements */
/* --- Shop Grid --- */
.shop-balance {
  font-size: 2.2rem;
  color: var(--accent);
  text-shadow: 0 0 15px var(--accent);
  margin-bottom: 30px;
  font-weight: 700;
}

.shop-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 950px;
}

.shop-item {
  background: rgba(20, 0, 0, 0.6);
  border: 1px solid #400;
  border-radius: 4px;
  padding: 15px;
  width: 170px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.shop-item:hover {
  background: rgba(50, 10, 10, 0.8);
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(255, 0, 0, 0.2);
}

.item-name {
  font-family: var(--font-head);
  font-size: 0.8rem;
  color: #fff;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.item-cost {
  font-size: 1.2rem;
  color: var(--secondary);
  margin-bottom: 5px;
  font-weight: bold;
}

.item-desc {
  font-size: 0.85rem;
  color: #888;
}

/* --- Settings Menu --- */
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 340px;
  align-items: center;
}

.setting-btn {
  border-color: var(--accent);
  width: 100%;
}

.setting-btn:hover {
  background: var(--accent);
  box-shadow: 0 0 25px var(--accent);
}

.danger-zone {
  margin-top: 40px;
  width: 100%;
  border-top: 1px solid #333;
  padding-top: 20px;
}

.reset-btn {
  background: rgba(50, 0, 0, 0.3);
  border-color: #ff0000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ff4444;
  width: 100%;
}

.reset-btn svg {
  width: 20px;
  height: 20px;
}

.reset-btn:hover {
  background: #ff0000;
  color: #000;
  box-shadow: 0 0 30px #ff0000;
}

/* --- Volume Slider Modernization --- */
.volume-container {
  width: 100%;
  padding: 0 20px;
  background: rgba(0, 255, 255, 0.05);
  border-left: 2px solid var(--accent);
  padding: 15px;
  margin-bottom: 20px;
}

.val-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.val-label {
  font-family: var(--font-head);
  font-size: 0.75rem;
  color: #fff;
  letter-spacing: 1px;
}

.val-percent {
  font-family: var(--font-head);
  font-size: 0.75rem;
  color: var(--accent);
}

.slider-box {
  display: flex;
  align-items: center;
  gap: 15px;
}

.vol-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.cyber-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #222;
  outline: none;
  cursor: pointer;
  border-radius: 2px;
}

.cyber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  transition: transform 0.1s ease;
}

.cyber-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.cyber-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  transition: transform 0.1s ease;
}

#instructionsBtn {
  margin-top: 20px;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: color 0.2s;
}

#instructionsBtn:hover {
  color: #fff;
  text-shadow: 0 0 10px #fff;
}

.version {
  position: absolute;
  bottom: 15px;
  right: 20px;
  font-size: 0.8rem;
  color: #444;
  font-family: var(--font-head);
}

.highlight {
  color: var(--accent);
  font-weight: bold;
}

.key {
  display: inline-block;
  background: #222;
  border: 1px solid #444;
  border-bottom: 3px solid #444;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-head);
  font-size: 0.85rem;
  color: #fff;
  margin: 0 2px;
}

/* --- Shop Max State --- */
.disabled-item {
  opacity: 0.5;
  filter: grayscale(0.8);
  cursor: default !important;
  pointer-events: none;
  border-color: #333 !important;
  background: rgba(10, 10, 10, 0.5) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* --- Transparent Swal Logic --- */
.transparent-popup {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

.no-bg-container {
  background: transparent !important;
}

/* --- Settings Pagination --- */
.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 340px;
}

.tab-btn {
  flex: 1;
  padding: 8px !important;
  font-size: 0.8rem !important;
  width: auto !important;
  clip-path: none !important;
  border-radius: 4px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid #333 !important;
  color: #888 !important;
}

.tab-btn.active {
  background: var(--accent) !important;
  color: #000 !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 15px var(--accent);
}

.settings-page {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
}

.settings-page.active {
  display: flex;
}

.sub-header {
  font-family: var(--font-head);
  font-size: 1rem;
  color: #fff;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid #333;
  padding-bottom: 8px;
}

#pauseMenu h2 {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent);
}