:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}

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

html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app { width: 100%; height: 100%; position: relative; }

.screen {
  width: 100%; height: 100%; position: absolute; top: 0; left: 0;
  display: flex; flex-direction: column;
}
.screen.hidden { display: none; }

.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer; outline: none;
}
.focusable:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}
.hidden { display: none !important; }

/* ---------- Headers ---------- */
.app-header {
  padding: 22px 26px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid #26263a;
}
.app-title {
  font-size: 34px; font-weight: 700; letter-spacing: 0.5px;
}
.app-sub { font-size: 16px; color: var(--text-secondary); margin-top: 4px; }
.screen-title { font-size: 26px; font-weight: 700; }

.browse-head {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 22px;
}
.back-btn {
  background: var(--bg-tertiary);
  color: var(--accent);
  font-size: 18px; font-weight: 600;
  border-radius: var(--radius-md);
  padding: 10px 16px; min-height: 44px;
}

/* ---------- Content area ---------- */
.content {
  flex: 1;
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: #2a2a3e; border-radius: 3px; }

.stat-line {
  font-size: 16px; color: var(--accent-secondary);
  font-weight: 600; letter-spacing: 0.3px;
}

/* ---------- Menu buttons ---------- */
.menu-btn {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  min-height: 88px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  text-align: left; width: 100%;
}
.menu-main { font-size: 22px; font-weight: 600; color: var(--text-primary); }
.menu-meta { font-size: 15px; color: var(--text-secondary); }

/* ---------- Region grid ---------- */
.region-btn {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  min-height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}
.region-name { font-size: 21px; font-weight: 600; }
.region-count {
  font-size: 15px; color: var(--text-secondary);
  background: var(--bg-secondary); padding: 4px 12px; border-radius: 20px;
}

/* ---------- Quiz ---------- */
.quiz-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid #26263a;
  font-size: 18px; font-weight: 600;
}
.quiz-progress { color: var(--text-secondary); }
.quiz-score { color: var(--accent); }

.quiz-content { gap: 8px; }
.quiz-prompt { font-size: 17px; color: var(--text-secondary); }
.quiz-country { font-size: 32px; font-weight: 700; line-height: 1.1; }
.quiz-region {
  font-size: 14px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px;
}

.options { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.option {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-height: 60px;
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
}
.option-code {
  font-size: 22px; font-weight: 700; color: var(--accent);
  min-width: 64px; letter-spacing: 0.5px;
}
.option-name { font-size: 17px; color: var(--text-secondary); }

.option.correct {
  background: rgba(0, 255, 136, 0.16);
  border-color: var(--accent-secondary);
}
.option.correct .option-code { color: var(--accent-secondary); }
.option.wrong {
  background: rgba(255, 68, 102, 0.16);
  border-color: var(--danger);
}
.option.wrong .option-code { color: var(--danger); }
.option.locked { cursor: default; }

.quiz-foot {
  padding: 14px 22px;
  min-height: 76px;
  display: flex; align-items: center;
  background: var(--bg-secondary);
  border-top: 1px solid #26263a;
}
.next-btn {
  background: var(--accent);
  color: #04141a;
  font-size: 20px; font-weight: 700;
  border-radius: var(--radius-md);
  padding: 14px; min-height: 56px; width: 100%;
}
.next-btn.focusable:focus { box-shadow: 0 0 20px rgba(0,212,255,0.7); border-color: #fff; }
.feedback {
  font-size: 16px; font-weight: 600;
}
.feedback.ok { color: var(--accent-secondary); }
.feedback.no { color: var(--danger); }

/* ---------- Result ---------- */
.result-content { align-items: center; justify-content: flex-start; gap: 10px; padding-top: 26px; }
.result-pct {
  font-size: 88px; font-weight: 800; line-height: 1;
  color: var(--accent);
}
.result-detail { font-size: 22px; color: var(--text-primary); }
.result-best { font-size: 16px; color: var(--text-secondary); margin-bottom: 14px; }
.result-content .menu-btn { max-width: 360px; }

/* ---------- Browse ---------- */
.browse-list { gap: 6px; padding-top: 12px; }
.browse-region {
  font-size: 14px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1.2px;
  font-weight: 700; margin-top: 14px; padding-left: 4px;
}
.browse-region:first-child { margin-top: 0; }
.browse-row {
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 12px 16px;
  min-height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}
.browse-country { font-size: 18px; font-weight: 500; }
.browse-ccy { display: flex; align-items: baseline; gap: 10px; }
.browse-code { font-size: 18px; font-weight: 700; color: var(--accent); }
.browse-name { font-size: 13px; color: var(--text-muted); max-width: 180px; text-align: right; }

/* ---------- Hint bar ---------- */
.hint-bar {
  padding: 12px 22px;
  font-size: 13px; color: var(--text-muted);
  background: var(--bg-secondary);
  border-top: 1px solid #1d1d2c;
  text-align: center;
}
