@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

:root {
  --bg: #080808;
  --bg2: #0e0e0e;
  --bg3: #141414;
  --border: #1e1e1e;
  --border2: #2a2a2a;
  --gold: #c9a84c;
  --gold2: #e8c97a;
  --red: #c0392b;
  --green: #27ae60;
  --text: #e8e0d0;
  --text2: #a09080;
  --text3: #5a5048;

  /* spacing scale — easier to tweak on mobile */
  --page-pad: clamp(1rem, 4vw, 2.5rem);
}

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

.bi {
  vertical-align: -0.125em;
  fill: currentColor;
  display: inline-block;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  min-height: 100vh;
  font-size: clamp(16px, 2.5vw, 18px);
  line-height: 1.6;
  /* prevent horizontal scroll on mobile */
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
  opacity: 0.4;
}

.hidden { display: none !important; }

/* ── NOTIFICATION DOT ── */
.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #f87171;
  border-radius: 50%;
  border: 2px solid var(--bg);
}

/* ── DAILY BONUS / DIFFICULTY ── */
.difficulty-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.1em;
  font-weight: bold;
}

.daily-bonus {
  background: var(--gold);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  margin: 1rem 0;
  text-align: center;
  letter-spacing: 0.05em;
}

/* ── ACHIEVEMENTS ── */
.achievements {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.achievement-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  font-size: 1.2rem;
  cursor: help;
  transition: transform 0.2s;
}
.achievement-badge:hover { transform: scale(1.1); }

/* ── TYPOGRAPHY ── */
h1, h2, h3, .rank-badge, .verdict-title {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.05em;
}

/* ── NAV ── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem var(--page-pad);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10001;
  gap: 0.8rem;
}

.logo {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-shadow: 0 0 30px rgba(201,168,76,0.3);
  white-space: nowrap;
}

.logo-small {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.logo-small .bi { font-size: 1.2em; }

/* Nav right: on mobile, collapse into a horizontal scroll row */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text2);
  font-family: 'Crimson Pro', serif;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 1;
  min-width: 0;
}
.nav-right::-webkit-scrollbar { display: none; }

/* ── BUTTONS ── */
.btn-primary {
  padding: 0.65rem 1.4rem;
  background: var(--gold);
  color: #080808;
  border: none;
  border-radius: 3px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  white-space: nowrap;
  /* larger touch target */
  min-height: 44px;
}
.btn-primary:hover {
  background: var(--gold2);
  box-shadow: 0 0 20px rgba(201,168,76,0.3);
}
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  padding: 0.55rem 1rem;
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: 3px;
  cursor: pointer;
  font-family: 'Crimson Pro', serif;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 44px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text3); }
.btn-ghost:active { transform: scale(0.97); }

.btn-primary .bi, .btn-ghost .bi { margin-right: 0.3rem; }

/* ── SCREEN BASE ── */
.screen { min-height: 100vh; }

/* ── LOGIN ── */
.login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1.2rem;
  padding: 2rem var(--page-pad);
  background: radial-gradient(ellipse at 50% 40%, #1a1208 0%, var(--bg) 70%);
  text-align: center;
}

.login-box .logo {
  font-size: clamp(2.5rem, 10vw, 4rem);
  margin-bottom: 0.5rem;
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 20px rgba(201,168,76,0.2); }
  to   { text-shadow: 0 0 50px rgba(201,168,76,0.6), 0 0 100px rgba(201,168,76,0.2); }
}

.tagline {
  color: var(--text3);
  font-style: italic;
  font-size: clamp(0.95rem, 3vw, 1.1rem);
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

/* ── FRIENDS ── */
.friends-content {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 var(--page-pad);
}
.friends-content h2 { margin-bottom: 1.5rem; }

.search-box {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.search-box input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 1rem;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 3px;
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
}
.search-box input:focus { outline: none; border-color: var(--gold); }

.search-result {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}
.friend-item:last-child { border-bottom: none; }
.friend-info { display: flex; flex-direction: column; gap: 0.2rem; }
.friend-name { font-family: 'Cinzel', serif; font-size: 0.9rem; }
.friend-rank { color: var(--gold); font-size: 0.75rem; }
.friend-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.friends-list {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-top: 1rem;
}

.pending-section { margin-bottom: 1rem; }
.pending-title {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text3);
  margin-bottom: 0.5rem;
}

