@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --primary: #00a3e0;
  --secondary: #8dc63f;
  --danger: #e5243b;
  --warning: #ffb703;
  --dark: #0f141c;
  --dark-panel: #18202c;
  --light: #f8fafc;
  --border-color: #2a3b50;
  --accent-glow: rgba(0, 163, 224, 0.4);
  --font-pixel: 'Press Start 2P', monospace, monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #070a0e;
  font-family: var(--font-pixel);
  color: var(--light);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Background animated pixel ambiance */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 50% 20%, rgba(0, 163, 224, 0.12), transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(141, 198, 63, 0.08), transparent 60%),
    linear-gradient(180deg, #090e16 0%, #030508 100%);
  z-index: -2;
}

/* Retro CRT scanline effect */
.crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 15;
  opacity: 0.7;
}

/* Main Cabinet Container */
.arcade-cabinet {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--dark);
  box-shadow: 0 0 35px rgba(0, 163, 224, 0.25), 0 0 10px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  border-left: 2px solid var(--border-color);
  border-right: 2px solid var(--border-color);
}

@media (min-width: 600px) {
  .arcade-cabinet {
    height: 96vh;
    border: 3px solid #233448;
    border-radius: 12px;
  }
}

/* Views Switching: Full Start Screen vs Full Gameplay Screen */
.main-screen-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #090e15;
  overflow: hidden;
  position: relative;
  z-index: 5;
}

.start-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 32px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.start-hero-header {
  text-align: center;
  margin-bottom: 2px;
}

.main-title {
  font-size: 16px;
  color: #00a3e0;
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.main-subtitle {
  font-size: 9px;
  color: #ffb703;
  letter-spacing: 0.5px;
}

.silos-banner {
  border: 2px solid #00a3e0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 163, 224, 0.25);
  background: #000;
}

.silos-banner img {
  width: 100%;
  display: block;
  image-rendering: pixelated;
}

.silos-caption {
  background: #09121a;
  padding: 6px 8px;
  font-size: 7px;
  color: #94a3b8;
  text-align: center;
}

.main-game-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #000;
  position: relative;
  overflow: hidden;
}

/* Header bar */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: linear-gradient(180deg, #1f2c3d, #121a24);
  border-bottom: 2px solid #00a3e0;
  font-size: 9px;
  letter-spacing: 0.5px;
  z-index: 10;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8dc63f;
}

.brand-badge img {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  object-fit: cover;
}

.brand-badge span {
  font-size: 9px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

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

.icon-btn {
  background: #253346;
  color: #fff;
  border: 1px solid #48658b;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 8px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background: #00a3e0;
}

.sound-toggle-btn {
  font-family: inherit;
  font-size: 8px;
  letter-spacing: 0.5px;
  padding: 5px 8px;
  border-radius: 4px;
  font-weight: bold;
  white-space: nowrap;
}

.sound-toggle-btn.sound-off {
  background: #192330;
  border-color: #4b627f;
  color: #94a3b8;
}

.sound-toggle-btn.sound-on {
  background: #065f46;
  border-color: #10b981;
  color: #a7f3d0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
}

/* Top In-Game HUD */
.hud-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 6px 12px;
  background: rgba(10, 15, 22, 0.95);
  border-bottom: 1px solid #253346;
  font-size: 8px;
  gap: 6px;
  z-index: 10;
}

.hud-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hud-stat .label {
  color: #8fa0b5;
}

.hud-stat .value {
  color: #ffb703;
  font-weight: bold;
}

.hud-stat.danger .value {
  color: var(--danger);
}

