:root {
  --bg: #12121A;
  --surface: #1C1C28;
  --surface-raised: #242433;
  --border: #33333F;
  --paper: #F5F1E8;
  --paper-dim: #B8B3A6;
  --amber: #FFB627;
  --red: #E94F4F;
  --mint: #4FD1A5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: 'Inter', sans-serif;
  padding: 32px 20px 90px;
}

.ff-display { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.04em; }
.ff-body { font-family: 'Inter', sans-serif; }
.ff-mono { font-family: 'JetBrains Mono', monospace; }

/* ---------- Header ---------- */
.header {
  max-width: 960px;
  margin: 0 auto 36px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.logo { font-size: 34px; color: var(--amber); }
.status { font-size: 11px; color: var(--paper-dim); letter-spacing: 1px; }

/* ---------- Layout ---------- */
.layout {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
}
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
}

.panel, .stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.label {
  font-size: 11px;
  color: var(--paper-dim);
  letter-spacing: 1px;
  margin: 18px 0 10px;
}
.panel > .label:first-child { margin-top: 0; }

/* ---------- Add option ---------- */
.add-row { display: flex; gap: 8px; margin-bottom: 8px; }
.add-row input {
  flex: 1;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--paper);
  font-size: 14px;
  outline: none;
  font-family: 'Inter', sans-serif;
}
.icon-btn {
  background: var(--amber);
  border: none;
  border-radius: 6px;
  width: 38px;
  font-size: 20px;
  line-height: 1;
  color: var(--bg);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.error-text { font-size: 11px; color: var(--red); margin-bottom: 8px; font-family: 'JetBrains Mono', monospace; }

/* ---------- Options list ---------- */
.options-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface-raised);
}
.option-row .dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.option-row .name {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.option-row .left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.option-row .remove-btn {
  background: none; border: none; cursor: pointer; opacity: 0.5; flex-shrink: 0;
  color: var(--paper-dim); font-size: 14px; padding: 2px 4px;
}

.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ---------- Timer ---------- */
.timer-row { display: flex; align-items: center; gap: 10px; }
.timer-row input[type="range"] { flex: 1; accent-color: var(--amber); }
.timer-value { font-size: 13px; color: var(--amber); width: 34px; }

/* ---------- Segmented toggles ---------- */
.segmented { display: flex; gap: 6px; }
.seg-btn {
  flex: 1;
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--paper-dim);
  font-family: 'Inter', sans-serif;
}
.segmented .seg-btn.active {
  border-color: var(--amber);
  background: rgba(255,182,39,0.12);
  color: var(--amber);
}
.segmented-mint .seg-btn.active {
  border-color: var(--mint);
  background: rgba(79,209,165,0.12);
  color: var(--mint);
}
.hint-text { font-size: 10.5px; color: var(--paper-dim); margin-top: 8px; line-height: 1.4; }

/* ---------- Stage ---------- */
.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 460px;
  position: relative;
  padding: 24px;
}

/* wheel */
.wheel-stage { position: relative; width: 340px; height: 340px; }
.pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  z-index: 2; width: 0; height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid var(--paper);
}
.wheel-disc {
  width: 340px; height: 340px; border-radius: 50%;
  border: 6px solid var(--surface-raised);
  box-shadow: 0 0 0 2px var(--border);
  position: relative;
}
.wheel-label {
  position: absolute; top: 50%; left: 50%;
  text-align: center;
  color: var(--bg);
  font-weight: 600;
  line-height: 1.1;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--amber);
  border: 4px solid var(--bg);
  z-index: 2;
}

/* ribbon */
.ribbon-stage {
  width: 100%; position: relative; height: 120px; overflow: hidden;
  background: var(--surface-raised); border-radius: 8px; border: 1px solid var(--border);
}
.ribbon-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--amber); z-index: 2; }
.ribbon-track { position: absolute; top: 50%; left: 50%; display: flex; gap: 8px; }
.ribbon-chip {
  width: 152px; height: 76px; border-radius: 6px; color: var(--bg);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 13px; font-weight: 600; padding: 0 10px; flex-shrink: 0;
}

/* spin button + result */
.spin-btn {
  margin-top: 28px; font-size: 22px; padding: 12px 40px; border-radius: 8px;
  border: none; cursor: pointer; background: var(--amber); color: var(--bg);
  letter-spacing: 2px;
}
.spin-btn:disabled { cursor: default; background: var(--surface-raised); color: var(--paper-dim); }

.winner-block { margin-top: 16px; text-align: center; }
.winner-label { font-size: 11px; letter-spacing: 1px; color: var(--paper-dim); }
.winner-name { font-size: 26px; color: var(--mint); }
.winner-label.eliminated, .winner-name.eliminated { color: var(--red); }

/* elimination history */
.elimination-panel { margin-top: 20px; width: 100%; max-width: 340px; }
.elimination-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.elimination-head span { font-size: 10.5px; color: var(--paper-dim); letter-spacing: 1px; }
.reset-btn { background: none; border: none; cursor: pointer; color: var(--paper-dim); font-size: 10.5px; }
.elimination-list { display: flex; flex-direction: column; gap: 4px; }
.elimination-row { font-size: 11.5px; color: var(--paper-dim); display: flex; gap: 8px; }
.elimination-row .idx { color: var(--red); width: 16px; }

/* ---------- Footer bits ---------- */
.version {
  max-width: 960px; margin: 16px auto 0; font-size: 10.5px;
  color: var(--paper-dim); opacity: 0.5; text-align: right;
}
.connection-error {
  max-width: 960px; margin: 16px auto 0; font-size: 12px; color: var(--red);
  background: rgba(233,79,79,0.1); border: 1px solid var(--red); border-radius: 8px;
  padding: 10px 14px;
}
.session-badge {
  position: fixed; bottom: 14px; right: 16px; font-size: 10.5px;
  color: var(--paper-dim); background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px; opacity: 0.75; user-select: all;
}
