
/* ── Hot Takes components (Fiddleden skin overrides live in skin.css) ── */
:root {
  /* Fiddleden palette (shared /assets/theme.css). Text rule: cream on ink/rose/teal, ink on green/salmon/aqua. */
  --bg:           var(--ink);
  --surface:      #16352A;
  --surface2:     var(--teal);
  --border:       #2B5440;
  --accent:       var(--green);
  --accent-dim:   #A6DB84;
  --text:         var(--cream);
  --muted:        var(--green);
  --agree:        var(--aqua);
  --disagree:     var(--rose);
  --success:      var(--green);
  --warning:      var(--salmon);
  --radius:       18px;
  --radius-lg:    28px;
  --shadow:       0 4px 24px rgba(0,0,0,0.35);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body { display: flex; flex-direction: column; }

/* ── Typography ── */
.display { font-family: var(--font-display); letter-spacing: 0.02em; }
h1 { font-family: var(--font-display); font-size: clamp(2.5rem, 8vw, 6rem); line-height: 1; }
h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 3.5rem); line-height: 1.1; }
h3 { font-family: var(--font-display); font-size: clamp(1.2rem, 3vw, 2rem); }

/* ── Layout helpers ── */
.fill  { flex: 1; display: flex; flex-direction: column; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row   { display: flex; align-items: center; gap: 0.75rem; }
.center { display: flex; align-items: center; justify-content: center; }
.wrap  { flex-wrap: wrap; }
.grow  { flex: 1; }

/* ── Surfaces ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card-lg {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

/* ── Buttons ── */
.btn {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  padding: 0.7rem 1.8rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-lg { font-size: 2rem; padding: 1rem 2.5rem; }
.btn-xl { font-size: 2.5rem; padding: 1.25rem 3rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Form elements ── */
input[type="text"], input[type="number"], select, textarea {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.1rem;
  padding: 0.75rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}
input::placeholder { color: var(--muted); }
label { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.25rem; display: block; }

/* ── Toggle switch ── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; }
.toggle { position: relative; width: 52px; height: 28px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 999px;
  transition: 0.2s;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 4px; top: 4px;
  background: var(--muted);
  border-radius: 50%;
  transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(24px); background: #fff; }

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.2rem 0.65rem;
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
}
.badge-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.badge-warn { background: var(--warning); border-color: var(--warning); color: #000; }

/* ── Emoji avatar ── */
.avatar {
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.avatar-lg { width: 4rem; height: 4rem; font-size: 2.2rem; }
.avatar-xl { width: 5.5rem; height: 5.5rem; font-size: 3rem; }

/* ── Timer bar ── */
.timer-bar-wrap {
  height: 6px; background: var(--border); border-radius: 999px; overflow: hidden;
}
.timer-bar {
  height: 100%; background: var(--accent); border-radius: 999px;
  transition: width 1s linear, background 0.5s;
}
.timer-bar.warning { background: var(--warning); }
.timer-bar.danger  { background: #ef4444; }

/* ── Animations ── */
@keyframes popIn {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

.pop-in   { animation: popIn   0.25s ease forwards; }
.slide-up { animation: slideUp 0.3s ease forwards; }
.fade-in  { animation: fadeIn  0.3s ease forwards; }

/* ── Screen system ── */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.hidden { display: none !important; }
.screen.hidden { display: none !important; }

/* ── Scrollable panels ── */
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { width: 4px; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 0.75rem 0; }

/* ── Muted text ── */
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ── Confetti canvas ── */
#confetti-canvas {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
}

/* ── Host-specific large display ── */
.host-prompt {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1.1;
  text-align: center;
}

/* ── Player phone-specific ── */
.phone-btn {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.05em;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  display: flex; align-items: center; justify-content: center;
}
.phone-btn:active { transform: scale(0.94); }
.phone-btn-agree { background: var(--agree); color: #fff; }
.phone-btn-disagree { background: var(--disagree); color: var(--text); border: 2px solid var(--border); }

/* ── Slider ── */
.slider-wrap { padding: 0.5rem 0; }
input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
  box-shadow: 0 0 0 4px rgba(0,232,252,0.3);
}
input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.2); }

/* ── 2D Grid canvas ── */
.grid-2d-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  touch-action: none;
}
#grid2d {
  width: 100%; height: 100%;
  cursor: crosshair;
}

/* ── Axis labels drawn on the 2D graph at the end of each axis ── */
.axis-tag {
  position: absolute;
  z-index: 2;
  max-width: 42%;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(14,14,14,0.85);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}
.axis-tag.top    { top: 6px;    left: 50%; transform: translateX(-50%); }
.axis-tag.bottom { bottom: 6px; left: 50%; transform: translateX(-50%); }
.axis-tag.left   { left: 6px;   top: 50%;  transform: translateY(-50%); max-width: 30%; }
.axis-tag.right  { right: 6px;  top: 50%;  transform: translateY(-50%); max-width: 30%; }
.axis-tag.top::before    { content: '↑ '; color: var(--accent); }
.axis-tag.bottom::before { content: '↓ '; color: var(--accent); }
.axis-tag.left::before   { content: '← '; color: var(--accent); }
.axis-tag.right::after   { content: ' →'; color: var(--accent); }

/* ── Reveal bar ── */
.reveal-bar-wrap {
  position: relative;
  height: 80px;
  background: linear-gradient(to right, var(--disagree) 0%, var(--agree) 100%);
  border-radius: var(--radius-lg);
  overflow: visible;
  margin: 2rem 0;
}
.reveal-emoji {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0);
  font-size: 1.8rem;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  text-align: center;
}
.reveal-emoji.shown { transform: translateY(-50%) scale(1); }

/* ── Leaderboard ── */
.lb-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.lb-rank { font-family: var(--font-display); font-size: 1.4rem; min-width: 2rem; color: var(--muted); }
.lb-rank.gold   { color: #FFD700; }
.lb-rank.silver { color: #C0C0C0; }
.lb-rank.bronze { color: #CD7F32; }
.lb-score { font-family: var(--font-display); font-size: 1.5rem; margin-left: auto; }
.lb-delta { font-size: 0.85rem; color: var(--success); font-weight: 600; }
.lb-delta.zero { color: var(--muted); }