/* Pollution / Deponij Bar */
.pollution-container {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pollution-header {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
}

.pollution-label {
  color: #ff6b6b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pollution-bar-bg {
  width: 100%;
  height: 10px;
  background: #1e1b1b;
  border: 1px solid #4f2d2d;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.pollution-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8dc63f 0%, #ffb703 50%, #e5243b 85%);
  transition: width 0.25s ease-out;
}

.pollution-critical {
  animation: pulse-danger 0.5s infinite alternate;
}

@keyframes pulse-danger {
  0% { box-shadow: 0 0 5px rgba(229, 36, 59, 0.6); }
  100% { box-shadow: 0 0 15px rgba(229, 36, 59, 1); }
}

/* Active Power-up Banner */
.active-powerups {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  min-height: 14px;
  align-items: center;
}

.powerup-tag {
  background: #0d283d;
  border: 1px solid #00a3e0;
  color: #00e1ff;
  font-size: 7px;
  padding: 2px 5px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  animation: pop-in 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Canvas Area */
.canvas-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 250px;
  background: #0f1620;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background-color: #1a2533;
}

/* Floating message alerts */
.canvas-message {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid #ffb703;
  padding: 10px 16px;
  font-size: 11px;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  pointer-events: none;
  z-index: 12;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.canvas-message.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.05);
}

/* Bottom Controls for Mobile with Silos Photo Background */
.mobile-controls {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 180px;
  flex-shrink: 0;
  border-top: 3px solid #00a3e0;
  box-shadow: 0 -6px 25px rgba(0, 163, 224, 0.4);
  overflow: hidden;
  z-index: 10;
  touch-action: none;
  padding: 8px 12px 14px 12px;
  background: #000;
}

.silos-bg-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.silos-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
  filter: contrast(1.08) brightness(0.92);
}

.silos-waste-layer {
  position: absolute;
  inset: 0;
  background-image: url('assets/silos_waste_layer.png');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  opacity: 0;
  mix-blend-mode: multiply;
  transition: opacity 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.silos-overlay-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(9, 14, 21, 0.35) 0%,
    rgba(9, 14, 21, 0.08) 35%,
    rgba(9, 14, 21, 0.55) 100%
  );
  z-index: 3;
}

.silos-location-tag {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 12, 19, 0.88);
  border: 1px solid #00a3e0;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 7.5px;
  color: #8dc63f;
  font-family: inherit;
  letter-spacing: 0.8px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  z-index: 4;
}

.gamepad-layout {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 12px;
}

/* Left thumb group: Movement (Lijevo & Desno side-by-side) */
.movement-group {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 220px;
}

.nav-btn {
  flex: 1;
  background: rgba(22, 35, 49, 0.82);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 2px solid #00a3e0;
  border-bottom: 5px solid #08121c;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  padding: 15px 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-shadow: 1px 1px 0 #000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
  touch-action: manipulation;
  transition: all 0.05s ease;
}

.nav-btn .sub-text {
  font-size: 7px;
  color: #a5c3e5;
  letter-spacing: 0.5px;
}

.nav-btn:active, .nav-btn.active {
  transform: translateY(3px);
  border-bottom-width: 2px;
  background: rgba(0, 163, 224, 0.9);
  box-shadow: 0 1px 6px rgba(0, 163, 224, 0.6);
}

/* Right thumb group: Action & Shooting */
.action-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fire-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(229, 36, 59, 0.9), rgba(166, 18, 36, 0.95));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 3px solid #ff99a6;
  border-bottom: 6px solid #4a0710;
  color: #fff;
  font-family: inherit;
  font-size: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 0 20px rgba(229, 36, 59, 0.6), 0 4px 12px rgba(0, 0, 0, 0.7);
  text-shadow: 1px 1px 0 #000;
  touch-action: manipulation;
  transition: all 0.05s ease;
}

