/* ═══════════════════════════════════════════════════════
   ADAGES  ·  CSS entry point
   PostCSS (postcss-import) bundles this into ../main.css
   ═══════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════
   ADAGES  ·  Common — variables, reset, layout, components
   ═══════════════════════════════════════════════════════ */

   
:root {
  --ink:        #050D50;
  --paper:      #f0f4f8;
  --cream:      #e0eaf2;
  --gold:       #F7AA14;
  --gold-light: #ffca4a;
  --rust:       #CC3333;
  --sage:       #00A19A;
  --muted:      #323E48;
  --border:     #c0ccd8;
  --navy:       #004489;
  --blue:       #3399CC;
  --cyan:       #66CCFF;
  --white:      #ffffff;

  --ff-display: 'Playfair Display', Georgia, serif;
  --ff-mono:    'DM Mono', 'Courier New', monospace;
  --ff-body:    'DM Sans', system-ui, sans-serif;

  --radius:     4px;
  --shadow:     0 2px 12px rgba(5,13,80,.12);
  --shadow-lg:  0 8px 32px rgba(5,13,80,.18);
}

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

html { font-size: 16px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-body);
  font-weight: 300;
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Layout ──────────────────────────────────────────── */

#app { min-height: 100vh; display: flex; flex-direction: column; }

.page { flex: 1; padding: 2rem 1rem; max-width: 960px; margin: 0 auto; width: 100%; }

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem .8rem;
  font-size: .55rem;
  color: rgba(255,255,255,.6);
  font-family: var(--ff-mono);
  letter-spacing: .06em;
  pointer-events: none;
}

#footer-location { color: var(--gold-light); text-transform: uppercase; letter-spacing: .06em; }

#footer-hint { color: var(--gold-light); max-width: 7rem; text-align: right; }

/* ── Typography ──────────────────────────────────────── */

h1 { font-family: var(--ff-display); font-size: 2.8rem; font-weight: 700; line-height: 1.15; }

h2 { font-family: var(--ff-display); font-size: 1.9rem; font-weight: 400; line-height: 1.25; }

h3 { font-family: var(--ff-display); font-size: 1.3rem; }

.subtitle { font-family: var(--ff-mono); font-size: .8rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

/* ── Buttons ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--ff-body);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background .2s, color .2s, transform .1s;
  text-decoration: none;
  letter-spacing: .03em;
}

.btn:active { transform: scale(.97); }

.btn-primary { background: var(--navy); color: var(--white); }

.btn-primary:hover { background: var(--ink); }

.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }

.btn-outline:hover { border-color: var(--ink); }

.btn-gold { background: var(--gold); color: white; }

.btn-gold:hover { background: var(--gold-light); }

.btn-sm { padding: .35rem .8rem; font-size: .78rem; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  padding: .3rem;
  border-radius: 50%;
  transition: color .2s, background .2s;
  line-height: 1;
}

.btn-icon:hover { color: var(--blue); background: var(--cream); }

.btn-icon.active { color: var(--gold); }

/* ── Forms ───────────────────────────────────────────── */

.form-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  max-width: 420px;
  margin: 4rem auto;
  box-shadow: var(--shadow);
}

.form-card h2 { margin-bottom: .25rem; }

.form-card .subtitle { margin-bottom: 2rem; }

.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.25rem; }

label { font-size: .8rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

input[type="text"], input[type="email"], input[type="password"], select {
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--ff-body);
  font-size: .95rem;
  background: var(--paper);
  color: var(--ink);
  transition: border-color .2s;
  width: 100%;
}

input:focus, select:focus { outline: none; border-color: var(--blue); }

.form-footer { text-align: center; margin-top: 1.25rem; font-size: .85rem; color: var(--muted); }

/* ── Captcha ─────────────────────────────────────────── */

.captcha-widget {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.captcha-question {
  font-family: var(--ff-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 3.5rem;
}

.captcha-eq { color: var(--muted); font-size: 1rem; }

.captcha-input {
  width: 4rem;
  padding: .5rem .6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--ff-mono);
  text-align: center;
  background: var(--paper);
  color: var(--ink);
}

.captcha-input:focus { outline: none; border-color: var(--blue); }

.captcha-refresh {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--muted);
  padding: .2rem .3rem;
  border-radius: 50%;
  transition: color .2s, background .2s;
  line-height: 1;
}

