/* ========================================
   2026 복권 번호 생성기 - Casino 스타일
   Primary: #e74c3c (Red), Accent: Gold
   ======================================== */

/* CSS Variables */
:root {
  /* Colors - Dark Theme (Default) */
  --primary: #e74c3c;
  --primary-light: #ff6b6b;
  --primary-dark: #c0392b;
  --gold: #f39c12;
  --gold-light: #f1c40f;
  --gold-dark: #d68910;

  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --border: rgba(231, 76, 60, 0.2);

  /* Gradients */
  --gradient-bg: linear-gradient(135deg, #0a0a0a 0%, #1a0a0a 50%, #0a0a0a 100%);
  --gradient-red: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  --gradient-gold: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
  --gradient-luxury: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Border Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 40px;

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.7);
  --shadow-red: 0 8px 32px rgba(231, 76, 60, 0.4);
  --shadow-gold: 0 8px 32px rgba(243, 156, 18, 0.4);
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #f5f5fa;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.95);
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a70;
  --border: rgba(231, 76, 60, 0.15);
  --gradient-bg: linear-gradient(135deg, #f5f5fa 0%, #ffffff 50%, #f5f5fa 100%);
  --shadow-sm: 0 4px 12px rgba(231, 76, 60, 0.1);
  --shadow-md: 0 8px 24px rgba(231, 76, 60, 0.15);
  --shadow-lg: 0 16px 48px rgba(231, 76, 60, 0.2);
}

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

/* 터치 최적화 */
button, a, input, [role="button"], [role="link"] {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

input[type="text"], textarea {
  -webkit-user-select: text;
  user-select: text;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: all 0.3s ease;
}

/* App Loader */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.loader-emoji {
    font-size: 48px;
    animation: loader-bounce 1s ease-in-out infinite;
}
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}
.loader-text {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    font-weight: 500;
}
@keyframes loader-spin {
    to { transform: rotate(360deg); }
}
@keyframes loader-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: var(--spacing-md) var(--spacing-sm);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.9);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  background: var(--gradient-luxury);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.emoji {
  font-size: 1.8rem;
}

.theme-toggle {
  position: fixed;
  top: 12px;
  right: 56px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing-sm);
}

/* Section Title */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

/* Type Selection */
.type-section {
  margin-bottom: var(--spacing-lg);
}

.type-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

.type-btn {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.type-btn:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: var(--shadow-red);
}

.type-btn.active {
  background: var(--gradient-red);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-red);
}

.type-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-xs);
}

.type-name {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Options Section */
.options-section {
  margin-bottom: var(--spacing-lg);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
}

.option-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.option-item label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
}

.select-box {
  width: 100%;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm);
  font-size: 1rem;
  cursor: pointer;
}

.checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin-right: var(--spacing-xs);
}

/* Generate Button */
.generate-section {
  margin-bottom: var(--spacing-xl);
}

.generate-btn {
  width: 100%;
  background: var(--gradient-luxury);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  box-shadow: var(--shadow-gold);
  transition: all 0.3s ease;
  min-height: 70px;
  animation: ctaPulse 2s ease-in-out infinite;
  animation-delay: 0s;
}

@keyframes ctaPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 32px rgba(243, 156, 18, 0.4); }
  50% { transform: scale(1.02); box-shadow: 0 12px 48px rgba(243, 156, 18, 0.8); }
}

.generate-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 16px 48px rgba(243, 156, 18, 0.9);
  animation: none;
}

.generate-btn:active {
  transform: scale(0.98);
}

.btn-icon {
  font-size: 2rem;
}

/* Results Section */
.results-section {
  margin-bottom: var(--spacing-xl);
}

.results-container {
  display: grid;
  gap: var(--spacing-md);
}