.fire-btn:active, .fire-btn.active {
  transform: translateY(4px);
  border-bottom-width: 2px;
  background: linear-gradient(180deg, #ff4158, #c7162b);
}

.fire-icon {
  font-size: 15px;
}

.fire-label {
  font-size: 7.5px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.autofire-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 8px;
  color: #a4b7cc;
  cursor: pointer;
  background: #141d28;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #233448;
}

.autofire-toggle input {
  accent-color: #8dc63f;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

/* ======================================================== */
/* FULL SCREEN END-GAME VIEWS (NO IFRAMES, FULL OVERVIEW)   */
/* ======================================================== */
.end-game-view {
  background: radial-gradient(circle at 50% 15%, #1e1418 0%, #0a0b10 100%);
}

.victory-screen-view {
  background: radial-gradient(circle at 50% 15%, #0e241b 0%, #090e0c 100%);
}

.end-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  -webkit-overflow-scrolling: touch;
}

.end-hero-header {
  text-align: center;
  margin-bottom: 0px;
}

.end-hero-header .main-title {
  font-size: 11px;
  line-height: 1.25;
  margin-bottom: 2px;
}

.end-hero-header .main-subtitle {
  font-size: 7.5px;
  letter-spacing: 0.5px;
}

.danger-text {
  color: #ef4444 !important;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.7), 2px 2px 0 #000;
}

.success-text {
  color: #10b981 !important;
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.7), 2px 2px 0 #000;
}

.danger-banner {
  position: relative;
  border: 1.5px solid #ef4444 !important;
  border-radius: 6px;
  overflow: hidden;
  height: 48px;
  max-height: 48px;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3) !important;
}

.danger-banner img {
  width: 100%;
  height: 48px;
  object-fit: cover;
  display: block;
}

.danger-banner-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(185, 28, 28, 0.92);
  color: #fff;
  font-size: 6.5px;
  padding: 3px 6px;
  text-align: center;
  letter-spacing: 0.5px;
  font-weight: bold;
}

.success-banner {
  position: relative;
  border: 1.5px solid #10b981 !important;
  border-radius: 6px;
  overflow: hidden;
  height: 48px;
  max-height: 48px;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3) !important;
}

.success-banner img {
  width: 100%;
  height: 48px;
  object-fit: cover;
  display: block;
}

.success-banner-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(6, 95, 70, 0.92);
  color: #fff;
  font-size: 6.5px;
  padding: 3px 6px;
  text-align: center;
  letter-spacing: 0.5px;
  font-weight: bold;
}

/* Hide server save status as requested */
.server-save-status {
  display: none !important;
}

.status-pill {
  font-size: 7.5px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.status-pill.danger {
  background: #7f1d1d;
  color: #fca5a5;
  border: 1px solid #ef4444;
}

.status-pill.success {
  background: #064e3b;
  color: #6ee7b7;
  border: 1px solid #10b981;
}

.glow-red {
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.25);
  border-color: #ef4444 !important;
}

.glow-green {
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
  border-color: #10b981 !important;
}

.btn-view-leaderboard {
  background: #111a26;
  border: 1.5px solid #38bdf8;
  color: #7dd3fc;
  font-family: inherit;
  font-size: 8px;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: all 0.1s ease;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-view-leaderboard:hover {
  background: #1e293b;
  color: #ffffff;
  border-color: #67e8f9;
}

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

.end-actions-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

/* Modals & Overlays */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 12, 18, 0.94);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-content {
  background: #151d2a;
  border: 3px solid #00a3e0;
  border-radius: 10px;
  padding: 20px 16px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 0 25px rgba(0, 163, 224, 0.4);
  max-height: 90vh;
  overflow-y: auto;
}

.level-modal-content {
  border-color: #8dc63f;
  box-shadow: 0 0 25px rgba(141, 198, 63, 0.35);
}

.level-next-btn {
  width: 100%;
  padding: 14px 10px;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  margin: 6px 0 10px 0;
  box-shadow: 0 0 15px rgba(141, 198, 63, 0.5);
  font-weight: 900;
}

@media (max-height: 720px) {
  .level-modal-content {
    padding: 12px 10px;
    max-height: 95vh;
  }
  .level-modal-content .modal-title {
    font-size: 12px;
    margin-bottom: 4px;
  }
  .level-next-btn {
    padding: 12px 8px;
    font-size: 11px;
    margin: 4px 0 6px 0;
  }
  .level-modal-content .modal-story {
    margin-bottom: 8px;
    padding: 6px;
    font-size: 7.5px;
  }
}

.modal-title {
  color: #00a3e0;
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.4;
  text-shadow: 2px 2px 0 #000;
}

.modal-title.danger {
  color: var(--danger);
}

.modal-title.success {
  color: var(--secondary);
}

.modal-logo {
  max-width: 130px;
  border-radius: 6px;
  margin-bottom: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.5);
}

