/* ============================================================
   WebcamClicks — main.css
   Fresh, vibrant Pink & White theme with Light Grey background.
   Mobile-first, responsive, accessible, high performance.
   ============================================================ */

:root {
  /* Surfaces & Backgrounds */
  --bg: #f1f3f6;            /* Light grey background */
  --bg-2: #ffffff;          /* Pure crisp white cards */
  --bg-3: #fdf2f8;          /* Soft delicate pink tint */
  --bg-hover: #fce7f3;      /* Subtle pink hover */
  --panel: rgba(255, 255, 255, 0.94);
  
  /* Borders */
  --border: rgba(236, 72, 153, 0.18);
  --border-2: rgba(236, 72, 153, 0.35);
  --border-focus: #db2777;
  
  /* Typography */
  --text: #1e293b;          /* Crisp slate charcoal for high readability */
  --text-secondary: #475569;
  --muted: #64748b;         /* Neutral slate muted */
  
  /* Pink Brand Colors */
  --brand: #ec4899;         /* Vibrant pink */
  --brand-2: #db2777;       /* Rich deep pink */
  --brand-light: #fbcfe8;   /* Light rose */
  --brand-grad: linear-gradient(135deg, #f43f5e 0%, #ec4899 50%, #d946ef 100%);
  --brand-grad-hover: linear-gradient(135deg, #e11d48 0%, #db2777 50%, #c026d3 100%);
  
  /* Functional Colors */
  --danger: #ef4444;
  --ok: #10b981;
  --warn: #f59e0b;
  
  /* Layout & Elevations */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 8px rgba(236, 72, 153, 0.08);
  --shadow: 0 10px 30px -5px rgba(236, 72, 153, 0.14), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 40px -10px rgba(236, 72, 153, 0.22);
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, canvas, video { max-width: 100%; display: block; }
a { color: var(--brand-2); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #be185d; text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; color: var(--text); font-weight: 700; }
.muted { color: var(--muted); }

/* Custom Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f3f6; }
::-webkit-scrollbar-thumb { background: #f472b6; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #db2777; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(236, 72, 153, 0.06);
}
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: -0.3px;
}
.logo em {
  font-style: normal;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo:hover { text-decoration: none; }
.site-nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  transition: all 0.15s ease;
}
.site-nav a:hover {
  color: var(--brand-2);
  background: var(--bg-3);
  text-decoration: none;
}
.site-nav a.lang-pill {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--brand-2);
  display: inline-flex; align-items: center; gap: 5px;
}
.site-nav a.lang-pill:hover {
  background: var(--bg-3);
  border-color: var(--brand);
}

/* ---------- Hero ---------- */
.hero {
  max-width: 980px; margin: 0 auto; padding: 36px 20px 10px; text-align: center;
}
.hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.8px;
  color: #0f172a;
}
.hero h1 span {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--muted);
  max-width: 720px;
  margin: 10px auto 0;
  font-size: clamp(0.98rem, 2vw, 1.12rem);
}
.hero-badges {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px;
}
.hero-badges span {
  font-size: 0.82rem; font-weight: 700; color: var(--text-secondary);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: var(--shadow-sm);
}

/* ---------- Ad slots ---------- */
.ad-slot {
  max-width: 970px; margin: 16px auto; padding: 6px;
  min-height: 60px; text-align: center; overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.ad-slot::before {
  content: "Advertisement"; display: block; font-size: 0.64rem;
  letter-spacing: 1.6px; text-transform: uppercase; color: #94a3b8;
  margin-bottom: 4px; font-weight: 600;
}
.ad-slot[data-ad-slot] ins { margin: 0 auto; }
.ad-slot-side { min-height: 250px; margin: 0; }

/* ---------- App layout ---------- */
.app {
  max-width: 1200px; margin: 12px auto 0; padding: 10px 16px 34px;
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px;
  align-items: start;
}
.stage-column { min-width: 0; }

/* ---------- Camera stage ---------- */
.camera-stage {
  position: relative;
  background: #0f172a; /* neutral dark background only behind raw video */
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
}
.camera-stage video { display: none; }
#stage-canvas { width: 100%; height: 100%; object-fit: contain; }

.stage-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center; padding: 28px;
  background: radial-gradient(circle at 50% 30%, #fff1f6 0%, #fdf2f8 50%, #f1f3f6 100%);
  color: var(--text);
}
.stage-overlay h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3.2vw, 1.8rem);
  font-weight: 800;
  color: #0f172a;
}
.stage-overlay p { margin: 0; color: var(--muted); max-width: 480px; font-size: 0.98rem; }
.stage-overlay .features-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; }
.stage-overlay .features-row span {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 0.95rem; font-weight: 700;
  border: 1px solid var(--border); border-radius: 999px;
  background: #ffffff; color: var(--text);
  padding: 11px 22px; cursor: pointer;
  transition: transform .12s ease, background .15s, border-color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  background: var(--bg-3);
  border-color: var(--brand);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--brand-grad); border: none; color: #ffffff;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.4);
}
.btn-primary:hover {
  background: var(--brand-grad-hover);
  box-shadow: 0 10px 28px rgba(236, 72, 153, 0.5);
  transform: translateY(-2px);
  filter: none;
}
.btn:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.tool {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font); font-size: 0.88rem; font-weight: 700;
  background: #ffffff; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.tool:hover {
  background: var(--bg-3);
  border-color: var(--brand);
  color: var(--brand-2);
  transform: translateY(-1px);
}
.tool.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}
.tool.recording {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
  animation: recPulse 1.2s infinite ease-in-out;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}
