/* MCCUG Live. Colours from mccug.co.uk: deep navy, purple, violet, magenta, pink, cream. */
:root {
  --bg: #1b1840;
  --panel: #24204f;
  --panel-2: #2e2961;
  --line: #3d377a;
  --text: #f4f2ff;
  --muted: #b9b4dd;
  --navy: #322d69;
  --purple: #7936cf;
  --violet: #8c52ff;
  --magenta: #c54cd9;
  --pink: #ff5499;
  --cream: #efd6ae;
  --ok: #5fd3a0;
  --warn: #ffb35c;
  --radius: 14px;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --display: 'Sora', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #3a2380 0%, transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.5 var(--font);
  min-height: 100vh;
}
a { color: var(--cream); }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.wide { max-width: 1200px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(20, 18, 50, .6); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px); }
header.top .where { color: var(--muted); font-size: .9rem; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-family: var(--display); font-weight: 700; letter-spacing: .02em; }
.brand-mark { color: var(--text); }
.brand-live { background: linear-gradient(90deg, var(--violet), var(--magenta), var(--pink)); color: #fff; padding: 2px 9px; border-radius: 8px; font-size: .9em; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.err { color: var(--pink); min-height: 1.2em; margin: 6px 0 0; }
.note { color: var(--ok); }
footer { color: var(--muted); font-size: .8rem; text-align: center; padding: 24px 16px 40px; }

button, .btn {
  font: inherit; font-weight: 600; color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, var(--purple), var(--violet)); border: 0; border-radius: 12px; padding: 12px 18px; min-height: 44px;
}
button:hover, .btn:hover { filter: brightness(1.1); }
button:disabled { opacity: .5; cursor: default; filter: none; }
button.ghost, .btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
button.small, .btn.small { padding: 6px 10px; min-height: 32px; font-size: .85rem; border-radius: 9px; }
button.danger { background: transparent; border: 1px solid #7a2a4f; color: var(--pink); }
input, textarea, select {
  font: inherit; color: var(--text); background: #15123a; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
}
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1; min-width: 140px; }

/* Choices on phones */
.choices { display: grid; gap: 10px; margin-top: 12px; }
.choice { text-align: left; justify-content: flex-start; background: var(--panel-2); border: 2px solid var(--line); color: var(--text); padding: 16px; font-size: 1.05rem; }
.choice.on { border-color: var(--violet); background: linear-gradient(135deg, rgba(121, 54, 207, .45), rgba(197, 76, 217, .35)); }
.choice .tick { margin-left: auto; opacity: 0; }
.choice.on .tick { opacity: 1; }
.state { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.state.open { background: rgba(95, 211, 160, .15); color: var(--ok); }
.state.closed { background: rgba(255, 84, 153, .12); color: var(--pink); }
.state.draft { background: rgba(239, 214, 174, .1); color: var(--cream); }

/* Ranking */
.ranklist { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.ranklist li { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; touch-action: none; user-select: none; }
.ranklist li.dragging { opacity: .6; border-color: var(--violet); }
.ranklist .pos { font-family: var(--display); font-weight: 700; color: var(--cream); width: 1.6em; text-align: center; }
.ranklist .txt { flex: 1; }
.ranklist .handle { cursor: grab; color: var(--muted); padding: 6px; font-size: 1.2rem; }
.ranklist .mv { background: transparent; border: 1px solid var(--line); min-height: 36px; min-width: 36px; padding: 0; border-radius: 9px; }

/* Dots */
.dots { display: grid; gap: 8px; margin: 12px 0; }
.dot-row { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; }
.dot-row .txt { flex: 1; }
.dot-row .n { font-family: var(--display); font-weight: 700; min-width: 1.6em; text-align: center; font-size: 1.2rem; }
.dot-row button { min-height: 40px; min-width: 40px; padding: 0; border-radius: 10px; }
.budget { font-weight: 600; }

/* Results */
.bars { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 12px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.bar-label em { font-style: normal; color: var(--cream); margin-right: .6em; font-family: var(--display); }
.bar { height: 14px; background: #15123a; border-radius: 999px; overflow: hidden; margin-top: 4px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--magenta), var(--pink)); border-radius: 999px; transition: width .6s ease; }
.bar-sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.cloud { text-align: center; line-height: 1.25; padding: 10px 0; }
.cloud .w { display: inline-block; margin: .1em .3em; font-family: var(--display); font-weight: 700; }
.cloud .c0 { color: #fff; } .cloud .c1 { color: var(--cream); } .cloud .c2 { color: #c9a8ff; } .cloud .c3 { color: #f39be6; } .cloud .c4 { color: #ff8fbc; }
.questions { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.questions li { display: flex; gap: 12px; align-items: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.questions li.answered { opacity: .55; }
.questions .votes { font-family: var(--display); font-weight: 700; color: var(--cream); min-width: 1.8em; text-align: center; }
.questions .q { flex: 1; }
.tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; background: rgba(95, 211, 160, .15); color: var(--ok); white-space: nowrap; }
.tag.held { background: rgba(255, 179, 92, .15); color: var(--warn); }
.upvote { background: transparent; border: 1px solid var(--line); min-height: 40px; min-width: 52px; padding: 4px 8px; border-radius: 10px; flex-direction: column; gap: 0; line-height: 1.1; color: var(--text); }
.upvote.on { border-color: var(--violet); background: rgba(140, 82, 255, .25); }
.upvote small { font-size: .75rem; color: var(--muted); }
.tabs { display: flex; gap: 8px; margin: 12px 0 0; }
.tabs button { flex: 1; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.tabs button.on { color: #fff; border-color: var(--violet); background: var(--panel-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; }
.chip button { min-height: 28px; min-width: 28px; padding: 0; border-radius: 999px; background: transparent; border: 1px solid var(--line); }
.waiting { text-align: center; padding: 40px 16px; }
.pulse { width: 14px; height: 14px; border-radius: 50%; background: var(--magenta); display: inline-block; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(197, 76, 217, .6); } 70% { box-shadow: 0 0 0 16px rgba(197, 76, 217, 0); } 100% { box-shadow: 0 0 0 0 rgba(197, 76, 217, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } .bar span { transition: none; } }
