/* ============================================
   style.css — Lagari Hasan Çelebi Roket Oyunu
   Tam Tasarım Sistemi
   ============================================ */

/* ── CSS Variables ── */
:root {
  /* Colors */
  --bg-deep: #050a1e;
  --bg-primary: #0a0e27;
  --bg-secondary: #111640;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  --bg-glass: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.12);

  --gold: #d4a843;
  --gold-light: #f0d078;
  --gold-dark: #a07828;
  --copper: #b87333;

  --accent-blue: #4a9eff;
  --accent-cyan: #58d5e3;
  --accent-green: #4ade80;
  --accent-red: #ef4444;
  --accent-orange: #f59e0b;
  --accent-purple: #a78bfa;

  --text-primary: #ffffff;
  --text-secondary: #b0b8d0;
  --text-muted: #6b7280;

  --success: #4ade80;
  --error: #ef4444;
  --warning: #f59e0b;

  /* Typography */
  --font: 'Outfit', sans-serif;

  /* Sizing */
  --radius-sm: 0.5vmin;
  --radius-md: 1vmin;
  --radius-lg: 2vmin;
  --radius-xl: 3vmin;

  /* Shadows */
  --shadow-sm: 0 0.2vmin 0.5vmin rgba(0, 0, 0, 0.3);
  --shadow-md: 0 0.5vmin 1.5vmin rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 1vmin 3vmin rgba(0, 0, 0, 0.5);
  --shadow-glow-gold: 0 0 2vmin rgba(212, 168, 67, 0.4);
  --shadow-glow-blue: 0 0 2vmin rgba(74, 158, 255, 0.4);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  touch-action: manipulation;
}

#app {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ── Screen System ── */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  background: var(--bg-deep);
  z-index: 1;
}

.screen.active {
  display: flex;
  animation: screenFadeIn 0.4s ease;
}

.screen-exit {
  animation: screenFadeOut 0.3s ease forwards;
}

.screen-enter {
  animation: screenFadeIn 0.4s ease;
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes screenFadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.03); }
}

/* ── Stars Background ── */
.stars-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 50% 15%, rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 85% 70%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 80%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 85%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 10%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 45%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 35%, rgba(212,168,67,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 75% 55%, rgba(212,168,67,0.3) 0%, transparent 100%);
  animation: twinkle 8s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

/* ── Buttons ── */
.btn {
  font-family: var(--font);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  overflow: hidden;
  font-size: clamp(14px, 2vmin, 24px);
  padding: 1.5vmin 4vmin;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0a0e27;
  box-shadow: var(--shadow-glow-gold);
}

.btn-primary:hover, .btn-primary:active {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 0 3vmin rgba(212, 168, 67, 0.6);
}

.btn-primary:disabled {
  background: linear-gradient(135deg, #555, #333);
  color: #888;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover, .btn-secondary:active {
  background: var(--bg-card-hover);
  border-color: var(--gold);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-red), #c0392b);
  color: white;
}

.btn-glow {
  animation: btnGlow 2s ease-in-out infinite;
}

@keyframes btnGlow {
  0%, 100% { box-shadow: 0 0 1.5vmin rgba(212, 168, 67, 0.3); }
  50% { box-shadow: 0 0 3vmin rgba(212, 168, 67, 0.6), 0 0 6vmin rgba(212, 168, 67, 0.2); }
}

.btn-launch {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  font-size: clamp(18px, 3vmin, 36px);
  padding: 2vmin 5vmin;
  box-shadow: 0 0 2vmin rgba(231, 76, 60, 0.4);
}

.btn-launch:hover, .btn-launch:active {
  box-shadow: 0 0 4vmin rgba(231, 76, 60, 0.7);
}

/* ── Top Controls (Sound & Lang) ── */
.top-controls {
  position: fixed;
  top: 1.5vmin;
  right: 1.5vmin;
  z-index: 9999;
  display: flex;
  gap: 1.5vmin;
}

.top-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  width: 5vmin;
  height: 5vmin;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: clamp(12px, 2vmin, 20px);
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
  color: var(--text-primary);
  font-weight: 700;
}

.top-btn:active {
  transform: scale(0.9);
}

.top-btn:hover {
  background: rgba(212, 168, 67, 0.2);
  border-color: var(--gold);
}

/* ══════════════════════════════════════════
   WELCOME SCREEN
   ══════════════════════════════════════════ */
#screen-welcome {
  background-image: url('../assets/bg_welcome.png');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-color: var(--bg-deep);
}

.welcome-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  height: 100%;
  z-index: 1;
  padding: 4vmin;
  gap: 5vmin;
  background: rgba(5, 10, 30, 0.65);
  backdrop-filter: blur(4px);
}

.welcome-left, .welcome-right {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
  justify-content: center;
}

.welcome-left {
  gap: 2vmin;
}

.welcome-logo {
  text-align: center;
  margin-bottom: -1vmin;
}

