:root {
  --bg-1: #0a0a1a;
  --bg-2: #12122e;
  --bg-3: #1a1a45;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-3: #06b6d4;
  --gold: #fbbf24;
  --green: #10b981;
  --red: #f43f5e;
  --glass: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.12);
  --glass-hover: rgba(255,255,255,0.1);
  --text: #ffffff;
  --text-dim: #94a3b8;
  --font: 'Cairo', 'Tajawal', system-ui, sans-serif;
  --font-en: 'Poppins', system-ui, sans-serif;
  --shadow-glow: 0 0 40px rgba(139,92,246,0.4);
  --shadow-card: 0 25px 50px -12px rgba(0,0,0,0.6);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

html[lang="en"] { --font: var(--font-en); }

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
  -webkit-tap-highlight-color: transparent; 
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg-1);
  color: var(--text);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(139,92,246,0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(236,72,153,0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(6,182,212,0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 { width: 400px; height: 400px; background: var(--accent); top: -100px; right: -100px; }
.orb-2 { width: 300px; height: 300px; background: var(--accent-2); bottom: -50px; left: -50px; animation-delay: -7s; }
.orb-3 { width: 250px; height: 250px; background: var(--accent-3); top: 50%; left: 50%; transform: translate(-50%, -50%); animation-delay: -14s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.9); }
  75% { transform: translate(20px, 30px) scale(1.05); }
}

.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
  z-index: 1;
  scrollbar-width: none;
}

.screen::-webkit-scrollbar { display: none; }

.screen.active {
  display: flex;
  animation: screenEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes screenEnter {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ═══ Start Screen ═══ */
#screen-start {
  justify-content: center;
  text-align: center;
  gap: 8px;
}

.logo-container { position: relative; margin-bottom: 16px; }

.logo-badge {
  font-size: 80px;
  filter: drop-shadow(0 0 30px var(--accent-2));
  animation: logoBounce 2s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes logoBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

.logo-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  opacity: 0.5;
  filter: blur(30px);
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.2); }
}

.title {
  font-size: clamp(36px, 10vw, 56px);
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, var(--accent-2) 50%, var(--gold) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
  animation: gradientShift 4s ease infinite;
  letter-spacing: -1px;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.subtitle {
  color: var(--text-dim);
  margin-bottom: 28px;
  font-size: 15px;
  font-weight: 500;
}

.best-score {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-md);
  padding: 16px 28px;
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  font-size: 14px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.best-score::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer { 100% { transform: translateX(100%); } }

.best-score .trophy { font-size: 28px; animation: trophySpin 4s ease-in-out infinite; }

@keyframes trophySpin {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.best-score strong { color: var(--gold); font-size: 24px; font-weight: 900; }

.lang-toggle {
  display: flex;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 28px;
}

.lang-btn {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(139,92,246,0.4);
}

/* ═══ Buttons ═══ */
.btn-primary, .btn-ghost, .btn-reward {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  border-radius: var(--radius-md);
  padding: 18px 32px;
  font-size: 16px;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 340px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 40px rgba(139,92,246,0.4);
  margin-bottom: 12px;
}

.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 50px rgba(139,92,246,0.6); }
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover { background: var(--glass-hover); transform: translateY(-2px); }

.btn-reward {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #000;
  margin-bottom: 12px;
}

.btn-reward:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(251,191,36,0.4); }

/* ═══ Levels Screen ═══ */
#screen-levels {
  justify-content: flex-start;
  padding-top: 40px;
}

.screen-title {
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.screen-subtitle {
  color: var(--text-dim);
  margin-bottom: 28px;
  font-size: 15px;
}

.levels-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 24px;
}

.level-card {
  background: var(--glass);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: start;
  font-family: inherit;
  color: var(--text);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.level-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--level-color, var(--accent)), transparent);
  opacity: 0.15;
  transition: opacity var(--transition-smooth);
}

.level-card:hover:not(.locked) {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--level-color, var(--accent));
  box-shadow: 0 15px 40px rgba(0,0,0,0.4), 0 0 30px var(--level-color, var(--accent));
}

.level-card.locked { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.6); }

.level-icon {
  font-size: 44px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 15px var(--level-color, var(--accent)));
  position: relative;
  z-index: 1;
}

.level-info { flex: 1; position: relative; z-index: 1; }

.level-info h3 {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 4px;
  color: var(--level-color, var(--accent));
}

.level-info p { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.level-score { font-size: 12px; color: var(--gold); font-weight: 700; }
.level-lock { font-size: 24px; position: relative; z-index: 1; }

/* ═══ Game Screen ═══ */
#screen-game {
  padding-top: 12px;
  justify-content: flex-start;
}

