/* survey.bioluminate.org: one stylesheet for the student page and the teacher page.
   Phones first: big tap targets, one column, nothing wider than the screen.
   Colours: neon on night (the miami-retro-ui skill's palette, assets/palette.md), colours only
   by the owner's word (2026-11-19: "don't add any icons, just use the colors"): no icons, no
   decorative graphics, no new fonts. The one picture is the KIS crest from EFL Fun. */

:root {
  --ink: #f3eefc;           /* near-white, violet cast */
  --soft: #a99cc9;          /* muted text */
  --line: #3a2a66;          /* hairlines */
  --paper: #16102e;         /* night indigo */
  --card: #241543;          /* panels */
  --raised: #2c1a52;        /* inner panels */
  --brand: #ff2d95;         /* hot pink: primary actions */
  --brand-ink: #ffffff;
  --brand-soft: #3a1140;    /* pink-tinted dark fill */
  --focus: #35e0f0;         /* cyan: focus, information, movement */
  --for: #35e0f0;           /* the FOR side: cyan */
  --for-soft: #13284a;
  --against: #ff8c42;       /* the AGAINST side: sunset orange */
  --against-soft: #3a1d2e;
  --warn: #ffd166;          /* waiting: gold (yellow family kept) */
  --warn-soft: #3a2a1f;
  --danger: #ff7a8c;        /* problems: coral (red family kept) */
  --glow-pink: 0 0 16px rgba(255, 45, 149, 0.55);
  --glow-cyan: 0 0 12px rgba(53, 224, 240, 0.45);
  --radius: 12px;
  --tap: 48px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* `hidden` always wins: a class that sets display (the waits, the controls) must never show a
   hidden element (found at the first screenshots, 2026-11-19). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: radial-gradient(ellipse 90% 30% at 50% -5%, rgba(138, 79, 255, 0.22), transparent) no-repeat, var(--paper);
  min-height: 100vh;
  color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- the bar */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--card);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.bar .logo { height: 32px; width: auto; flex: none; display: block; }
.bar .brand { flex: 1; font-weight: 700; font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ---------------------------------------------------------------- layout */
main {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}
main section { display: block; }
main section[hidden] { display: none; }

h1 { font-size: 24px; line-height: 1.25; margin: 4px 0 12px; text-shadow: 0 0 1.2rem rgba(255, 45, 149, 0.5); }
h2 { font-size: 19px; margin: 24px 0 8px; }
p { margin: 8px 0; }
.small { font-size: 15px; color: var(--soft); }
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--focus); margin: 16px 0 2px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}

/* ---------------------------------------------------------------- buttons */
button, .button {
  font: inherit;
  cursor: pointer;
}
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  max-width: 100%;
}
.primary { background: var(--brand); color: var(--brand-ink); border: 2px solid var(--brand); box-shadow: var(--glow-pink); }
.secondary { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.wide { width: 100%; }
button:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.linkish { background: none; border: none; color: var(--focus); text-decoration: underline; padding: 8px 0; min-height: 40px; }

/* ---------------------------------------------------------------- the ranking list */
.ranking {
  list-style: none;
  margin: 12px 0;
  padding: 0;
}
.ranking li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 6px 8px 8px;
  margin: 8px 0;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.3s;
}
.ranking li.moved { background: var(--brand-soft); }
.ranking li.dragging { box-shadow: var(--glow-cyan); position: relative; z-index: 2; background: var(--brand-soft); }
.ranking .num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 0 8px rgba(255, 45, 149, 0.5);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.ranking .label { min-width: 0; }
.ranking .moves { display: flex; align-items: center; gap: 4px; }
.ranking .moves button {
  width: 44px; height: 44px;
  border: 2px solid var(--focus);
  border-radius: 10px;
  background: var(--raised);
  color: var(--focus);
  font-size: 18px;
  line-height: 1;
}
.ranking .handle {
  width: 32px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--soft);
  font-size: 22px;
  cursor: grab;
  touch-action: none;
}
.ranking.readonly li { grid-template-columns: 36px minmax(0, 1fr); }

/* ---------------------------------------------------------------- waiting and notes */
.wait {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--warn);
  margin: 12px 0;
}
.spinner {
  width: 22px; height: 22px; flex: none;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.problem { color: var(--danger); font-weight: 600; }
.address {
  display: block;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--card);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 15px;
  word-break: break-all;
}

