/* ==========================================================================
   Verbalys — Design system
   Loaded after Bootstrap 5.3, which is almost entirely driven by CSS custom
   properties. We therefore define our own tokens first, then bridge them onto
   the `--bs-*` variables so stock Bootstrap components inherit the theme.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Surfaces & text — warm neutrals rather than pure greys */
  --v-bg: #fdf7f2;
  --v-surface: #ffffff;
  --v-surface-alt: #f8f0e8;
  --v-border: #ecdfd2;
  --v-border-strong: #dbc8b5;
  --v-text: #2a1f17;
  --v-text-muted: #7c6857;
  --v-heading: #1c130c;

  /* Brand — the orange already present in the previous theme, warmed up */
  --v-brand: #f4601f;
  --v-brand-strong: #d84a0e;
  --v-brand-soft: #ffece1;
  --v-on-brand: #ffffff;

  /* Accent — used for secondary actions and links */
  --v-accent: #5b5bd6;
  --v-accent-soft: #ececfd;

  /* Semantic */
  --v-success: #12a150;
  --v-success-soft: #e2f7eb;
  --v-warn: #e0890c;
  --v-warn-soft: #fff2da;
  --v-danger: #e03131;
  --v-danger-soft: #ffecec;
  --v-gold: #e0a008;

  /* Streak flame gradient */
  --v-flame-from: #ffa93d;
  --v-flame-to: #f4441f;

  /* Elevation — shadows are tinted warm so they sit on the warm background */
  --v-shadow-sm: 0 1px 2px rgba(74, 45, 25, 0.05), 0 1px 3px rgba(74, 45, 25, 0.07);
  --v-shadow: 0 2px 4px rgba(74, 45, 25, 0.04), 0 8px 20px -6px rgba(74, 45, 25, 0.13);
  --v-shadow-lg: 0 14px 36px -10px rgba(74, 45, 25, 0.22);
  --v-shadow-brand: 0 6px 16px -5px rgba(244, 96, 31, 0.45);

  /* Radii */
  --v-r-xs: 8px;
  --v-r-sm: 12px;
  --v-r-md: 16px;
  --v-r-lg: 22px;
  --v-r-xl: 30px;

  /* Layout */
  --v-sidebar-w: 264px;
  --v-topbar-h: 64px;
  --v-content-max: 1140px;

  --v-ease: cubic-bezier(0.32, 0.72, 0, 1);
}

[data-bs-theme="dark"] {
  --v-bg: #15110e;
  --v-surface: #201a15;
  --v-surface-alt: #2a221b;
  --v-border: #3a2f26;
  --v-border-strong: #4d3f33;
  --v-text: #f3eae2;
  --v-text-muted: #a89383;
  --v-heading: #fff7f0;

  --v-brand: #ff7a3c;
  --v-brand-strong: #ff9463;
  --v-brand-soft: #3a2015;
  --v-on-brand: #1c130c;

  --v-accent: #9797ee;
  --v-accent-soft: #262646;

  --v-success: #35c46f;
  --v-success-soft: #12301f;
  --v-warn: #f0a93a;
  --v-warn-soft: #352610;
  --v-danger: #ff6b6b;
  --v-danger-soft: #3a1a1a;
  --v-gold: #f0b73c;

  --v-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --v-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 8px 20px -6px rgba(0, 0, 0, 0.5);
  --v-shadow-lg: 0 14px 36px -10px rgba(0, 0, 0, 0.6);
  --v-shadow-brand: 0 6px 16px -5px rgba(255, 122, 60, 0.35);
}

/* --------------------------------------------------------------------------
   2. Bridge onto Bootstrap
   -------------------------------------------------------------------------- */