.btn-small {
  padding: 0.4rem 0.9rem;
  font-size: 0.75rem;
  border-radius: 3px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.08em;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  transition: all 0.2s;
  min-height: 36px;
}
.btn-small.accept  { border-color: var(--green); color: #4ade80; }
.btn-small.accept:hover  { background: rgba(39,174,96,0.1); }
.btn-small.decline { border-color: var(--red); color: #f87171; }
.btn-small.decline:hover { background: rgba(192,57,43,0.1); }
.btn-small.challenge { border-color: var(--gold); color: var(--gold); }
.btn-small.challenge:hover { background: rgba(201,168,76,0.1); }

/* ── LEADERBOARD & HISTORY ── */
.lb-content {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 var(--page-pad);
}
.lb-content h2 { margin-bottom: 0.4rem; }

.lb-list {
  margin-top: 1.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.lb-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.lb-item:last-child { border-bottom: none; }
.lb-item:hover, .lb-item:active { background: var(--bg3); }

.lb-position {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--text3);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.lb-position.gold   { color: var(--gold); font-weight: 700; font-size: 1rem; }
.lb-position.silver { color: #aaa; font-weight: 700; }
.lb-position.bronze { color: #cd7f32; font-weight: 700; }
.lb-info { flex: 1; display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.lb-name { font-family: 'Cinzel', serif; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-rank-label { color: var(--gold); font-size: 0.7rem; }
.lb-points { font-family: 'Cinzel', serif; font-size: 1rem; color: var(--text); font-weight: 700; }
.lb-pts-label { color: var(--text3); font-size: 0.7rem; text-align: right; }

/* ── LOBBY ── */
.lobby-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  transition: background 0.2s;
  flex-wrap: wrap;
}
.lobby-item:hover  { background: var(--bg3); }
.lobby-item:last-child { border-bottom: none; }
.lobby-topic { font-size: 0.95rem; margin-bottom: 0.3rem; }
.lobby-meta  { color: var(--text3); font-size: 0.8rem; font-style: italic; }
.lobby-mode {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border2);
  border-radius: 20px;
  color: var(--text2);
}

/* lobby controls row */
.lobby-controls { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.lobby-controls .btn-primary { flex: 1; min-width: 140px; justify-content: center; }

/* ── HOME ── */
.home-content {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 var(--page-pad);
}

.home-content h2 {
  font-size: clamp(1.4rem, 5vw, 2rem);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.subtitle {
  color: var(--text2);
  font-style: italic;
  margin-bottom: 2rem;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  letter-spacing: 0.02em;
}

.custom-topic {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.custom-topic input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1.2rem;
  background: var(--bg3);
  color: var(--text);
  border: 2px solid var(--border2);
  border-radius: 4px;
  font-size: 1rem;
  font-family: 'Crimson Pro', serif;
  transition: all 0.3s;
}
.custom-topic input::placeholder { color: var(--text3); font-style: italic; }
.custom-topic input:focus { outline: none; border-color: var(--gold); background: var(--bg2); }
.custom-topic .btn-primary { flex-shrink: 0; }

/* Topic grid */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.topic-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.5rem;
  transition: all 0.3s;
}
.topic-card:hover,
.topic-card:focus-within { background: var(--bg3); border-color: var(--gold); box-shadow: 0 0 15px rgba(201,168,76,0.1); }

.topic-card h3 {
  font-family: 'Crimson Pro', serif;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1.2rem;
  color: var(--text);
  line-height: 1.6;
}

.side-btns { display: flex; gap: 0.5rem; }
.side-btn {
  flex: 1;
  padding: 0.65rem 0.5rem;
  border: 1px solid var(--border2);
  border-radius: 3px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: clamp(0.65rem, 2vw, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: all 0.2s;
  min-height: 44px;
}
.side-btn.for:hover,
.side-btn.for:active    { background: rgba(39,174,96,0.15); border-color: var(--green); color: #4ade80; }
.side-btn.against:hover,
.side-btn.against:active { background: rgba(192,57,43,0.15); border-color: var(--red); color: #f87171; }

/* ── MODE SELECT ── */
.mode-content {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 var(--page-pad);
}
.mode-content h2 { margin-bottom: 0.4rem; }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.mode-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.8rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.mode-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}
.mode-card[data-mode="chaos"]::before   { background: linear-gradient(90deg, #c0392b, #e74c3c); }
.mode-card[data-mode="bargain"]::before { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.mode-card[data-mode="court"]::before   { background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.mode-card:hover::before  { opacity: 1; }
.mode-card:hover { border-color: var(--border2); transform: translateY(-2px); }

.mode-icon { font-size: 2rem; }
.mode-card h3 { font-size: 1.1rem; }
.mode-card p  { color: var(--text2); font-style: italic; font-size: 0.9rem; line-height: 1.6; flex: 1; }

.mode-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag {
  padding: 0.2rem 0.6rem;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--text3);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.04em;
}

/* ── DEBATE ── */
.debate-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 1rem var(--page-pad) 2rem;
  display: flex;
  flex-direction: column;
  /* on mobile, use available viewport height minus the nav */
  min-height: calc(100vh - 60px);
}

.case-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text2);
  font-style: italic;
}

.side-badge {
  padding: 0.2rem 0.7rem;
  border-radius: 2px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  font-style: normal;
  white-space: nowrap;
}
.side-badge.for     { background: rgba(39,174,96,0.15); color: #4ade80; border: 1px solid rgba(39,174,96,0.3); }
.side-badge.against { background: rgba(192,57,43,0.15); color: #f87171; border: 1px solid rgba(192,57,43,0.3); }

.round-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  font-style: normal;
  white-space: nowrap;
}

/* Timer bar */
.timer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  padding: 0.7rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.mode-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.timer-wrap { display: flex; align-items: baseline; gap: 0.4rem; }
.timer-display {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 900;
  color: var(--text);
  transition: color 0.3s;
  min-width: 2rem;
  text-align: right;
}
.timer-display.urgent { color: #f87171; animation: urgentPulse 0.5s ease-in-out infinite; }
.timer-label { color: var(--text3); font-size: 0.75rem; }

@keyframes urgentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Objection bar */
.objection-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 0.8rem;
}
.btn-objection {
  padding: 0.7rem 2.5rem;
  background: transparent;
  color: #f87171;
  border: 2px solid #c0392b;
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: all 0.2s;
  animation: softPulse 2s ease-in-out infinite;
  min-height: 48px;
  width: 100%;
  max-width: 320px;
}
.btn-objection:hover,
.btn-objection:active {
  background: rgba(192,57,43,0.15);
  box-shadow: 0 0 30px rgba(192,57,43,0.4);
  transform: scale(1.03);
}

@keyframes softPulse {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 1; }
}

.objection-flash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Cinzel', serif;
  font-size: clamp(3rem, 12vw, 5rem);
  font-weight: 900;
  color: #f87171;
  text-shadow: 0 0 60px rgba(192,57,43,0.8);
  z-index: 9999;
  animation: objectionAnim 1.5s ease forwards;
  pointer-events: none;
  text-align: center;
  width: 90%;
}

@keyframes objectionAnim {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  30%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  70%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

/* Chat log */
.chat-log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1rem;
  /* On mobile clamp to 40vh so input is always visible */
  max-height: clamp(35vh, 45vh, 52vh);
  overflow-y: auto;
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.chat-log::-webkit-scrollbar { width: 3px; }
.chat-log::-webkit-scrollbar-track { background: var(--bg); }
.chat-log::-webkit-scrollbar-thumb { background: var(--border2); }

.message {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.7;
  animation: fadeIn 0.3s ease;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}
.message:last-child { border-bottom: none; }
.message.you      { background: rgba(39,174,96,0.04); }
.message.opponent { background: rgba(192,57,43,0.04); }

.message .sender {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}
.message.you .sender      { color: #4ade80; }
.message.opponent .sender { color: #f87171; }
.message.objection .sender { color: #f87171; }

.sender-with-avatar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.opponent-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border2);
  flex-shrink: 0;
}

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

/* Input area */
.input-area { display: flex; flex-direction: column; gap: 0.7rem; }

textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 3px;
  font-size: clamp(0.95rem, 2.5vw, 1rem);
  font-family: 'Crimson Pro', serif;
  resize: vertical;
  min-height: 90px;
  transition: border-color 0.2s;
  /* prevents zoom on iOS when font-size < 16px */
  font-size: max(16px, 1rem);
}
textarea::placeholder { color: var(--text3); font-style: italic; }
textarea:focus { outline: none; border-color: var(--gold); }

.thinking {
  color: var(--text3);
  font-style: italic;
  font-size: 0.9rem;
  padding: 0.8rem 0;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* Evidence section */
.evidence-section {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.5rem;
}
.evidence-label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 0.7rem;
}
.evidence-types { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.evidence-type-btn {
  padding: 0.4rem 0.8rem;
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: 3px;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 36px;
}
.evidence-type-btn:hover,
.evidence-type-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,0.08); }

#evidence-input-wrap { margin-top: 0.4rem; }
#evidence-input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 3px;
  font-family: 'Crimson Pro', serif;
  font-size: max(16px, 1rem);
}
#evidence-input:focus { outline: none; border-color: var(--gold); }
.evidence-type-label { display: block; color: var(--text3); font-size: 0.78rem; font-style: italic; margin-top: 0.3rem; }

.evidence-card {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.8rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 3px;
  font-size: 0.82rem;
  color: var(--gold);
  flex-wrap: wrap;
}
.evidence-verdict {
  margin-top: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: var(--bg3);
  border-left: 2px solid var(--gold);
  font-size: 0.82rem;
  color: var(--text2);
  font-style: italic;
}

/* ── VERDICT ── */
.verdict-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2.5rem var(--page-pad);
  text-align: center;
  background: radial-gradient(ellipse at 50% 30%, #1a0808 0%, var(--bg) 65%);
  gap: 1.2rem;
}

.judge-image-section { text-align: center; }
.judge-image {
  max-width: clamp(120px, 40vw, 200px);
  max-height: 250px;
  border-radius: 8px;
  border: 2px solid var(--gold);
  object-fit: cover;
  box-shadow: 0 0 20px rgba(201,168,76,0.3);
}

.verdict-title {
  font-size: clamp(2rem, 9vw, 3.5rem);
  font-weight: 900;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(201,168,76,0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

.verdict-eyebrow {
  color: var(--text3);
  font-style: italic;
  font-size: clamp(0.8rem, 2.5vw, 0.95rem);
  letter-spacing: 0.15em;
}

.verdict-text {
  max-width: 580px;
  width: 100%;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  line-height: 1.9;
  color: var(--text2);
  padding: 1.5rem var(--page-pad);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 3px;
  font-style: italic;
  position: relative;
  text-align: left;
}
.verdict-text::before {
  content: '"';
  font-family: 'Cinzel', serif;
  font-size: 3.5rem;
  color: var(--gold);
  opacity: 0.2;
  position: absolute;
  top: -0.8rem;
  left: 0.8rem;
  line-height: 1;
}

.result-badge {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.6rem 1.5rem;
  border-radius: 2px;
  text-align: center;
}
.result-badge.win  { background: rgba(39,174,96,0.1);  color: #4ade80; border: 1px solid rgba(39,174,96,0.3); }
.result-badge.loss { background: rgba(192,57,43,0.1); color: #f87171; border: 1px solid rgba(192,57,43,0.3); }

/* ── MULTIPLAYER ── */
.mp-content {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 var(--page-pad);
}
.mp-options {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.mp-card {
  flex: 1;
  min-width: 260px;
  max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  transition: all 0.3s;
}
.mp-card:hover { border-color: var(--gold); box-shadow: 0 0 15px rgba(201,168,76,0.1); }
.mp-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--gold); }
.mp-card p  { color: var(--text2); font-size: 0.9rem; font-style: italic; }
.mp-card input {
  padding: 0.8rem 1rem;
  background: var(--bg3);
  color: var(--text);
  border: 2px solid var(--border2);
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  transition: all 0.3s;
  /* prevents iOS zoom */
  font-size: max(16px, 1rem);
}
.mp-card input:focus { outline: none; border-color: var(--gold); background: var(--bg2); }
.mp-card select {
  padding: 0.8rem 1rem;
  background: var(--bg3);
  color: var(--text);
  border: 2px solid var(--border2);
  border-radius: 4px;
  font-family: 'Crimson Pro', serif;
  font-size: max(16px, 0.95rem);
  cursor: pointer;
  transition: all 0.3s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c9a84c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  width: 100%;
}
.mp-card select:focus { outline: none; border-color: var(--gold); background-color: var(--bg2); }
.mp-divider {
  color: var(--text3);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  align-self: center;
  padding: 0 1rem;
}

/* ── WAITING ── */
.waiting-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1.5rem;
  text-align: center;
  padding: 2rem var(--page-pad);
}
.waiting-box h2 { font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 700; }

.room-code-display {
  background: var(--bg3);
  border: 2px solid var(--gold);
  border-radius: 5px;
  padding: 1.5rem 2.5rem;
  margin: 1rem 0;
  box-shadow: 0 0 20px rgba(201,168,76,0.15);
}
.room-code-display p {
  color: var(--text3);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  margin-bottom: 0.8rem;
  font-weight: 600;
}
.room-code-display span {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.2rem, 10vw, 3.5rem);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.4em;
  display: block;
}
.waiting-dots { font-size: 2rem; animation: pulse 1.5s ease-in-out infinite; }

/* ── COURT TIME MODAL ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  backdrop-filter: blur(4px);
  padding: var(--page-pad);
}
.modal.hidden { display: none; }
.modal-content {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  animation: slideUp 0.3s ease;
}
.modal-content h2 { margin-bottom: 0.5rem; font-size: clamp(1.2rem, 4vw, 1.5rem); }
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── CHALLENGE BANNER ── */
.challenge-banner {
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  z-index: 999;
  animation: slideIn 0.3s ease;
  max-width: calc(100vw - 2rem);
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(100px); }
  to   { opacity: 1; transform: translateX(0); }
}
.challenge-banner-inner {
  background: var(--bg2);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  max-width: 320px;
  box-shadow: 0 0 30px rgba(201,168,76,0.2);
}
.challenge-banner-inner p { color: var(--text); line-height: 1.5; font-size: 0.95rem; }

/* ── PROFILE / STATS ── */
.profile-content {
  display: flex;
  gap: 2.5rem;
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 var(--page-pad);
  align-items: flex-start;
}

.profile-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 200px;
}

.avatar-display {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--bg2);
  border: 2px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  margin-bottom: 1rem;
  position: relative;
}
.avatar-display::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), transparent 60%);
  z-index: -1;
  opacity: 0.5;
}

.profile-display-name { font-size: clamp(1.1rem, 3vw, 1.3rem); margin-bottom: 0.2rem; }
.profile-username { color: var(--text3); font-size: 0.82rem; font-style: italic; margin-bottom: 0.4rem; }
.profile-bio {
  color: var(--text2);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 0.8rem;
  max-width: 200px;
  line-height: 1.5;
}

.rank-badge { color: var(--gold); font-size: 0.78rem; letter-spacing: 0.18em; margin-bottom: 2rem; opacity: 0.9; }

.profile-right { flex: 1; min-width: 0; }
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 1.5rem;
}
.stat-box {
  background: var(--bg2);
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.stat-box span { font-family: 'Cinzel', serif; font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 700; }
.stat-box label { color: var(--text3); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* Edit form */
.edit-form {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.2rem;
}
.edit-section-title {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--text3);
  margin-bottom: 0.5rem;
}
.edit-form input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 3px;
  font-family: 'Crimson Pro', serif;
  font-size: max(16px, 1rem);
}
.edit-form input:focus { outline: none; border-color: var(--gold); }

