/* ==========================================================================
   FS NEON STACKER - DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

/* Fonts loaded locally via <link rel="stylesheet" href="../../assets/fonts.css"> in HTML */

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;

  --bg-main: #0b0713;
  --bg-card: rgba(22, 14, 36, 0.7);
  --bg-card-border: rgba(255, 255, 255, 0.12);
  --text-main: #f5f5ff;
  --text-muted: #a095bd;

  --primary-glow: #ff4d6d;
  --secondary-glow: #00f3ff;
  --accent-glow: #ffc300;
  --success-glow: #00e5a3;

  --shadow-color: rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Background Animated Blobs */
.background-ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: floatBlob 18s infinite alternate ease-in-out;
}

.blob-1 {
  width: 450px;
  height: 450px;
  background: var(--primary-glow);
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--secondary-glow);
  bottom: -120px;
  right: -120px;
  animation-delay: -6s;
}

.blob-3 {
  width: 350px;
  height: 350px;
  background: var(--accent-glow);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -12s;
}

@keyframes floatBlob {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 60px) scale(1.15); }
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 580px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Header Bar */
.game-header {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1rem 1.25rem;
  border-radius: 20px;
  box-shadow: 0 8px 32px var(--shadow-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.back-btn {
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.45rem 0.8rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.logo-icon {
  color: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.title-group h1 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-main), var(--primary-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Stats Badges */
.game-stats {
  display: flex;
  gap: 0.6rem;
}

.stat-badge {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--bg-card-border);
  padding: 0.4rem 0.75rem;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.stat-badge.combo-badge {
  opacity: 0.4;
  transition: all 0.2s ease;
}

.stat-badge.combo-badge.active {
  opacity: 1;
  border-color: var(--primary-glow);
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.4);
}

.stat-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Controls Toolbar */
.game-controls {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.75rem 1.25rem;
  border-radius: 18px;
  box-shadow: 0 8px 32px var(--shadow-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.control-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.glass-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  padding: 0 0.85rem;
  height: 38px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.glass-select:hover {
  border-color: var(--primary-glow);
}

.glass-select option {
  background: #160e24;
  color: #fff;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.glass-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  padding: 0 0.9rem;
  height: 38px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--primary-glow);
  box-shadow: 0 4px 16px rgba(255, 77, 109, 0.3);
  transform: translateY(-1px);
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  justify-content: center;
  flex-shrink: 0;
}

.donate-btn {
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  background: rgba(0, 229, 163, 0.12) !important;
  border: 1px solid rgba(0, 229, 163, 0.4) !important;
  color: #00e5a3 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.donate-btn:hover {
  background: rgba(0, 229, 163, 0.25) !important;
  border-color: #00e5a3 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 229, 163, 0.4) !important;
}

/* Game Canvas Container */
.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 480px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 40px var(--shadow-color);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Modals */
.glass-modal {
  border: none;
  background: transparent;
  padding: 1rem;
  margin: auto;
  outline: none;
}

.glass-modal::backdrop {
  background: rgba(7, 4, 15, 0.8);
  backdrop-filter: blur(10px);
}

.modal-content {
  background: linear-gradient(135deg, rgba(26, 17, 43, 0.95), rgba(12, 7, 21, 0.95));
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 1.75rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.close-btn, .modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.win-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-glow);
  margin-bottom: 0.2rem;
}

.win-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.gameover-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.go-stat-card {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--bg-card-border);
  padding: 0.85rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.go-stat-card .label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
}

.go-stat-card .val {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-glow);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-glow), #ff758c);
  color: #fff;
  border: none;
  padding: 0.75rem 1.8rem;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 77, 109, 0.4);
  transition: all 0.2s ease;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 77, 109, 0.6);
}

/* Step-by-Step Donate Timeline */
.donate-timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  margin: 0.4rem 0 0.75rem;
  padding: 0.5rem 0.65rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
}

.timeline-step {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0.9;
}

.step-num {
  width: 18px;
  height: 18px;
  background: rgba(0, 229, 163, 0.2);
  border: 1px solid #00e5a3;
  color: #00e5a3;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-text {
  font-size: 0.75rem;
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
}

.timeline-arrow {
  color: #00e5a3;
  font-size: 0.75rem;
  opacity: 0.6;
  flex-shrink: 0;
}