@keyframes recPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.tool .kbd {
  font-size: 0.68rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0 5px;
  background: #f8fafc;
}
.tool.active .kbd, .tool.recording .kbd {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
  background: transparent;
}
.toolbar .spacer { flex: 1; }
.toolbar label.intensity {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.86rem; color: var(--text-secondary); font-weight: 600;
}
.toolbar input[type="range"] {
  accent-color: var(--brand);
  width: 110px;
  cursor: pointer;
}

/* ---------- Status badges ---------- */
.badges {
  position: absolute; top: 12px; left: 12px; z-index: 12;
  display: flex; gap: 8px; flex-direction: column; align-items: flex-start;
}
.badge {
  font-size: 0.74rem; font-weight: 700; color: #1e293b;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-2);
  border-radius: 999px; padding: 4px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
}
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.err { color: var(--danger); }
.badge.rec {
  color: #ffffff;
  background: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.45);
}
.badge.rec::before {
  content: "● ";
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0.3; } }

/* ---------- Flash + toast ---------- */
#flash { position: absolute; inset: 0; background: #ffffff; opacity: 0; pointer-events: none; z-index: 30; }
#flash.go { animation: flash 0.28s ease-out; }
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: #ffffff; border: 1px solid var(--border-2); color: var(--text);
  border-radius: 999px; padding: 12px 24px; font-size: 0.92rem; font-weight: 700;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 90; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Effects panel ---------- */
.effects-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.panel-head h3 { font-size: 1.05rem; margin: 0; color: #0f172a; }
.panel-hint { font-size: 0.74rem; color: var(--muted); font-weight: 500; }

.category-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.category-tabs button {
  font-family: var(--font); font-size: 0.8rem; font-weight: 700;
  color: var(--text-secondary); background: #ffffff;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; cursor: pointer;
  transition: all .15s ease;
}
.category-tabs button:hover {
  background: var(--bg-3);
  border-color: var(--brand);
  color: var(--brand-2);
}
.category-tabs button.active {
  color: #ffffff;
  background: var(--brand-grad);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.35);
}