.welcome-rocket {
  height: clamp(80px, 20vmin, 200px);
  filter: drop-shadow(0 0 3vmin rgba(212, 168, 67, 0.6));
  animation: floatingRocket 4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes floatingRocket {
  0%, 100% { transform: translateY(0) rotate(-45deg); }
  50% { transform: translateY(-3vmin) rotate(-42deg); }
}

.welcome-title {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5vmin;
  text-shadow: 0 1vmin 3vmin rgba(0, 0, 0, 1), 0 0 1vmin rgba(0, 0, 0, 0.8);
}

.title-primary {
  font-size: clamp(20px, 4.5vmin, 56px);
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 0.5vmin 1.5vmin rgba(0, 0, 0, 1);
}

.title-secondary {
  font-size: clamp(32px, 8vmin, 96px);
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, var(--gold-light) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 1vmin 2vmin rgba(0, 0, 0, 0.8);
}

.welcome-tagline {
  font-size: clamp(10px, 1.8vmin, 18px);
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-bottom: 2vmin;
  text-shadow: 0 0.5vmin 1vmin rgba(0, 0, 0, 0.9);
}

.btn-large {
  padding: 1.5vmin 5vmin;
  font-size: clamp(18px, 3vmin, 32px);
  border-width: 2px;
  box-shadow: 0 0 4vmin rgba(212, 168, 67, 0.4);
}

/* Mini Leaderboard */
.welcome-leaderboard {
  margin-top: 0;
  background: rgba(10, 15, 35, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2vmin 4vmin;
  width: 90%;
  max-width: 50vmin;
  backdrop-filter: blur(15px);
  box-shadow: 0 2vmin 4vmin rgba(0, 0, 0, 0.8);
  border-top: 1px solid rgba(212, 168, 67, 0.5);
}

.lb-mini-title {
  font-size: clamp(12px, 2vmin, 20px);
  color: var(--gold);
  margin-bottom: 1vmin;
  text-align: center;
}

.lb-mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.5vmin;
}

.lb-mini-item {
  display: flex;
  justify-content: space-between;
  font-size: clamp(10px, 1.4vmin, 16px);
  padding: 0.2vmin 1vmin;
  border-radius: var(--radius-sm);
}

.lb-mini-item:nth-child(1) { color: var(--gold-light); }
.lb-mini-item:nth-child(2) { color: #c0c0c0; }
.lb-mini-item:nth-child(3) { color: var(--copper); }

.lb-mini-item.lb-mini-empty {
  justify-content: center;
  text-align: center;
  color: var(--text-secondary);
  padding: 1.5vmin 1vmin;
}

/* Bugün / Tüm Zamanlar sekmeleri (giriş ve skor ekranı) */
.lb-tabs {
  display: flex;
  gap: 0.6vmin;
  padding: 0.5vmin;
  margin: 0 auto 1.2vmin;
  width: fit-content;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
}

.lb-tab {
  font-family: var(--font);
  font-size: clamp(11px, 1.6vmin, 17px);
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.8vmin 2.2vmin;
  min-height: 36px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.lb-tab.active {
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
}


/* ══════════════════════════════════════════
   LANGUAGE SCREEN
   ══════════════════════════════════════════ */
.language-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  z-index: 1;
  gap: 4vmin;
}

.lang-title {
  font-size: clamp(24px, 5vmin, 56px);
  font-weight: 700;
  color: var(--gold-light);
}

.lang-subtitle {
  font-size: clamp(16px, 3vmin, 32px);
  color: var(--text-secondary);
  margin-top: -2vmin;
}

.lang-buttons {
  display: flex;
  gap: 4vmin;
}

.btn-lang {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5vmin;
  padding: 3vmin 5vmin;
  background: var(--bg-glass);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
  cursor: pointer;
  font-family: var(--font);
  color: var(--text-primary);
}

.btn-lang:hover, .btn-lang:active {
  border-color: var(--gold);
  background: var(--bg-card-hover);
  transform: scale(1.05);
  box-shadow: var(--shadow-glow-gold);
}

.lang-flag {
  font-size: clamp(40px, 8vmin, 80px);
}

.lang-name {
  font-size: clamp(14px, 2.5vmin, 28px);
  font-weight: 600;
}

/* ══════════════════════════════════════════
   NAME INPUT SCREEN
   ══════════════════════════════════════════ */
#screen-name {
  background-image: url('../assets/bg_welcome.png');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-color: var(--bg-deep);
}

.name-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  z-index: 1;
  gap: 2vmin;
  padding: 2vmin;
  background: rgba(5, 10, 30, 0.85);
  backdrop-filter: blur(8px);
}

.name-title {
  font-size: clamp(24px, 5vmin, 48px);
  font-weight: 700;
  color: var(--gold-light);
}

.name-input-wrapper {
  width: 100%;
  max-width: 60vmin;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.name-field {
  width: 100%;
  padding: 1.5vmin 2vmin;
  font-size: clamp(18px, 3.5vmin, 36px);
  font-family: var(--font);
  font-weight: 600;
  text-align: center;
  background: var(--bg-glass);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  outline: none;
  backdrop-filter: blur(10px);
  caret-color: var(--gold);
  transition: border-color var(--transition-normal);
}

.name-field:focus {
  border-color: var(--gold);
  box-shadow: var(--shadow-glow-gold);
}

.name-warning {
  color: var(--error);
  font-size: clamp(10px, 1.5vmin, 16px);
  margin-top: 0.5vmin;
  text-align: center;
}

/* Virtual Keyboard */
.virtual-keyboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8vmin;
  width: 100%;
  max-width: 80vmin;
}

.kb-row {
  display: flex;
  gap: 0.6vmin;
  justify-content: center;
}

.kb-key {
  min-width: clamp(28px, 5vmin, 52px);
  min-height: clamp(32px, 5.5vmin, 56px);
  padding: 0.8vmin 1.2vmin;
  font-family: var(--font);
  font-size: clamp(12px, 2vmin, 22px);
  font-weight: 600;
  background: rgba(10, 15, 35, 0.6);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: var(--radius-md);
  color: var(--gold-light);
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(5px);
}

.kb-key:active {
  background: var(--gold);
  color: var(--bg-deep);
  transform: scale(0.92);
}

.kb-space {
  flex: 3;
  min-width: clamp(120px, 25vmin, 280px);
}

.kb-backspace {
  flex: 1.5;
  min-width: clamp(60px, 12vmin, 120px);
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.kb-backspace:active {
  background: var(--accent-red);
}

.kb-row-bottom {
  gap: 1vmin;
}

/* ══════════════════════════════════════════
   STORY SCREEN
   ══════════════════════════════════════════ */
.story-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  z-index: 1;
  position: relative;
  padding: 4vmin;
}

