@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&family=Inter:wght@400;500&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:    #0a0a0a;
  --offblack: #111;
  --surface:  #1a1a1a;
  --border:   #2a2a2a;
  --white:    #f0f0ee;
  --muted:    #555;
  --dimmed:   #444;
  --orange:   #f97316;
  --red:      #ef4444;
  --blue:     #3b82f6;
  --purple:   #7c3aed;
  --green:    #4ade80;
  --yellow:   #fbbf24;
}

html, body {
  min-height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

/* ── Noise + scanline background ── */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Floating question marks ── */
.qs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.q {
  position: absolute;
  font-family: 'Black Ops One', sans-serif;
  color: var(--white);
  opacity: 0;
  animation: floatQ linear infinite;
  user-select: none;
}

@keyframes floatQ {
  0%   { transform: translateY(110vh) rotate(0deg);   opacity: 0; }
  5%   { opacity: 0.06; }
  95%  { opacity: 0.03; }
  100% { transform: translateY(-20vh) rotate(360deg); opacity: 0; }
}

/* ── Page wrapper ── */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

/* ── WTFDWD logo mark ── */
.logo {
  font-family: 'Black Ops One', sans-serif;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: 6px;
  cursor: pointer;
  display: inline-block;
  transition: opacity 0.15s;
  user-select: none;
}

.logo:hover { opacity: 0.75; }

/* ── Card ── */
.card {
  background: rgba(26, 26, 26, 0.92);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  height: fit-content;
  backdrop-filter: blur(8px);
}

/* ── Page title inside card ── */
.card-title {
  font-family: 'Black Ops One', sans-serif;
  font-size: clamp(20px, 5vw, 26px);
  letter-spacing: 0.02em;
  color: var(--white);
  margin-bottom: 4px;
  line-height: 1.1;
}

.card-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

/* ── Eyebrow labels ── */
.eyebrow {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.eyebrow.vote   { color: var(--blue); }
.eyebrow.random { color: var(--purple); }
.eyebrow.host   { color: var(--orange); }
.eyebrow.tie    { color: var(--yellow); }

/* ── Section labels ── */
.section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

/* ── Inputs ── */
input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: var(--offblack);
  color: var(--white);
  margin-bottom: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: 'Inter', system-ui, sans-serif;
}

input[type="text"]::placeholder { color: #333; }

input[type="text"]:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px #f9731615;
}

/* ── Primary buttons ── */
.btn {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Black Ops One', sans-serif;
  letter-spacing: 0.06em;
  transition: transform 0.12s, box-shadow 0.15s, opacity 0.15s;
  position: relative;
}

.btn:active  { transform: scale(0.97); }
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
}

