:root {
  --bg:      #1e1e2e;
  --surface: #2a2a3d;
  --border:  #3a3a52;
  --text:    #cdd6f4;
  --muted:   #6c7086;
  --accent:  #89b4fa;
  --green:   #a6e3a1;
  --yellow:  #f9e2af;
  --red:     #f38ba8;
  --radius:  8px;
}

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

body {
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 1rem;
}

#app { max-width: 860px; margin: 0 auto; }

.screen { padding: 2rem 0; }
.screen.center {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh; gap: 1rem; text-align: center;
}

header { margin-bottom: 2rem; }
h1 { font-size: 2rem; color: var(--accent); margin-bottom: 0.4rem; }
h2 { font-size: 1.6rem; color: var(--accent); }
.meta { color: var(--muted); font-size: 0.9rem; }
footer { margin-top: 2rem; }

.deck-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.deck-table th {
  text-align: left; padding: 0.5rem 0.75rem;
  color: var(--muted); border-bottom: 1px solid var(--border); font-weight: normal;
}
.deck-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.deck-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.deck-table tr.muted td { color: var(--muted); }
.deck-table tr.active-deck:hover td { background: var(--surface); }

button {
  cursor: pointer; border: none; border-radius: var(--radius);
  font-family: inherit; font-size: 0.9rem; padding: 0.45rem 1rem; transition: opacity 0.1s;
}
button:hover { opacity: 0.85; }
.btn-primary   { background: var(--accent);  color: var(--bg); font-weight: bold; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost     { background: transparent; color: var(--muted); padding: 0.3rem 0.5rem; }
.btn-success   { background: var(--green);  color: var(--bg); font-weight: bold; }
.btn-warning   { background: var(--yellow); color: var(--bg); font-weight: bold; }
.btn-danger    { background: var(--red);    color: var(--bg); font-weight: bold; }

.study-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.progress-wrap { display: flex; align-items: center; gap: 0.75rem; flex: 1; }
.progress-bar { flex: 1; height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s ease; }
.counter { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem; min-height: 280px;
  display: flex; flex-direction: column; gap: 1.5rem;
}
.card-front { font-size: 1.3rem; font-weight: bold; line-height: 1.5; }
.card-divider { height: 1px; background: var(--border); }
.card-back { font-size: 1rem; line-height: 1.7; color: var(--text); }
.ratings { display: flex; gap: 0.75rem; margin-top: auto; flex-wrap: wrap; }
.ratings button { flex: 1; min-width: 80px; }

.muted { color: var(--muted); }
