: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;
  --c1: #00d4ff;
  --c2: #00ff88;
  --c3: #ffcc44;
  --c4: #ff9944;
  --c5: #ff4466;
}

* { 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; }
.hidden { display: none !important; }

.focusable {
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background 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);
  background: var(--bg-tertiary);
}

/* ---- Bars / headers ---- */
.bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  background: var(--bg-primary);
  border-bottom: 1px solid #23232f;
}
.bar-home { flex-direction: column; align-items: flex-start; gap: 4px; padding: 26px 24px 20px; }
.app-title { font-size: 36px; font-weight: 800; letter-spacing: -0.5px; }
.app-sub { font-size: 17px; color: var(--text-secondary); }
.bar-title { font-size: 26px; font-weight: 700; }

.back-btn {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; line-height: 1;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-weight: 700;
}

/* ---- Lists ---- */
.list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 20px 8px;
  display: flex; flex-direction: column; gap: 12px;
}
.list::-webkit-scrollbar { width: 6px; }
.list::-webkit-scrollbar-thumb { background: #2a2a3a; border-radius: 3px; }

/* Home cards */
.home-card {
  flex: 0 0 auto;
  min-height: 88px;
  display: flex; align-items: center; gap: 18px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.hc-badge {
  flex: 0 0 auto;
  width: 72px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
  border-radius: 10px;
  background: var(--bg-tertiary);
}
.hc-badge.fav { color: var(--accent-secondary); font-size: 30px; }
.hc-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hc-title { font-size: 23px; font-weight: 600; }
.hc-sub { font-size: 16px; color: var(--text-secondary); }
.chev { flex: 0 0 auto; font-size: 30px; color: var(--text-muted); }

/* Code rows */
.code-row {
  flex: 0 0 auto;
  min-height: 68px;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.code-num {
  flex: 0 0 auto;
  width: 78px;
  font-size: 30px; font-weight: 800; letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.code-name { flex: 1 1 auto; font-size: 21px; font-weight: 500; min-width: 0; }

.empty {
  margin: 30px 6px; padding: 26px;
  background: var(--bg-secondary); border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 19px; line-height: 1.5; text-align: center;
}

/* ---- Detail ---- */
.detail-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 28px 26px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
}
.detail-code {
  font-size: 128px; font-weight: 800; line-height: 0.95;
  letter-spacing: -3px; font-variant-numeric: tabular-nums;
}
.detail-name { font-size: 34px; font-weight: 700; line-height: 1.1; }
.detail-badge {
  font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--bg-tertiary);
}
.detail-desc {
  font-size: 22px; line-height: 1.5; color: var(--text-secondary);
  margin-top: 4px;
}
.fav-btn {
  margin-top: 18px; width: 100%;
  min-height: 72px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
}
.fav-btn.on { color: var(--accent-secondary); }

/* ---- Color classes ---- */
.c1 { color: var(--c1); }
.c2 { color: var(--c2); }
.c3 { color: var(--c3); }
.c4 { color: var(--c4); }
.c5 { color: var(--c5); }
.hc-badge.c1, .hc-badge.c2, .hc-badge.c3, .hc-badge.c4, .hc-badge.c5 {
  background: var(--bg-tertiary);
}
.detail-badge.c1 { color: var(--c1); }
.detail-badge.c2 { color: var(--c2); }
.detail-badge.c3 { color: var(--c3); }
.detail-badge.c4 { color: var(--c4); }
.detail-badge.c5 { color: var(--c5); }

/* ---- Footer hint ---- */
.hint {
  flex: 0 0 auto;
  padding: 12px 20px 16px;
  font-size: 15px; color: var(--text-muted); text-align: center;
}