.result-item {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all 0.3s ease;
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-item:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.result-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.save-btn {
  background: rgba(243, 156, 18, 0.1);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: var(--spacing-xs) var(--spacing-md);
  cursor: pointer;
  color: var(--gold);
  font-weight: 600;
  transition: all 0.3s ease;
}

.save-btn:hover {
  background: var(--gradient-gold);
  color: white;
}

.save-btn.saved {
  background: var(--gold);
  color: white;
}

/* Number Balls */
.numbers-display {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  justify-content: center;
}

.number-ball {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  box-shadow: var(--shadow-sm);
  animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

@keyframes popIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes spinIn {
  0% {
    opacity: 0;
    transform: scale(0) rotateZ(-720deg);
  }
  60% {
    transform: scale(1.15) rotateZ(20deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateZ(0deg);
  }
}

.number-ball.spinning {
  animation: spinIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

/* Lotto ball colors by range (Korean lottery standard) */
.number-ball.lotto { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.number-ball.range-1  { background: linear-gradient(135deg, #fbc531, #e1b12c); color: #333; }
.number-ball.range-2  { background: linear-gradient(135deg, #4a90d9, #2d6cb4); }
.number-ball.range-3  { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.number-ball.range-4  { background: linear-gradient(135deg, #7f8c8d, #636e72); }
.number-ball.range-5  { background: linear-gradient(135deg, #27ae60, #1e8449); }

/* Frequency analysis section */
.freq-section { margin-bottom: var(--spacing-xl); }
.freq-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  margin-bottom: var(--spacing-md);
}
.freq-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}
.freq-cell .freq-count {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 8px;
  background: var(--gold);
  color: #000;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.freq-cell.hot { border-color: var(--primary); box-shadow: 0 0 8px rgba(231,76,60,0.4); }
.freq-cell.cold { opacity: 0.4; }
.freq-legend {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.freq-legend span { display: flex; align-items: center; gap: 4px; }
.freq-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.freq-dot.hot-dot { background: var(--primary); box-shadow: 0 0 6px rgba(231,76,60,0.5); }
.freq-dot.cold-dot { background: var(--border); opacity: 0.4; }

/* Ball spin animation - 슬롯머신 스타일 */
@keyframes ballSpin {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(360deg); opacity: 1; }
  100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

@keyframes slotMachineRoll {
  0% { transform: translateY(-100px) rotateX(0deg); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(0) rotateX(360deg); opacity: 1; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(243, 156, 18, 0.3), inset 0 0 10px rgba(243, 156, 18, 0.1); }
  50% { box-shadow: 0 0 30px rgba(243, 156, 18, 0.8), inset 0 0 15px rgba(243, 156, 18, 0.3); }
}

.number-ball.spinning {
  animation: slotMachineRoll 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-fill-mode: forwards;
}

.number-ball {
  position: relative;
  transition: all 0.3s ease;
}

.number-ball.spinning:after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5), transparent);
  opacity: 0;
  animation: glowPulse 0.8s ease-in-out forwards;
}

/* Range legend */
.range-legend {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--spacing-sm);
  flex-wrap: wrap;
}
.range-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.range-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Pension numbers */
.pension-group {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
  font-size: 1.2rem;
  font-weight: 700;
}

.pension-label {
  color: var(--gold);
  margin-right: var(--spacing-sm);
}

/* Saved Section */
.saved-section {
  margin-bottom: var(--spacing-xl);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.clear-btn {
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: var(--spacing-xs) var(--spacing-md);
  color: #ff4757;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-btn:hover {
  background: #ff4757;
  color: white;
}

.saved-container {
  display: grid;
  gap: var(--spacing-sm);
}

.delete-btn {
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  cursor: pointer;
  color: #ff4757;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.delete-btn:hover {
  background: #ff4757;
  color: white;
}

/* Stats */
.stats-section {
  margin-bottom: var(--spacing-xl);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--spacing-md);
}

.stat-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-8px);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-sm);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-luxury);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Analysis Section */
.analysis-section {
  margin-bottom: var(--spacing-xl);
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--spacing-sm);
}

.analysis-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  text-align: center;
}

.analysis-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
}

.analysis-value {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-luxury);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Info Section */
.info-section {
  margin-bottom: var(--spacing-xl);
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
}

.info-card h3 {
  color: var(--gold);
  margin-bottom: var(--spacing-md);
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card li {
  padding: var(--spacing-xs) 0;
  color: var(--text-secondary);
  line-height: 1.8;
}

.info-card li strong {
  color: var(--text-primary);
}

/* Empty Message */
.empty-message {
  text-align: center;
  color: var(--text-secondary);
  padding: var(--spacing-xl);
  font-style: italic;
}

/* Footer */
.footer {
  text-align: center;
  padding: var(--spacing-lg);
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

/* Ad Banner */
.ad-banner {
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  text-align: center;
  padding: var(--spacing-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.ad-placeholder {
  opacity: 0.5;
}

/* Semi-Auto Section */
.semi-auto-section {
  margin-bottom: var(--spacing-lg);
}

.semi-auto-section.hidden {
  display: none;
}

.semi-auto-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-sm);
}

.semi-auto-hint {
  font-size: 0.8rem;
  color: var(--gold);
  margin-top: var(--spacing-xs);
}

.number-picker {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  margin-bottom: var(--spacing-sm);
}

.pick-num {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
}

.pick-num:hover {
  border-color: var(--gold);
  background: rgba(243, 156, 18, 0.1);
}

.pick-num.picked {
  background: var(--gradient-gold);
  color: #000;
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
}

.selected-numbers {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.selected-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.selected-display {
  color: var(--gold);
  font-weight: 700;
}

/* Simulation Section */
.simulation-section {
  margin-bottom: var(--spacing-lg);
}

.simulation-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-sm);
  text-align: center;
}

.simulation-btn,
.premium-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  width: 100%;
  padding: var(--spacing-md);
  background: linear-gradient(135deg, #f1c40f 0%, #e74c3c 50%, #c0392b 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
  min-height: 56px;
  animation-delay: 0s;
}

.simulation-btn:hover,
.premium-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(231, 76, 60, 0.5);
}

.simulation-icon,
.premium-icon {
  font-size: 1.4rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Premium Button */
.premium-section {
  margin-bottom: var(--spacing-lg);
}

.premium-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  width: 100%;
  padding: var(--spacing-md);
  background: linear-gradient(135deg, #f1c40f 0%, #e74c3c 50%, #c0392b 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
  min-height: 56px;
}

.premium-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(231, 76, 60, 0.5);
}

.premium-icon {
  font-size: 1.4rem;
}

.premium-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

/* Interstitial Ad */
.interstitial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.interstitial-overlay.hidden {
  display: none;
}

.interstitial-content {
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.interstitial-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin-bottom: var(--spacing-sm);
}

.ad-placeholder-large {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-xl);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-ad-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 48px;
}

.close-ad-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Premium Modal */
.premium-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: var(--spacing-sm);
}

.premium-modal.hidden {
  display: none;
}

.premium-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.premium-close {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.premium-close:hover {
  background: rgba(231, 76, 60, 0.2);
  color: var(--primary);
}

.premium-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.premium-modal-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--spacing-xs);
}

.premium-header h2 {
  background: var(--gradient-luxury);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.5rem;
}

.premium-numbers {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-lg);
}