/* Payment Channel Selector Tabs */
.channel-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--bg-card-border);
  width: 100%;
}

.channel-btn {
  flex: 1;
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.tab-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.channel-btn[data-channel="promptpay"].active {
  border-color: rgba(0, 229, 163, 0.5);
  color: #00e5a3;
  background: rgba(0, 229, 163, 0.12);
}

.channel-btn[data-channel="binance"].active {
  border-color: rgba(240, 185, 11, 0.5);
  color: #F0B90B;
  background: rgba(240, 185, 11, 0.12);
}

.channel-view {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.channel-view.hidden {
  display: none !important;
}

.promptpay-badge {
  background: linear-gradient(135deg, rgba(0, 75, 145, 0.4), rgba(0, 229, 163, 0.2));
  border: 1px solid #00e5a3;
  padding: 0.75rem 1.25rem;
  border-radius: 16px;
  width: 100%;
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.pp-logo {
  font-size: 0.75rem;
  font-weight: 700;
  color: #00e5a3;
  letter-spacing: 1px;
}

.amount-chips {
  display: flex;
  gap: 0.4rem;
  width: 100%;
  margin: 0.6rem 0 0.4rem;
  justify-content: center;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  border-color: #00e5a3;
  color: #00e5a3;
  background: rgba(0, 229, 163, 0.1);
}

.chip-btn.active {
  background: linear-gradient(135deg, rgba(0, 229, 163, 0.25), rgba(0, 243, 255, 0.25));
  border-color: #00e5a3;
  color: #00e5a3;
  box-shadow: 0 0 12px rgba(0, 229, 163, 0.3);
}

.custom-amount-group {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.5rem;
}

.custom-amount-group.hidden {
  display: none !important;
}

.amount-display-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.amount-display-badge span {
  color: #00e5a3;
  font-weight: 800;
  font-size: 1.1rem;
}

.binance-qr-wrapper {
  background: #ffffff;
  padding: 10px;
  border-radius: 16px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0.5rem 0 0.4rem;
  box-shadow: 0 0 25px rgba(240, 185, 11, 0.35);
  border: 1px solid rgba(240, 185, 11, 0.4);
  max-width: 100%;
}

.binance-qr-img {
  width: 180px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  object-fit: contain;
}

.share-input-group {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.75rem;
}

.share-url-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  outline: none;
}

.btn-copy {
  background: var(--secondary-glow);
  color: #070913;
  border: none;
  padding: 0.55rem 0.95rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hidden {
  display: none !important;
}

.global-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(16, 24, 39, 0.95);
  border: 1px solid var(--secondary-glow);
  color: #fff;
  padding: 0.65rem 1.4rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 243, 255, 0.3);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 99999;
}

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

/* Responsive adjustments for Mobile & Tablet */
@media (max-width: 650px) {
  .app-container {
    padding: 0.6rem;
    gap: 0.65rem;
  }
  .game-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
  }
  .brand {
    justify-content: space-between;
    width: 100%;
  }
  .title-group h1 { font-size: 1.05rem; }
  .title-group .subtitle { font-size: 0.7rem; }
  .game-stats { width: 100%; gap: 0.4rem; }
  .stat-badge { flex: 1; min-width: 0; padding: 0.3rem 0.25rem; }
  .stat-value { font-size: 0.95rem; }
  .game-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
  }
  .control-group { width: 100%; justify-content: space-between; }
  .glass-select { flex: 1; min-width: 0; height: 38px; font-size: 0.8rem; }
  .action-buttons { width: 100%; justify-content: space-between; gap: 0.35rem; }
  .glass-btn { height: 38px; padding: 0 0.6rem; font-size: 0.8rem; }
  .icon-btn { width: 38px; height: 38px; flex-shrink: 0; }
  .canvas-wrapper { height: 380px; max-height: 55vh; border-radius: 18px; }
  .glass-modal { width: 94%; max-height: 90vh; }
  .modal-content { padding: 1.15rem; gap: 0.75rem; }
}

@media (min-width: 651px) and (max-width: 900px) {
  .app-container { max-width: 760px; padding: 1rem; }
  .canvas-wrapper { height: 420px; }
}