:root,
[data-bs-theme="dark"] {
  --bs-body-bg: var(--v-bg);
  --bs-body-color: var(--v-text);
  --bs-emphasis-color: var(--v-heading);
  --bs-heading-color: var(--v-heading);
  --bs-secondary-color: var(--v-text-muted);
  --bs-border-color: var(--v-border);
  --bs-border-color-translucent: var(--v-border);
  --bs-tertiary-bg: var(--v-surface-alt);
  --bs-secondary-bg: var(--v-surface-alt);

  --bs-primary: var(--v-brand);
  --bs-link-color: var(--v-accent);
  --bs-link-hover-color: var(--v-brand);
  --bs-link-color-rgb: 91, 91, 214;

  --bs-border-radius: var(--v-r-sm);
  --bs-border-radius-sm: var(--v-r-xs);
  --bs-border-radius-lg: var(--v-r-md);
  --bs-border-radius-xl: var(--v-r-lg);

  --bs-focus-ring-color: rgba(244, 96, 31, 0.3);
  --bs-focus-ring-width: 3px;

  --bs-body-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.65;
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */

* {
  scrollbar-color: var(--v-border-strong) transparent;
}

body {
  background-color: var(--v-bg);
  color: var(--v-text);
  font-family: var(--bs-body-font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--v-heading);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

a {
  text-decoration: none;
  transition: color 0.18s var(--v-ease);
}

a:hover {
  text-decoration: none;
}

hr {
  border-color: var(--v-border);
  opacity: 1;
}

:focus-visible {
  outline: 3px solid rgba(244, 96, 31, 0.45);
  outline-offset: 2px;
  border-radius: var(--v-r-xs);
}

::selection {
  background: var(--v-brand-soft);
  color: var(--v-brand-strong);
}

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

/* --------------------------------------------------------------------------
   4. App shell
   -------------------------------------------------------------------------- */

.v-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.v-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
}

.v-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--v-topbar-h));
}

.v-container {
  width: 100%;
  max-width: var(--v-content-max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  flex: 1;
}

@media (min-width: 992px) {
  .v-container {
    padding: 2.5rem 2.5rem 4rem;
  }
}

/* Topbar ------------------------------------------------------------------ */

.v-topbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  height: var(--v-topbar-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  background: color-mix(in srgb, var(--v-surface) 85%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--v-border);
}

@media (min-width: 992px) {
  .v-topbar {
    padding: 0 1.75rem;
  }
}

.v-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--v-heading);
}

.v-brand:hover {
  color: var(--v-brand);
}

.v-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--v-flame-from), var(--v-brand-strong));
  box-shadow: var(--v-shadow-brand);
  flex: none;
}

.v-brand-mark svg {
  width: 19px;
  height: 19px;
}

.v-topbar-spacer {
  flex: 1;
}

.v-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Icon button ------------------------------------------------------------- */

.v-icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--v-border);
  border-radius: var(--v-r-sm);
  background: var(--v-surface);
  color: var(--v-text);
  cursor: pointer;
  transition: background 0.18s var(--v-ease), border-color 0.18s var(--v-ease),
    transform 0.18s var(--v-ease);
}

.v-icon-btn:hover {
  background: var(--v-surface-alt);
  border-color: var(--v-border-strong);
  color: var(--v-brand);
}

.v-icon-btn:active {
  transform: scale(0.94);
}

.v-icon-btn svg {
  width: 19px;
  height: 19px;
}

.v-burger {
  display: inline-grid;
}

@media (min-width: 992px) {
  .v-burger {
    display: none;
  }
}

/* Theme toggle shows one icon per theme */
.v-theme-toggle .v-icon-dark { display: none; }
[data-bs-theme="dark"] .v-theme-toggle .v-icon-dark { display: block; }
[data-bs-theme="dark"] .v-theme-toggle .v-icon-light { display: none; }

/* Chips (XP / trophies / streak) ------------------------------------------ */

.v-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 40px;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: var(--v-surface-alt);
  border: 1px solid var(--v-border);
  color: var(--v-text);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.18s var(--v-ease), border-color 0.18s var(--v-ease);
}

a.v-chip:hover {
  color: var(--v-text);
  border-color: var(--v-border-strong);
  transform: translateY(-1px);
}

.v-chip svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.v-chip--xp { color: var(--v-success); background: var(--v-success-soft); border-color: transparent; }
.v-chip--trophy { color: var(--v-gold); background: var(--v-warn-soft); border-color: transparent; }
.v-chip--flame { color: var(--v-brand-strong); background: var(--v-brand-soft); border-color: transparent; }

@media (max-width: 575.98px) {
  .v-chip {
    height: 36px;
    padding: 0 0.6rem;
    font-size: 0.82rem;
  }
  .v-chip-label { display: none; }
}

/* Avatar ------------------------------------------------------------------ */

.v-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--v-on-brand);
  background: linear-gradient(135deg, var(--v-flame-from), var(--v-brand-strong));
  flex: none;
  transition: transform 0.18s var(--v-ease);
}