.hud {
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.hud-item {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: center;
  backdrop-filter: blur(20px);
  transition: var(--transition-smooth);
}

.hud-item .hud-label {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hud-item strong {
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(135deg, #fff, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.timer-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
}

.timer-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 6; }

.ring-fg {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
  filter: drop-shadow(0 0 10px var(--accent-2));
}

.timer-wrap span {
  position: absolute;
  font-size: 26px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.timer-wrap.danger span { color: var(--red); animation: dangerPulse 0.5s infinite; }

@keyframes dangerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.timer-wrap.danger .ring-fg { stroke: var(--red); filter: drop-shadow(0 0 15px var(--red)); }

/* ═══ Level Bar ═══ */
.level-bar {
  width: 100%;
  max-width: 520px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.level-badge {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 800;
  backdrop-filter: blur(20px);
}

.hint-btn {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  color: #000;
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(251,191,36,0.3);
}

.hint-btn:hover:not(.disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(251,191,36,0.5); }
.hint-btn.disabled, .hint-btn:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.5); }

.hint-count {
  background: rgba(0,0,0,0.25);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}

/* ═══ Hint Panel ═══ */
.hint-panel {
  width: 100%;
  max-width: 520px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin 0.3s ease, opacity 0.3s;
  opacity: 0;
  margin-bottom: 0;
}

.hint-panel.active {
  max-height: 100px;
  opacity: 1;
  margin-bottom: 16px;
}

.hint-content {
  background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(236,72,153,0.1));
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeInUp 0.4s;
  backdrop-filter: blur(20px);
}

.hint-icon { font-size: 24px; flex-shrink: 0; }
.hint-text { font-size: 15px; font-weight: 700; color: var(--gold); line-height: 1.4; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══ Letters ═══ */
.letters-board {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 520px;
}

.letter-tile {
  width: 62px;
  height: 72px;
  background: linear-gradient(160deg, rgba(255,255,255,0.15), rgba(255,255,255,0.03));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
  backdrop-filter: blur(20px);
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 8px 24px rgba(0,0,0,0.4);
  animation: tileIn 0.5s backwards;
  transition: var(--transition-bounce);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

@keyframes tileIn {
  from { opacity: 0; transform: translateY(-40px) rotate(-15deg) scale(0.8); }
  to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

.letter-tile:hover {
  transform: translateY(-5px) scale(1.05);
  border-color: var(--accent-2);
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 15px 40px rgba(236,72,153,0.3);
}

.letter-tile.used { opacity: 0.3; transform: scale(0.9); filter: grayscale(0.5); }

/* ═══ Input ═══ */
.input-wrap {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 520px;
  margin-bottom: 16px;
}

#word-input {
  flex: 1;
  background: var(--glass);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  color: var(--text);
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  outline: none;
  text-align: center;
  transition: var(--transition-smooth);
  backdrop-filter: blur(20px);
}

#word-input::placeholder { color: var(--text-dim); font-weight: 500; }

#word-input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(236,72,153,0.15), 0 0 30px rgba(236,72,153,0.2);
  background: rgba(255,255,255,0.1);
}

#btn-submit {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 25px rgba(139,92,246,0.4);
}

#btn-submit:hover { transform: scale(1.05); }
#btn-submit:active { transform: scale(0.95); }

/* ═══ Feedback ═══ */
.feedback {
  min-height: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  font-size: 15px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.feedback.ok { color: var(--green); animation: feedbackPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); }
.feedback.err { color: var(--red); animation: feedbackShake 0.4s; }
.feedback.bonus {
  color: var(--gold);
  animation: feedbackBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-shadow: 0 0 20px rgba(251,191,36,0.5);
}

@keyframes feedbackPop {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes feedbackShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@keyframes feedbackBounce {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ═══ Found Words ═══ */
.found-words {
  width: 100%;
  max-width: 520px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  backdrop-filter: blur(20px);
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.found-words::-webkit-scrollbar { width: 6px; }
.found-words::-webkit-scrollbar-track { background: transparent; }
.found-words::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

.found-words h3 {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.found-words ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }

.found-words li {
  background: linear-gradient(135deg, rgba(139,92,246,0.4), rgba(236,72,153,0.3));
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  animation: wordPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border: 1px solid rgba(255,255,255,0.1);
}

.found-words li.gold {
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  color: #000;
  box-shadow: 0 4px 15px rgba(251,191,36,0.4);
}

@keyframes wordPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ═══ Result ═══ */
#screen-result { justify-content: center; }

.result-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  width: 100%;
  max-width: 440px;
  backdrop-filter: blur(30px);
  text-align: center;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEnter {
  from { opacity: 0; transform: scale(0.9) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--gold));
}

.record-badge {
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  color: #000;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 8px 25px rgba(251,191,36,0.5);
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.result-emoji {
  font-size: 80px;
  margin-bottom: 12px;
  animation: emojiBounce 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes emojiBounce {
  0% { transform: scale(0) rotate(-30deg); }
  60% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.result-card h2 { font-size: 28px; margin-bottom: 20px; font-weight: 900; }

.result-score {
  font-size: 80px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 20px;
  animation: scoreReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scoreReveal {
  from { opacity: 0; transform: scale(0.5) translateY(20px); filter: blur(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

.result-score small {
  font-size: 20px;
  display: block;
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
  font-weight: 600;
  margin-top: 4px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.result-stats > div {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
}

.result-stats strong { display: block; font-size: 20px; color: var(--gold); font-weight: 900; }
.result-stats span { font-size: 11px; color: var(--text-dim); text-transform: uppercase; }

.native-ad {
  background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(139,92,246,0.15));
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 20px;
  min-height: 70px;
  display: grid;
  place-items: center;
}

.result-actions { display: flex; flex-direction: column; gap: 12px; }

/* ═══ Modal ═══ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal.active { display: flex; animation: modalFade 0.3s; }

@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: linear-gradient(160deg, #1e1e4a, #0f0f23);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 440px;
  width: 100%;
  animation: modalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.modal-content h2 { margin-bottom: 20px; text-align: center; font-size: 24px; }

.rules { list-style: none; margin-bottom: 24px; }

.rules li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 14px;
  line-height: 1.7;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.rules li:last-child { border-bottom: 0; }
.rules li b { color: var(--gold); font-weight: 800; }
.rules li .icon { font-size: 20px; flex-shrink: 0; }

/* ═══ Combo ═══ */
.combo-indicator {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 60px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 40px var(--gold);
  pointer-events: none;
  opacity: 0;
  z-index: 50;
}

.combo-indicator.active { animation: comboFlash 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55); }

@keyframes comboFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

.shake { animation: screenShake 0.4s; }

@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.particle {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 100;
  animation: particleBurst 0.8s ease-out forwards;
}

@keyframes particleBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}