.captcha-refresh:hover { color: var(--navy); background: var(--cream); }

.form-footer a { color: var(--blue); cursor: pointer; text-decoration: none; }

.form-footer a:hover { text-decoration: underline; }

/* ── Alerts ──────────────────────────────────────────── */

.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 1rem;
}

.alert-error { background: #fdf0ec; border: 1px solid #e9b8ac; color: var(--rust); }

.alert-success { background: #edf3ef; border: 1px solid #aec8b5; color: var(--sage); }

/* ── Modal ───────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: min(420px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal h3 { margin: 0; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: .5rem;
}

/* ── Loader ──────────────────────────────────────────── */

.loader {
  text-align: center;
  padding: 3rem;
  font-family: var(--ff-mono);
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .08em;
}

/* ── Cookie Banner ───────────────────────────────────── */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ink);
  color: rgba(255,255,255,.85);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  font-size: .82rem;
  z-index: 900;
  box-shadow: 0 -2px 12px rgba(5,13,80,.2);
}

.cookie-banner p { margin: 0; flex: 1; min-width: 200px; }

.cookie-banner-link { color: var(--cyan); text-decoration: underline; cursor: pointer; }

.cookie-banner-actions { flex-shrink: 0; }

/* ── Policy pages ─────────────────────────────────────── */

.policy-body { margin: 2rem 0; display: flex; flex-direction: column; gap: 1.25rem; }

.policy-body h3 { font-family: var(--ff-display); font-size: 1.1rem; margin-bottom: .25rem; }

.policy-body ul { padding-left: 1.5rem; display: flex; flex-direction: column; gap: .4rem; }

.policy-body a, .policy-inline-link { color: var(--blue); text-decoration: underline; cursor: pointer; }

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 600px) {
  h1 { font-size: 2rem; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .form-card { margin: 2rem 0; }
}

/* ═══════════════════════════════════════════════════════
   ADAGES  ·  Themes
   ═══════════════════════════════════════════════════════ */

/* ── Theme: Forest ───────────────────────────────────── */

[data-theme="forest"] {
  --ink:        #1B3A2D;
  --paper:      #F4F0E6;
  --cream:      #E8E1D0;
  --gold:       #C8921A;
  --gold-light: #E0B040;
  --rust:       #A63D2F;
  --sage:       #3D8B6E;
  --muted:      #3A4E40;
  --border:     #BDD1BC;
  --navy:       #2E6B4F;
  --blue:       #4A9B76;
  --cyan:       #7EC8A0;
  --shadow:     0 2px 12px rgba(27,58,45,.12);
  --shadow-lg:  0 8px 32px rgba(27,58,45,.18);
}

/* ── Theme: Sepia ────────────────────────────────────── */

[data-theme="sepia"] {
  --ink:        #2C1A0E;
  --paper:      #F5EDDC;
  --cream:      #EDE0C4;
  --gold:       #B8860B;
  --gold-light: #D4A030;
  --rust:       #8B3A1A;
  --sage:       #6B7C4A;
  --muted:      #5C4030;
  --border:     #D4C0A0;
  --navy:       #5C3A1E;
  --blue:       #8B6040;
  --cyan:       #B89060;
  --shadow:     0 2px 12px rgba(44,26,14,.12);
  --shadow-lg:  0 8px 32px rgba(44,26,14,.18);
}

/* ── Theme: Dusk ─────────────────────────────────────── */

[data-theme="dusk"] {
  --ink:        #1E1035;
  --paper:      #F7F4FF;
  --cream:      #EDE7F6;
  --gold:       #E040A0;
  --gold-light: #F06FBB;
  --rust:       #D32F6F;
  --sage:       #7E57C2;
  --muted:      #4A3A66;
  --border:     #CEC0E8;
  --navy:       #5C3D99;
  --blue:       #8B5CF6;
  --cyan:       #C084FC;
  --shadow:     0 2px 12px rgba(30,16,53,.12);
  --shadow-lg:  0 8px 32px rgba(30,16,53,.18);
}

/* ── Theme: Greyscale ────────────────────────────────── */

[data-theme="greyscale"] {
  --ink:        #111111;
  --paper:      #F2F2F2;
  --cream:      #E4E4E4;
  --gold:       #555555;
  --gold-light: #777777;
  --rust:       #333333;
  --sage:       #666666;
  --muted:      #444444;
  --border:     #CCCCCC;
  --navy:       #222222;
  --blue:       #555555;
  --cyan:       #888888;
  --shadow:     0 2px 12px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.18);
}