/* ---------------------------------------------------------------- the result */
.side {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 2px 0 4px;
  padding: 12px 16px;
  border-radius: var(--radius);
  text-align: center;
}
.side[data-side="for"] { color: var(--for); background: var(--for-soft); border: 2px solid var(--for); text-shadow: 0 0 1.2rem rgba(53, 224, 240, 0.6); }
.side[data-side="against"] { color: var(--against); background: var(--against-soft); border: 2px solid var(--against); text-shadow: 0 0 1.2rem rgba(255, 140, 66, 0.6); }
.motion { font-size: 22px; font-weight: 700; line-height: 1.3; }
.people { list-style: none; padding: 0; margin: 6px 0; }
.people li { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: none; }
.people .number { color: var(--soft); font-variant-numeric: tabular-nums; margin-right: 8px; }
.points { padding-left: 22px; }
.points li { margin: 6px 0; }

/* ---------------------------------------------------------------- footer */
footer {
  max-width: 640px;
  margin: 24px auto 32px;
  padding: 0 16px;
  font-size: 14px;
  color: var(--soft);
}
footer .who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }

/* ---------------------------------------------------------------- the teacher page */
body.teacher main { max-width: 1200px; }
body.teacher footer { max-width: 1200px; }
.teacher-top { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.teacher-top > .card { flex: 1 1 280px; margin: 0; }
.count { font-size: 56px; font-weight: 800; line-height: 1; margin: 6px 0; font-variant-numeric: tabular-nums; }
.count small { font-size: 28px; color: var(--soft); font-weight: 700; }
.state-chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.state-chip[data-state="open"] { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand); }
.state-chip[data-state="closed"] { background: var(--warn-soft); color: var(--warn); }
.state-chip[data-state="published"] { background: var(--for-soft); color: var(--for); }
.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.missing { columns: 2 220px; padding: 0; list-style: none; margin: 8px 0; }
.missing li { padding: 4px 0; break-inside: avoid; }
.qr { width: 220px; max-width: 100%; aspect-ratio: 1; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; display: block; }
.join { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.join .address { font-size: 18px; }

.teams { margin-top: 16px; }
.topic-block { margin: 0 0 18px; }
.topic-block h3 { font-size: 26px; margin: 10px 0 8px; line-height: 1.25; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.team-card { border-radius: var(--radius); padding: 12px 16px; border: 2px solid; }
.team-card[data-side="for"] { border-color: var(--for); background: var(--for-soft); }
.team-card[data-side="against"] { border-color: var(--against); background: var(--against-soft); }
.team-card .team-side { font-size: 24px; font-weight: 800; text-transform: uppercase; }
.team-card[data-side="for"] .team-side { color: var(--for); }
.team-card[data-side="against"] .team-side { color: var(--against); }
.team-card ul { list-style: none; padding: 0; margin: 6px 0 0; font-size: 24px; line-height: 1.35; }
.team-card .number { color: var(--soft); font-size: 18px; margin-right: 8px; font-variant-numeric: tabular-nums; }
.counts { font-size: 22px; font-weight: 600; margin: 8px 0 16px; }

/* ---------------------------------------------------------------- student pictures (teacher page) */
.pictures-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 16px 0 4px; }
.face { display: inline-block; vertical-align: middle; border-radius: 50%; object-fit: cover; background: var(--raised); border: 2px solid var(--line); margin-right: 10px; }
.face.small { width: 36px; height: 36px; }
.face.large { width: 52px; height: 52px; }
.face.blank { border-style: dashed; }
.team-card li { display: flex; align-items: center; margin: 4px 0; }

/* ---------------------------------------------------------------- the room screen (join.html) */
body.join-screen main { max-width: none; min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.join-logo { width: auto; height: clamp(40px, 8vh, 72px); }
body.join-screen h1 { font-size: clamp(28px, 5vh, 56px); margin: 8px 0; }
.join-step { font-size: clamp(18px, 3vh, 30px); color: var(--soft); }
.join-qr { width: min(62vh, 86vw); aspect-ratio: 1; margin: 12px auto; background: #fff; padding: 12px; border-radius: 16px; box-shadow: var(--glow-pink); }
.join-qr svg { width: 100%; height: 100%; display: block; }
.join-address { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: clamp(20px, 4vh, 44px); font-weight: 700; color: var(--focus); word-break: break-all; margin: 8px 0; }
