:root {
  --ink: #1e293b;
  --bg: #f0fdf4;
  --surface: #ffffff;
  --line: #bbf7d0;
  --emerald-main: #059669;
  --emerald-dark: #064e3b;
  --celtic-gold: #d97706;
  --broad-color: #3b82f6;
  --slender-color: #ec4899;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Lexend", system-ui, sans-serif;
  --shadow: 0 8px 24px rgba(5, 150, 105, 0.08);
  --shadow-hover: 0 16px 36px rgba(5, 150, 105, 0.16);
  --radius-lg: 20px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: #064e3b;
  color: #fff;
  padding: 0.9rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 3px solid #34d399;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: #fff;
}

.brand-icon {
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.4rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #a7f3d0;
  letter-spacing: -0.01em;
}

.brand p {
  font-size: 0.8rem;
  color: #d1fae5;
}

.controls-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tab-pills {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.25rem;
  border-radius: 999px;
  gap: 0.3rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #d1fae5;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  background: #34d399;
  color: #064e3b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-header {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}

.btn-header:hover {
  background: rgba(255, 255, 255, 0.25);
}

.game-container {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.2rem;
  width: 100%;
  flex: 1;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-intro {
  margin-bottom: 1.5rem;
}

.section-intro h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--emerald-dark);
}

.section-desc {
  color: #475569;
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

/* ================== TAB 1: CONJUGATION LAB ================== */
.lab-header {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lab-controls {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.6rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-group label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
}

#verb-select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
}

.tense-selector {
  display: flex;
  gap: 0.4rem;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
}

.tense-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.tense-btn.active {
  background: var(--emerald-main);
  color: #fff;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.rule-banner {
  background: #fefce8;
  border: 1.5px solid #fef08a;
  border-radius: var(--radius-md);
  padding: 0.8rem 1.2rem;
  font-size: 0.92rem;
  color: #854d0e;
}

.conjugation-card {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.card-title-bar h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--emerald-dark);
}

.badge-type {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
}

.conjugation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.pronoun-box {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem 0.8rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.pronoun-box:hover {
  transform: translateY(-3px);
  border-color: var(--emerald-main);
  background: #f0fdf4;
}

.pronoun-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.verb-conjugated {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--emerald-dark);
}

.forms-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-top: 1.2rem;
  border-top: 1px solid #e2e8f0;
}

.form-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.form-tag {
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748b;
}

.form-item strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--emerald-dark);
}

/* ================== TAB 2: CAOL NÓ LEATHAN ================== */
.sorter-hud {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.8rem;
  background: #ffffff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  max-width: fit-content;
}

.sorter-stage {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.5rem;
}

.sort-card-prompt {
  background: #ffffff;
  border: 3px solid var(--emerald-main);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.prompt-verb {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--emerald-dark);
  letter-spacing: 0.05em;
}

.prompt-meaning {
  font-size: 1rem;
  color: #64748b;
  font-style: italic;
  margin-top: 0.2rem;
}

.sort-bins {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.sort-bin {
  background: #ffffff;
  border: 3px dashed;
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  min-height: 280px;
}

.sort-bin:hover {
  transform: translateY(-4px);
}

.bin-leathan {
  border-color: var(--broad-color);
  background: #eff6ff;
}

.bin-leathan h3 { color: #1e40af; }

.bin-caol {
  border-color: var(--slender-color);
  background: #fdf2f8;
}

.bin-caol h3 { color: #9d174d; }

.bin-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.sort-bin h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
}

.sort-bin p {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.bin-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
}

.sorted-tag {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ================== TAB 3: TURAS NA NAIMSIRÍ ================== */
.quest-stage {
  max-width: 760px;
  margin: 0 auto;
}

.quest-hud {
  display: flex;
  justify-content: space-between;
  background: #ffffff;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin-bottom: 1.2rem;
}

.quest-card {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.quest-clue {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  text-transform: uppercase;
}

.quest-sentence {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--emerald-dark);
}

.quest-verb-info {
  font-size: 0.95rem;
  color: #64748b;
}

.quest-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.quest-opt-btn {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.quest-opt-btn:hover {
  background: #f0fdf4;
  border-color: var(--emerald-main);
  transform: translateY(-2px);
}

.quest-opt-btn.correct {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #14532d !important;
}

.quest-opt-btn.wrong {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #7f1d1d !important;
}

.quest-feedback {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.95rem;
  color: #166534;
}

.quest-footer {
  display: flex;
  justify-content: flex-end;
}

/* ================== TAB 4: 60-SEC DASH ================== */
.dash-stage {
  max-width: 700px;
  margin: 0 auto;
}

.dash-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.dash-arena {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  text-align: center;
}

.dash-tense-tag {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--celtic-gold);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

#dash-verb-display {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--emerald-dark);
}

.dash-sub {
  color: #64748b;
  font-style: italic;
  font-size: 0.95rem;
}

.dash-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.dash-btn {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}

.dash-btn:hover {
  background: #f0fdf4;
  border-color: var(--emerald-main);
  transform: translateY(-2px);
}

.btn-action {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 800;
  background: var(--emerald-main);
  color: #fff;
  border: none;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action:hover {
  background: #047857;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .forms-trio, .sort-bins, .quest-options, .dash-buttons {
    grid-template-columns: 1fr;
  }
}