.v-avatar:hover {
  color: var(--v-on-brand);
  transform: translateY(-1px);
}

/* Sidebar ----------------------------------------------------------------- */

.v-sidebar {
  width: var(--v-sidebar-w);
  flex: none;
  align-self: stretch;
  padding: 1.5rem 0.85rem;
  border-right: 1px solid var(--v-border);
  background: var(--v-surface);
}

@media (min-width: 992px) {
  .v-sidebar {
    position: sticky;
    top: var(--v-topbar-h);
    height: calc(100vh - var(--v-topbar-h));
    overflow-y: auto;
  }
}

.v-sidebar-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--v-text-muted);
  padding: 0 0.75rem;
  margin-bottom: 0.6rem;
}

.v-nav {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.v-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.75rem;
  border-radius: var(--v-r-sm);
  color: var(--v-text);
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.35;
  transition: background 0.18s var(--v-ease), color 0.18s var(--v-ease);
}

.v-nav-link:hover {
  background: var(--v-surface-alt);
  color: var(--v-text);
}

.v-nav-link.is-active {
  background: var(--v-brand-soft);
  color: var(--v-brand-strong);
}

.v-nav-icon {
  width: 26px;
  flex: none;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1;
}

.v-nav-icon svg {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
}

/* Mobile drawer */
@media (max-width: 991.98px) {
  .v-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1060;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s var(--v-ease);
    box-shadow: var(--v-shadow-lg);
  }
  .v-sidebar.is-open {
    transform: translateX(0);
  }
}

.v-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(28, 19, 12, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--v-ease), visibility 0.3s var(--v-ease);
}

.v-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 992px) {
  .v-backdrop { display: none; }
}

/* Footer ------------------------------------------------------------------ */

.v-footer {
  border-top: 1px solid var(--v-border);
  padding: 1.5rem;
  color: var(--v-text-muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  justify-content: center;
}

.v-footer a {
  color: var(--v-text-muted);
  font-weight: 600;
}

.v-footer a:hover {
  color: var(--v-brand);
}

/* --------------------------------------------------------------------------
   5. Page header
   -------------------------------------------------------------------------- */

.v-page-head {
  margin-bottom: 1.75rem;
}

.v-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--v-text-muted);
  margin-bottom: 0.6rem;
}

.v-breadcrumb a {
  color: var(--v-text-muted);
}

.v-breadcrumb a:hover {
  color: var(--v-brand);
}

.v-breadcrumb-sep {
  opacity: 0.5;
}

.v-page-title {
  font-size: clamp(1.7rem, 1.25rem + 1.7vw, 2.4rem);
  margin: 0;
}

.v-page-subtitle {
  margin: 0.5rem 0 0;
  color: var(--v-text-muted);
  font-size: 1.02rem;
}

/* --------------------------------------------------------------------------
   6. Surfaces
   -------------------------------------------------------------------------- */

.v-card {
  background: var(--v-surface);
  border: 1px solid var(--v-border);
  border-radius: var(--v-r-lg);
  box-shadow: var(--v-shadow-sm);
  padding: 1.5rem;
}

.v-card--flush {
  padding: 0;
  overflow: hidden;
}

.v-card-title {
  font-size: 1.05rem;
  font-weight: 750;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.v-card-title svg {
  width: 19px;
  height: 19px;
  color: var(--v-brand);
  flex: none;
}

/* Interactive card ---------------------------------------------------------*/

.v-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  padding: 1.35rem;
  background: var(--v-surface);
  border: 1px solid var(--v-border);
  border-radius: var(--v-r-lg);
  box-shadow: var(--v-shadow-sm);
  color: var(--v-text);
  transition: transform 0.2s var(--v-ease), box-shadow 0.2s var(--v-ease),
    border-color 0.2s var(--v-ease);
}

a.v-tile:hover {
  color: var(--v-text);
  transform: translateY(-3px);
  box-shadow: var(--v-shadow);
  border-color: var(--v-brand);
}

.v-tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.v-tile-name {
  font-size: 1.12rem;
  font-weight: 750;
  color: var(--v-heading);
  margin: 0;
  letter-spacing: -0.02em;
}

.v-tile-sub {
  color: var(--v-text-muted);
  font-size: 0.92rem;
  margin: 0.15rem 0 0;
}