.avatar-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.avatar-opt {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s;
}
.avatar-opt:hover, .avatar-opt.selected {
  border-color: var(--gold);
  background: rgba(201,168,76,0.1);
  transform: scale(1.08);
}

.gender-select { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.gender-btn {
  padding: 0.4rem 0.9rem;
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: 3px;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 36px;
}
.gender-btn:hover, .gender-btn.selected {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}

/* Image upload */
.image-upload-section {
  background: var(--bg3);
  border: 2px dashed var(--border2);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}
.upload-label { display: block; color: var(--text2); font-size: 0.88rem; margin-bottom: 0.7rem; }
.upload-preview {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  justify-content: center;
  padding: 0.7rem;
  background: rgba(201,168,76,0.08);
  border-radius: 4px;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}
.upload-preview img { border: 1px solid var(--border2); }

/* objection input */
.message.objection {
  background: rgba(192,57,43,0.08);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1.2rem;
}

/* ══════════════════════════════════════════
   MOBILE BREAKPOINTS
   ══════════════════════════════════════════ */

/* ── Tablet / small laptop (≤ 900px) ── */
@media (max-width: 900px) {
  .profile-content {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  .profile-left { width: 100%; }
  .profile-right { width: 100%; }
}

/* ── Mobile (≤ 640px) ── */
@media (max-width: 640px) {
  /* Nav: logo left, scrollable buttons right */
  nav {
    padding: 0.7rem 1rem;
    gap: 0.5rem;
  }
  .nav-right {
    gap: 0.4rem;
    font-size: 0.8rem;
    /* let buttons shrink text a bit on very small screens */
  }
  .nav-right .btn-ghost {
    padding: 0.45rem 0.7rem;
    font-size: 0.75rem;
    min-height: 38px;
  }
  #user-name { display: none; } /* hide the name text, saves space */

  /* home */
  .home-content { padding: 0 1rem; margin: 1.2rem auto; }
  .topic-grid { grid-template-columns: 1fr; }
  .custom-topic { flex-direction: column; }
  .custom-topic .btn-primary { width: 100%; }

  /* mode select — stack all cards */
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { padding: 1.4rem 1.2rem; }

  /* debate */
  .debate-content { padding: 0.7rem 1rem 1rem; }
  .case-header { gap: 0.5rem; font-size: 0.8rem; }
  .chat-log { max-height: 38vh; }
  .btn-objection { padding: 0.65rem 1.5rem; font-size: 0.9rem; }

  /* mp */
  .mp-options { flex-direction: column; gap: 1rem; }
  .mp-card { min-width: 100%; max-width: 100%; padding: 1.4rem 1.2rem; }
  .mp-divider { padding: 0.2rem 0; }

  /* lb / history */
  .lb-content { padding: 0 1rem; }
  .lb-item { padding: 0.9rem 1rem; gap: 0.7rem; }
  .lb-name { font-size: 0.8rem; }

  /* lobby */
  .lobby-item { padding: 0.9rem 1rem; }
  .lobby-controls { flex-direction: column; }
  .lobby-controls .btn-primary { width: 100%; }

  /* friends */
  .friends-content { padding: 0 1rem; }
  .friend-item { flex-direction: column; align-items: flex-start; gap: 0.7rem; }
  .friend-actions { width: 100%; justify-content: flex-end; }

  /* verdict */
  .verdict-box { padding: 2rem 1rem; gap: 1rem; }
  .verdict-text { padding: 1.2rem 1rem; }

  /* profile */
  .profile-content { padding: 0 1rem; margin: 1.2rem auto; }
  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-box { padding: 1rem 0.7rem; }

  /* challenge banner — full width on mobile */
  .challenge-banner { right: 0.5rem; left: 0.5rem; }
  .challenge-banner-inner { max-width: 100%; }

  /* modal */
  .modal-content { padding: 1.5rem 1.2rem; }

  /* waiting */
  .room-code-display { padding: 1.2rem 1.5rem; }
}

/* ── Very small phones (≤ 375px) ── */
@media (max-width: 375px) {
  .logo-small { font-size: 0.85rem; letter-spacing: 0.05em; }
  .nav-right .btn-ghost { padding: 0.4rem 0.55rem; font-size: 0.7rem; }
  .side-btn { font-size: 0.6rem; letter-spacing: 0.05em; }
  .timer-display { font-size: 1.4rem; }
  .verdict-title { font-size: 1.8rem; letter-spacing: 0.15em; }
}

/* ── FORFEIT / ABORT BUTTON ── */
.btn-abort {
  padding: 0.55rem 1rem;
  background: transparent;
  color: #f87171;
  border: 1px solid #c0392b;
  border-radius: 3px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: clamp(0.7rem, 2vw, 0.8rem);
  letter-spacing: 0.08em;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 44px;
}
.btn-abort:hover, .btn-abort:active {
  background: rgba(192,57,43,0.15);
  box-shadow: 0 0 12px rgba(192,57,43,0.3);
}

/* ── KO-FI DONATE BUTTON ── */
.btn-donate {
  text-decoration: none;
  color: var(--text2) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.btn-donate:hover {
  color: #ff914d !important;
  border-color: #ff914d !important;
}
.btn-donate .bi { color: inherit; }

/* Ko-fi link on verdict screen */
.btn-kofi {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  background: transparent;
  color: #ff914d;
  border: 1px solid #ff914d;
  border-radius: 3px;
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}
.btn-kofi:hover {
  background: rgba(255,145,77,0.1);
  box-shadow: 0 0 15px rgba(255,145,77,0.25);
}

/* ── SUGGESTION PANEL ── */
.suggestion-panel {
  margin-top: 3rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg2);
  overflow: hidden;
}

.suggestion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  transition: background 0.2s;
  user-select: none;
}
.suggestion-header:hover { background: var(--bg3); }
.suggestion-header .bi-lightbulb-fill { margin-right: 0.5rem; }

.suggestion-chevron {
  transition: transform 0.25s ease;
  font-size: 0.9rem;
  color: var(--text3);
}

.suggestion-body {
  padding: 1.2rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Tabs */
.suggestion-tabs {
  display: flex;
  gap: 0.5rem;
}
.suggestion-tab {
  padding: 0.4rem 1rem;
  background: transparent;
  color: var(--text3);
  border: 1px solid var(--border2);
  border-radius: 20px;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 36px;
}
.suggestion-tab:hover { color: var(--text2); border-color: var(--text3); }
.suggestion-tab.active {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
}

/* Textarea */
.suggestion-body textarea {
  min-height: 90px;
  resize: vertical;
  font-size: max(16px, 0.95rem);
}

/* Footer row */
.suggestion-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.suggestion-count {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: var(--text3);
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

/* Recent submissions list */
.suggestion-list-title {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--text3);
  margin-bottom: 0.7rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.suggestion-item {
  padding: 0.9rem 1rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 0.6rem;
  transition: border-color 0.2s;
}
.suggestion-item:last-child { margin-bottom: 0; }
.suggestion-item:hover { border-color: var(--border2); }

.suggestion-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.suggestion-item-user {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: var(--text2);
  letter-spacing: 0.05em;
}
.suggestion-item-date {
  font-size: 0.72rem;
  color: var(--text3);
  margin-left: auto;
  font-style: italic;
}
.suggestion-item-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .suggestion-header { padding: 0.9rem 1rem; }
  .suggestion-body { padding: 1rem; }
  .suggestion-footer { flex-wrap: wrap; }
  .suggestion-footer .btn-primary { width: 100%; justify-content: center; }
  .suggestion-tabs { flex-wrap: wrap; }
}
