: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 bar */
.bar {
  flex: 0 0 auto;
  padding: 20px 24px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
}
.bar-title { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; }
.bar-sub { font-size: 15px; color: var(--text-secondary); margin-top: 4px; }

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

/* Footer hint */
.hint {
  flex: 0 0 auto;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-primary);
  border-top: 1px solid var(--bg-tertiary);
}

/* Home / list rows */
.row-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 16px 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-align: left;
  font-size: 19px;
  font-weight: 600;
}
.row-icon {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: var(--bg-tertiary);
  border-radius: 9px;
}
.row-text { flex: 1 1 auto; }
.row-count {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
}
.row-btn.special .row-icon { color: var(--accent-secondary); }

/* Phrase list item */
.phrase-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 72px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  text-align: left;
  position: relative;
}
.pi-en { font-size: 15px; color: var(--text-secondary); }
.pi-fr { font-size: 21px; font-weight: 700; color: var(--text-primary); }
.pi-star {
  position: absolute;
  top: 14px; right: 16px;
  font-size: 18px;
  color: var(--accent-secondary);
}

.empty-msg {
  margin: 40px auto;
  color: var(--text-muted);
  font-size: 17px;
  text-align: center;
  max-width: 360px;
  line-height: 1.5;
}

/* Detail */
.detail-body { justify-content: flex-start; }
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.d-en { font-size: 18px; color: var(--text-secondary); }
.d-fr { font-size: 36px; font-weight: 700; line-height: 1.15; color: var(--accent); letter-spacing: -0.5px; }
.d-ph { font-size: 19px; font-style: italic; color: var(--text-muted); }

.actions { display: flex; gap: 12px; }
.act-btn {
  flex: 1 1 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
}
.act-icon { font-size: 20px; }
.act-btn.is-fav { color: var(--accent-secondary); }
.act-btn.speaking { box-shadow: 0 0 24px rgba(0, 255, 136, 0.5); border-color: var(--accent-secondary); }

.nav-btn {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 17px;
  font-weight: 600;
}