.modal-story {
  font-size: 7.5px;
  line-height: 1.35;
  color: #cbd5e1;
  margin-bottom: 6px;
  text-align: left;
  background: #0d131c;
  padding: 6px 8px;
  border-radius: 6px;
  border-left: 3px solid #8dc63f;
}

.modal-instructions {
  font-size: 8px;
  line-height: 1.5;
  color: #ffb703;
  margin-bottom: 12px;
  background: #1b1c11;
  padding: 8px;
  border-radius: 4px;
  border: 1px dashed #ffb703;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 7.5px;
}

.stat-box {
  background: #0d141e;
  padding: 6px 4px;
  border-radius: 6px;
  border: 1px solid #233448;
  text-align: center;
}

.stat-box .title {
  color: #8da4be;
  margin-bottom: 3px;
  font-size: 6.5px;
}

.stat-box .number {
  color: #8dc63f;
  font-size: 15px;
  font-weight: bold;
}

.primary-btn {
  background: linear-gradient(180deg, #8dc63f, #679628);
  border: 2px solid #abf04e;
  border-bottom: 4px solid #436319;
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  text-shadow: 1px 1px 0 #000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  width: 100%;
  margin-top: 8px;
  transition: all 0.1s ease;
  animation: pulse-green-btn 2.2s infinite;
}

@keyframes pulse-green-btn {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(141, 198, 63, 0.4);
  }
  50% {
    box-shadow: 0 4px 22px rgba(171, 240, 78, 0.85);
  }
}

.primary-btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.secondary-btn {
  background: #253346;
  border: 2px solid #48658b;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 9px;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
  width: 100%;
}

.secondary-btn:active {
  background: #1a2533;
}

/* ======================================================== */
/* SHARE & WHATSAPP ACTION BUTTONS                          */
/* ======================================================== */
.share-action-group {
  margin: 4px 0 2px 0;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px dashed rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  text-align: center;
}

.share-group-title {
  font-size: 7px;
  color: #94a3b8;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.share-buttons-row {
  display: flex;
  flex-direction: row;
  gap: 6px;
}

.btn-whatsapp {
  background: linear-gradient(180deg, #25D366, #128C7E);
  border: 2px solid #5cf492;
  border-bottom: 3px solid #075E54;
  color: #ffffff;
  font-family: inherit;
  font-size: 8.5px;
  padding: 9px 8px;
  border-radius: 6px;
  cursor: pointer;
  text-shadow: 1px 1px 0 #000;
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.3);
  width: 100%;
  transition: all 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1.25;
}

.btn-whatsapp:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.5);
}

.btn-whatsapp:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.btn-copy-link {
  background: #1e293b;
  border: 2px solid #475569;
  border-bottom: 3px solid #0f172a;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 8px;
  padding: 9px 8px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  transition: all 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1.25;
}

.btn-copy-link:hover {
  background: #334155;
  color: #ffffff;
}

.btn-copy-link:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
  background: #0f172a;
}

/* Floating Toast Notification */
.game-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #064e3b;
  color: #6ee7b7;
  border: 2px solid #10b981;
  padding: 11px 20px;
  border-radius: 6px;
  font-size: 9px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.85), 0 0 16px rgba(16, 185, 129, 0.45);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  max-width: 90vw;
  white-space: nowrap;
}

.game-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Legend of Power-ups on start/help screen */
.powerup-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 14px;
  text-align: left;
}

.powerup-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 7px;
  color: #94a3b8;
}

.powerup-legend-icon {
  font-size: 14px;
  min-width: 20px;
  text-align: center;
}

/* Animations */
@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  20% { transform: translate(-2px, -2px) rotate(-1deg); }
  40% { transform: translate(-3px, 0px) rotate(1deg); }
  60% { transform: translate(3px, 2px) rotate(0deg); }
  80% { transform: translate(1px, -1px) rotate(1deg); }
  100% { transform: translate(0px, 0px) rotate(0deg); }
}

.screen-shake {
  animation: shake 0.25s ease-in-out;
}