/* ═══════════════════════════════════════════════════════
   ADAGES  ·  Navigation
   ═══════════════════════════════════════════════════════ */

nav {
  background: linear-gradient(135deg, var(--ink) 0%, var(--navy) 100%);
  color: var(--white);
  padding: .75rem 2rem;
  display: flex;
  align-items: center;
  position: relative;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(5,13,80,.3);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.nav-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.nav-brand-text {
  font-family: var(--ff-display);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--gold-light);
  letter-spacing: .02em;
}

.nav-links { display: flex; gap: 1.5rem; align-items: center; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  transition: opacity .2s;
}

.nav-links a, .nav-links button.nav-link {
  color: var(--cyan);
  text-decoration: none;
  font-size: .875rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 400;
  background: none;
  border: none;
  cursor: pointer;
  transition: color .2s;
}

.nav-links a:hover, .nav-links button.nav-link:hover { color: var(--gold-light); }

/* ── Language dropdown ───────────────────────────────── */

.nav-lang-dropdown {
  position: relative;
  margin-left: .5rem;
}

.nav-lang-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: .1rem .2rem;
  border-radius: 3px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: opacity .15s;
}

.nav-lang-toggle:hover { opacity: .75; }

.nav-lang-toggle .fi { font-size: 1.1rem; }

.nav-lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + .4rem);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  flex-direction: column;
  overflow: hidden;
  z-index: 200;
}

.nav-lang-menu.open { display: flex; }

.nav-lang-item {
  background: transparent;
  border: none;
  padding: .4rem .7rem;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s;
}

.nav-lang-item .fi { font-size: 1.2rem; }

.nav-lang-item:hover  { background: var(--cream); }

.nav-lang-item.active { background: var(--cream); }

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 800px) {
  nav { padding: .75rem 1rem; flex-wrap: wrap; }

  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    width: 100%;
    padding: .75rem 0 .25rem;
  }
  nav.nav-open .nav-links { display: flex; }
}

@media (max-width: 600px) {
  .nav-brand-text { font-size: 1.2rem; }
}

/* ═══════════════════════════════════════════════════════
   ADAGES  ·  Home screen & adage cards
   ═══════════════════════════════════════════════════════ */

/* ── Home screen ─────────────────────────────────────── */

.home-screen {
  position: relative;
  height: calc(100vh - 56px - 2rem);
  width: calc(100% - 2rem);
  max-width: 750px;
  margin: 1rem auto 0;
  border-radius: 1.25rem;
  box-shadow: var(--shadow-lg);
  background-size: cover;
  background-position: center;
  background-color: #000;
  overflow: hidden;
}

.home-screen--compact { height: 500px; }

.home-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(5,13,80,.5);
  pointer-events: none;
}

.home-card-location {
  position: absolute;
  bottom: 3.5rem;
  left: 1.25rem;
  z-index: 2;
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--gold);
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  pointer-events: none;
  text-transform: capitalize;
}

.home-card-hint {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: .62rem;
  color: rgba(255,255,255,.8);
  letter-spacing: .06em;
  text-transform: uppercase;
  pointer-events: none;
  background: var(--ink);
  padding: .3rem .8rem;
  border-radius: 20px;
}

.home-hint-row {
  text-align: center;
  margin-bottom: 1.25rem;
}

.home-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  padding: 1.5rem;
  text-align: center;
}

.home-welcome {
  font-size: 1.6rem;
  font-family: var(--ff-display);
  font-style: italic;
  color: var(--gold-light);
  letter-spacing: .02em;
  text-align: center;
  padding: 1.5rem 1rem .5rem;
}

/* Positioned version inside the hero */

.home-screen .home-welcome {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.25rem;
  padding: 0;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.home-hero-title {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.9rem;
  color: var(--gold-light);
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0,0,0,.4);
}

.home-hero-taglines {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  width: 75vw;
  text-align: center;
}

.home-hero-tagline {
  font-size: .85rem;
  color: var(--gold-light);
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
}