.v-tile-index {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: var(--v-r-xs);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  background: var(--v-brand-soft);
  color: var(--v-brand-strong);
}

.v-tile-foot {
  margin-top: auto;
  padding-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: space-between;
}

/* Grid --------------------------------------------------------------------- */

.v-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
}

.v-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */

.btn {
  --bs-btn-padding-y: 0.62rem;
  --bs-btn-padding-x: 1.15rem;
  --bs-btn-font-weight: 700;
  --bs-btn-border-radius: var(--v-r-sm);
  --bs-btn-focus-box-shadow: 0 0 0 3px rgba(244, 96, 31, 0.3);
  letter-spacing: -0.01em;
  transition: transform 0.16s var(--v-ease), background-color 0.16s var(--v-ease),
    box-shadow 0.16s var(--v-ease), border-color 0.16s var(--v-ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  --bs-btn-color: var(--v-on-brand);
  --bs-btn-bg: var(--v-brand);
  --bs-btn-border-color: var(--v-brand);
  --bs-btn-hover-color: var(--v-on-brand);
  --bs-btn-hover-bg: var(--v-brand-strong);
  --bs-btn-hover-border-color: var(--v-brand-strong);
  --bs-btn-active-color: var(--v-on-brand);
  --bs-btn-active-bg: var(--v-brand-strong);
  --bs-btn-active-border-color: var(--v-brand-strong);
  --bs-btn-disabled-color: var(--v-on-brand);
  --bs-btn-disabled-bg: var(--v-brand);
  --bs-btn-disabled-border-color: var(--v-brand);
  box-shadow: var(--v-shadow-brand);
}

.btn-primary:hover {
  box-shadow: var(--v-shadow-brand);
}

.btn-secondary {
  --bs-btn-color: var(--v-text);
  --bs-btn-bg: var(--v-surface);
  --bs-btn-border-color: var(--v-border-strong);
  --bs-btn-hover-color: var(--v-brand-strong);
  --bs-btn-hover-bg: var(--v-surface-alt);
  --bs-btn-hover-border-color: var(--v-brand);
  --bs-btn-active-color: var(--v-brand-strong);
  --bs-btn-active-bg: var(--v-surface-alt);
  --bs-btn-active-border-color: var(--v-brand);
}

.btn-success {
  --bs-btn-bg: var(--v-success);
  --bs-btn-border-color: var(--v-success);
  --bs-btn-hover-bg: color-mix(in srgb, var(--v-success) 85%, black);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--v-success) 85%, black);
  --bs-btn-active-bg: color-mix(in srgb, var(--v-success) 80%, black);
}

.btn-warning {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--v-warn);
  --bs-btn-border-color: var(--v-warn);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: color-mix(in srgb, var(--v-warn) 85%, black);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--v-warn) 85%, black);
  --bs-btn-active-color: #fff;
}

.btn-danger {
  --bs-btn-bg: var(--v-danger);
  --bs-btn-border-color: var(--v-danger);
}

.btn-lg {
  --bs-btn-padding-y: 0.85rem;
  --bs-btn-padding-x: 1.75rem;
  --bs-btn-font-size: 1.05rem;
  --bs-btn-border-radius: var(--v-r-md);
}

.btn-sm {
  --bs-btn-padding-y: 0.4rem;
  --bs-btn-padding-x: 0.8rem;
  --bs-btn-font-size: 0.86rem;
  --bs-btn-border-radius: var(--v-r-xs);
}

/* Ghost variant used for tertiary navigation actions */
.btn-ghost {
  --bs-btn-color: var(--v-text-muted);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--v-brand);
  --bs-btn-hover-bg: var(--v-surface-alt);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: var(--v-brand);
  --bs-btn-active-bg: var(--v-surface-alt);
  --bs-btn-active-border-color: transparent;
}

.btn svg {
  width: 17px;
  height: 17px;
  vertical-align: -3px;
}

.v-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* --------------------------------------------------------------------------
   8. Forms
   -------------------------------------------------------------------------- */

.form-label {
  font-weight: 650;
  font-size: 0.9rem;
  color: var(--v-text);
  margin-bottom: 0.4rem;
}

.form-control,
.form-select {
  background-color: var(--v-surface);
  border: 1.5px solid var(--v-border-strong);
  border-radius: var(--v-r-sm);
  color: var(--v-text);
  padding: 0.68rem 0.9rem;
  transition: border-color 0.18s var(--v-ease), box-shadow 0.18s var(--v-ease);
}

