:root {
  --bg: #0b1020;
  --bg-2: #121a33;
  --card: #121a2a;
  --card-2: #182238;
  --text: #f4f7ff;
  --muted: #b8c1d9;
  --line: #2a3657;
  --primary: #4f7cff;
  --primary-2: #3f67df;
  --success: #1f9d63;
  --danger: #d9534f;
  --chip: #253150;
  --shadow: 0 8px 24px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at -10% -20%, #2b3d73 0%, transparent 55%),
    radial-gradient(900px 500px at 110% -20%, #4b1f55 0%, transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  min-height: 100vh;
}

.wrap {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 14px;
}

#appSection { display: none; }

.swipe-zone {
  margin-top: 10px;
  margin-bottom: 10px;
  border: 1px solid #3a4f80;
  border-radius: 14px;
  padding: 14px 12px;
  background: linear-gradient(180deg, #1a2948, #15233f);
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

.swipe-labels {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  margin-bottom: 8px;
}

.swipe-labels .left { color: #ffb3b3; }
.swipe-labels .right { color: #b7ffd7; }

.vote-slider {
  position: relative;
  height: 56px;
  border-radius: 999px;
  background: #101b31;
  border: 1px solid #2f456f;
  overflow: hidden;
  touch-action: none;
}

.vote-slider-track {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(217,83,79,.18) 0 50%, rgba(31,157,99,.18) 50% 100%);
}

.vote-slider-thumb {
  position: absolute;
  top: 6px;
  left: calc(50% - 22px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #6f87bb;
  background: linear-gradient(180deg, #4f7cff, #3159c5);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
  touch-action: none;
}

.vote-slider.is-left .vote-slider-thumb {
  background: linear-gradient(180deg, #d9534f, #a43b39);
}

.vote-slider.is-right .vote-slider-thumb {
  background: linear-gradient(180deg, #1f9d63, #167447);
}

.swipe-hint {
  font-weight: 700;
  color: #d8e3ff;
  margin-top: 8px;
  font-size: .95rem;
}

h1 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  letter-spacing: .2px;
}

.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

input, select, button {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f172a;
  color: var(--text);
  min-height: 42px;
  padding: 10px 12px;
  font-size: 0.98rem;
}

input, select {
  flex: 1 1 170px;
}

button {
  cursor: pointer;
  font-weight: 600;
  background: #1b2740;
  transition: transform .05s ease, background .15s ease;
}
button:hover { background: #223356; }
button:active { transform: translateY(1px); }

#joinBtn, #openVoteBtn {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  border-color: #567fff;
}
#joinBtn:hover, #openVoteBtn:hover { filter: brightness(1.05); }

#closeVoteBtn, #resetBtn {
  background: #3c2430;
  border-color: #6f3c55;
}
#closeVoteBtn:hover, #resetBtn:hover { background: #4b2e3c; }

#voteOptionsButtons {
  margin-top: 8px;
}

#voteOptionsButtons button {
  flex: 1 1 140px;
  min-height: 46px;
  background: #1f3a66;
  border-color: #32528c;
}

ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #111a2f;
  border: 1px solid #223153;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

li button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: .85rem;
}

.muted {
  color: var(--muted);
  font-size: 0.92em;
}

.pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid #334774;
  margin-right: 6px;
  margin-bottom: 6px;
  font-size: .9rem;
}

.result-big {
  margin-top: 10px;
  margin-bottom: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #3f5ea5;
  background: linear-gradient(180deg, #223863, #1a2c4f);
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
}

.result-big span {
  display: block;
  margin-top: 4px;
  font-size: .95rem;
  font-weight: 600;
  color: #c8d7ff;
}

@media (min-width: 760px) {
  .wrap { padding: 20px; }
  h1 { font-size: 1.6rem; }
  .card { padding: 14px; }
}
