/* LuckyBuzz — Casino-vibe dark theme with gold accents */
:root {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1a2744;
  --gold: #FFD700;
  --gold-dim: #B8960C;
  --green: #4CAF50;
  --red: #e74c3c;
  --text: #f0f0f0;
  --text-dim: #8892b0;
  --accent: var(--gold);
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  min-height: 100dvh;
}

#app {
  max-width: 420px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Language Bar */
.lang-bar {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  justify-content: center;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.9);
  backdrop-filter: blur(8px);
}

.lang-btn {
  background: rgba(255,255,255,0.08);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-btn:hover, .lang-btn.active {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--gold);
}

.lang-btn .fi {
  font-size: 20px;
  border-radius: 2px;
}

/* Screens */
.screen {
  display: none;
  width: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: flex;
}

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

/* Card */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px 24px;
  width: 100%;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,215,0,0.1);
  text-align: center;
}

/* Logo & Business Name */
.logo-area { margin-bottom: 20px; text-align: center; }
.biz-name {
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Typography */
h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--gold), #FFA500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-dim);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

/* Form */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--gold);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #FFA500);
  color: #1a1a2e;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(255,215,0,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-large {
  width: 100%;
  padding: 16px;
  font-size: 1.15rem;
}

/* Game Cards */
.game-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  margin-top: 20px;
}

.game-card {
  background: var(--bg-card);
  border: 2px solid rgba(255,215,0,0.1);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.game-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.15);
}

.game-card:active { transform: scale(0.97); }

.game-icon { font-size: 3rem; margin-bottom: 12px; }

.game-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--gold);
}

.game-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Scratch Card */
.scratch-container {
  position: relative;
  width: 300px;
  height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 20px auto;
  border: 3px solid var(--gold);
}

.scratch-prize {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  z-index: 1;
}

.scratch-prize .prize-emoji { font-size: 3rem; margin-bottom: 8px; }
.scratch-prize .prize-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
}

#scratch-canvas {
  position: absolute;
  top: 0; left: 0;
  z-index: 2;
  cursor: pointer;
  touch-action: none;
}

.hint {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Spin Wheel */
.wheel-container {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 20px auto;
}

#wheel-canvas {
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(255,215,0,0.3), inset 0 0 20px rgba(0,0,0,0.3);
  border: 4px solid var(--gold);
}

.wheel-pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: var(--gold);
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  line-height: 1;
}

.spin-btn {
  margin-top: 20px;
  font-size: 1.4rem;
  letter-spacing: 2px;
  padding: 18px 48px;
  border-radius: 50px;
}

.spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Result Screen */
.result-card {
  padding: 40px 24px;
}

.result-emoji { font-size: 4rem; margin-bottom: 16px; }

.result-card h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.result-prize-name {
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 16px;
}

.redemption-box {
  background: rgba(255,215,0,0.1);
  border: 2px dashed var(--gold);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}

.redemption-code {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--gold);
  font-family: 'Courier New', monospace;
}

.redemption-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 8px;
}

/* Lose result */
.result-card.lose h2 {
  background: linear-gradient(135deg, #8892b0, #a0a8c0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Social Links */
.social-links {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.social-link:hover { background: rgba(255,255,255,0.12); }

/* Cooldown */
.cooldown-icon { font-size: 3rem; margin-bottom: 16px; }

#cooldown-time {
  color: var(--text-dim);
  margin-top: 12px;
}

/* Powered by */
.powered-by {
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-top: 24px;
  opacity: 0.6;
}

/* Confetti Canvas */
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* Loader */
.loader {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,215,0,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Shake animation for "try again" */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake { animation: shake 0.5s ease; }

/* Responsive */
@media (max-width: 380px) {
  .scratch-container { width: 260px; height: 170px; }
  .wheel-container, #wheel-canvas { width: 280px; height: 280px; }
  .game-cards { gap: 10px; }
  .game-card { padding: 20px 12px; }
}