/* Player Name Input Field */
.player-name-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  text-align: left;
  background: #0d141f;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #2a3c50;
}

.name-label {
  font-size: 8px;
  color: #8dc63f;
  letter-spacing: 0.5px;
}

.name-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.name-input-row .player-name-input {
  flex: 1;
}

.confirm-name-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ffb703, #d97706);
  border: 2px solid #fef08a;
  border-bottom: 3px solid #92400e;
  color: #000;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  padding: 10px 16px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: all 0.15s ease;
  min-width: 64px;
}

.confirm-name-btn:hover {
  background: linear-gradient(180deg, #facc15, #b45309);
  transform: translateY(-1px);
}

.confirm-name-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

.confirm-name-btn.confirmed {
  background: linear-gradient(180deg, #8dc63f, #679628);
  border-color: #abf04e;
  border-bottom-color: #436319;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.player-name-input {
  background: #06090e;
  border: 2px solid #00a3e0;
  border-radius: 4px;
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  padding: 10px;
  outline: none;
  width: 100%;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
  transition: border-color 0.2s;
}

.player-name-input:focus,
.player-name-input.has-value {
  border-color: #8dc63f !important;
  box-shadow: 0 0 8px rgba(141, 198, 63, 0.4) !important;
  animation: none !important;
}

/* Blinking UNESI IME until player types their name */
.blink-prompt {
  color: #ffb703 !important;
  display: inline-block;
  animation: blink-name-glow 0.85s infinite alternate ease-in-out;
}

@keyframes blink-name-glow {
  0% {
    color: #ffb703;
    opacity: 0.4;
    text-shadow: none;
  }
  100% {
    color: #facc15;
    opacity: 1;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.95);
  }
}

.player-name-input.blink-input {
  animation: blink-input-border 0.85s infinite alternate ease-in-out;
}

@keyframes blink-input-border {
  0% {
    border-color: #00a3e0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
  }
  100% {
    border-color: #facc15;
    box-shadow: 0 0 14px rgba(250, 204, 21, 0.85), inset 0 0 8px rgba(250, 204, 21, 0.25);
  }
}

/* Leaderboard Table */
.leaderboard-section {
  margin: 12px 0;
  background: #0b1118;
  border: 1px solid #233448;
  border-radius: 6px;
  padding: 10px 8px;
  max-height: 320px;
  overflow-y: auto;
}

.leaderboard-screen-view .leaderboard-section,
.end-game-view .leaderboard-section {
  max-height: none;
  overflow: visible;
}

.leaderboard-title {
  font-size: 9px;
  color: #ffb703;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8px;
  text-align: left;
}

.leaderboard-table th {
  color: #8da4be;
  padding: 5px 4px;
  border-bottom: 1px solid #1f2c3d;
  font-weight: normal;
}

.leaderboard-table td {
  padding: 5px 4px;
  border-bottom: 1px solid #131b24;
  color: #cbd5e1;
}

.leaderboard-table tr:hover {
  background: rgba(0, 163, 224, 0.1);
}

.leaderboard-table tr.current-player {
  background: rgba(141, 198, 63, 0.25);
  font-weight: bold;
}

.leaderboard-table tr.current-player td {
  color: #abf04e;
}

.rank-badge {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  font-weight: bold;
}

.rank-1 { color: #facc15; }
.rank-2 { color: #cbd5e1; }
.rank-3 { color: #d97706; }

/* Modal Tab Nav */
.modal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
}

.tab-btn {
  flex: 1;
  background: #182332;
  border: 1px solid #2a3c50;
  color: #8da4be;
  font-family: inherit;
  font-size: 8px;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.tab-btn.active {
  background: #00a3e0;
  color: #fff;
  border-color: #38bdf8;
}

.leaderboard-credits {
  font-family: inherit;
  font-size: 8px;
  color: #94a3b8;
  text-align: center;
  margin-top: 10px;
  padding: 6px 4px;
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
  letter-spacing: 0.5px;
}

.leaderboard-credits::before {
  content: "★ ";
  color: #ffb703;
}

.leaderboard-credits::after {
  content: " ★";
  color: #ffb703;
}