.form-control::placeholder {
  color: var(--v-text-muted);
  opacity: 0.7;
}

.form-control:focus,
.form-select:focus {
  background-color: var(--v-surface);
  border-color: var(--v-brand);
  color: var(--v-text);
  box-shadow: 0 0 0 4px rgba(244, 96, 31, 0.16);
}

.form-check-input {
  border-color: var(--v-border-strong);
  background-color: var(--v-surface);
}

.form-check-input:checked {
  background-color: var(--v-brand);
  border-color: var(--v-brand);
}

.form-check-input:focus {
  border-color: var(--v-brand);
  box-shadow: 0 0 0 4px rgba(244, 96, 31, 0.16);
}

.form-text,
.invalid-feedback {
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   9. Badges, alerts, tables, progress
   -------------------------------------------------------------------------- */

.badge {
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 0.35em 0.7em;
}

.v-badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--v-surface-alt);
  color: var(--v-text-muted);
  white-space: nowrap;
}

.v-badge-soft--xp { background: var(--v-success-soft); color: var(--v-success); }
.v-badge-soft--brand { background: var(--v-brand-soft); color: var(--v-brand-strong); }
.v-badge-soft--accent { background: var(--v-accent-soft); color: var(--v-accent); }
.v-badge-soft--warn { background: var(--v-warn-soft); color: var(--v-warn); }
.v-badge-soft--danger { background: var(--v-danger-soft); color: var(--v-danger); }

.alert {
  border: 1px solid transparent;
  border-radius: var(--v-r-md);
  padding: 1rem 1.15rem;
  font-weight: 600;
}

.alert-success {
  --bs-alert-bg: var(--v-success-soft);
  --bs-alert-color: var(--v-success);
  --bs-alert-border-color: transparent;
}

.alert-danger {
  --bs-alert-bg: var(--v-danger-soft);
  --bs-alert-color: var(--v-danger);
  --bs-alert-border-color: transparent;
}

.alert-warning {
  --bs-alert-bg: var(--v-warn-soft);
  --bs-alert-color: var(--v-warn);
  --bs-alert-border-color: transparent;
}

.alert-info {
  --bs-alert-bg: var(--v-accent-soft);
  --bs-alert-color: var(--v-accent);
  --bs-alert-border-color: transparent;
}

.v-flash {
  margin-bottom: 1.5rem;
  animation: v-slide-up 0.35s var(--v-ease) both;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--v-text);
  --bs-table-border-color: var(--v-border);
  --bs-table-striped-bg: var(--v-surface-alt);
  --bs-table-striped-color: var(--v-text);
  --bs-table-hover-bg: var(--v-brand-soft);
  --bs-table-hover-color: var(--v-text);
  margin-bottom: 0;
}

.table > thead th {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--v-text-muted);
  background: var(--v-surface-alt);
  border-bottom: 1px solid var(--v-border);
  padding: 0.8rem 1rem;
  white-space: nowrap;
}

.table > tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-color: var(--v-border);
}

/* Tables scroll rather than pushing the page sideways on small screens */
.v-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--v-border);
  border-radius: var(--v-r-md);
  background: var(--v-surface);
}

.v-table-wrap .table > tbody tr:last-child td {
  border-bottom: 0;
}

/* Progress ---------------------------------------------------------------- */

.v-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--v-surface-alt);
  overflow: hidden;
}

.v-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--v-flame-from), var(--v-brand));
  transition: width 0.6s var(--v-ease);
}

.v-progress--xp .v-progress-bar {
  background: linear-gradient(90deg, #35c46f, var(--v-success));
}

.v-progress--lg {
  height: 14px;
}

.v-progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--v-text-muted);
}

.v-progress-meta strong {
  color: var(--v-text);
}

/* --------------------------------------------------------------------------
   10. Verb cards
   -------------------------------------------------------------------------- */

.v-verb-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.35rem;
  background: var(--v-surface);
  border: 1px solid var(--v-border);
  border-radius: var(--v-r-lg);
  box-shadow: var(--v-shadow-sm);
  transition: transform 0.2s var(--v-ease), box-shadow 0.2s var(--v-ease);
}

.v-verb-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--v-shadow);
}

.v-verb-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--v-heading);
  margin: 0;
  letter-spacing: -0.025em;
}