.btn-orange {
  background: var(--orange);
  color: var(--black);
}
.btn-orange:hover { box-shadow: 0 0 0 6px #f9731625, 0 0 20px #f9731630; }

.btn-blue {
  background: var(--blue);
  color: white;
}
.btn-blue:hover { box-shadow: 0 0 0 6px #3b82f620; }

.btn-purple {
  background: var(--purple);
  color: white;
}
.btn-purple:hover { box-shadow: 0 0 0 6px #7c3aed20; }

.btn-red {
  background: var(--red);
  color: white;
}
.btn-red:hover { box-shadow: 0 0 0 6px #ef444420; }

/* ── Ghost button ── */
.btn-ghost {
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #1a1a1a;
  color: #aaa;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.1s;
}
.btn-ghost:hover  { border-color: var(--orange); color: var(--orange); background: #1a0d00; }
.btn-ghost:active { transform: scale(0.97); }

/* ── Dashed add button ── */
.btn-dashed {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-bottom: 20px;
  font-family: 'Inter', system-ui, sans-serif;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.1s;
}
.btn-dashed:hover  { border-color: var(--orange); color: var(--orange); background: #1a0d00; }
.btn-dashed:active { transform: scale(0.98); }

/* ── Mode toggle ── */
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.mode-btn {
  padding: 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--offblack);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  text-align: center;
  font-family: 'Inter', system-ui, sans-serif;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.mode-btn:hover  { border-color: #444; color: #aaa; }
.mode-btn:active { transform: scale(0.96); }
.mode-btn.active-vote   { background: #1a0d00; border-color: var(--orange); color: var(--orange); }
.mode-btn.active-random { background: #130d2e; border-color: var(--purple); color: #a78bfa; }

/* ── Idea rows ── */
.idea-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  animation: slideIn 0.18s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.idea-row input { margin-bottom: 0; flex: 1; }

.remove-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.remove-btn:hover  { background: #2a1010; border-color: #7f1d1d; color: var(--red); }
.remove-btn:active { transform: scale(0.92); }

/* ── Tags / status pills ── */
.tag {
  background: var(--offblack);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  font-family: 'Inter', system-ui, sans-serif;
}
.tag.open   { border-color: #166534; color: var(--green);  background: #0a1f12; }
.tag.locked { border-color: #7f1d1d; color: #f87171;       background: #1f0a0a; }
.tag.tie    { border-color: #92400e; color: var(--yellow);  background: #1f1400; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid #1e1e1e; margin: 20px 0; }

/* ── Vote option items ── */
.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--offblack);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s, box-shadow 0.15s;
  user-select: none;
  margin-bottom: 8px;
}
.option-item:hover   { border-color: var(--orange); background: #1a0d00; box-shadow: 0 0 0 3px #f9731610; }
.option-item:active  { transform: scale(0.98); }
.option-item.selected { border-color: var(--orange); background: #1a0d00; }
.option-item.selected .check { background: var(--orange); border-color: var(--orange); }
.option-item.selected .check::after { opacity: 1; }
.option-item.selected .option-label { color: #fdba74; }

.check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #333;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.check::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--black);
  opacity: 0;
  transition: opacity 0.15s;
}

.option-label { font-size: 14px; color: var(--white); flex: 1; }

/* ── Vote bars ── */
.bar-wrap { margin-bottom: 12px; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; color: #aaa; margin-bottom: 5px; }
.bar-label .count { color: var(--muted); font-size: 12px; }
.bar-track { background: #1e1e1e; border-radius: 4px; height: 8px; overflow: hidden; }
.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--blue);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bar-fill.leading { background: var(--orange); }
.bar-fill.tied    { background: var(--yellow); }

/* ── Voter rows ── */
.voter-row {
  background: var(--offblack);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
  animation: slideIn 0.2s ease;
}
.voter-name { color: var(--white); }
.voter-picks { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pick-chip {
  background: #1a0d00;
  border: 1px solid #4a2500;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  color: #fdba74;
}

/* ── Winner boxes ── */
.winner-box {
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
.winner-box.clean-win {
  background: linear-gradient(135deg, #1a0d00, #0f0800);
  border: 1px solid var(--orange);
  box-shadow: 0 0 30px #f9731620;
}
.winner-box.tie-box {
  background: #1a1200;
  border: 1px solid #92400e;
}
.winner-eyebrow {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.clean-win .winner-eyebrow { color: var(--orange); }
.tie-box   .winner-eyebrow { color: var(--yellow); }
.winner-name { font-family: 'Black Ops One', sans-serif; font-size: 26px; color: var(--white); margin-bottom: 4px; letter-spacing: 0.02em; }
.winner-sub  { font-size: 12px; color: var(--muted); }

/* ── Share box ── */
.share-box {
  background: var(--offblack);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  animation: fadeUp 0.3s ease;
  margin-top: 16px;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.share-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.share-url-row { display: flex; gap: 8px; }
.share-url {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  background: var(--black);
  border: 1px solid #1e1e1e;
  border-radius: 6px;
  color: var(--orange);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.copy-btn {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #888;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: border-color 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.copy-btn:hover  { border-color: var(--orange); color: var(--orange); }
.copy-btn:active { transform: scale(0.95); }
.copy-btn.copied { border-color: #166534; color: var(--green); }

/* ── Locked notice ── */
.locked-notice {
  background: #1a0800;
  border: 1px solid #7f3a1d;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #fb923c;
  text-align: center;
  margin-bottom: 16px;
}

/* ── Confirm panel ── */
.confirm-center { text-align: center; padding: 8px 0 20px; }
.confirm-icon  { font-size: 36px; margin-bottom: 10px; }
.confirm-title { font-family: 'Black Ops One', sans-serif; font-size: 20px; color: var(--white); margin-bottom: 6px; letter-spacing: 0.04em; }
.confirm-sub   { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.voted-summary { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.voted-pill {
  background: #1a0d00;
  border: 1px solid #4a2500;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: #fdba74;
  text-align: center;
}
.waiting-msg { font-size: 12px; color: #444; text-align: center; }

/* ── Misc ── */
.loading { text-align: center; padding: 40px 0; color: #444; font-size: 14px; }
.no-votes { text-align: center; color: #444; font-size: 13px; padding: 16px 0; }
.max-hint { font-size: 12px; color: #444; margin-bottom: 20px; min-height: 18px; }
.max-hint.warn { color: var(--yellow); }
.status-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 10px; flex-wrap: wrap; }
.refresh-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: border-color 0.15s, color 0.15s, transform 0.1s;
}
.refresh-btn:hover  { border-color: var(--orange); color: var(--orange); }
.refresh-btn:active { transform: scale(0.95); }

/* ── Animations ── */
@keyframes popIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Confetti canvas ── */
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 999;
}