.premium-ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-luxury);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.premium-analysis-item {
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.premium-analysis-item h3 {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: var(--spacing-xs);
}

.premium-analysis-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.lucky-message {
  color: var(--gold) !important;
  font-style: italic;
}

.premium-pension {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.pension-display {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-luxury);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive */
@media (max-width: 768px) {
  .app-title {
    font-size: 1.2rem;
  }

  .type-buttons {
    grid-template-columns: 1fr;
  }

  .number-ball {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Recommendations Section */
.recommendations-section { margin: 24px 0 0; padding: 0 16px; }
.rec-title { font-size: 15px; font-weight: 700; color: rgba(255,255,255,0.5); margin-bottom: 12px; text-align: center; letter-spacing: 0.5px; }
.rec-grid { display: flex; flex-direction: column; gap: 10px; }
.rec-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; text-decoration: none; color: #fff; transition: all 0.2s ease; }
.rec-card:hover { background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.rec-icon { font-size: 28px; flex-shrink: 0; }
.rec-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rec-name { font-size: 14px; font-weight: 600; }
.rec-desc { font-size: 12px; color: rgba(255,255,255,0.5); }

/* Language Selector */
.language-selector { position: fixed; top: 20px; right: 20px; z-index: 1000; }
.lang-btn { background: rgba(231,76,60,0.3); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(231,76,60,0.4); color: #fff; font-size: 20px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; transition: all 0.2s ease; }
.lang-btn:hover { background: rgba(231,76,60,0.5); transform: scale(1.05); }
.lang-menu { position: absolute; top: 52px; right: 0; background: rgba(20,20,30,0.95); backdrop-filter: blur(20px); border: 1px solid rgba(231,76,60,0.3); border-radius: 12px; padding: 8px; min-width: 150px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.lang-menu.hidden { display: none; }
.lang-option { width: 100%; padding: 10px 14px; background: transparent; border: none; text-align: left; cursor: pointer; border-radius: 8px; font-size: 14px; color: #f0e0e0; transition: background 0.2s; }
.lang-option:hover { background: rgba(231,76,60,0.2); }
.lang-option.active { background: rgba(231,76,60,0.3); font-weight: 600; }

/* Light theme language selector */
[data-theme="light"] .lang-btn { background: rgba(231,76,60,0.2); border-color: rgba(231,76,60,0.3); }
[data-theme="light"] .lang-btn:hover { background: rgba(231,76,60,0.3); }
[data-theme="light"] .lang-menu { background: rgba(255,255,255,0.95); border-color: rgba(231,76,60,0.2); }
[data-theme="light"] .lang-option { color: #1a1a1a; }
[data-theme="light"] .lang-option:hover { background: rgba(231,76,60,0.1); }
[data-theme="light"] .lang-option.active { background: rgba(231,76,60,0.2); }

/* Light theme rec/back-link overrides */
[data-theme="light"] .rec-card { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .rec-card:hover { background: rgba(0,0,0,0.06); }
[data-theme="light"] .rec-title { color: rgba(26,26,46,0.5); }
[data-theme="light"] .rec-name { color: #1a1a2e; }
[data-theme="light"] .rec-desc { color: #555; }
[data-theme="light"] .back-link { color: rgba(26,26,46,0.4); }
[data-theme="light"] .back-link:hover { color: rgba(26,26,46,0.7); }

/* Footer with Back Link */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,0.4); text-decoration: none; font-size: 13px; padding: 12px 0; transition: color 0.2s; margin-top: 12px; }
.back-link:hover { color: rgba(255,255,255,0.7); }

/* === Accessibility Improvements === */
button:focus-visible,a:focus-visible,input:focus-visible,[role="button"]:focus-visible{outline:3px solid #e74c3c;outline-offset:2px;}
button,a[href],input[type="button"],input[type="submit"],[role="button"]{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;}
.skip-link{position:absolute;top:-40px;left:0;background:#e74c3c;color:white;padding:8px;text-decoration:none;z-index:100;}
.skip-link:focus{top:0;}
[role="dialog"]{z-index:1000;}
@media (prefers-reduced-motion: reduce){*{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important;}}
/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark, var(--bg-primary, var(--background, #0f0f23)));
}

::-webkit-scrollbar-thumb {
    background: #e74c3c;
    border-radius: 5px;
    border: 2px solid var(--bg-dark, var(--bg-primary, var(--background, #0f0f23)));
}

::-webkit-scrollbar-thumb:hover {
    background: #eb6f63;
    opacity: 0.8;
}

/* Selection Color */
::selection {
    background: #e74c3c;
    color: white;
}

::-moz-selection {
    background: #e74c3c;
    color: white;
}

@media (prefers-contrast: more){button{border:2px solid #e74c3c;}}
.rec-card:focus-visible{outline:3px solid #e74c3c;outline-offset:4px;}
