:root {
  --bg: #1b1410;
  --bg-2: #261a12;
  --card: #2e2018;
  --card-2: #38271c;
  --line: #4a3526;
  --text: #f7ede2;
  --muted: #c9a98f;
  --accent: #ff7a3d;
  --accent-2: #ffb04a;
  --good: #6fd08c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 80% -10%, #4a2a17 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 110%, #3a1f3a 0%, transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); }

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.brand .logo { font-size: 26px; }
.brand a { color: var(--text); text-decoration: none; }

/* ---------- Landing ---------- */
.hero {
  text-align: center;
  padding: 48px 0 12px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.02;
  margin: 22px 0 10px;
  letter-spacing: -0.03em;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  color: var(--muted);
  font-size: clamp(16px, 2.4vw, 20px);
  max-width: 560px;
  margin: 0 auto 30px;
}

.create-card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  max-width: 460px;
  margin: 0 auto;
  text-align: left;
}
.create-card label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #20150e;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 61, 0.18);
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  transition: transform .08s ease, filter .15s ease, opacity .15s;
}
button:active { transform: translateY(1px) scale(0.99); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #2a1408;
  padding: 14px 22px;
  font-size: 16px;
  box-shadow: 0 10px 24px rgba(255, 122, 61, 0.35);
}
.btn-primary.big { width: 100%; margin-top: 14px; padding: 16px; font-size: 17px; }

.btn-ghost {
  background: #00000022;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 16px;
  font-size: 14px;
}
.btn-ghost:hover { filter: brightness(1.15); }

.steps {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 44px;
  color: var(--muted);
  font-size: 14px;
}
.steps .step {
  background: #ffffff08;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 220px;
}
.steps .step b { color: var(--text); }

/* ---------- Room ---------- */
.room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 8px;
  flex-wrap: wrap;
}
.room-title { font-size: clamp(24px, 4vw, 34px); margin: 0; letter-spacing: -0.02em; }
.role-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.role-pill.host { color: var(--accent-2); border-color: #6e4524; background: #ffb04a14; }

.share {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #00000026;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 8px 8px 8px 14px;
  margin: 6px 0 24px;
}
.share .url {
  flex: 1;
  font-size: 14px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 360px;
  gap: 26px;
  align-items: start;
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wheel-wrap {
  position: relative;
  width: min(440px, 86vw);
  aspect-ratio: 1;
}
canvas#wheel {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.5));
}
.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
  border-top: 30px solid var(--accent);
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.5));
  z-index: 3;
}

.controls {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-spin {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #2a1408;
  padding: 16px 40px;
  font-size: 20px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(255, 122, 61, 0.4);
}

.winner-banner {
  margin-top: 22px;
  text-align: center;
  min-height: 28px;
}
.winner-banner .win-card {
  display: inline-block;
  background: linear-gradient(180deg, #2f3d2a, #243320);
  border: 1px solid #4e6b43;
  border-radius: 14px;
  padding: 14px 26px;
  box-shadow: var(--shadow);
  animation: pop .35s ease;
}
.winner-banner .label { font-size: 13px; color: var(--good); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.winner-banner .name { font-size: 26px; font-weight: 800; margin-top: 2px; }
.winner-banner .hint { color: var(--muted); font-size: 14px; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* options panel */
.panel {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel h2 {
  margin: 0 0 14px;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel h2 .count {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-left: auto;
}
.add-row { display: flex; gap: 8px; margin-bottom: 14px; }
.add-row input { flex: 1; }
.add-row button { padding: 0 18px; }

.opt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.opt-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #00000022;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  animation: slidein .2s ease;
}
@keyframes slidein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.opt-list .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.opt-list .txt { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-list .mine { font-size: 11px; color: var(--muted); }
.opt-list .x {
  background: none; border: none; color: var(--muted); font-size: 18px; line-height: 1;
  padding: 2px 6px; border-radius: 8px;
}
.opt-list .x:hover { color: #ff8a6a; background: #ff6a4a18; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 6px; }

.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #3a2418;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
  font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.notice { text-align: center; padding: 80px 20px; color: var(--muted); }
.notice h1 { color: var(--text); }
.hidden { display: none !important; }
