/* ---------- Theme Tokens ---------- */
:root {
  --grad-1: linear-gradient(45deg,#7b2ff7,#00c6ff);
  --grad-2: linear-gradient(45deg,#f953c6,#b91d73);

  --bg: #f9f9fb;
  --text: #222;
  --muted: #666;
  --surface: #ffffff;
  --surface-2: #f1f3f5;

  --shadow: 0 8px 28px rgba(16,24,40,.12);
  --radius: 14px;

  --blue: #2d7ef7;
  --red: #e74c3c;
  /* NEW: green for Open button */
  --green: #22c55e;
}

html.dark-mode {
  --bg: #141419;
  --text: #eef1f5;
  --muted: #a7adbb;
  --surface: #1e1f27;
  --surface-2: #242632;
}

/* ---------- Base ---------- */
*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: "Lexend", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-top: 92px;
  line-height: 1.55;
}

/* ---------- Header ---------- */
.site-header{
  position: fixed; inset: 0 0 auto 0;
  background: var(--grad-1);
  color: #fff;
  text-align: center;
  padding: 12px 16px 10px;
  box-shadow: var(--shadow);
  z-index: 1000;
}
.logo{
  font-family: "Pacifico", cursive;
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}
.tagline{
  margin: 4px 0 0 0;
  font-size: .95rem;
  opacity: .92;
}

/* ---------- Layout ---------- */
.content{
  max-width: 920px;
  margin: 0 auto;
  padding: 16px;
}
.empty-state{
  text-align:center;
  color: var(--muted);
}

/* ---------- Buttons (general) ---------- */
.btn{
  font: inherit;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform .1s ease, opacity .15s ease, box-shadow .2s ease;
  box-shadow: var(--shadow);
  text-decoration: none;
  display: inline-block;
}
.btn:active{ transform: translateY(1px) scale(.99); }

.create-btn{
  display:block;
  margin: 12px auto 18px;
  background: var(--grad-1);
  color:#fff;
}

/* Solid system buttons that never change color with theme */
.btn-blue{ background: var(--blue); color:#fff; }
.btn-red{ background: var(--red); color:#fff; }
/* NEW: green button for Open */
.btn-green{ background: var(--green); color:#fff; }
.btn-green:hover { background: #16a34a; }
.btn.sm{ padding: 8px 12px; border-radius: 10px; box-shadow: none; }

/* Hover responsiveness for the main buttons only (incl. Back button on arguments page) */
.create-btn:hover,
.modal-actions .btn:hover,
.row.actions .btn:hover,
.back-btn:hover,
.kanban-card .btn:hover,
#addBtn.btn:hover,
#clearSpeech.btn:hover,
.col-add.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px) scale(1.03);
}

/* ---------- Debate cards ---------- */
.debates{ display:grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 680px){ .debates{ grid-template-columns: 1fr 1fr; } }

.debate-box {
  background: var(--surface);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.debate-box .actions {
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
}

.debate-title {
  margin: 0;
  font-size: 1.1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}

.debate-type {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.row {
  display: flex;
  align-items: center;
}

/* ---------- Modal ---------- */
.modal{
  position: fixed; inset: 0;
  display:none;
  align-items: center; justify-content: center;
  padding: 20px;           /* keeps card from touching edges on mobile */
  background: rgba(4,6,10,.65);
  z-index: 1200;
}
.modal-card{
  width: min(560px, 100%);
  background: var(--surface);
  color: var(--text);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}
.field-label{ font-size: .92rem; opacity: .9; }
/* ensure inputs and textarea use the same app font (consistency) */
.field{
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
  font-family: inherit;   /* <-- explicit font consistency */
  font-size: 1rem;
}
.field:focus{ border-color:#9bbcff; box-shadow: 0 0 0 3px rgba(125,166,255,.25); }

.textarea{ min-height: 110px; resize: vertical; }

.error-text{
  color: #ff4d4f;
  font-size: .82rem;
}

/* Modal actions are responsive */
.modal-actions{
  display: flex; gap: 12px; flex-wrap: wrap;
}
.modal-actions .btn{ flex: 1 1 160px; }

/* ---------- Topic buttons (outline by overlay, fill on select) ---------- */
.topic-choices{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
}
.topic-btn{
  --outline: var(--grad-1);
  position: relative;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  transition: background .3s ease, color .3s ease, transform .1s ease;
  box-shadow: none;
}
.topic-btn span{ display:inline-block; line-height:0; }
.topic-btn::after{
  content:"";
  position:absolute; inset:0;
  border-radius: 999px;
  padding: 2px;             /* outline width */
  background: var(--outline);
  /* gradient outline overlay that follows rounding */
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  transition: background .25s ease, opacity .25s ease;
}
.topic-btn:hover{ transform: translateY(-1px); }
.topic-btn:hover::after{ background: var(--grad-2); }
.topic-btn:active{ transform: translateY(0); }

.topic-btn.selected{
  background: var(--grad-1);
  color:#fff;
}
.topic-btn.selected::after{ opacity:0; }  /* Hide outline when filled to avoid edges */

/* ---------- Dark mode toggle ---------- */
.dark-toggle{
  position: fixed; right: 20px; bottom: 20px;
  width: 68px; height: 68px;
  border: none;
  border-radius: 50%;
  background: var(--grad-1);
  color: #fff;             /* sets svg currentColor */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s ease;
  z-index: 1400;
}
.dark-toggle:hover{ transform: scale(1.06); }
.toggle-icon{
  width: 44px; height: 44px;   /* BIG & centered */
  display:block;
  pointer-events: none;        /* ensure whole button clickable */
}

/* ---------- Debate details on arguments page ---------- */
.debate-details{ margin-top: 8px; margin-bottom: 14px; }
.debate-desc{
  margin: 8px 0 0 0;
  color: var(--muted);
  font-size: .95rem;
  white-space: pre-wrap; /* preserve line breaks */
}

/* ---------- Confirmation Modal ---------- */
.confirm-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1100;
  align-items: center;
  justify-content: center;
}

.confirm-card {
  background: var(--surface);
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.confirm-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.confirm-checkbox {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Arguments Page & Speech Builder Styles ---------- */
.main-container { 
  display: flex; 
  flex-direction: column;
  gap: 20px; 
  margin-top: 14px; 
}
.kanban-section { flex: 1; min-width: 0; }
.speech-section { 
  width: 100%;
  background: var(--surface); 
  border-radius: 12px; 
  padding: 16px; 
  box-shadow: var(--shadow); 
  margin-top: 20px;
}

/* Add styles for speech arguments */
.speech-args-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
}

.speech-arg-card {
  background: var(--surface-2);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  position: relative;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.speech-arg-card .speech-arg-actions {
  position: static;
  margin-top: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.speech-arg-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.speech-arg-card .icon-btn {
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: none;
  border: none;
  transition: all 0.2s ease;
}

.speech-arg-card .icon-btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
  box-shadow: 0 8px 22px rgba(16,24,40,0.08);
  background: var(--surface-3);
}

.speech-arg-card .icon-btn.delete {
  color: var(--red);
}

.speech-arg-card .arg-title {
  font-weight: 500;
  margin-bottom: 4px;
  padding-right: 80px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.speech-arg-card .arg-body {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  width: 100%;
  max-width: 100%;
}

/* Strength color indicator bar */
.strength-indicator {
  display: block;
  height: 5px;
  width: 100%;
  border-radius: 6px 6px 0 0;
  margin-bottom: 6px;
  background: #bbb;
  position: relative;
  overflow: hidden;
}

/* Strength color mapping */
.strength-1 { background: #ef4444 !important; } /* red */
.strength-2 { background: #f59e42 !important; } /* orange */
.strength-3 { background: #facc15 !important; } /* yellow */
.strength-4 { background: #22d3ee !important; } /* cyan (much lighter blue-green) */
.strength-5 { background: #15803d !important; } /* strong green, much darker and deeper than 4 */

/* For speech-arg-card and sidebar-argument */
.speech-arg-card .strength-indicator,
.sidebar-argument .strength-indicator {
  margin-bottom: 8px;
  height: 4px;
}

@media (max-width: 1200px) {
  .main-container { flex-direction: column; }
}

.kanban{ 
  display: grid; 
  grid-template-columns: repeat(3, minmax(0, 1fr)); 
  gap: 14px; 
  margin-top: 14px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Update kanban layout for mobile responsiveness */
@media (max-width: 768px) {
  .kanban {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  /* Ensure card actions stay within bounds */
  .card-actions {
    flex-wrap: wrap;
    gap: 4px;
  }

  /* Make buttons smaller on mobile */
  .kanban-card .btn.small {
    padding: 6px 8px;
    font-size: 0.85rem;
  }

  /* Adjust icon size in buttons */
  .icon-btn svg {
    width: 14px;
    height: 14px;
  }
}

/* Update card actions to prevent overflow */
.card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
}

/* Ensure buttons don't cause horizontal scroll */
.kanban-card .btn {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.col{ 
  background: var(--surface); 
  border-radius: 12px; 
  padding: 12px; 
  box-shadow: var(--shadow); 
  min-height: 140px; 
  display: flex; 
  flex-direction: column;
  width: 100%;
  min-width: 0;
}
.col-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; font-weight:600; }
.col-list{ display:flex; flex-direction:column; gap:10px; }
.kanban-card{ 
  background: var(--surface-2); 
  padding: 10px 12px; 
  border-radius: 12px; 
  box-shadow: none; 
  user-select: text; 
  position: relative;
  width: 100%;
  min-width: 0;
  /* Add these properties */
  word-break: break-word;
  overflow-wrap: break-word;
}
.card-head{ 
  display: flex; 
  flex-direction: column;
  gap: 8px; 
  cursor: default;
}
.card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.card-title{ 
  font-size: 0.98rem;
  width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.4;
  margin-top: 8px;
}
.card-body{ 
  margin: 8px 0 10px; 
  color: var(--muted); 
  font-size: 0.95rem; 
  /* Fix wrapping */
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  width: 100%;
  max-width: 100%;
}
.card-meta{ display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:.86rem; color:var(--muted); flex-wrap:wrap; }
.muted{ color:var(--muted); font-size:.9rem; }
.small{ padding:6px 8px; border-radius:8px; box-shadow:none; font-size:.9rem; }
.card-actions{ display:flex; gap:6px; align-items:center; }
.icon-btn svg{ width:16px; height:16px; display:block; }

/* Speech template styles */
.speech-header { margin-bottom: 16px; }
.speech-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.speech-controls select, .speech-controls button { font-size: 0.9rem; }

.speech-template { background: var(--surface-2); border-radius: 8px; padding: 16px; }
.speech-section-header { font-weight: 600; margin: 16px 0 8px 0; color: var(--text); border-bottom: 2px solid var(--border); padding-bottom: 4px; }
.speech-section-header:first-child { margin-top: 0; }

.speech-textarea { 
  width: 100%; 
  min-height: 120px; 
  padding: 12px; 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  font-family: inherit; 
  font-size: 0.9rem; 
  resize: vertical; 
  margin-bottom: 8px;
  background: var(--surface-2);
  color: var(--text);
}

.speech-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

body.dark-mode .speech-textarea {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .speech-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Sidebar for arguments */
.arguments-sidebar { 
  position: fixed; 
  right: -350px; 
  top: 0; 
  width: 350px; 
  height: 100vh; 
  background: var(--surface); 
  box-shadow: -4px 0 20px rgba(0,0,0,0.1); 
  transition: right 0.3s ease; 
  z-index: 1000; 
  overflow-y: auto;
  padding: 16px;
}
.arguments-sidebar.open { right: 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sidebar-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; }

.sidebar-argument { 
  background: var(--surface-2); 
  border-radius: 8px; 
  padding: 10px; 
  margin-bottom: 8px; 
  border-left: 4px solid var(--accent);
  cursor: pointer;
  transition: background 0.2s ease;
}
.sidebar-argument:hover { background: var(--surface-3, #f0f0f0); }
.sidebar-argument.pro { border-left-color: #10b981; }
.sidebar-argument.con { border-left-color: #ef4444; }
.sidebar-argument.neutral { border-left-color: #6b7280; }

.sidebar-arg-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.sidebar-arg-body { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.sidebar-arg-rebuttals { margin-top: 8px; }
.sidebar-rebuttal { 
  background: rgba(0,0,0,0.05); 
  padding: 6px; 
  border-radius: 4px; 
  font-size: 0.8rem; 
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.sidebar-rebuttal:hover { background: rgba(0,0,0,0.1); }

/* Rebuttal list styles */
.rebut-list { 
  margin-top: 8px; 
  display: flex; 
  flex-direction: column; 
  gap: 8px;
  width: 100%; /* Ensure full width */
}

.rebut-item { 
  background: rgba(0,0,0,0.02); 
  padding: 8px; 
  border-radius: 8px; 
  font-size: .92rem; 
  color: var(--text);
  width: 100%; /* Ensure full width */
  word-wrap: break-word; /* Enable word wrapping */
  overflow-wrap: break-word;
}

.rebut-quote {
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  padding: 14px 20px;
  font-style: italic;
  position: relative;
  margin: 0 0 10px 0;
  white-space: pre-wrap;
  overflow-wrap: break-word; /* Enable word wrapping */
  word-wrap: break-word;
  width: 100%; /* Ensure full width */
  max-width: 100%; /* Prevent overflow */
  box-sizing: border-box;
}

.rebut-response { 
  margin-top: 6px; 
  color: var(--text); 
  white-space: pre-wrap;
  word-wrap: break-word; /* Enable word wrapping */
  overflow-wrap: break-word;
  width: 100%; /* Ensure full width */
}

/* Top action group */
.top-actions { 
  display: flex; 
  gap: 10px; 
  align-items: center;
  flex-wrap: wrap;
}

.top-actions .btn { 
  display: inline-flex; 
  align-items: center; 
  gap: 8px;
  flex: 1 1 auto;
  justify-content: center;
}

/* Auth button styles */
.auth-container {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 16px;
}

.auth-button {
  background: #fff;
  color: #444;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.auth-button:hover {
  background: #f8f8f8;
  transform: translateY(-1px);
}

.auth-button img {
  width: 18px;
  height: 18px;
}

.user-info {
  display: none;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 0.9rem;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.sign-out-button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  display: none;
}

.sign-out-button:hover {
  background: rgba(255,255,255,0.3);
}

/* ---------- Dark mode styles ---------- */
body.dark-mode {
  --bg: #141419;
  --text: #eef1f5;
  --muted: #a7adbb;
  --surface: #1e1f27;
  --surface-2: #242632;
}

body.dark-mode .site-header {
  background: var(--grad-1);
  color: #fff;
}

body.dark-mode .tagline {
  color: #ddd;
}

body.dark-mode .content {
  background: var(--bg);
  color: var(--text);
}

body.dark-mode .btn {
  background: var(--blue);
  color: #fff;
}

body.dark-mode .btn:hover {
  background: #2563eb;
}

body.dark-mode .debate-box {
  background: var(--surface);
  color: var(--text);
}

body.dark-mode .modal-card {
  background: var(--surface);
  color: var(--text);
}

body.dark-mode .field {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid transparent;
}

body.dark-mode .field:focus {
  border-color: #9bbcff;
  box-shadow: 0 0 0 3px rgba(125, 166, 255, 0.25);
}

body.dark-mode .topic-btn {
  background: var(--surface);
  color: var(--text);
}

body.dark-mode .topic-btn.selected {
  background: var(--grad-1);
  color: #fff;
}

body.dark-mode .dark-toggle {
  background: var(--grad-1);
  color: #fff;
}

body.dark-mode .dark-toggle:hover {
  transform: scale(1.06);
}

body.dark-mode .speech-textarea {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .speech-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

body.dark-mode .arguments-sidebar {
  background: var(--surface);
  color: var(--text);
}

body.dark-mode .sidebar-argument {
  background: var(--surface-2);
  color: var(--text);
}

body.dark-mode .sidebar-argument.pro {
  border-left-color: #10b981;
}

body.dark-mode .sidebar-argument.con {
  border-left-color: #ef4444;
}

body.dark-mode .sidebar-argument.neutral {
  border-left-color: #6b7280;
}

body.dark-mode .rebut-quote {
  background: var(--surface-2);
  color: var(--text);
}

body.dark-mode .confirm-card {
  background: var(--surface);
  color: var(--text);
}

body.dark-mode .footer-inner {
  background: var(--surface);
  color: var(--text);
}

body.dark-mode .footer-links a {
  color: var(--muted);
}

body.dark-mode .footer-links a:hover {
  color: var(--blue);
}

/* ---------- 404 Page Specific Styles ---------- */
#message {
  text-align: center;
}
.notfound-code {
  color: var(--blue);
  font-weight: 700;
  font-size: 2.2rem;
  margin: 0 0 8px;
  letter-spacing: 2px;
}
.notfound-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 16px;
}
.notfound-desc {
  color: var(--muted);
  margin: 16px 0 24px;
  font-size: 1rem;
}
.notfound-home {
  margin-top: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(45,126,247,0.10);
  /* Make button a bit larger and more prominent */
  padding: 14px 28px;
  border-radius: 14px;
  display: inline-block;
}
.btn-blue.notfound-home {
  background: var(--blue);
  color: #fff !important;
  border: none;
}
.btn-blue.notfound-home:hover,
.btn-blue.notfound-home:focus {
  background: #2563eb;
  color: #fff !important;
  text-decoration: none;
  outline: none;
  box-shadow: 0 4px 16px rgba(45,126,247,0.18);
}

.notfound-center {
  min-height: calc(100vh - 92px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 64px;
  padding-bottom: 0;
}
@media (max-width: 600px) {
  .notfound-center {
    min-height: calc(100vh - 72px);
    padding-top: 32px;
  }
}

/* ---------- Homepage Hero Styles ---------- */
.homepage-hero {
  background: var(--surface-2);
  padding: 0 0 36px 0;
  border-bottom: 1px solid rgba(16, 24, 40, 0.1);
}
body.dark-mode .homepage-hero {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.homepage-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}
.homepage-title {
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--text);
  letter-spacing: -1px;
}
.homepage-lead {
  font-size: 1.18rem;
  color: var(--muted);
  margin: 0 0 36px 0;
  line-height: 1.7;
}
.homepage-hero-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 28px 32px;
  margin: 0 auto 36px auto;
  max-width: 900px;
}
.homepage-hero-feature {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(16,24,40,0.06);
  padding: 28px 18px 22px 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 210px;
  transition: 
    box-shadow 0.18s,
    transform 0.25s cubic-bezier(.25,.8,.25,1),
    filter 0.18s;
  will-change: transform, box-shadow, filter;
  perspective: 600px;
  cursor: pointer;
}
.homepage-hero-feature:hover,
.homepage-hero-feature:focus-visible {
  box-shadow: 0 12px 36px rgba(45,126,247,0.16), 0 2px 12px rgba(16,24,40,0.06);
  transform: perspective(600px) rotateY(8deg) scale(1.045) translateY(-6px);
  filter: brightness(1.04) saturate(1.08);
  z-index: 2;
}
.homepage-hero-feature:active {
  transform: perspective(600px) rotateY(0deg) scale(0.98) translateY(1px);
  box-shadow: 0 2px 12px rgba(16,24,40,0.06);
  filter: brightness(0.98);
}
@media (hover: none) and (pointer: coarse) {
  .homepage-hero-feature:hover,
  .homepage-hero-feature:focus-visible {
    transform: none;
    box-shadow: 0 2px 12px rgba(16,24,40,0.06);
    filter: none;
  }
}
.homepage-hero-feature-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.hero-icon {
  font-size: 1.35rem;
  width: 1.8em;
  height: 1.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  line-height: 1;
}
.homepage-hero-feature h3 {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0;
  color: var(--blue);
  display: inline;
  position: relative;  /* Add for pseudo-element positioning */
}

/* Add animated underline effect */
.homepage-hero-feature h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--blue) 0%, #60a5fa 100%);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 1px;
}

.homepage-hero-feature:hover h3::after,
.homepage-hero-feature:focus-visible h3::after {
  transform: scaleX(1);
  transform-origin: left;
}

.homepage-hero-feature p {
  font-size: 0.98rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.homepage-cta {
  margin-top: 28px;
}
.homepage-hero-note {
  margin-top: 18px;
  font-size: 0.98rem;
  color: var(--muted);
  background: var(--surface);
  border-radius: 10px;
  display: inline-block;
  padding: 8px 18px;
  box-shadow: 0 1px 6px rgba(16,24,40,0.06);
}
@media (max-width: 900px) {
  .homepage-hero-inner { max-width: 100%; }
  .homepage-hero-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .homepage-hero {
    padding: 0 0 18px 0;
    margin-top: 0;
  }
  .homepage-title {
    font-size: 1.3rem;
  }
  .homepage-hero-inner {
    padding: 0 8px;
  }
  .homepage-hero-grid {
    grid-template-columns: 1fr;
    gap: 18px 0;
  }
  .homepage-hero-feature {
    min-height: 0;
    padding: 18px 10px 14px 10px;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  padding: 40px 0;
  background: var(--surface);
  border-top: 1px solid rgba(16,24,40,0.08);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-logo {
  font-family: "Pacifico", cursive;
  font-size: 1.6rem;
  color: var(--text);
  text-decoration: none;
}

.footer-desc {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 340px;
  line-height: 1.6;
}

.footer-group h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--text);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--blue);
}

.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(16,24,40,0.08);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

body.dark-mode .site-footer {
  border-top-color: rgba(255,255,255,0.04);
}

body.dark-mode .footer-bottom {
  border-top-color: rgba(255,255,255,0.04);
}

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .site-footer {
    padding: 32px 0;
  }
  .footer-bottom {
    margin-top: 32px;
  }
}

/* ---------- Static Pages ---------- */
.static-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px;
}

.static-page h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text);
}

.static-page h2 {
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  color: var(--text);
}

.static-page p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Feature page specific */
.feature-section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(16,24,40,0.1);
}

.feature-section:last-child {
  border-bottom: none;
}

/* FAQ page specific */
.faq-list {
  max-width: 700px;
}

.faq-item {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(16,24,40,0.1);
}

.faq-item:last-child {
  border-bottom: none;
}

body.dark-mode .feature-section,
body.dark-mode .faq-item {
  border-bottom-color: rgba(255,255,255,0.1);
}

/* Return home button */
.return-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.return-home:hover {
  transform: translateX(-4px);
}

.return-home svg {
  width: 18px;
  height: 18px;
}

.return-home:hover {
  transform: translateX(-4px);
}

.return-home svg {
  width: 18px;
  height: 18px;
}
.add-argument-btn {
  background: var(--surface-2);
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 8px;
  margin-top: 4px;
  transition: 
    background 0.18s,
    color 0.18s,
    border-color 0.18s,
    transform 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.add-argument-btn:hover,
.add-argument-btn:focus {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  transform: translateY(-2px) scale(1.03);
  outline: none;
}

/* ---------- Range Slider Styles ---------- */
.range-slider-container {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface-2);
  border-radius: 12px;
}

.slider-container {
  margin: 16px 0;
  padding: 0 12px;
  height: 50px;
  position: relative;
}

#rangeSlider {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: none;
}

.slider-values {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--text);
  text-align: center;
  font-weight: 500;
}

.poi-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Fix dark mode slider styles */
body.dark-mode .range-slider-container {
  background: var(--surface-2);
}

body.dark-mode #rangeSlider {
  filter: brightness(0.8);
}

/* ---------- Speech Timer Styles ---------- */
.speech-timer {
  position: relative;
  margin-top: 20px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 2px solid transparent;
  z-index: 500; /* Ensure it appears above content */
}


.speech-timer::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 4px solid var(--blue);
  border-radius: 12px;
  opacity: 0.3;
  clip-path: polygon(0 0, var(--progress, 0%) 0, var(--progress, 0%) 100%, 0% 100%);
  transition: clip-path 1s linear;
  pointer-events: none;
}

.timer-duration {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
  min-width: 80px;
  flex-shrink: 0;
}

.timer-duration input {
  width: 28px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 1.1rem;
  padding: 0;
  text-align: center;
  -moz-appearance: textfield;
}

.timer-duration input::-webkit-outer-spin-button,
.timer-duration input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.timer-duration span {
  color: var(--text);
  font-size: 1.1rem;
  opacity: 0.5;
  user-select: none;
}

.timer-actions {
  display: flex;
  gap: 12px;
}

.timer-btn {
  background: var(--surface);
  border: none;
  padding: 10px;
  cursor: pointer;
  color: var(--text);
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-btn:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.timer-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.timer-time {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  min-width: 62px;
  flex-shrink: 0;
  text-align: right;
  user-select: none;
}

@media (max-width: 480px) {
  .speech-timer {
    position: relative;
    z-index: 500;
    padding: 12px;
    gap: 8px;  /* Fixed missing semicolon */
    background: var(--surface-2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 2px solid transparent;
  }

  .timer-duration {
    padding: 6px 8px;
    min-width: 70px;
  }
  
  .timer-duration input {
    font-size: 1rem;
    width: 24px;
  }

  .timer-time {
    font-size: 1.1rem;
    min-width: 54px;
  }
  
  .timer-btn {
    padding: 8px;
  }
  
  .timer-btn svg {
    width: 18px;
    height: 18px;
  }


  .timer-time {
    flex: 0 0 auto;
    margin: 0;
    min-width: 52px;
  }
}

/* Short green flash animation */
.speech-timer.flash {
  animation: flash 0.6s ease;
}

@keyframes flash {
  0%   { box-shadow: 0 0 0px #22c55e; }
  50%  { box-shadow: 0 0 20px #22c55e; }
  100% { box-shadow: 0 0 0px #22c55e; }
}

/* Applause animation */
.applause-flash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
  text-align: center;
  padding: 20px 40px;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  will-change: transform, opacity;
}

.applause-flash.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.2);
}

.applause-flash.hide {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

body.dark-mode .applause-flash {
  background: rgba(30, 31, 39, 0.95);
}

/* ---------- Debate Tracker Styles ---------- */
.debate-tracker-container {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface-2);
  border-radius: 12px;
}

.tracker-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.tracker-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tracker-item label {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.tracker-notes {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.tracker-notes:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(45,126,247,0.1);
}

/* Dark mode styles */
body.dark-mode .tracker-notes {
  border-color: rgba(255,255,255,0.1);
}

body.dark-mode .tracker-notes:focus {
  border-color: var(--blue);
}