.filter-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  max-height: 440px; overflow-y: auto; padding-right: 4px;
}
.filter-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-family: var(--font);
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 6px 10px; cursor: pointer;
  transition: border-color .15s, transform .12s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.filter-tile:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  background: var(--bg-3);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.12);
}
.filter-tile.selected {
  border-color: var(--brand-2);
  background: var(--bg-3);
  box-shadow: 0 0 0 2px var(--brand-2);
}
.filter-tile .ft-icon { font-size: 1.55rem; line-height: 1; }
.filter-tile .ft-name {
  font-size: 0.72rem; font-weight: 700;
  color: var(--text-secondary); text-align: center;
}
.filter-tile.selected .ft-name { color: var(--brand-2); font-weight: 800; }
.filter-tile .ft-fav {
  position: absolute; top: 4px; right: 6px; font-size: 0.78rem;
  color: #cbd5e1; background: none; border: none; cursor: pointer; padding: 2px;
  transition: color 0.15s ease;
}
.filter-tile .ft-fav:hover { color: #f59e0b; }
.filter-tile .ft-fav.on { color: #f59e0b; }

/* ---------- Games section ---------- */
.games-section { max-width: 1200px; margin: 34px auto 0; padding: 0 16px; }
.section-title { font-size: clamp(1.35rem, 3.2vw, 1.85rem); color: #0f172a; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 14px; }
.game-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px; cursor: pointer;
  transition: border-color .15s, transform .12s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.game-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.game-card .gc-icon { font-size: 2.1rem; }
.game-card h3 { font-size: 1.08rem; margin: 8px 0 4px; color: #0f172a; }
.game-card p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.game-card .gc-play {
  display: inline-block; margin-top: 12px; font-size: 0.84rem; font-weight: 800;
  color: var(--brand-2);
}

/* Game HUD */
.game-hud {
  position: absolute; top: 12px; right: 12px; z-index: 14;
  display: none; gap: 8px; align-items: center;
}
.game-hud.on { display: flex; }
.game-hud .score {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border-2); border-radius: 999px;
  padding: 6px 16px; font-weight: 800; font-size: 0.95rem;
  color: #0f172a;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  backdrop-filter: blur(8px);
}
.game-msg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 16; display: none; flex-direction: column; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, 0.97);
  border: 2px solid var(--border-2);
  border-radius: var(--radius); padding: 26px 36px; text-align: center;
  box-shadow: var(--shadow-lg); backdrop-filter: blur(12px); max-width: 86%;
}
.game-msg.on { display: flex; }
.game-msg h3 { margin: 0; color: #0f172a; font-size: 1.35rem; }
.game-msg p { margin: 0; color: var(--muted); font-size: 0.96rem; }
.game-msg .big { font-size: 2.6rem; }

/* ---------- Content sections (SEO) ---------- */
.content-section { max-width: 980px; margin: 48px auto 0; padding: 0 20px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.feature-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
.feature-card:hover { transform: translateY(-2px); }
.feature-card h3 { font-size: 1.05rem; margin: 0 0 6px; color: #0f172a; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.feature-card .fc-icon { font-size: 1.65rem; display: block; margin-bottom: 10px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-top: 16px; counter-reset: step; }
.step {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px; position: relative;
  box-shadow: var(--shadow-sm);
}
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; margin-bottom: 12px;
  background: var(--brand-grad); color: #ffffff; font-weight: 800; font-size: 0.9rem;
}
.step h3 { font-size: 1.02rem; margin: 0 0 5px; color: #0f172a; }
.step p { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* FAQ */
.faq details {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer; font-weight: 700; font-size: 1rem; color: #0f172a;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; color: var(--brand); font-size: 1.4rem; font-weight: 800; flex: none;
}
.faq details[open] summary::after { content: "–"; color: var(--brand-2); }
.faq details p { margin: 12px 0 0; color: var(--muted); font-size: 0.94rem; line-height: 1.6; }

/* ---------- Gallery drawer ---------- */
.gallery-drawer {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(8px);
}
.gallery-drawer.on { display: block; }
.gallery-inner {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(480px, 94vw);
  background: #ffffff;
  border-left: 1px solid var(--border-2);
  padding: 22px; overflow-y: auto;
  box-shadow: -15px 0 45px rgba(236, 72, 153, 0.15);
}
.gallery-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.gallery-head h3 { margin: 0; font-size: 1.15rem; color: #0f172a; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gallery-item {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); background: #f8fafc;
  box-shadow: var(--shadow-sm);
}
.gallery-item img, .gallery-item video {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000;
}
.gallery-item .gi-actions {
  display: flex; gap: 6px; padding: 8px; background: var(--bg-3);
  border-top: 1px solid var(--border);
}
.gallery-item .gi-actions button {
  flex: 1; font-size: 0.78rem; font-weight: 700; font-family: var(--font);
  color: var(--text); background: #ffffff; border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 2px; cursor: pointer;
  transition: all 0.15s ease;
}
.gallery-item .gi-actions button:hover {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}
.gallery-empty { color: var(--muted); font-size: 0.95rem; text-align: center; padding: 36px 12px; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 110; display: none;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal.on { display: flex; }
.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  max-width: 580px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 28px;
  box-shadow: var(--shadow-lg);
}
.modal-card h2 { margin-top: 0; font-size: 1.3rem; color: #0f172a; }
.modal-card h3 { font-size: 1.05rem; margin-bottom: 6px; color: #0f172a; }
.modal-card p, .modal-card li { color: var(--muted); font-size: 0.92rem; }
.modal-card ul { padding-left: 20px; }
.modal-close {
  float: right; background: none; border: none; color: var(--muted);
  font-size: 1.5rem; cursor: pointer; transition: color 0.15s;
}
.modal-close:hover { color: var(--brand-2); }
.shortcut-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 10px 0; }
.shortcut-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--muted); }
.shortcut-table td:first-child { color: var(--brand-2); font-weight: 700; white-space: nowrap; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1200px; margin: 52px auto 0; padding: 32px 24px 44px;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.88rem;
  background: #ffffff;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-sm);
}
.site-footer .footer-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px; margin-bottom: 24px;
}
.site-footer h4 { color: #0f172a; font-size: 0.95rem; margin: 0 0 10px; font-weight: 700; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer li a { color: var(--muted); transition: color 0.15s; }
.site-footer li a:hover { color: var(--brand-2); text-decoration: none; }
.site-footer .fineprint {
  font-size: 0.78rem; color: #94a3b8; line-height: 1.6;
  border-top: 1px solid var(--border); padding-top: 18px; margin-top: 18px;
}

/* ---------- Legal & Language Directory Pages ---------- */
.legal-page { background: var(--bg); }
.legal {
  max-width: 820px; margin: 34px auto 60px; padding: 32px 30px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.legal h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); color: #0f172a; }
.legal h2 { font-size: 1.18rem; margin-top: 32px; color: #0f172a; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.legal p, .legal li { color: #334155; font-size: 0.96rem; line-height: 1.65; }
.legal ul { padding-left: 22px; }

/* Language cards grid */
.lang-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px; margin-top: 24px;
}
.lang-card {
  display: flex; flex-direction: column; justify-content: space-between;
  background: #ffffff; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); transition: all 0.2s ease;
  text-decoration: none !important; color: inherit;
}
.lang-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  background: var(--bg-3);
}
.lang-card .lang-flag { font-size: 2.2rem; margin-bottom: 8px; }
.lang-card .lang-name { font-size: 1.15rem; font-weight: 800; color: #0f172a; margin-bottom: 4px; }
.lang-card .lang-native { font-size: 0.85rem; color: var(--brand-2); font-weight: 700; margin-bottom: 8px; }
.lang-card .lang-desc { font-size: 0.86rem; color: var(--muted); margin: 0 0 14px; line-height: 1.45; }
.lang-card .lang-cta {
  font-size: 0.82rem; font-weight: 700; color: var(--brand-2);
  display: inline-flex; align-items: center; gap: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(5, 1fr); max-height: none; }
}
@media (max-width: 640px) {
  .hero { padding-top: 24px; }
  .site-nav a:not(.keep) { display: none; }
  .filter-grid { grid-template-columns: repeat(4, 1fr); }
  .filter-tile .ft-name { font-size: 0.62rem; }
  .tool span.tool-label { display: none; }
  .tool { padding: 8px 11px; }
  .toolbar label.intensity { order: 10; width: 100%; }
  .toolbar input[type="range"] { width: 100%; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .legal { padding: 22px 18px; margin: 20px 12px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