.v-verb-translation {
  color: var(--v-text-muted);
  font-size: 0.95rem;
  font-style: italic;
  margin: 0.1rem 0 0;
}

.v-conj-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--v-border);
  border: 1px solid var(--v-border);
  border-radius: var(--v-r-sm);
  overflow: hidden;
  font-size: 0.9rem;
}

.v-conj-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--v-border);
}

.v-conj-cell {
  background: var(--v-surface);
  padding: 0.45rem 0.7rem;
}

.v-conj-cell--target {
  font-weight: 650;
  color: var(--v-text);
}

.v-conj-cell--source {
  color: var(--v-text-muted);
}

/* --------------------------------------------------------------------------
   11. Exercise screen
   -------------------------------------------------------------------------- */

.v-exercise {
  max-width: 680px;
  margin: 0 auto;
}

.v-exercise-progress {
  margin-bottom: 2rem;
}

.v-exercise-card {
  background: var(--v-surface);
  border: 1px solid var(--v-border);
  border-radius: var(--v-r-xl);
  box-shadow: var(--v-shadow);
  padding: 1.75rem;
}

@media (min-width: 768px) {
  .v-exercise-card {
    padding: 2.25rem;
  }
}

.v-exercise-kicker {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--v-brand);
  margin-bottom: 0.75rem;
}

.v-prompt {
  font-size: 1.5rem;
  font-weight: 750;
  color: var(--v-heading);
  letter-spacing: -0.025em;
  margin: 0 0 0.35rem;
}

.v-field {
  margin-bottom: 1.1rem;
}

.v-field-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--v-heading);
  margin-bottom: 0.45rem;
}

/* Large, friendly answer input */
.v-answer {
  width: 100%;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.9rem 1.1rem;
  border: 2px solid var(--v-border-strong);
  border-radius: var(--v-r-md);
  background: var(--v-surface);
  color: var(--v-text);
  transition: border-color 0.18s var(--v-ease), box-shadow 0.18s var(--v-ease);
}

.v-answer::placeholder {
  color: var(--v-text-muted);
  font-weight: 500;
  opacity: 0.65;
}

.v-answer:focus {
  outline: none;
  border-color: var(--v-brand);
  box-shadow: 0 0 0 4px rgba(244, 96, 31, 0.16);
}

/* Inline input inside a sentence exercise */
.v-answer--inline {
  display: inline-block;
  width: auto;
  min-width: 190px;
  font-size: 1.05rem;
  padding: 0.45rem 0.75rem;
  margin: 0 0.2rem;
  vertical-align: baseline;
}

.v-sentence {
  font-size: 1.2rem;
  line-height: 2.1;
  font-weight: 600;
  color: var(--v-heading);
}

.v-sentence-hint {
  color: var(--v-text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Corrective feedback shown when the previous answer was wrong */
.v-feedback {
  display: flex;
  gap: 0.85rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--v-r-md);
  background: var(--v-danger-soft);
  margin-bottom: 1.5rem;
}

.v-feedback-icon {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--v-danger);
  color: #fff;
}

.v-feedback-icon svg {
  width: 15px;
  height: 15px;
}

.v-feedback-title {
  font-weight: 800;
  color: var(--v-danger);
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.v-feedback-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.v-feedback-list li {
  background: var(--v-surface);
  border-radius: var(--v-r-xs);
  padding: 0.3rem 0.65rem;
  font-weight: 700;
  color: var(--v-text);
  font-size: 0.95rem;
}

/* Réponse acceptée mais imparfaite : ton d'encouragement, pas d'erreur. */
.v-notice {
  display: flex;
  gap: 0.85rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--v-r-md);
  background: var(--v-warn-soft);
  margin-bottom: 1.5rem;
}

.v-notice-icon {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--v-warn);
  color: #fff;
}

.v-notice-icon svg {
  width: 15px;
  height: 15px;
}

.v-notice-title {
  font-weight: 800;
  color: var(--v-warn);
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.v-exercise-actions {
  margin-top: 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.v-kbd {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--v-border-strong);
  border-bottom-width: 2px;
  background: var(--v-surface-alt);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--v-text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --------------------------------------------------------------------------
   12. Result screen
   -------------------------------------------------------------------------- */

.v-result-hero {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-radius: var(--v-r-xl);
  background: linear-gradient(160deg, var(--v-brand-soft), var(--v-surface) 70%);
  border: 1px solid var(--v-border);
  margin-bottom: 1.75rem;
}

.v-result-medal {
  width: 82px;
  height: 82px;
  margin: 0 auto 1.1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--v-flame-from), var(--v-brand-strong));
  color: #fff;
  box-shadow: var(--v-shadow-brand);
  animation: v-pop 0.5s var(--v-ease) both;
}

