: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;
  --gold: #ffd24a;
  --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; }
.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);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px 18px;
  background: var(--bg-primary);
  border-bottom: 1px solid #22222e;
  flex-shrink: 0;
}
.topbar-flag { font-size: 40px; line-height: 1; }
.topbar-text { min-width: 0; flex: 1; }
.topbar h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sub {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-back {
  width: 52px; height: 52px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

/* ---------- Scroll area ---------- */
.scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }

/* ---------- Home category rows ---------- */
.cat-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.cat-row .ico {
  font-size: 32px;
  width: 44px;
  text-align: center;
  flex-shrink: 0;
}
.cat-row .meta { flex: 1; min-width: 0; }
.cat-row .name { font-size: 21px; font-weight: 600; }
.cat-row .count { font-size: 15px; color: var(--text-secondary); margin-top: 2px; }
.cat-row .chev { font-size: 26px; color: var(--text-muted); flex-shrink: 0; }
.cat-row.accent .name { color: var(--accent); }
.cat-row.gold .ico { filter: drop-shadow(0 0 6px rgba(255,210,74,0.5)); }

/* ---------- List phrase rows ---------- */
.phrase-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.phrase-row .meta { flex: 1; min-width: 0; }
.phrase-row .es {
  font-size: 21px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phrase-row .en {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phrase-row .star { font-size: 22px; flex-shrink: 0; width: 28px; text-align: center; }
.star-on { color: var(--gold); }
.star-off { color: var(--text-muted); }

.empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 18px;
  padding: 60px 30px;
  line-height: 1.5;
}

/* ---------- Detail ---------- */
.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 26px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: none;
}
.detail-body::-webkit-scrollbar { display: none; }
.detail-card {
  background: var(--bg-secondary);
  border-radius: 18px;
  padding: 26px 24px;
  text-align: center;
}
.detail-en {
  font-size: 19px;
  color: var(--text-secondary);
  font-weight: 500;
}
.detail-es {
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.15;
  margin: 14px 0 16px;
  letter-spacing: -0.5px;
}
.detail-phon {
  display: inline-block;
  font-size: 19px;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  padding: 8px 16px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}
.detail-actions {
  display: flex;
  gap: 12px;
}
.btn {
  flex: 1;
  min-height: 64px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn .bico { font-size: 22px; }
.btn-fav.is-fav { background: rgba(255,210,74,0.16); color: var(--gold); }
.detail-nav {
  display: flex;
  gap: 12px;
}
.btn-nav {
  flex: 1;
  min-height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-nav.dim { opacity: 0.4; }

/* ---------- Hint footer ---------- */
.hint {
  flex-shrink: 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  padding: 12px;
  background: var(--bg-primary);
  border-top: 1px solid #22222e;
  letter-spacing: 0.3px;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid #2c2c3a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