.story-layout {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4vmin;
  width: 100%;
  max-width: 160vmin;
}

.story-video-container {
  flex: 1;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(212, 168, 67, 0.5);
  box-shadow: 0 0 3vmin rgba(212, 168, 67, 0.2);
  position: relative;
}

.story-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-text-box {
  flex: 1;
  padding: 4vmin;
  background: rgba(10, 15, 35, 0.8);
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 3vmin rgba(212, 168, 67, 0.15);
}

.story-text-box p {
  font-size: clamp(14px, 2.5vmin, 28px);
  line-height: 1.6;
  color: var(--text-secondary);
  text-align: center;
}

.btn-skip {
  position: absolute;
  bottom: 4vmin;
  right: 5vmin;
  z-index: 10;
  padding: 1vmin 2.5vmin;
  font-size: clamp(12px, 1.8vmin, 20px);
}

/* Video bitti: "Devam" düğmesi büyür ve ortaya gelir */
.btn-skip.btn-continue {
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  bottom: 7vmin;
  padding: 1.5vmin 6vmin;
  font-size: clamp(18px, 3vmin, 32px);
}

/* ══════════════════════════════════════════
   STAGE 1 SCREEN (Fuel Lab)
   ══════════════════════════════════════════ */
#screen-stage1 {
  background-image: linear-gradient(rgba(10, 15, 30, 0.2), rgba(10, 15, 30, 0.2)), url('../assets/bg_lab.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: var(--bg-deep);
}

/* ══════════════════════════════════════════
   STAGE HEADER (shared)
   ══════════════════════════════════════════ */
.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8vmin 2.5vmin 1.5vmin;
  background: transparent;
  z-index: 10;
  position: relative;
}

.stage-info-left {
  display: flex;
  flex-direction: column;
}

.stage-title {
  font-size: clamp(14px, 2.8vmin, 32px);
  font-weight: 800;
  color: var(--gold-light);
  text-shadow: 0 2px 10px rgba(0,0,0,1), 0 0 15px rgba(0,0,0,0.8);
}

.stage-subtitle {
  font-size: clamp(10px, 1.5vmin, 16px);
  color: #fff;
  font-weight: 500;
  text-shadow: 0 1px 5px rgba(0,0,0,1), 0 0 10px rgba(0,0,0,0.8);
}

/* Oyun sırasında köşede duran kontrol ipucu */
.stage-controls {
  align-self: flex-start;
  margin-top: 0.8vmin;
  padding: 0.4vmin 1.2vmin;
  font-size: clamp(10px, 1.4vmin, 15px);
  font-weight: 600;
  color: var(--gold-light);
  background: rgba(10, 15, 35, 0.75);
  border: 1px solid rgba(212, 168, 67, 0.45);
  border-radius: 999px;
}

.stage-info-right {
  display: flex;
  gap: 2.5vmin;
  align-items: center;
}

.stage-timer, .stage-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.8vmin 1.5vmin;
  min-width: 8vmin;
  backdrop-filter: blur(5px);
}

.timer-label, .score-label {
  font-size: clamp(8px, 1.2vmin, 12px);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.timer-value {
  font-size: clamp(18px, 3.5vmin, 40px);
  font-weight: 800;
  color: var(--accent-cyan);
}

.timer-value.timer-warning {
  color: var(--accent-red);
  animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.score-value {
  font-size: clamp(18px, 3.5vmin, 40px);
  font-weight: 800;
  color: var(--gold-light);
}

/* ══════════════════════════════════════════
   STAGE 1 — Fuel Lab
   ══════════════════════════════════════════ */
.stage1-game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1vmin 2vmin 15vmin 2vmin;
  gap: 1.5vmin;
  position: relative;
  overflow: hidden;
}

.s1-description {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1vmin 2vmin;
  max-width: 70vmin;
  text-align: center;
  backdrop-filter: blur(5px);
}

.s1-description p {
  font-size: clamp(10px, 1.5vmin, 16px);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Target formula */
.s1-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5vmin;
}

.s1-target-label {
  font-size: clamp(10px, 1.5vmin, 16px);
  color: var(--gold-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 5px rgba(0,0,0,1);
}

.s1-formula-display {
  display: flex;
  align-items: baseline;
  gap: 1.5vmin;
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(212, 168, 67, 0.6);
  border-radius: var(--radius-lg);
  padding: 1vmin 3vmin;
  box-shadow: 0 1vmin 4vmin rgba(0,0,0,1), 0 0 2vmin rgba(212, 168, 67, 0.4);
}

.s1-formula-name {
  font-size: clamp(12px, 2vmin, 22px);
  color: var(--text-secondary);
  font-weight: 400;
}

.s1-formula {
  font-size: clamp(24px, 5vmin, 56px);
  font-weight: 800;
  color: var(--gold-light);
  text-shadow: 0 0 2vmin rgba(212, 168, 67, 0.3);
}

.s1-formula-hint {
  font-size: clamp(9px, 1.3vmin, 14px);
  color: var(--accent-cyan);
  font-style: italic;
}

.s1-formula-progress {
  display: flex;
  gap: 0.8vmin;
  margin-top: 0.5vmin;
}

.s1-progress-atom {
  width: clamp(20px, 3.5vmin, 36px);
  height: clamp(20px, 3.5vmin, 36px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(10px, 1.5vmin, 16px);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.85);
  transition: all var(--transition-normal);
  box-shadow: inset 0 0 1vmin rgba(0,0,0,1);
}

.s1-progress-atom.filled {
  border-color: var(--accent-green);
  background: rgba(74, 222, 128, 0.2);
  color: var(--accent-green);
  transform: scale(1.1);
}

/* Karışım adımı: 8 boş ölçek kutusu (dolunca malzemenin formülü yazar) */
.s1-progress-scoop {
  width: auto;
  min-width: clamp(28px, 4.6vmin, 48px);
  padding: 0 0.6vmin;
  border-radius: var(--radius-md);
  font-size: clamp(9px, 1.3vmin, 14px);
}

.s1-progress-scoop:not(.filled) {
  border-style: dashed;
}

.s1-formula-counter {
  font-size: clamp(10px, 1.5vmin, 14px);
  color: #fff;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.85);
  padding: 0.5vmin 1.5vmin;
  border-radius: 2vmin;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 1px 3px rgba(0,0,0,1);
}



/* Mixing bowl */
.s1-mixing-bowl {
  width: clamp(120px, 22vmin, 240px);
  height: clamp(100px, 18vmin, 200px);
  position: relative;
}

.s1-bowl-inner {
  width: 100%;
  height: 100%;
  border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%;
  background: rgba(40, 30, 20, 0.85);
  border: 2px solid var(--copper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  box-shadow: inset 0 1vmin 3vmin rgba(0, 0, 0, 0.8), 0 1vmin 3vmin rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.s1-mixing-bowl.bowl-active .s1-bowl-inner {
  border-color: var(--gold-light);
  box-shadow: inset 0 1vmin 2vmin rgba(0, 0, 0, 0.3), var(--shadow-glow-gold);
}

.s1-mixing-bowl.bowl-correct .s1-bowl-inner {
  border-color: var(--accent-green);
  box-shadow: 0 0 3vmin rgba(74, 222, 128, 0.5);
}

.s1-mixing-bowl.bowl-wrong .s1-bowl-inner {
  border-color: var(--accent-red);
  box-shadow: 0 0 3vmin rgba(239, 68, 68, 0.5);
}

.s1-mixing-bowl.bowl-wrong {
  animation: bowlShake 0.4s ease;
}

@keyframes bowlShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-1vmin); }
  75% { transform: translateX(1vmin); }
}

.s1-bowl-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3vmin;
  justify-content: center;
  padding: 1vmin;
}

