:root {
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface2: #22222f;
  --accent: #6c63ff;
  --accent2: #ff6584;
  --green: #00e676;
  --yellow: #ffd740;
  --red: #ff5252;
  --text: #f0f0f5;
  --text2: #9090a8;
  --radius: 16px;
}

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

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

#app {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

/* ── Language bar ────────────────────────────── */
.lang-bar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 0 4px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}

.lang-dropdown { position: relative; }

.lang-current {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid #333;
  border-radius: 20px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s;
  white-space: nowrap;
}
.lang-current:active { opacity: .8; }
.lang-current:focus  { border-color: var(--accent); outline: none; }
.lang-arrow { font-size: 11px; color: var(--text2); transition: transform .2s; }
.lang-dropdown.open .lang-arrow { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid #333;
  border-radius: 14px;
  overflow: hidden;
  min-width: 150px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  z-index: 200;
}
.lang-option {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid #2a2a3a;
}
.lang-option:last-child { border-bottom: none; }
.lang-option:active,
.lang-option.selected { background: rgba(108,99,255,.2); color: #a78bfa; }

.screen { width: 100%; }
.hidden { display: none !important; }

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: block;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
  margin-top: 12px;
}
.btn:active { transform: scale(.97); opacity: .85; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
}
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid #333;
}

/* ── Register screen ─────────────────────────── */
.hero {
  text-align: center;
  padding: 40px 0 28px;
}
.hero-icon { font-size: 64px; margin-bottom: 12px; }
.hero h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.subtitle { color: var(--text2); font-size: 15px; }

.register-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
}
.register-steps { margin-bottom: 20px; }
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #2a2a3a;
  font-size: 15px;
}
.step:last-child { border-bottom: none; }
.step-num {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.hint { color: var(--text2); font-size: 13px; text-align: center; margin-top: 14px; }

.active-step { background: rgba(108,99,255,.1); border-radius: 8px; padding: 10px 8px !important; margin: 2px 0; }
.step-num.done { background: #2a2a3a; color: var(--text2); }

.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(108,99,255,.4); }
  50%      { box-shadow: 0 0 0 12px rgba(108,99,255,0); }
}

.deposit-bonus {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(0,230,118,.1), rgba(108,99,255,.1));
  border: 1px solid rgba(0,230,118,.3);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.bonus-icon { font-size: 36px; flex-shrink: 0; }
.bonus-title { font-size: 15px; font-weight: 700; color: var(--green); }
.bonus-sub { font-size: 13px; color: var(--text2); margin-top: 3px; }

/* ── Upload screen ───────────────────────────── */
.header { text-align: center; padding: 24px 0 20px; }
.header h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.header p { color: var(--text2); font-size: 14px; }

.upload-area {
  position: relative;
  background: var(--surface);
  border: 2px dashed #333;
  border-radius: var(--radius);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .2s;
  overflow: hidden;
}
.upload-area:active { border-color: var(--accent); }
.upload-area input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; z-index: 2;
}
.upload-content { text-align: center; padding: 32px 20px; pointer-events: none; }
.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-text { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.upload-hint { font-size: 13px; color: var(--text2); }

.preview {
  width: 100%; height: auto;
  max-height: 300px;
  object-fit: contain;
  border-radius: calc(var(--radius) - 2px);
}

.examples { margin-top: 24px; }
.examples-title { color: var(--text2); font-size: 13px; margin-bottom: 10px; }
.examples-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.example-item {
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  font-size: 13px;
  color: var(--text2);
}

/* ── Loading screen ──────────────────────────── */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
}
.spinner {
  width: 56px; height: 56px;
  border: 4px solid #2a2a3a;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 18px; font-weight: 600; }
.loading-sub { color: var(--text2); font-size: 14px; }

/* ── Result screen ───────────────────────────── */
.result-header { text-align: center; padding: 20px 0 16px; }
.result-header h2 { font-size: 22px; font-weight: 700; }

.result-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.result-event {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  padding: 16px 20px;
}
.result-sport { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; opacity: .8; }
.result-event-name { font-size: 18px; font-weight: 700; margin-top: 4px; }

.result-body { padding: 16px 20px; }

.result-section { margin-bottom: 16px; }
.result-section:last-child { margin-bottom: 0; }
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  margin-bottom: 6px;
}
.section-value { font-size: 15px; line-height: 1.5; }

