:root {
  color-scheme: dark;
  --bg: #0d0a1a;
  --card: rgba(30, 24, 55, .88);
  --line: rgba(255,255,255,.11);
  --text: #f8f5ff;
  --muted: #b9b1ce;
  --accent: #9d6cff;
  --accent2: #34d9c5;
  --danger: #ff6d91;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 0%, #30225c 0, transparent 34rem),
    radial-gradient(circle at 90% 25%, #113c47 0, transparent 30rem), var(--bg);
}
.container { width: min(100% - 28px, 720px); margin: auto; padding: 34px 0 70px; }
.hero { text-align: center; margin-bottom: 25px; }
.eyebrow { margin: 0; color: var(--accent2); font-weight: 800; letter-spacing: .2em; font-size: .78rem; }
h1 { margin: 7px 0 8px; font-size: clamp(1.8rem, 7vw, 2.8rem); }
.hero > p:last-child, label, .empty, .status-row { color: var(--muted); }
.card {
  margin: 14px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 16px 45px rgba(0,0,0,.22);
  backdrop-filter: blur(12px);
}
h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 15px; font-size: 1.08rem; }
h2 span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--accent); font-size: .84rem; }
label { display: block; margin-bottom: 7px; font-size: .88rem; }
textarea, input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px;
  background: rgba(6,4,14,.55); color: var(--text); font: inherit; outline: none;
}
textarea { resize: vertical; }
textarea:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(157,108,255,.16); }
.item-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.status-row, .section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.status-row { margin-top: 10px; font-size: .84rem; }
.status-row p { margin: 0; }
.section-head h2 { margin: 0; }
button { border: 0; border-radius: 12px; padding: 12px 16px; color: white; font: inherit; font-weight: 750; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
.primary { width: 100%; padding: 15px; background: linear-gradient(135deg, var(--accent), #6c5cff); font-size: 1.05rem; box-shadow: 0 10px 28px rgba(115,78,255,.35); }
.secondary, .copy { background: rgba(157,108,255,.18); color: #d9caff; }
.text-button { padding: 7px; background: transparent; color: var(--danger); font-size: .85rem; }
.roulette { display: grid; place-items: center; min-height: 94px; margin-bottom: 15px; padding: 16px; border: 1px dashed rgba(52,217,197,.4); border-radius: 16px; background: rgba(52,217,197,.06); font-weight: 850; font-size: clamp(1.35rem, 7vw, 2.25rem); text-align: center; overflow-wrap: anywhere; }
.roulette.spinning { animation: pulse .35s infinite alternate; }
@keyframes pulse { to { transform: scale(1.025); border-color: var(--accent); box-shadow: 0 0 30px rgba(157,108,255,.2); } }
.message { min-height: 1.4em; margin: 10px 0 0; color: var(--danger); text-align: center; }
.result-card { border-color: rgba(52,217,197,.5); text-align: center; }
.result-card h2 { justify-content: center; }
.result-text { white-space: pre-line; font-size: 1.2rem; font-weight: 800; line-height: 1.7; }
.copy { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.chip { padding: 7px 11px;
  border-radius: 99px;
  background: rgba(255,109,145,.14);
  color: #ffc0d0;
  font-size: .88rem;

  display: inline-flex;
  align-items: center;
  gap: 6px; }
.empty { margin: 8px 0 0; font-size: .9rem; }
.history-item { padding: 12px 0; border-top: 1px solid var(--line); }
.history-item:first-child { border-top: 0; }
.history-item p { margin: 3px 0; }
.history-meta { color: var(--muted); font-size: .78rem; }
@media (max-width: 480px) {
  .container { width: min(100% - 20px, 720px); padding-top: 24px; }
  .card { padding: 16px; border-radius: 15px; }
  .item-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; }
  .secondary { padding: 9px 10px; font-size: .8rem; }
}
.participant-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 14px;
}

#participantInput {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid #38486a;
  border-radius: 18px;
  background: #0f1729;
  color: #fff;
  font-size: 1rem;
  box-sizing: border-box;
}

#addParticipant {
  padding: 0 22px;
  border: 0;
  border-radius: 18px;
  background: #303d61;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.participant-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.participant-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 9px 16px;
  border: 1px solid #405175;
  border-radius: 999px;
  background: #273554;
  color: #fff;
  font-weight: 600;
}

.participant-chip button {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #131d32;
  color: #b9c4da;
  cursor: pointer;
}

.participant-chip.excluded {
  opacity: .45;
  text-decoration: line-through;
}

@media (max-width: 480px) {
  .participant-input-row {
    grid-template-columns: 1fr auto;
  }

  #addParticipant {
    padding: 0 16px;
  }
}

.result-actions{
  display:flex;
  gap:12px;
  margin-top:16px;
}

.result-actions button{
  flex:1;
}

.winner-name{
  font-size: 52px;
  font-weight: 800;
  text-align: center;
  margin: 8px 0 24px;
}

.winner-item{
  font-size: 20px;
  text-align: center;
  color: #d9c27b;
}

.share-card{
  padding:40px 30px;
  border-radius:20px;
  background:linear-gradient(180deg,#1d2339,#121827);
  border:1px solid #b89034;
  box-shadow:
  0 0 10px rgba(212,175,55,.25),
  0 0 30px rgba(212,175,55,.15);
  text-align:center;
}

.winner-label{
  color:#f2c14d;
  font-size:14px;
  font-weight:700;
  letter-spacing:4px;
  margin-bottom:16px;
  text-shadow: 0 0 10px rgba(212,175,55,.4);
}

.result-date{
  margin-top:24px;
  color:#9aa3b8;
  font-size:14px;
}

.share-brand{
  margin-top:18px;
  color:#42f5ef;
  font-weight:700;
}

.share-brand span{
  display:block;
  margin-top:4px;
  font-size:12px;
  color:#8a92a6;
}

.app-version{
  margin-top:4px;
  font-size:12px;
  color:#9aa3b8;
  letter-spacing:2px;
}