.s1-bowl-element {
  font-size: clamp(10px, 1.8vmin, 20px);
  font-weight: 700;
  padding: 0.3vmin 0.8vmin;
  border-radius: var(--radius-sm);
  animation: elementDrop 0.3s ease;
}

@keyframes elementDrop {
  from { transform: translateY(-2vmin); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.s1-bowl-label {
  position: absolute;
  bottom: -2.5vmin;
  font-size: clamp(8px, 1.2vmin, 12px);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Element bottles */
.s1-elements {
  display: flex;
  gap: 1vmin;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1vmin;
  max-width: 85vmin;
}

.s1-element {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(48px, 8vmin, 80px);
  height: clamp(56px, 9vmin, 90px);
  border-radius: var(--radius-md);
  cursor: grab;
  transition: all var(--transition-fast);
  border: 2px solid;
  background: rgba(10, 15, 30, 0.98);
  backdrop-filter: blur(5px);
  box-shadow: 0 1vmin 2vmin rgba(0,0,0,0.9);
  position: relative;
  touch-action: none;
}

.s1-element:active {
  transform: scale(1.1);
  cursor: grabbing;
  z-index: 100;
}

.s1-element-symbol {
  font-size: clamp(18px, 3.5vmin, 36px);
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.s1-element.s1-element-jar {
  /* 8 kavanoz tek satıra sığsın (.s1-elements max-width: 85vmin) */
  width: clamp(60px, 9.3vmin, 100px);
}

.s1-element-jar .s1-element-symbol {
  font-size: clamp(13px, 2.3vmin, 24px);
  white-space: nowrap;
}

.s1-progress-scoop:not(.filled) {
  border-color: rgba(255, 255, 255, 0.35);
}

.s1-element-name {
  font-size: clamp(7px, 1vmin, 10px);
  color: #fff;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.s1-element.dragging {
  opacity: 0.7;
  transform: scale(1.15);
  z-index: 1000;
  pointer-events: none;
  position: fixed;
}

/* ══════════════════════════════════════════
   TRANSITION SCREEN
   ══════════════════════════════════════════ */
#screen-transition {
  background-image: linear-gradient(rgba(10, 15, 30, 0.4), rgba(10, 15, 30, 0.6)), url('../assets/bg_welcome.png');
  background-size: cover;
  background-position: center center;
}

.transition-content {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  padding-bottom: 5vmin;
  z-index: 1;
}

.character-container {
  display: flex;
  align-items: flex-start;
  position: relative;
  max-width: 90vmin;
}

.transition-character {
  height: clamp(200px, 45vmin, 450px);
  object-fit: contain;
  filter: drop-shadow(0 0 2vmin rgba(0,0,0,0.8));
  animation: float 3s ease-in-out infinite;
  z-index: 2;
}

.speech-bubble {
  position: relative;
  background: rgba(40, 30, 20, 0.95);
  border-radius: 2vmin;
  padding: 3vmin 4vmin;
  margin-left: 2vmin;
  margin-top: 5vmin;
  box-shadow: 0 1vmin 3vmin rgba(0,0,0,0.5);
  border: 4px solid var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5vmin;
  z-index: 1;
}

/* Konuşma balonunun sivri ucu */
.speech-bubble::before {
  content: '';
  position: absolute;
  top: 40%;
  left: -2.5vmin;
  transform: translateY(-50%);
  border-width: 1.5vmin 3vmin 1.5vmin 0;
  border-style: solid;
  border-color: transparent var(--gold) transparent transparent;
}
.speech-bubble::after {
  content: '';
  position: absolute;
  top: 40%;
  left: -1.5vmin;
  transform: translateY(-50%);
  border-width: 1vmin 2vmin 1vmin 0;
  border-style: solid;
  border-color: transparent rgba(40, 30, 20, 0.95) transparent transparent;
}

.transition-fact {
  max-width: 50vmin;
  padding: 1.5vmin 2vmin;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: var(--radius-md);
  text-align: center;
}

.transition-fact-label {
  display: block;
  margin-bottom: 0.6vmin;
  font-size: clamp(11px, 1.6vmin, 18px);
  font-weight: 800;
  color: var(--gold);
}

.transition-fact-text {
  margin: 0;
  font-size: clamp(12px, 1.9vmin, 21px);
  line-height: 1.45;
  color: var(--text-primary);
}

.transition-skip {
  margin-top: 0.5vmin;
  padding: 0.6vmin 2vmin;
  font-size: clamp(13px, 1.9vmin, 20px);
  font-weight: 700;
  color: var(--gold-light);
  border: 1px solid rgba(212, 168, 67, 0.5);
  border-radius: 999px;
  opacity: 0.8;
  animation: pulseSoft 1.6s ease-in-out infinite;
}

@keyframes pulseSoft {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}

.transition-icon {
  font-size: clamp(30px, 6vmin, 60px);
  animation: transitionBounce 1.5s ease-in-out infinite;
}

@keyframes transitionBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1vmin); }
}