.bet-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--green);
}

.stats-row {
  display: flex;
  gap: 12px;
}
.risk-row { display: flex; align-items: center; justify-content: space-between; }
.risk-badge { font-size: 16px; font-weight: 700; }
.stat-box {
  flex: 1;
  background: var(--surface2);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.stat-num { font-size: 22px; font-weight: 800; word-break: break-word; }
.stat-label { font-size: 11px; color: var(--text2); margin-top: 3px; }

.chance-green { color: var(--green); }
.chance-yellow { color: var(--yellow); }
.chance-red { color: var(--red); }

.risk-low { color: var(--green); }
.risk-medium { color: var(--yellow); }
.risk-high { color: var(--red); }

.odds-value { color: var(--accent); font-weight: 700; }

.warning-box {
  background: rgba(255, 87, 34, .12);
  border: 1px solid rgba(255, 87, 34, .3);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #ff8a65;
  margin-top: 12px;
}

.result-actions { margin-top: 16px; }
.disclaimer {
  text-align: center;
  font-size: 12px;
  color: var(--text2);
  margin-top: 16px;
  line-height: 1.5;
}

/* ── Bet cards ───────────────────────────────── */
.bets-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

.bet-card {
  background: var(--surface2);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid #2a2a3a;
  transition: border-color .2s;
}
.bet-card:hover { border-color: var(--accent); }

.bet-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.bet-type-badge {
  background: rgba(108,99,255,.2);
  color: #a78bfa;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 20px;
}
.bet-pick {
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
}
.bet-card-stats {
  display: flex;
  gap: 8px;
}
.bet-stat {
  flex: 1;
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}
.bet-stat-val { font-size: 18px; font-weight: 800; }
.bet-stat-label { font-size: 10px; color: var(--text2); margin-top: 3px; text-transform: uppercase; letter-spacing: .4px; }

/* ── Error screen ────────────────────────────── */
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  text-align: center;
  padding: 0 20px;
}
.error-icon { font-size: 56px; }
.error-text { font-size: 16px; color: var(--text2); line-height: 1.6; }

/* ── Promo code ──────────────────────────────── */
.promo-card {
  background: linear-gradient(135deg, #1a2a1a, #1e2a1e);
  border: 1px solid #00e67644;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.promo-label {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: .3px;
}
.promo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.promo-code {
  flex: 1;
  background: #0f1f0f;
  border: 1px dashed #00e67688;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--green);
  text-align: center;
  font-family: monospace;
}
.promo-copy {
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s;
}
.promo-copy:active { opacity: .7; }
.promo-hint {
  font-size: 11px;
  color: var(--text2);
  text-align: center;
}

/* ── New Result Design ───────────────────────── */
.result-event-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.result-sport-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.result-event-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.ai-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.ai-top-card {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 14px;
}
.ai-top-label {
  font-size: 10px;
  color: var(--text2);
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ai-top-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--green);
  line-height: 1;
}
.ai-top-val--signal {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.ai-section {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.ai-section-title {
  font-size: 10px;
  color: var(--text2);
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.signals-list { display: flex; flex-direction: column; gap: 10px; }
.signal-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.signal-label {
  font-size: 13px;
  color: var(--text);
  min-width: 130px;
  flex-shrink: 0;
}
.signal-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}
.signal-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .6s ease;
}
.signal-pct {
  font-size: 13px;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}
.ai-analysis-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}
