/* Roth na mBriathra - Stylesheet */
:root {
  --navy: #1f3a5f;
  --dark: #0f172a;
  --teal: #0f766e;
  --emerald: #10b981;
  --shamrock: #059669;
  --sun: #f59e0b;
  --coral: #ef4444;
  --purple: #8b5cf6;
  --bg: #f8fafc;
  --surface: #ffffff;
  --line: #e2e8f0;
  --muted: #64748b;
  --text: #1e293b;
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Lexend', system-ui, sans-serif;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: var(--surface);
  border-bottom: 2px solid var(--line);
  padding: 0.8rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.back-link {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  background: #f1f5f9;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  transition: all 0.2s;
}
.back-link:hover { color: var(--navy); background: #e2e8f0; }
.logo-icon {
  font-size: 2rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand h1 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}
.subtitle {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Header Stats */
.header-stats {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.stat-pill {
  background: #f1f5f9;
  border: 1px solid var(--line);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stat-label { color: var(--muted); font-weight: 600; }
.stat-val { color: var(--navy); font-weight: 800; }
.ctrl-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}
.ctrl-btn:hover { background: #f8fafc; border-color: var(--muted); }

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.2rem;
  width: 100%;
  flex: 1;
}

/* Mode Navigation */
.mode-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.8rem;
  background: #e2e8f0;
  padding: 0.35rem;
  border-radius: 16px;
  overflow-x: auto;
}
.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.mode-tab:hover { color: var(--navy); }
.mode-tab.active {
  background: var(--surface);
  color: var(--emerald);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Views */
.game-view { display: none; }
.game-view.active { display: block; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.view-intro {
  margin-bottom: 1.5rem;
}
.view-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--emerald);
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}
.view-intro h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--navy);
}
.view-intro p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* VIEW 1: WHEEL DASHBOARD */
.wheel-dashboard {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .wheel-dashboard { grid-template-columns: 1fr; }
}

.wheel-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wheel-outer {
  position: relative;
  width: 380px;
  height: 380px;
  margin-bottom: 1.5rem;
}
.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  color: var(--coral);
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.verb-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  cursor: pointer;
  transition: transform 3.5s cubic-bezier(0.15, 0.9, 0.25, 1);
}
.spin-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  border: 4px solid #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
  z-index: 5;
  text-align: center;
}
.spin-center-btn span { font-size: 0.72rem; color: #a7f3d0; }
.spin-center-btn:hover { background: #0f766e; transform: translate(-50%, -50%) scale(1.06); }

.verb-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  max-width: 380px;
}
.verb-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.15s;
}
.verb-chip:hover { border-color: var(--emerald); color: var(--emerald); }
.verb-chip.active { background: var(--emerald); color: #fff; border-color: var(--emerald); }

/* Conjugation Card */
.conjugation-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}
.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--line);
  padding-bottom: 1.2rem;
  margin-bottom: 1.2rem;
}
.root-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #9333ea;
  background: #f3e8ff;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 0.2rem;
}
.verb-title-group h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
}
.verb-meaning { color: var(--muted); font-size: 0.92rem; }
.speak-btn {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.speak-btn:hover { background: #dcfce7; }

/* Tense Selector */
.tense-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.tense-btn {
  padding: 0.8rem 0.6rem;
  background: #f8fafc;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.tense-btn .t-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--navy);
}
.tense-btn .t-sub {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.tense-btn.active {
  background: #ecfdf5;
  border-color: var(--emerald);
}
.tense-btn.active .t-title { color: #065f46; }

/* Conjugation Grid */
.conjugation-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 600px) {
  .conjugation-grid { grid-template-columns: 1fr; }
}
.conj-row {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}
.conj-row:hover { background: #f1f5f9; border-color: #cbd5e1; }
.person-tag {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
}
.verb-form {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.01em;
}

/* Sample sentence */
.sample-sentence-box {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 1rem 1.2rem;
  border-radius: 8px;
}
.sample-label { font-size: 0.76rem; font-weight: 800; color: #b45309; text-transform: uppercase; }
.sample-irish { font-size: 1.05rem; font-weight: 700; color: #78350f; margin-top: 0.2rem; }
.sample-english { font-size: 0.88rem; color: #92400e; font-style: italic; }

/* VIEW 2: SENTENCE QUEST */
.quest-card-wrap {
  max-width: 720px;
  margin: 0 auto;
}
.quest-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow);
  position: relative;
}
.quest-progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.quest-fill {
  height: 100%;
  background: var(--emerald);
  transition: width 0.3s;
}
.quest-clue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}
.clue-tag {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
}
.clue-root {
  font-size: 0.88rem;
  color: var(--muted);
}
.quest-sentence {
  font-size: 1.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin: 1.5rem 0 0.5rem;
  line-height: 1.4;
}
.sentence-blank {
  color: var(--emerald);
  border-bottom: 3px dashed var(--emerald);
  padding: 0 0.5rem;
}
.quest-translation {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}
.quest-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.quest-opt-btn {
  background: #f8fafc;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s;
}
.quest-opt-btn:hover { background: #f1f5f9; border-color: var(--navy); }
.quest-opt-btn.correct { background: #ecfdf5; border-color: #10b981; color: #047857; }
.quest-opt-btn.wrong { background: #fef2f2; border-color: #ef4444; color: #b91c1c; opacity: 0.6; }
.quest-feedback {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1.2rem;
  min-height: 28px;
}
.quest-controls {
  text-align: center;
  margin-top: 1.5rem;
}
.action-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(31, 58, 95, 0.2);
}
.action-btn:hover { background: var(--emerald); }

/* VIEW 3: TENSE SORTER */
.sorter-game {
  max-width: 800px;
  margin: 0 auto;
}
.sorter-current-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
}
.sorter-timer {
  background: #f1f5f9;
  border: 1px solid var(--line);
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.sorter-card {
  background: var(--surface);
  border: 3px solid var(--navy);
  border-radius: var(--radius-lg);
  padding: 2rem 3rem;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
  min-width: 320px;
}
.card-verb {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--navy);
}
.card-hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.4rem;
}

.sorter-buckets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
@media (max-width: 700px) {
  .sorter-buckets { grid-template-columns: 1fr; }
}
.bucket-btn {
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.2rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  border: 2px dashed #cbd5e1;
}
.bucket-btn:hover { transform: translateY(-4px); }
.bucket-icon { font-size: 2.2rem; margin-bottom: 0.5rem; }
.bucket-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; }
.bucket-sub { font-size: 0.82rem; margin-top: 0.2rem; }

.bucket-past { background: #fdf2f8; border-color: #f472b6; color: #9d174d; }
.bucket-present { background: #eff6ff; border-color: #60a5fa; color: #1e40af; }
.bucket-future { background: #ecfdf5; border-color: #34d399; color: #065f46; }

.sorter-results {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  margin-top: 1.5rem;
}
.sorter-results h3 { font-family: var(--font-display); font-size: 2rem; color: var(--navy); margin-bottom: 0.5rem; }
.sorter-results p { font-size: 1.15rem; color: var(--muted); margin-bottom: 1.5rem; }

/* VIEW 4: TABLE */
.table-container {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.verbs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.verbs-table th, .verbs-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.verbs-table th {
  background: #f8fafc;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
}
.verbs-table td {
  font-size: 0.92rem;
}
.verbs-table tr:hover { background: #f1f5f9; }
.root-col { font-weight: 800; color: var(--emerald); font-family: var(--font-display); font-size: 1.1rem; }
.tense-col-past { color: #be185d; font-weight: 600; }
.tense-col-pres { color: #1d4ed8; font-weight: 600; }
.tense-col-fut { color: #047857; font-weight: 600; }

@media print {
  .app-header, .mode-tabs, .action-btn { display: none !important; }
  .game-view { display: none !important; }
  #view-reference { display: block !important; }
  body { background: #fff; color: #000; }
}