.home-hero-tagline--sub {
  font-size: .75rem;
  color: rgba(255,255,255,.5);
  font-style: italic;
}

/* ── Home card ───────────────────────────────────────── */

.home-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 700px;
  transition: background .3s, padding .3s, border-radius .3s;
}

#home-card-text { cursor: pointer; }

.home-card--cta {
  background: var(--gold-light);
  padding: 1.5rem 2rem;
  border-radius: var(--radius);
}

.home-card--cta .adage-featured-text { color: var(--navy); }

/* ── Adage featured text ─────────────────────────────── */

.adage-featured-text {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  line-height: 1.5;
  color: var(--gold-light);
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  max-width: 700px;
}

.adage-featured-text--fr {
  font-size: clamp(1.15rem, 2.5vw, 1.6rem);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
  margin-top: .25rem;
}

/* ── Favourite & nav buttons ─────────────────────────── */

.home-fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.75rem;
  color: rgba(255,255,255,.7);
  transition: color .2s, transform .15s;
  padding: .25rem;
}

.home-fav-btn:hover  { transform: scale(1.15); }

.home-fav-btn.active { color: var(--gold); }

.home-next-btn, .home-login-btn {
  position: absolute;
  bottom: calc(2rem + 100px);
  left: 50%;
  transform: translateX(-50%);
  padding: .75rem 2.5rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.home-next-btn {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.6);
  color: #fff;
}

.home-next-btn:hover { background: rgba(255,255,255,.1); }

.home-login-btn {
  background: var(--navy);
  border: none;
  color: #fff;
}

.home-login-btn:hover { background: var(--ink); }

/* ── Favourites grid ─────────────────────────────────── */

.favourites-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* ── Adage card (profile/favourites list) ────────────── */

.adage-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: box-shadow .2s, transform .15s;
  position: relative;
  overflow: hidden;
}

.adage-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
}

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

.adage-text {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
}

.adage-text--fr {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

.adage-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .5rem;
}

.adage-author { font-size: .78rem; color: var(--muted); font-family: var(--ff-mono); }

.adage-category-row {
  display: flex;
  justify-content: center;
  margin-top: auto;
}

.adage-category {
  font-size: .7rem;
  padding: .2rem .55rem;
  background: #e0f4f3;
  border-radius: 20px;
  color: var(--sage);
  font-family: var(--ff-mono);
  letter-spacing: .04em;
}

.translate-hint {
  font-size: .4rem;
  color: var(--muted);
  font-family: var(--ff-mono);
  letter-spacing: .04em;
  margin-bottom: .75rem;
}

.adage-card-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.adage-card-text {
  flex: 1;
  min-width: 0;
}

.adage-card-text--cycable { cursor: pointer; }

.adage-card[data-mode] { cursor: pointer; }

.adage-star-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--gold);
  cursor: pointer;
  padding: .25rem .3rem;
  flex-shrink: 0;
  transition: transform .15s;
}

.adage-star-btn:hover { transform: scale(1.2); }

/* ── Filter bar ──────────────────────────────────────── */

.filter-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 2rem; }

.filter-chip {
  padding: .3rem .85rem;
  border-radius: 20px;
  font-size: .78rem;
  font-family: var(--ff-mono);
  border: 1.5px solid var(--border);
  background: white;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .04em;
}

.filter-chip:hover, .filter-chip.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ── Empty state ─────────────────────────────────────── */

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.empty-icon { font-size: 2.5rem; margin-bottom: .75rem; }

.empty p { font-style: italic; font-family: var(--ff-display); }

/* ── Search ──────────────────────────────────────────── */

.search-bar {
  display: flex;
  gap: .5rem;
  margin-bottom: 2rem;
}

.search-bar input { flex: 1; }

/* ── Scroll cue ──────────────────────────────────────── */

.home-scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  animation: home-bounce 2s ease-in-out infinite;
  z-index: 2;
}

.home-scroll-arrow { font-size: 2rem; line-height: 1; }

@keyframes home-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ── Features section ────────────────────────────────── */