.v-result-medal svg {
  width: 40px;
  height: 40px;
}

.v-result-title {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
  margin: 0 0 0.4rem;
}

.v-result-sub {
  color: var(--v-text-muted);
  margin: 0;
  font-size: 1.02rem;
}

@keyframes v-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.v-success-alert {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.2rem;
  border-radius: var(--v-r-md);
  background: var(--v-warn-soft);
  color: var(--v-text);
  font-weight: 650;
  margin-bottom: 0.75rem;
  animation: v-slide-up 0.45s var(--v-ease) both;
}

.v-success-alert-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--v-gold);
  color: #fff;
}

.v-success-alert-icon svg {
  width: 20px;
  height: 20px;
}

@keyframes v-slide-up {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* --------------------------------------------------------------------------
   13. Stat tiles
   -------------------------------------------------------------------------- */

.v-stats {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 2rem;
}

.v-stat {
  padding: 1.35rem;
  border-radius: var(--v-r-lg);
  background: var(--v-surface);
  border: 1px solid var(--v-border);
  box-shadow: var(--v-shadow-sm);
}

.v-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--v-r-sm);
  display: grid;
  place-items: center;
  margin-bottom: 0.85rem;
}

.v-stat-icon svg {
  width: 21px;
  height: 21px;
}

.v-stat-icon--xp { background: var(--v-success-soft); color: var(--v-success); }
.v-stat-icon--trophy { background: var(--v-warn-soft); color: var(--v-gold); }
.v-stat-icon--time { background: var(--v-accent-soft); color: var(--v-accent); }
.v-stat-icon--level { background: var(--v-brand-soft); color: var(--v-brand-strong); }

.v-stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--v-heading);
}

.v-stat-label {
  font-size: 0.88rem;
  color: var(--v-text-muted);
  font-weight: 600;
  margin-top: 0.2rem;
}

/* --------------------------------------------------------------------------
   14. Auth
   -------------------------------------------------------------------------- */

.v-auth {
  max-width: 440px;
  margin: 1rem auto;
}

.v-auth-card {
  background: var(--v-surface);
  border: 1px solid var(--v-border);
  border-radius: var(--v-r-xl);
  box-shadow: var(--v-shadow);
  padding: 2rem;
}

.v-auth-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.v-auth-foot {
  text-align: center;
  margin-top: 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--v-border);
  color: var(--v-text-muted);
  font-size: 0.92rem;
}

.v-auth-foot a {
  font-weight: 700;
  color: var(--v-brand);
}

/* Segmented sub-navigation (account section) */
.v-segment {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: var(--v-r-md);
  background: var(--v-surface-alt);
  border: 1px solid var(--v-border);
  margin-bottom: 1.75rem;
  max-width: 100%;
  overflow-x: auto;
}

.v-segment a {
  padding: 0.5rem 1rem;
  border-radius: var(--v-r-xs);
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--v-text-muted);
  white-space: nowrap;
  transition: background 0.18s var(--v-ease), color 0.18s var(--v-ease);
}

.v-segment a:hover {
  color: var(--v-text);
}

.v-segment a.is-active {
  background: var(--v-surface);
  color: var(--v-brand-strong);
  box-shadow: var(--v-shadow-sm);
}

/* --------------------------------------------------------------------------
   15. Prose (markdown course/chapter descriptions)
   -------------------------------------------------------------------------- */

.v-prose {
  color: var(--v-text);
  line-height: 1.75;
}

.v-prose > *:first-child { margin-top: 0; }
.v-prose > *:last-child { margin-bottom: 0; }

.v-prose h2 {
  font-size: 1.45rem;
  margin: 2rem 0 0.85rem;
}

.v-prose h3 {
  font-size: 1.18rem;
  margin: 1.6rem 0 0.7rem;
}

.v-prose p { margin-bottom: 1.05rem; }

.v-prose ul,
.v-prose ol {
  margin-bottom: 1.05rem;
  padding-left: 1.3rem;
}

