: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;
}
#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; }

/* Header */
.hdr {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 24px;
  background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-primary));
  border-bottom: 1px solid #2a2a3a;
}
.hdr-mark { font-size: 30px; color: var(--accent); }
.hdr h1 { font-size: 30px; font-weight: 700; letter-spacing: 0.5px; }
.hdr-sub { padding: 16px 20px; }
.hdr-sub h2 { font-size: 24px; font-weight: 600; }
.back-btn {
  width: 52px; height: 52px; flex: 0 0 52px;
  background: var(--bg-tertiary); color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 30px; line-height: 1; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Home menu */
.menu { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.card {
  display: flex; align-items: center; gap: 18px;
  min-height: 88px; padding: 0 22px;
  background: var(--bg-secondary); color: var(--text-primary);
  border-radius: var(--radius-md);
  text-align: left;
}
.card-ico {
  font-size: 28px; width: 52px; height: 52px; flex: 0 0 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary); border-radius: 10px; color: var(--accent);
}
.card-body { display: flex; flex-direction: column; gap: 2px; }
.card-title { font-size: 22px; font-weight: 600; }
.card-sub { font-size: 15px; color: var(--text-secondary); }

/* Query bar */
.query-bar {
  margin: 14px 20px 10px; padding: 14px 18px;
  background: var(--bg-secondary); border-radius: var(--radius-md);
  min-height: 56px; display: flex; align-items: center;
  font-size: 26px; font-weight: 600; letter-spacing: 1px;
}
.query-text { color: var(--text-primary); }
.query-text:empty::before { content: "Type a city or code"; color: var(--text-muted); font-weight: 400; letter-spacing: 0; font-size: 20px; }
.caret { width: 3px; height: 28px; background: var(--accent); margin-left: 4px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Keyboard */
.kbd { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px; justify-content: center; }
.key {
  height: 50px; min-width: 50px; padding: 0 8px;
  background: var(--bg-tertiary); color: var(--text-primary);
  border-radius: 9px; font-size: 22px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.key.key-wide { min-width: 88px; font-size: 18px; color: var(--accent); }

.results-hint { text-align: center; color: var(--text-muted); font-size: 14px; padding: 10px 0 6px; }

/* Results / lists */
.results { overflow-y: auto; padding: 0 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.results-full { flex: 1; padding-top: 12px; }
.result {
  display: flex; align-items: center; gap: 16px;
  min-height: 64px; padding: 10px 18px;
  background: var(--bg-secondary); color: var(--text-primary);
  border-radius: var(--radius-md); text-align: left;
}
.result-code {
  font-size: 24px; font-weight: 800; letter-spacing: 1px;
  color: var(--accent); width: 64px; flex: 0 0 64px;
}
.result-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.result-city { font-size: 19px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-country { font-size: 14px; color: var(--text-secondary); }
.empty { color: var(--text-muted); font-size: 18px; text-align: center; padding: 40px 20px; }

/* Alpha grid */
.alpha {
  flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
  padding: 20px; align-content: start; overflow-y: auto;
}
.alpha-key {
  height: 80px; background: var(--bg-secondary); color: var(--text-primary);
  border-radius: var(--radius-md); font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.alpha-key.empty-letter { color: var(--text-muted); opacity: 0.45; }

/* Detail */
.detail-body { flex: 1; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.detail-code {
  font-size: 92px; font-weight: 800; letter-spacing: 4px;
  color: var(--accent); text-align: center; line-height: 1;
  text-shadow: 0 0 30px var(--focus-glow);
}
.detail-name { font-size: 24px; font-weight: 600; text-align: center; }
.detail-rows { display: flex; flex-direction: column; gap: 12px; }
.detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; background: var(--bg-secondary); border-radius: var(--radius-md);
}
.detail-row .lbl { color: var(--text-secondary); font-size: 16px; }
.detail-row .val { font-size: 20px; font-weight: 600; }
.fav-btn {
  min-height: 72px; margin-top: auto;
  background: var(--bg-tertiary); color: var(--text-primary);
  border-radius: var(--radius-md); font-size: 20px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.fav-btn.is-fav { color: var(--accent-secondary); }

/* About */
.about-body { flex: 1; padding: 24px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.about-body p { font-size: 19px; line-height: 1.5; color: var(--text-primary); }
.about-body strong { color: var(--accent); }
.about-body .muted { color: var(--text-secondary); font-size: 16px; }