.transition-text {
  font-size: clamp(14px, 2.2vmin, 26px);
  color: var(--gold-light);
  text-align: center;
  max-width: 50vmin;
  line-height: 1.4;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,1);
}

/* ══════════════════════════════════════════
   STAGE 2 — Rocket Launch
   ══════════════════════════════════════════ */
#screen-stage2 {
  background-image: url('../assets/bg_stage2.png?v=7');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

.stage2-game-area {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.s2-controls {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none; /* Let clicks pass through except on interactive elements */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10vmin 3vmin 2vmin 3vmin; /* Top padding for stage header */
  z-index: 5;
}

.s2-wind {
  pointer-events: auto;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(15, 8, 4, 0.96);
  backdrop-filter: blur(8px);
  border: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1.5vmin 3vmin;
  box-shadow: 0 1vmin 2vmin rgba(0,0,0,0.8), inset 0 0 10px rgba(0,0,0,0.5);
  position: relative;
}

.s2-wind::before {
  content: '';
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 1px dashed rgba(212, 168, 67, 0.4);
  pointer-events: none;
  border-radius: calc(var(--radius-lg) - 4px);
}

.s2-bottom-controls {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  background: linear-gradient(to bottom, #4a2c11 0%, #2b1807 100%);
  padding: 3vmin 4vmin;
  margin-bottom: 2vmin;
  border-radius: var(--radius-lg);
  border: 4px solid var(--gold);
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 0 20px rgba(0,0,0,0.9);
  position: relative;
  gap: 6vmin;
}

.s2-wind-label {
  font-size: clamp(10px, 1.5vmin, 16px);
  color: var(--gold-light);
  text-transform: uppercase;
}

.s2-wind-display {
  display: flex;
  align-items: center;
  gap: 1vmin;
}

.s2-wind-arrow {
  font-size: clamp(20px, 3.5vmin, 36px);
  color: var(--accent-cyan);
}

.s2-wind-value {
  font-size: clamp(14px, 2vmin, 22px);
  font-weight: 700;
  color: var(--accent-cyan);
}

.s2-angle-control, .s2-power-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5vmin;
}

.s2-control-label {
  font-size: clamp(12px, 1.8vmin, 18px);
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 4px rgba(0,0,0,1);
}

.s2-control-value {
  font-size: clamp(16px, 2.8vmin, 32px);
  font-weight: 800;
  color: var(--gold-light);
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.s2-slider {
  -webkit-appearance: none;
  appearance: none;
  width: clamp(100px, 20vmin, 250px);
  height: clamp(8px, 1.5vmin, 18px);
  border-radius: var(--radius-md);
  background: rgba(20, 15, 10, 0.8);
  border: 2px solid var(--gold-dark);
  box-shadow: inset 0 2px 5px rgba(0,0,0,1);
  outline: none;
}

.s2-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: clamp(28px, 4.5vmin, 45px);
  height: clamp(28px, 4.5vmin, 45px);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold-light), #8a6a25);
  border: 3px solid #3d2a15;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.8);
}

/* Power slider and bar styling removed since it is now a horizontal slider identical to the angle slider */

.s2-target-distance,
.s2-attempts {
  font-size: clamp(11px, 1.6vmin, 18px);
  font-weight: 700;
  color: var(--gold-light);
  margin-top: 0.6vmin;
}

.s2-attempts {
  color: var(--text-secondary);
  font-weight: 600;
}

.s2-result-hint {
  font-size: clamp(14px, 2.4vmin, 26px);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,1);
  text-align: center;
}

.s2-physics {
  position: absolute;
  top: 8vmin;
  right: 2vmin;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5vmin 2vmin;
  backdrop-filter: blur(5px);
  z-index: 5;
}

.s2-physics-formula {
  font-size: clamp(10px, 1.5vmin, 16px);
  color: var(--accent-cyan);
  font-family: 'Courier New', monospace;
  margin-bottom: 0.5vmin;
}

.s2-physics-values {
  font-size: clamp(10px, 1.3vmin, 14px);
  color: var(--text-secondary);
}

.s2-result {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1vmin;
  z-index: 20;
  animation: resultPopIn 0.5s ease;
}