.v-prose li { margin-bottom: 0.4rem; }

.v-prose a {
  color: var(--v-brand);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

.v-prose strong { font-weight: 750; color: var(--v-heading); }

.v-prose code {
  background: var(--v-surface-alt);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--v-brand-strong);
}

.v-prose blockquote {
  border-left: 3px solid var(--v-brand);
  padding-left: 1.1rem;
  margin: 1.35rem 0;
  color: var(--v-text-muted);
}

.v-prose table {
  width: 100%;
  margin-bottom: 1.25rem;
  border-collapse: collapse;
}

.v-prose th,
.v-prose td {
  border: 1px solid var(--v-border);
  padding: 0.6rem 0.85rem;
  text-align: left;
}

.v-prose th {
  background: var(--v-surface-alt);
  font-weight: 700;
}

/* Internal-link pills (other tenses, sibling verbs) */
.v-linklist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.v-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: var(--v-surface);
  border: 1px solid var(--v-border);
  color: var(--v-text);
  font-weight: 650;
  font-size: 0.93rem;
  transition: transform 0.18s var(--v-ease), border-color 0.18s var(--v-ease),
    color 0.18s var(--v-ease);
}

.v-pill:hover {
  color: var(--v-brand-strong);
  border-color: var(--v-brand);
  transform: translateY(-1px);
}

.v-pill span {
  color: var(--v-text-muted);
  font-weight: 500;
  font-size: 0.86rem;
  font-style: italic;
}

/* FAQ blocks on the SEO verb pages */
.v-faq {
  display: grid;
  gap: 0.85rem;
}

.v-faq-item {
  padding: 1.25rem 1.4rem;
  background: var(--v-surface);
  border: 1px solid var(--v-border);
  border-left: 3px solid var(--v-brand);
  border-radius: var(--v-r-md);
}

.v-faq-item h3 {
  font-size: 1.02rem;
  font-weight: 750;
  margin: 0 0 0.5rem;
}

.v-faq-item p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   16. Empty state & misc
   -------------------------------------------------------------------------- */

.v-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1.5px dashed var(--v-border-strong);
  border-radius: var(--v-r-lg);
  color: var(--v-text-muted);
}

.v-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
}

.v-section {
  margin-bottom: 2.5rem;
}

.v-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.v-section-title {
  font-size: 1.2rem;
  font-weight: 750;
  margin: 0;
}

.v-report {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.86rem;
  color: var(--v-text-muted);
}

.v-report a {
  color: var(--v-text-muted);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.v-report a:hover { color: var(--v-brand); }

.v-report code {
  background: var(--v-surface-alt);
  padding: 0.1em 0.4em;
  border-radius: 5px;
  font-size: 0.92em;
}

/* --------------------------------------------------------------------------
   17. Admin — drag & drop verb sorting
   -------------------------------------------------------------------------- */

.v-sortable {
  min-height: 120px;
  padding: 0.5rem;
  border: 1.5px dashed var(--v-border-strong);
  border-radius: var(--v-r-sm);
  background: var(--v-surface-alt);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v-sortable--pool {
  max-height: 420px;
  overflow-y: auto;
}

.v-sortable.ex-over {
  border-color: var(--v-brand);
  background: var(--v-brand-soft);
}

.v-sortable .movable {
  padding: 0.4rem 0.6rem;
  border-radius: var(--v-r-xs);
  background: var(--v-surface);
  border: 1px solid var(--v-border);
  font-size: 0.85rem;
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.v-sortable .movable:active { cursor: grabbing; }

.v-sortable .movable.ex-moved {
  border-color: var(--v-success);
  background: var(--v-success-soft);
}

.gu-mirror {
  position: fixed !important;
  margin: 0 !important;
  z-index: 9999 !important;
  opacity: 0.9;
  list-style: none;
  padding: 0.4rem 0.6rem;
  border-radius: var(--v-r-xs);
  background: var(--v-surface);
  border: 1px solid var(--v-brand);
  box-shadow: var(--v-shadow-lg);
  font-size: 0.85rem;
}

.gu-transit { opacity: 0.35; }
.gu-unselectable { user-select: none !important; }

/* Required by dragula: it hides the mirror behind this class to resolve the
   element under the cursor. Without it, drops are never accepted. */
.gu-hide { display: none !important; }

/* --------------------------------------------------------------------------
   18. Motion preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