.home-features {
  background: var(--paper);
  padding: 4rem 1.5rem 5rem;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.home-features-title {
  font-family: var(--ff-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 400;
  color: var(--ink);
  text-align: center;
  margin-bottom: 2.5rem;
}

.home-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.home-feature-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: box-shadow .2s, transform .15s;
}

.home-feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.home-feature-header {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.home-feature-icon { font-size: 1.8rem; line-height: 1; flex-shrink: 0; }

.home-feature-card h3 {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.home-feature-card p {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.home-feature-card--cta {
  background: linear-gradient(135deg, var(--ink) 0%, var(--navy) 100%);
  border-color: transparent;
}

.home-feature-card--cta h3 { color: var(--gold-light); }

.home-feature-card--cta p  { color: rgba(255,255,255,.7); }

.home-feature-register-btn { margin-top: .75rem; align-self: flex-start; }

/* ── Hero taglines banner (above image, small screens) ── */

.home-taglines-banner {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  text-align: center;
  padding: .75rem 1.5rem;
  background: var(--ink);
  border-radius: 1.25rem;
  width: calc(100% - 2rem);
  max-width: 700px;
  margin: 1rem auto 0;
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 800px) {
  .favourites-grid { grid-template-columns: 1fr; }
  .home-features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .home-hero-title {
    white-space: normal;
    text-align: center;
    font-size: 1.5rem;
    max-width: 80vw;
  }
  .home-hero-tagline--sub { max-width: 60vw; }
  .home-features-grid { grid-template-columns: 1fr; }
  .home-features { padding: 2.5rem 1rem 3rem; }
}

@media (max-width: 400px) {
  .home-taglines-banner { display: flex; }
  .home-screen .home-hero-taglines { display: none; }
}

/* ═══════════════════════════════════════════════════════
   ADAGES  ·  Play page
   ═══════════════════════════════════════════════════════ */

.play-page { position: relative; min-height: 100vh; }

.play-page::before { content: ''; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(135deg, var(--ink) 0%, var(--navy) 100%); z-index: -1; }

.play-tagline { text-align: center; color: rgba(255,255,255,.75); font-size: .9rem; margin-top: .4rem; }

.play-page .subtitle { font-family: var(--ff-display); font-style: italic; color: var(--gold-light); text-align: center; font-size: clamp(1.4rem, 3.5vw, 2.3rem); text-transform: none; letter-spacing: .02em; text-shadow: 0 1px 4px rgba(0,0,0,.3); }

#play-attempts, #play-score, #play-last-score { text-align: center; font-family: var(--ff-mono); font-size: .8rem; color: rgba(255,255,255,.5); margin-bottom: .25rem; }

.play-limit-msg { font-family: var(--ff-display); font-style: italic; font-size: clamp(1.1rem, 2.5vw, 1.6rem); color: var(--gold-light); text-align: center; margin-top: 3rem; }

.play-adage { margin: 1.5rem auto; text-align: center; max-width: 600px; border-radius: 1rem; padding: 2.5rem 2rem; background-size: cover; background-position: center; position: relative; overflow: hidden; }

.play-adage::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.45); border-radius: 1rem; }

.play-adage .adage-featured-text { position: relative; z-index: 1; }

.play-choices { display: flex; flex-direction: column; align-items: center; gap: .75rem; max-width: 600px; margin: 0 auto; }

.play-choice { text-align: center; padding: .85rem 2rem; width: 100%; max-width: 420px; background: #ddeeff; border: 2px solid var(--gold); color: var(--ink); font-size: .95rem; border-radius: 999px; cursor: pointer; transition: border-color .2s, background .2s; }

.play-choice:hover:not(:disabled) { border-color: var(--gold-light); background: var(--navy); color: var(--white); }

.play-choice--wrong { border-color: var(--rust) !important; }

.play-feedback { text-align: center; color: var(--rust); font-size: .85rem; margin-top: .75rem; min-height: 1.2em; }

.play-stop-btn { display: block; margin: 1rem auto 0; padding: .85rem 2.5rem; background: var(--white); border: none; color: var(--navy); border-radius: 999px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background .2s, color .2s; }

.play-stop-btn:hover { background: var(--cream); }

.play-popup { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 1001; }

.play-popup.hidden { display: none; }

.play-popup-box { background: var(--ink); border-radius: 1rem; padding: 2rem 2.5rem; text-align: center; display: flex; flex-direction: column; gap: 1.25rem; box-shadow: var(--shadow-lg); width: min(500px, 90vw); }

.play-popup-box .btn { border-radius: 999px; }

.play-popup-msg { font-family: var(--ff-display); font-size: 1.6rem; color: var(--gold-light); }

.play-popup-translation { font-size: 1rem; color: var(--white); display: block; margin-top: .4rem; }

/* ═══════════════════════════════════════════════════════
   ADAGES  ·  Stats, Game Sessions & Adages Admin
   ═══════════════════════════════════════════════════════ */

/* ── Stats tiles & grid ──────────────────────────────── */

.stats-totals {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stats-tile {
  flex: 1;
  min-width: 120px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: center;
}

.stats-tile-value {
  font-family: var(--ff-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.stats-tile-label {
  font-family: var(--ff-mono);
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: .4rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.stats-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.stats-card h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--muted);
  font-family: var(--ff-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.stats-card--wide { grid-column: 1 / -1; }

.stats-empty { color: var(--muted); font-style: italic; font-size: .9rem; }

/* ── SVG charts ──────────────────────────────────────── */

.stats-svg { width: 100%; height: auto; display: block; overflow: visible; }

.stats-svg--line { min-height: 120px; }

.sc-bar   { fill: var(--navy); opacity: .8; }

.sc-label { font-size: 11px; fill: var(--muted); font-family: var(--ff-mono); }

.sc-val   { font-size: 11px; fill: var(--muted); font-family: var(--ff-mono); }

.sc-axis  { font-size: 9px;  fill: var(--muted); font-family: var(--ff-mono); }

.sc-axis-line { stroke: var(--border); stroke-width: 1; }

.sc-area  { fill: var(--navy); opacity: .1; }

.sc-line  { fill: none; stroke: var(--navy); stroke-width: 2; }

.sc-dot   { fill: var(--navy); }

/* ── Sortable table helpers (game sessions & adages) ─── */

.gs-id { color: var(--muted); font-family: var(--ff-mono); font-size: .75rem; width: 2rem; }

#gs-table thead th[data-col],
#aa-table thead th[data-col] { cursor: pointer; user-select: none; white-space: nowrap; }

#gs-table thead th[data-col]:hover,
#aa-table thead th[data-col]:hover { background: var(--border); }

.gs-sort-arrow { opacity: .35; font-style: normal; margin-left: .25rem; }

.gs-sort-active { opacity: 1; color: var(--navy); }

/* ── Adages admin table ───────────────────────────────── */

.aa-table .aa-lb { font-style: italic; }

.aa-table .aa-tr { color: var(--muted); }

.aa-search-wrap { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }

.aa-search { flex: 1; max-width: 360px; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .875rem; font-family: var(--ff-sans); background: var(--paper); color: var(--ink); }

.aa-search:focus { outline: none; border-color: var(--navy); }

.aa-count { font-family: var(--ff-mono); font-size: .75rem; color: var(--muted); }

/* ── Image gallery ───────────────────────────────────── */

/* ── Image filter bar ────────────────────────────────── */

.img-filter-bar { margin-bottom: 1.25rem; }

.img-filter-select {
  padding: .5rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--ff-body);
  font-size: .875rem;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  min-width: 200px;
}

.img-filter-select:focus { outline: none; border-color: var(--navy); }

/* ── Image town sections ─────────────────────────────── */

.img-town-section { margin-bottom: 2rem; }

.img-town-heading {
  font-family: var(--ff-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--navy);
  border-bottom: 2px solid var(--border);
  padding-bottom: .4rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  gap: .6rem;
}

.img-town-count {
  font-family: var(--ff-mono);
  font-size: .7rem;
  color: var(--muted);
  font-weight: 400;
}

.img-count {
  font-family: var(--ff-mono);
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.img-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.img-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .15s;
}

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

.img-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--cream);
}

.img-filename {
  font-family: var(--ff-mono);
  font-size: .65rem;
  color: var(--muted);
  padding: .1rem .6rem .5rem;
  word-break: break-all;
}

/* ── Image lightbox modal ────────────────────────────── */

.img-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.img-modal.hidden { display: none; }

.img-modal-wrap {
  position: relative;
  width: 100%;
  max-width: 100vw;
}

.img-modal-img {
  width: 100%;
  max-width: 100vw;
  max-height: calc(100vh - 5rem);
  object-fit: contain;
  display: block;
  border-radius: var(--radius);
}

.img-modal-town {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: .75rem 1rem;
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: #ffffff;
  text-align: center;
  text-shadow:
    -2px -2px 0 var(--navy),
     2px -2px 0 var(--navy),
    -2px  2px 0 var(--navy),
     2px  2px 0 var(--navy);
  pointer-events: none;
}

.img-modal-caption {
  margin-top: .6rem;
  font-family: var(--ff-mono);
  font-size: .7rem;
  color: rgba(255,255,255,.5);
  text-align: center;
}

.img-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: 4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .5rem;
  transition: color .15s;
  user-select: none;
}

.img-modal-nav:hover { color: #fff; }

.img-modal-prev { left: 1rem; }

.img-modal-next { right: 1rem; }

.img-modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  z-index: 1;
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color .15s;
  padding: 0;
}

.img-modal-close:hover { color: #fff; }

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stats-card--wide { grid-column: 1; }
}

/* ═══════════════════════════════════════════════════════
   ADAGES  ·  Users table & score table
   ═══════════════════════════════════════════════════════ */

/* ── Users table ─────────────────────────────────────── */

.users-table-wrap { overflow-x: auto; }

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.users-table th {
  text-align: left;
  padding: .6rem .75rem;
  background: var(--cream);
  color: var(--muted);
  font-family: var(--ff-mono);
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
}

.users-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.users-table tr:last-child td { border-bottom: none; }

.users-table tr:hover td { background: var(--cream); }

/* ── Score table (My Scores page) ───────────────────── */

.score-table { margin-top: .5rem; font-size: .75rem; }

.score-table th, .score-table td { padding: .35rem .5rem; }

.score-cell { text-align: center; font-family: var(--ff-mono); }

.score-pct { font-weight: 600; color: var(--navy); }

.score-best td { background: var(--navy) !important; color: var(--gold-light); }

.score-best .score-pct { color: var(--gold-light); }

/* ── Role badges ─────────────────────────────────────── */

.role-badge {
  font-family: var(--ff-mono);
  font-size: .7rem;
  padding: .15rem .5rem;
  border-radius: 20px;
  letter-spacing: .04em;
}

.role-admin { background: #fef3c7; color: #92400e; }

.role-user  { background: var(--cream); color: var(--muted); }

.user-actions { display: flex; gap: .4rem; }

.btn-danger {
  color: var(--rust);
  border-color: var(--rust);
}

.btn-danger:hover { background: var(--rust); color: #fff; }

/* ═══════════════════════════════════════════════════════
   ADAGES  ·  Profile & Preferences
   ═══════════════════════════════════════════════════════ */

/* ── Profile header ──────────────────────────────────── */

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ink), var(--navy));
  color: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-display);
  font-size: 1.8rem;
  font-style: italic;
  flex-shrink: 0;
}

.profile-meta h2 { margin-bottom: .15rem; }

.profile-meta .subtitle { margin-top: .25rem; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}

.count-badge {
  font-family: var(--ff-mono);
  font-size: .75rem;
  color: var(--muted);
}

/* ── Theme picker ────────────────────────────────────── */

.theme-picker { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .75rem; }

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--ff-body);
  font-size: .8rem;
  color: var(--muted);
}

.theme-swatch-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: border-color .2s, transform .15s;
}

.theme-swatch:hover .theme-swatch-dot,
.theme-swatch.active .theme-swatch-dot { border-color: var(--gold); transform: scale(1.1); }

.theme-swatch.active { color: var(--ink); font-weight: 500; }

/* ═══════════════════════════════════════════════════════
   ADAGES  ·  Site footer
   ═══════════════════════════════════════════════════════ */

.site-footer-bar {
  background: var(--ink);
  color: rgba(255,255,255,.65);
  font-size: .78rem;
  font-family: var(--ff-mono);
  letter-spacing: .04em;
  padding: 1rem 1.5rem;
  margin-top: auto;
}

.site-footer-bar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer-bar-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.site-footer-bar-logo {
  height: 1.1rem;
  width: auto;
  opacity: .7;
}

.site-footer-bar-links {
  display: flex;
  gap: 1.25rem;
}

.site-footer-bar-links a {
  color: rgba(255,255,255,.55);
  cursor: pointer;
  text-decoration: none;
  transition: color .2s;
}

.site-footer-bar-links a:hover {
  color: rgba(255,255,255,.9);
  text-decoration: underline;
}
