@font-face {
  font-family: Bricolage;
  src: url(../assets/fonts/bricolage.ttf) format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: DM;
  src: url(../assets/fonts/dm.ttf) format('truetype');
  font-weight: 100 1000;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #10101b;
  --panel: #1b1b2b;
  --line: #39374c;
  --soft: #bdbace;
  --lime: #d9ff63;
  --violet: #b8a4ff;
  --pad: clamp(16px, 4.2vw, 72px);
  font:
    16px/1.45 DM,
    system-ui,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: #faf8ff;
}
button,
a,
input,
select {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  opacity: 0.52;
  cursor: default;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
h1,
h2,
h3,
b,
strong,
.brand {
  font-family: Bricolage, system-ui, sans-serif;
}
h1,
h2,
h3,
p {
  margin: 0;
}
p + p {
  margin-top: 0.65em;
}
header {
  border-bottom: 1px solid var(--line);
  background: #12121e;
}
.bar,
main,
footer {
  width: min(1450px, 100%);
  margin: auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
.bar,
nav,
.actions,
.specs,
.row,
.topline,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bar {
  min-height: 75px;
  justify-content: space-between;
}
.brand {
  text-decoration: none;
  letter-spacing: -1.6px;
  font-size: 26px;
  gap: 8px;
}
.brand i {
  font-weight: 350;
  color: #65627a;
  padding: 0 3px;
}
.brand em {
  color: var(--lime);
  font-size: 15px;
  letter-spacing: 0.5px;
  font-weight: 850;
}
nav {
  gap: 20px;
}
button {
  border: 0;
}
.link,
.outline,
.secondary,
.primary,
.quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 700;
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 17px;
}
.link,
.quiet {
  background: none;
}
.outline,
.secondary {
  background: #252436;
  border: 1px solid #56516a;
}
.link {
  color: #d5d3e2;
}
.tvicon {
  width: 18px;
  height: 13px;
  border: 1.75px solid currentColor;
  border-radius: 3px;
  position: relative;
}
.tvicon:after {
  content: '';
  position: absolute;
  bottom: -5px;
  height: 2px;
  left: 4px;
  width: 7px;
  background: currentColor;
}
.primary {
  background: #d3c4ff;
  color: #281c40;
}
.primary:hover {
  background: #e2d7ff;
}
.secondary:hover,
.outline:hover {
  background: #39364d;
}
.skip {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 8;
}
.skip:focus {
  top: 8px;
  background: #222;
  padding: 12px;
}
main {
  padding-top: 28px;
  padding-bottom: 38px;
  min-height: 70vh;
}
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid #5b4680;
  border-radius: 28px;
  background: #110d30 url(plateau.jpg) center 51% / cover no-repeat;
  min-height: clamp(400px, 38vw, 570px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
}
.hero:before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(13, 9, 38, 0.68), transparent 74%);
}
.hero-copy {
  padding: clamp(28px, 4vw, 70px);
}
.tag,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.73rem;
  line-height: 1.3;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.tag {
  border: 1px solid #847881;
  border-radius: 100px;
  padding: 6px 11px;
  color: #f1eef7;
  background: #1813279c;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
}
.hero h1 {
  font-size: clamp(66px, 7vw, 107px);
  letter-spacing: -0.055em;
  line-height: 0.89;
  margin: 24px 0 15px;
}
.hero h1 em {
  color: var(--lime);
  font-style: italic;
  display: inline-block;
  padding-right: 0.12em;
}
.hero p {
  font-size: clamp(16px, 1.35vw, 22px);
  max-width: 38ch;
  color: #e5e0f0;
}
.hero .actions {
  margin-top: 24px;
}
.actions {
  flex-wrap: wrap;
}
.hero .actions button {
  min-height: 50px;
  padding: 12px 21px;
}
.specs {
  background: #151023b0;
  padding: 13px clamp(28px, 4vw, 70px);
  gap: 0;
  border-top: 1px solid #bbb0da3d;
  backdrop-filter: blur(8px);
  font-size: 0.92em;
  color: #e0dceb;
}
.specs span + span {
  border-left: 1px solid #6c6283;
  padding-left: 21px;
  margin-left: 21px;
}
.specs b {
  color: #fff;
  font-size: 1.16em;
}
.formats {
  margin-top: 32px;
}
.formats h2,
.room-head h1 {
  font-size: clamp(29px, 3vw, 46px);
  letter-spacing: -0.055em;
  line-height: 1.05;
}
.formats h2 em {
  font-weight: 520;
  color: var(--violet);
}
.modes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.modecard,
.panel,
.stage {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}
.modecard {
  text-align: left;
  padding: 18px;
  position: relative;
  transition:
    transform 0.18s,
    border-color 0.18s;
}
.modecard:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.symbol {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--accent);
  font:
    800 24px/1 Bricolage,
    system-ui;
}
.modecard strong {
  display: block;
  font-size: 1.2rem;
}
.modecard small {
  color: var(--soft);
}
.modecard:after {
  content: '↗';
  position: absolute;
  top: 15px;
  right: 17px;
  color: var(--soft);
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 32px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.85em;
}
dialog {
  background: #202030;
  color: #fff;
  border: 1px solid #615a73;
  border-radius: 23px;
  padding: 28px;
  width: min(470px, calc(100% - 24px));
  max-height: 88dvh;
  box-shadow: 0 24px 80px #0008;
}
dialog::backdrop {
  background: #060611c9;
  backdrop-filter: blur(5px);
}
dialog h2 {
  padding-right: 32px;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
  margin-bottom: 14px;
}
dialog h3 {
  margin-top: 16px;
}
.close {
  position: absolute;
  top: 12px;
  right: 12px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  background: #39374b;
  font-size: 23px;
}
.help,
.muted,
dialog p,
.panel p {
  color: var(--soft);
}
label {
  display: block;
  font-weight: 700;
}
input:not([type='checkbox']),
select {
  width: 100%;
  margin-top: 5px;
  border: 1px solid #656078;
  border-radius: 10px;
  color: white;
  background: #12121d;
  padding: 11px 12px;
  font-size: 16px;
}
.code-input {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: monospace !important;
}
form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
input[type='checkbox'] {
  accent-color: var(--lime);
  width: 18px;
  height: 18px;
  vertical-align: middle;
}
.palette {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sw);
  border: 4px solid #242334;
}
.swatch[aria-pressed='true'] {
  outline: 2px solid white;
}
.danger,
#modal-error {
  color: #ffb4a9;
}
#modal-error:empty {
  display: none;
}
#modal-error {
  margin-top: 14px;
}
#notice:not(:empty) {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #383347;
  color: white;
  border: 1px solid #716981;
  padding: 10px 18px;
  border-radius: 12px;
  max-width: 90vw;
  z-index: 9;
}
.room-head,
.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.room-head {
  margin: 4px 0 22px;
}
.eyebrow {
  color: var(--violet);
  margin-bottom: 8px;
}
.code {
  font: 800 1.25rem/1 monospace;
  letter-spacing: 0.11em;
  color: var(--lime);
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(240px, 1fr);
  gap: 16px;
  align-items: start;
}
.stage,
.panel {
  padding: clamp(16px, 2.5vw, 36px);
  min-width: 0;
}
.stage {
  background: radial-gradient(ellipse at 90% 0%, #3b285b 0, transparent 58%), #201d31;
  border-color: #514461;
  animation: arrive 0.3s ease-out;
}
.stage h2 {
  font-size: clamp(25px, 3vw, 49px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  margin: 12px 0 14px;
}
.stage .actions,
.stage .choices {
  margin-top: 20px;
}
.panel h2,
.panel h3 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}
.panel + .panel {
  margin-top: 12px;
}
.row {
  flex-wrap: wrap;
}
.pill {
  display: inline-block;
  font-size: 0.81em;
  font-weight: 700;
  padding: 5px 10px;
  background: #363148;
  border: 1px solid #534a63;
  border-radius: 30px;
}
.stage .timer {
  font:
    750 1.2em/1 Bricolage,
    system-ui;
  color: var(--lime);
  margin-left: auto;
}
.meter {
  height: 4px;
  border-radius: 6px;
  background: #ffffff25;
  margin: 15px 0;
}
.meter i {
  height: 100%;
  display: block;
  background: var(--lime);
  transform-origin: left;
  transition: transform 0.12s linear;
}
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.answer,
.pick {
  padding: 14px;
  border: 1px solid #716586;
  background: #302a3f;
  border-radius: 12px;
  min-height: 52px;
  color: white;
  text-align: left;
  overflow-wrap: anywhere;
}
.answer {
  display: flex;
  align-items: center;
  gap: 10px;
}
.answer i {
  font:
    800 0.85em Bricolage,
    system-ui;
  font-style: normal;
  border-radius: 6px;
  padding: 5px 8px;
  background: #514264;
  color: #e2d3ff;
}
.answer.good {
  border-color: var(--lime);
  background: #33462a;
}
.answer:disabled,
.pick:disabled {
  opacity: 1;
}
.pick:disabled {
  color: #a7a1b3;
  background: #252333;
  border-style: dashed;
}
.pick small,
.rank small {
  display: block;
  color: var(--soft);
}
.pick[data-delegate]:not(:disabled):hover {
  border-color: var(--lime);
  background: #453b58;
}
.rank {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rank li,
.listrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #ffffff13;
  min-width: 0;
}
.rank li:last-child {
  border: 0;
}
.rank .pos {
  min-width: 20px;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}
.rank .who {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.rank b {
  font-size: 0.96em;
}
.rank .value {
  white-space: nowrap;
  font-weight: 700;
}
.log {
  font-size: 0.87em;
  padding-left: 18px;
  margin: 0;
  color: #ddd5ef;
}
.log li + li {
  margin-top: 7px;
}
.point {
  color: var(--lime);
}
.result {
  margin-top: 15px;
  padding: 13px;
  border-left: 3px solid var(--lime);
  background: #171723;
  border-radius: 5px;
}
.result a {
  font-size: 0.8rem;
  color: var(--violet);
}
.order {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  list-style-position: inside;
}
.order li {
  background: #302c41;
  border-radius: 8px;
  padding: 7px 10px;
}
.wheel-wrap {
  position: relative;
  width: min(260px, 100%);
  margin: 18px auto;
}
.wheel-wrap:before {
  content: '▼';
  color: white;
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.wheel {
  aspect-ratio: 1;
  border: 6px solid #d5cde5;
  border-radius: 50%;
  box-shadow: 0 0 27px #9371dc77;
  position: relative;
  animation: spin 3.8s cubic-bezier(0.12, 0.6, 0.18, 1) both;
}
.wheel span {
  position: absolute;
  inset: 0;
  text-align: center;
  padding-top: 5%;
  font-weight: 800;
  color: #181323;
}
.wheel-wrap:after {
  content: '✦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #211b37;
  color: #fff;
  border-radius: 50%;
  width: 24%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 2rem;
}
.wheelkey {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  font-size: 0.82rem;
}
.wheelkey b {
  color: var(--violet);
}
details {
  margin-top: 15px;
}
summary {
  cursor: pointer;
  font-weight: 700;
}
.tv .stage h2 {
  font-size: clamp(30px, 3.8vw, 68px);
}
.tv .answer {
  font-size: clamp(18px, 1.65vw, 32px);
}
.tv .rank li {
  padding: 5px 0;
}
.tv .rank {
  columns: var(--cols, 1);
  column-gap: 18px;
}
.tv .rank li {
  break-inside: avoid;
}
.tv .grid {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}
.tv .room-head {
  margin-bottom: 14px;
}
.tv footer {
  display: none;
}
.tv .panel {
  padding: 16px;
}
.tv .rank small {
  font-size: 0.72em;
}
.tv:fullscreen {
  overflow: auto;
}
@keyframes arrive {
  from {
    opacity: 0.5;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes spin {
  from {
    transform: rotate(var(--from));
  }
  to {
    transform: rotate(var(--to));
  }
}
@media (max-width: 850px) {
  .grid,
  .tv .grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(190px, 1fr);
  }
  .modes {
    grid-template-columns: repeat(3, 1fr);
  }
  .hero {
    background-position: 57% center;
  }
  .hero-copy {
    max-width: 65%;
  }
}
@media (max-width: 640px) {
  .bar {
    min-height: 60px;
  }
  .brand {
    font-size: 20px;
    gap: 4px;
  }
  .brand img {
    width: 26px;
    height: 26px;
  }
  .brand em {
    font-size: 11px;
  }
  .bar nav {
    gap: 4px;
  }
  .bar nav button {
    min-height: 38px;
    font-size: 0.82em;
    padding: 7px;
  }
  .wide {
    display: none;
  }
  main {
    padding-top: 16px;
  }
  .hero {
    border-radius: 19px;
    background-position: 64% center;
  }
  .hero:before {
    background: linear-gradient(90deg, #0d092ae8, #0d092a99 62%, #0d092a22);
  }
  .hero-copy {
    max-width: none;
    padding: 25px 20px;
  }
  .hero h1 {
    font-size: clamp(58px, 15vw, 80px);
  }
  .hero p {
    max-width: 24ch;
  }
  .hero .actions {
    gap: 8px;
  }
  .hero .actions button {
    padding: 10px 12px;
    min-height: 43px;
    font-size: 0.88em;
  }
  .specs {
    padding: 12px 18px;
    font-size: 0.78rem;
  }
  .specs span + span {
    padding-left: 12px;
    margin-left: 12px;
  }
  .formats {
    margin-top: 22px;
  }
  .modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .modecard {
    padding: 14px;
  }
  .grid,
  .tv .grid {
    grid-template-columns: 1fr;
  }
  .choices {
    gap: 8px;
  }
  .answer,
  .pick {
    padding: 10px;
  }
  .room-head {
    gap: 8px;
  }
  .room-head .outline {
    min-height: 37px;
  }
  .panel,
  .stage {
    border-radius: 16px;
  }
  .bar nav .link span[aria-hidden] {
    display: none;
  }
  .palette {
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    transition: none !important;
  }
}

@media (min-width: 1000px) {
  .grid aside {
    position: sticky;
    top: 12px;
  }
  .tv .grid:has(.large-group) {
    grid-template-columns: minmax(0, 3fr) minmax(400px, 2fr);
  }
  .tv .rank.large-group {
    columns: 2;
    column-rule: 1px solid var(--line);
  }
}