/* Yerinde beliren öğeler için (resultPopIn ortalanmış öğeleri kaydırır) */
@keyframes popInPlace {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes resultPopIn {
  from { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.s2-result-text {
  font-size: clamp(28px, 6vmin, 64px);
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 0 3vmin rgba(212, 168, 67, 0.5);
  text-align: center;
}

.s2-result-hit .s2-result-text {
  color: #ffcc33;
  text-shadow: 0 0 3vmin rgba(255, 120, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 1);
}

.s2-result-miss .s2-result-text {
  color: #ff8a7a;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 1);
}

.s2-result-score {
  font-size: clamp(20px, 4vmin, 48px);
  font-weight: 700;
  color: var(--accent-cyan);
}

/* ══════════════════════════════════════════
   STAGE 3 — Gliding
   ══════════════════════════════════════════ */
.stage3-game-area {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.s3-hud {
  position: absolute;
  top: 1.5vmin;
  left: 1.5vmin;
  bottom: 1.5vmin;
  width: clamp(56px, 9vmin, 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.2vmin 0.8vmin;
  background: rgba(5, 10, 30, 0.55);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(4px);
  z-index: 5;
  gap: 0.8vmin;
  pointer-events: none;
}

.s3-hud-label {
  font-size: clamp(9px, 1.2vmin, 13px);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.s3-altitude-value {
  font-size: clamp(13px, 2vmin, 22px);
  font-weight: 800;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.s3-altitude-bar-container {
  flex: 1;
  width: clamp(10px, 1.8vmin, 20px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.s3-altitude-bar {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: linear-gradient(0deg, var(--accent-green), var(--accent-cyan), var(--accent-blue));
  border-radius: 999px;
}

.s3-landing-result {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5vmin;
  font-size: clamp(26px, 6vmin, 60px);
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 168, 67, 0.5);
  text-align: center;
  z-index: 60;
  animation: resultPopIn 0.5s ease;
  pointer-events: none;
}

.s3-landing-result small {
  font-size: 0.55em;
  color: var(--accent-cyan);
}

.s3-touch-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.s3-touch-left {
  left: 0;
  justify-content: flex-start;
  padding-left: clamp(72px, 12vmin, 120px);
}

.s3-touch-right {
  right: 0;
  justify-content: flex-end;
  padding-right: 3vmin;
}

.s3-touch-hint {
  font-size: clamp(14px, 2.5vmin, 28px);
  color: rgba(255, 255, 255, 0.15);
  font-weight: 700;
  pointer-events: none;
  transition: all var(--transition-fast);
}

.s3-touch-zone:active .s3-touch-hint {
  color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

/* ══════════════════════════════════════════
   SCORE & LEADERBOARD SCREEN
   ══════════════════════════════════════════ */
.score-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  z-index: 1;
  padding: 2vmin 3vmin;
  overflow-y: auto;
  gap: 2vmin;
}

.score-epilogue {
  max-width: min(90%, 110vmin);
  margin: -1vmin 0 0;
  font-size: clamp(13px, 2vmin, 22px);
  line-height: 1.45;
  color: var(--text-secondary);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.score-title {
  font-size: clamp(28px, 6vmin, 64px);
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--copper));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleShine 2s ease-in-out infinite;
}

@keyframes titleShine {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

.score-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 2vmin 5vmin;
  width: 100%;
}

.score-top-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2vmin;
  flex: 0 1 50vmin;
  min-width: min(100%, 300px);
}

.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.8vmin;
  width: 100%;
  max-width: 50vmin;
}

/* Sertifika QR kutusu: QR beyaz zeminde olmalı (telefon kamerası okuyabilsin) */
.score-cert {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6vmin;
  padding: 1.5vmin;
  background: rgba(10, 15, 35, 0.85);
  border: 1px solid rgba(212, 168, 67, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 3vmin rgba(212, 168, 67, 0.2);
  animation: popInPlace 0.5s ease;
}

.score-cert[hidden] {
  display: none;
}

.score-cert-qr {
  width: clamp(110px, 19vmin, 210px);
  aspect-ratio: 1;
  padding: 0.8vmin;
  background: #ffffff;
  border-radius: var(--radius-md);
}

.score-cert-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.score-cert-title {
  margin: 0;
  font-size: clamp(13px, 2vmin, 22px);
  font-weight: 800;
  color: var(--gold-light);
}

.score-cert-hint {
  margin: 0;
  font-size: clamp(10px, 1.4vmin, 15px);
  color: var(--text-secondary);
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1vmin 2vmin;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  backdrop-filter: blur(5px);
}

.score-row-total {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
}

.score-row-label {
  font-size: clamp(12px, 2vmin, 20px);
  font-weight: 500;
}

.score-row-value {
  display: flex;
  align-items: baseline;
  gap: 0.3vmin;
}

.score-num {
  font-size: clamp(18px, 3vmin, 32px);
  font-weight: 800;
  color: var(--gold-light);
}

.score-num-total {
  font-size: clamp(24px, 4vmin, 44px);
  color: var(--gold-light);
}

.score-max {
  font-size: clamp(10px, 1.5vmin, 16px);
  color: var(--text-muted);
}

/* Rank popup */
.rank-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-secondary);
  border: 2px solid var(--gold);
  border-radius: var(--radius-xl);
  padding: 3vmin 5vmin;
  z-index: 100;
  box-shadow: 0 0 5vmin rgba(212, 168, 67, 0.5);
  animation: rankPopIn 0.5s ease;
}

@keyframes rankPopIn {
  from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

#rank-popup-text {
  font-size: clamp(20px, 4vmin, 44px);
  font-weight: 800;
  color: var(--gold-light);
  text-align: center;
}

/* Leaderboard */
.score-leaderboard {
  flex: 0 1 55vmin;
  min-width: min(100%, 320px);
}

.lb-title {
  font-size: clamp(14px, 2.5vmin, 28px);
  color: var(--gold);
  text-align: center;
  margin-bottom: 1vmin;
}

.lb-table-wrapper {
  max-height: 35vh;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
}

.lb-table th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  padding: 1vmin 1.5vmin;
  font-size: clamp(10px, 1.5vmin, 14px);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
}

.lb-th-rank { width: 15%; text-align: center; }
.lb-th-name { width: 55%; }
.lb-th-score { width: 30%; text-align: right; }

.lb-table td {
  padding: 0.8vmin 1.5vmin;
  font-size: clamp(12px, 1.8vmin, 18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.lb-rank { text-align: center; font-weight: 700; }
.lb-name { font-weight: 500; }
.lb-score { text-align: right; font-weight: 700; color: var(--gold-light); }

.lb-row-1 td { color: var(--gold-light); }
.lb-row-2 td { color: #c0c0c0; }
.lb-row-3 td { color: var(--copper); }

.lb-row-highlight {
  background: rgba(212, 168, 67, 0.15) !important;
  border: 1px solid var(--gold) !important;
  animation: lbHighlight 1.5s ease-in-out infinite;
}

@keyframes lbHighlight {
  0%, 100% { background: rgba(212, 168, 67, 0.1); }
  50% { background: rgba(212, 168, 67, 0.25); }
}

.lb-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Özel Fırlat Butonu */
.btn-launch {
  font-size: clamp(18px, 3.5vmin, 36px);
  padding: 2vmin 5vmin;
  background: linear-gradient(180deg, #e74c3c, #962d22);
  border: 4px solid var(--gold);
  border-radius: 5vmin;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  box-shadow: 0 1vmin 2vmin rgba(0,0,0,0.6), inset 0 5px 10px rgba(255,100,100,0.4);
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 2px;
  transition: all 0.2s ease;
  margin-left: auto; /* Itibaren buton en sağa gitsin, sliderlar solda kalsın */
  margin-right: 4vmin;
}
.btn-launch:hover {
  background: linear-gradient(180deg, #ff5e4d, #b93729);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 1.5vmin 3vmin rgba(231, 76, 60, 0.4), inset 0 5px 10px rgba(255,150,150,0.5);
}
.btn-launch:active {
  transform: translateY(2px);
  box-shadow: 0 0.5vmin 1vmin rgba(0,0,0,0.6), inset 0 5px 10px rgba(0,0,0,0.4);
}

.score-buttons {
  display: flex;
  gap: 2vmin;
  margin-top: 1vmin;
}

/* Auto-reset bar */
.auto-reset-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0.5vmin;
  background: rgba(255, 255, 255, 0.1);
  z-index: 50;
}

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

/* Confetti */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.confetti {
  position: absolute;
  top: -2vmin;
  width: clamp(6px, 1vmin, 12px);
  height: clamp(8px, 1.5vmin, 16px);
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

/* ══════════════════════════════════════════
   COUNTDOWN OVERLAY
   ══════════════════════════════════════════ */
.countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9000;
  backdrop-filter: blur(5px);
}

.countdown-number {
  font-size: clamp(60px, 15vmin, 180px);
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 0 5vmin rgba(212, 168, 67, 0.5);
  animation: countdownPop 0.8s ease;
}

@keyframes countdownPop {
  0% { transform: scale(2); opacity: 0; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

/* ══════════════════════════════════════════
   SCORE POPUPS
   ══════════════════════════════════════════ */
.score-popups-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.score-popup {
  position: absolute;
  font-size: clamp(14px, 2.5vmin, 28px);
  font-weight: 800;
  pointer-events: none;
  animation: scorePopup 1s ease forwards;
  text-shadow: 0 0 1vmin rgba(0, 0, 0, 0.5);
}

.score-popup.positive {
  color: var(--accent-green);
}

.score-popup.negative {
  color: var(--accent-red);
}

@keyframes scorePopup {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
  }
  20% {
    transform: translateY(-1vmin) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translateY(-5vmin) scale(0.8);
    opacity: 0;
  }
}

/* ══════════════════════════════════════════
   SCROLLBAR STYLING
   ══════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 0.6vmin;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ══════════════════════════════════════════
   OTTOMAN DECORATIVE BORDER (used sparingly)
   ══════════════════════════════════════════ */
.ottoman-border {
  position: relative;
}

.ottoman-border::before,
.ottoman-border::after {
  content: '✦';
  position: absolute;
  color: var(--gold-dark);
  font-size: clamp(12px, 2vmin, 20px);
  opacity: 0.5;
}

.ottoman-border::before { top: -1vmin; left: 50%; transform: translateX(-50%); }
.ottoman-border::after { bottom: -1vmin; left: 50%; transform: translateX(-50%); }

/* ══════════════════════════════════════════
   CREDITS (TOFA)
   ══════════════════════════════════════════ */
.credits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.8vmin, 22px);
  width: fit-content;
  margin-inline: auto;
  padding: clamp(6px, 1vmin, 12px) clamp(14px, 2.4vmin, 30px);
  background: rgba(5, 10, 30, 0.45);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 999px;
  backdrop-filter: blur(4px);
  color: var(--text-secondary);
  font-size: clamp(11px, 1.7vmin, 19px);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  flex-wrap: wrap;
}

.credits-text:empty {
  display: none;
}

.credits-logo {
  height: clamp(16px, 2.6vmin, 32px);
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}

.credits-welcome {
  position: absolute;
  left: 50%;
  bottom: 2.5vmin;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 20vmin);
  z-index: 2;
}

.story-content .credits,
.score-content .credits {
  margin-top: 2vmin;
}

.cert-banner {
  max-width: 50vmin;
  margin: 0;
  font-size: clamp(12px, 1.8vmin, 19px);
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  color: var(--gold-light);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(212, 168, 67, 0.5);
  border-radius: 999px;
  padding: 0.8vmin 2.4vmin;
}

.cert-banner[hidden] {
  display: none;
}

/* ══════════════════════════════════════════
   BOŞTA BEKLEME VİTRİNİ (attract.js)
   ══════════════════════════════════════════ */
.attract {
  position: fixed;
  inset: 0;
  z-index: 9500;               /* dil düğmesinin (9999) altında */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6vmin;
  padding: 4vmin 6vmin;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(212, 168, 67, 0.16), transparent 60%),
    linear-gradient(rgba(5, 10, 30, 0.82), rgba(5, 10, 30, 0.92)),
    url('../assets/bg_welcome.png') center bottom / cover no-repeat,
    var(--bg-deep);
  cursor: pointer;
  animation: screenFadeIn 0.6s ease;
}

.attract[hidden] {
  display: none;
}

.attract-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2vmin;
  text-align: center;
  flex: 0 1 75vmin;
}

.attract-rocket {
  height: clamp(110px, 28vmin, 300px);
  filter: drop-shadow(0 0 4vmin rgba(212, 168, 67, 0.6));
  animation: floatingRocket 4s ease-in-out infinite;
}

.attract-title {
  display: flex;
  flex-direction: column;
  margin: 0;
  line-height: 1.05;
}

.attract-title-primary {
  font-size: clamp(20px, 4.5vmin, 52px);
  font-weight: 700;
  color: var(--text-primary);
}

.attract-title-secondary {
  font-size: clamp(36px, 9vmin, 110px);
  white-space: nowrap;
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, var(--gold-light) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.attract-cta {
  margin: 1vmin 0 0;
  padding: 1.6vmin 4vmin;
  font-size: clamp(16px, 3.2vmin, 36px);
  font-weight: 800;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-radius: 999px;
  box-shadow: 0 0 4vmin rgba(212, 168, 67, 0.5);
  animation: btnGlow 2s ease-in-out infinite;
}

.attract-board {
  flex: 0 1 70vmin;
  width: min(92vw, 70vmin);
  padding: 3vmin 4vmin;
  background: rgba(10, 15, 35, 0.88);
  border: 1px solid rgba(212, 168, 67, 0.5);
  border-radius: var(--radius-xl);
  box-shadow: 0 3vmin 6vmin rgba(0, 0, 0, 0.7), 0 0 4vmin rgba(212, 168, 67, 0.15);
}

.attract-board-title {
  margin: 0 0 2vmin;
  font-size: clamp(18px, 4vmin, 44px);
  font-weight: 800;
  color: var(--gold-light);
  text-align: center;
}

.attract-list {
  display: flex;
  flex-direction: column;
  gap: 0.8vmin;
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 50vmin;
}

.attract-list li {
  display: grid;
  grid-template-columns: 8vmin 1fr auto;
  align-items: center;
  padding: 0.9vmin 2vmin;
  font-size: clamp(15px, 3vmin, 34px);
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  animation: popInPlace 0.45s ease both;
}

.attract-list li:nth-child(1) { color: var(--gold-light); background: rgba(212, 168, 67, 0.16); }
.attract-list li:nth-child(2) { color: #d8d8d8; }
.attract-list li:nth-child(3) { color: var(--copper); }

.attract-list li.attract-empty {
  display: block;
  padding: 6vmin 2vmin;
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
}

.attract-rank {
  text-align: center;
}

.attract-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attract-score {
  font-variant-numeric: tabular-nums;
  color: var(--gold-light);
}

.attract-dots {
  display: flex;
  justify-content: center;
  gap: 1vmin;
  margin-top: 2vmin;
}

.attract-dot {
  width: 1.4vmin;
  height: 1.4vmin;
  min-width: 8px;
  min-height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: background var(--transition-fast);
}

.attract-dot.active {
  background: var(--gold);
}

/* Dikey ekranda alt alta */
@media (orientation: portrait) {
  .attract {
    flex-direction: column;
    gap: 3vmin;
  }
}

/* ══════════════════════════════════════════
   NASIL OYNANIR? kartı (her aşamadan önce)
   ══════════════════════════════════════════ */
.stage-intro {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vmin;
  background: rgba(5, 10, 30, 0.72);
  backdrop-filter: blur(4px);
  z-index: 8500;
}

.stage-intro[hidden] {
  display: none;
}

.stage-intro-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2vmin;
  width: min(92vw, 110vmin);
  max-height: 94vh;
  overflow-y: auto;
  padding: 3.5vmin 4.5vmin;
  background: rgba(40, 30, 20, 0.96);
  border: 4px solid var(--gold);
  border-radius: 2vmin;
  box-shadow: 0 1vmin 4vmin rgba(0, 0, 0, 0.6);
  animation: popInPlace 0.35s ease;
}

.stage-intro-title {
  margin: 0;
  text-align: center;
  font-size: clamp(22px, 4.2vmin, 46px);
  font-weight: 900;
  color: var(--gold-light);
}

.stage-intro-section {
  padding: 1.6vmin 2.2vmin;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 168, 67, 0.35);
  border-radius: var(--radius-md);
}

.stage-intro-label {
  display: block;
  margin-bottom: 0.8vmin;
  font-size: clamp(12px, 1.8vmin, 20px);
  font-weight: 800;
  color: var(--gold);
}

.stage-intro-goal,
.stage-intro-controls {
  margin: 0;
  font-size: clamp(14px, 2.4vmin, 26px);
  line-height: 1.4;
  color: var(--text-primary);
}

.stage-intro-goal {
  font-weight: 700;
}

.stage-intro-steps {
  margin: 0;
  padding-left: 1.3em;
  display: flex;
  flex-direction: column;
  gap: 0.8vmin;
  font-size: clamp(14px, 2.3vmin, 25px);
  line-height: 1.4;
  color: var(--text-primary);
}

.stage-intro-steps li::marker {
  font-weight: 800;
  color: var(--gold-light);
}

.stage-intro-card .btn {
  align-self: center;
  margin-top: 0.5vmin;
}

.btn-skip.btn-continue:active {
  transform: translateX(-50%) scale(0.95);
}
