:root {
  --ink: #0f1220;
  --text: #f8fbff;
  --muted: #b8c4cf;
  --line: rgba(255, 255, 255, 0.24);
  --line-strong: rgba(255, 255, 255, 0.44);
  --panel: rgba(15, 18, 32, 0.68);
  --gold: #ffd166;
  --aqua: #35d6c9;
  --blue: #277da1;
  --danger: #d4372a;
  --danger-dark: #971b16;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
  --hard-shadow: 6px 7px 0 rgba(0, 0, 0, 0.78);
  --soft-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  min-height: 100%;
  background: #090b13;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(115deg, rgba(255, 209, 102, 0.16), transparent 28%),
    linear-gradient(245deg, rgba(53, 214, 201, 0.2), transparent 30%),
    linear-gradient(335deg, rgba(224, 68, 122, 0.15), transparent 34%),
    linear-gradient(180deg, #070912 0%, #14192b 48%, #0b1018 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.036) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.26));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.26));
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 18%, rgba(255, 209, 102, 0.12) 19%, transparent 31%),
    linear-gradient(58deg, transparent 0 46%, rgba(53, 214, 201, 0.11) 47%, transparent 61%),
    linear-gradient(168deg, transparent 0 60%, rgba(123, 77, 214, 0.15) 61%, transparent 78%);
  filter: blur(18px);
}

button,
select,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.game {
  position: relative;
  isolation: isolate;
  width: min(1380px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px clamp(12px, 2.4vw, 34px) 24px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 16px;
}

.scene-depth,
.creature-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.scene-beam {
  position: absolute;
  width: 34vw;
  min-width: 320px;
  height: 80vh;
  opacity: 0.5;
  filter: blur(30px);
  transform: rotate(18deg);
}

.beam-left {
  top: -18%;
  left: -18%;
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.38), rgba(224, 68, 122, 0));
}

.beam-right {
  right: -16%;
  bottom: -24%;
  background: linear-gradient(180deg, rgba(53, 214, 201, 0.36), rgba(123, 77, 214, 0));
  transform: rotate(-24deg);
}

.scene-grid {
  position: absolute;
  inset: 7% 3%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  opacity: 0.65;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 54px rgba(53, 214, 201, 0.1);
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 2px 0 4px;
}

.brand-signature {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 2px;
  width: 174px;
  height: 102px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  pointer-events: none;
}

.brand-recommendation {
  position: relative;
  z-index: 1;
  min-width: 82px;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding-top: 2px;
  text-align: center;
  text-transform: uppercase;
}

.award-wreath {
  position: absolute;
  inset: 3px 0;
}

.award-wreath::before,
.award-wreath::after {
  position: absolute;
  top: -3px;
  bottom: 3px;
  width: 48px;
  content: "";
  background: linear-gradient(180deg, #fff1b2 0%, #ffd166 54%, #d89a20 100%);
  filter:
    drop-shadow(0 2px 0 rgba(0, 0, 0, 0.48))
    drop-shadow(0 0 8px rgba(255, 209, 102, 0.16));
  -webkit-mask: url("assets/laurel-branch.svg") center / contain no-repeat;
  mask: url("assets/laurel-branch.svg") center / contain no-repeat;
}

.award-wreath::before {
  left: 14px;
  transform: scaleX(-1) rotate(-10deg) scale(1.04);
  transform-origin: 50% 88%;
}

.award-wreath::after {
  right: 14px;
  transform: rotate(-10deg) scale(1.04);
  transform-origin: 50% 88%;
}

.award-year {
  color: #7debe1;
  font-size: 9px;
  font-weight: 1000;
  line-height: 1;
}

.brand-recommendation strong {
  color: #fff9e8;
  font-size: 14px;
  font-weight: 1000;
  line-height: 0.92;
  white-space: nowrap;
  text-shadow:
    1px 2px 0 rgba(0, 0, 0, 0.62),
    0 0 10px rgba(255, 209, 102, 0.2);
}

.brand-recommendation small {
  color: #ffe28d;
  font-size: 6px;
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

h1 {
  grid-column: 1;
  margin: 0;
  padding-left: 176px;
  font-size: clamp(34px, 5vw, 78px);
  font-weight: 1000;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff9e8;
  text-shadow:
    3px 3px 0 rgba(255, 114, 93, 0.9),
    7px 8px 0 rgba(0, 0, 0, 0.5),
    0 0 24px rgba(255, 209, 102, 0.42),
    0 0 54px rgba(53, 214, 201, 0.18);
}

h1 span {
  display: inline-block;
}

h1 span:nth-child(2) {
  color: #7debe1;
}

h1 span:nth-child(3) {
  color: #ffe28d;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.worksheet-download {
  min-height: 50px;
  display: grid;
  grid-template-columns: 34px auto;
  align-items: center;
  gap: 8px;
  border: 2px solid rgba(125, 235, 225, 0.62);
  border-radius: 8px;
  padding: 5px 11px 5px 7px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08)),
    rgba(11, 14, 24, 0.82);
  color: var(--text);
  box-shadow:
    4px 5px 0 rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.worksheet-download-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #35d6c9;
  color: #10131d;
  font-size: 23px;
  font-weight: 1000;
}

.worksheet-download-copy {
  display: grid;
  gap: 1px;
  line-height: 1;
}

.worksheet-download-copy strong {
  font-size: 13px;
  font-weight: 1000;
}

.worksheet-download-copy small {
  color: #b8c4cf;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.worksheet-download:hover,
.worksheet-download:focus-visible {
  transform: translate(2px, 2px);
  border-color: #7debe1;
  box-shadow:
    2px 3px 0 rgba(0, 0, 0, 0.72),
    0 0 22px rgba(53, 214, 201, 0.28);
}

.icon-button {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08)),
    rgba(11, 14, 24, 0.82);
  color: var(--text);
  box-shadow:
    4px 5px 0 rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible,
.icon-button.active {
  transform: translate(2px, 2px);
  border-color: rgba(255, 209, 102, 0.9);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 209, 102, 0.18)),
    rgba(20, 24, 42, 0.9);
  box-shadow:
    2px 3px 0 rgba(0, 0, 0, 0.72),
    0 0 26px rgba(255, 209, 102, 0.34);
}

.collapsible-panel,
.board,
.result-dialog {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.055)),
    linear-gradient(115deg, rgba(255, 209, 102, 0.09), transparent 42%),
    linear-gradient(245deg, rgba(53, 214, 201, 0.1), transparent 45%),
    var(--panel);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(20px) saturate(1.18);
  backdrop-filter: blur(20px) saturate(1.18);
}

.collapsible-panel {
  padding: 14px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header div {
  display: grid;
  gap: 3px;
}

.panel-header span {
  color: #7debe1;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}

.panel-header strong {
  color: var(--text);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.1;
}

.panel-toggle {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.66);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.panel-toggle:hover,
.panel-toggle:focus-visible {
  transform: translate(2px, 2px);
  border-color: rgba(53, 214, 201, 0.9);
  box-shadow:
    1px 2px 0 rgba(0, 0, 0, 0.66),
    0 0 18px rgba(53, 214, 201, 0.25);
}

.panel-content {
  margin-top: 12px;
}

.settings-view-tabs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(53, 214, 201, 0.09), rgba(255, 209, 102, 0.08)),
    rgba(8, 11, 20, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.settings-view-tab {
  position: relative;
  min-width: 0;
  min-height: 58px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  padding: 0;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
}

.settings-view-tab > span {
  min-height: 58px;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: stretch;
  padding: 0;
  text-align: left;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.settings-view-tab small {
  display: grid;
  place-items: center;
  padding: 8px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.07);
  color: #7debe1;
  font-size: 20px;
  line-height: 1;
  font-weight: 1000;
  text-transform: uppercase;
}

.settings-view-tab strong {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  color: inherit;
  font-size: 17px;
  line-height: 1.1;
  text-align: center;
}

#categorySettingsTab > span {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 38%),
    linear-gradient(180deg, #f35b55, #b51f25);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 0 24px rgba(239, 61, 62, 0.42);
}

#categorySettingsTab small {
  color: #fff3d8;
  background: rgba(104, 7, 16, 0.26);
}

.settings-view-tab[aria-selected="true"] > span {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 38%),
    linear-gradient(180deg, #35d6c9, #277da1);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 0 20px rgba(53, 214, 201, 0.22);
}

.settings-view-tab[aria-selected="true"] small {
  color: #ffffff;
}

#categorySettingsTab[aria-selected="true"] > span {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 38%),
    linear-gradient(180deg, #ff7168, #c3232c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 0 30px rgba(239, 61, 62, 0.58);
}

.settings-view-tab:hover > span,
.settings-view-tab:focus-visible > span {
  color: #ffffff;
  box-shadow: inset 0 0 0 2px rgba(255, 209, 102, 0.72);
}

.settings-step-arrow {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 209, 102, 0.38);
  border-radius: 50%;
  background: rgba(255, 209, 102, 0.1);
  color: #ffe28d;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.12);
}

.mode-selector {
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.mode-selector legend {
  width: 100%;
  margin-bottom: 7px;
  color: #7debe1;
  font-size: 12px;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.mode-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.mode-choice {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.mode-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-choice > span {
  min-height: 88px;
  display: grid;
  place-content: center;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 50%),
    rgba(8, 11, 20, 0.52);
  color: var(--muted);
  text-align: center;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.mode-choice small {
  color: #7debe1;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.mode-choice strong {
  color: inherit;
  font-size: 20px;
}

.mode-choice em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.2;
}

.mode-choice input:checked + span {
  border-color: rgba(125, 235, 225, 0.78);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 40%),
    linear-gradient(180deg, rgba(53, 214, 201, 0.82), rgba(39, 125, 161, 0.86));
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 0 22px rgba(53, 214, 201, 0.2);
}

.mode-choice input:checked + span em,
.mode-choice input:checked + span small {
  color: #efffff;
}

.mode-choice:hover > span,
.mode-choice input:focus-visible + span {
  transform: translateY(-1px);
  border-color: rgba(255, 209, 102, 0.68);
}

.category-settings-view .controls-content {
  padding-top: 2px;
}

.setup-content {
  display: grid;
  grid-template-columns:
    minmax(230px, 1.05fr)
    minmax(190px, 0.72fr)
    minmax(145px, 0.48fr)
    minmax(220px, 0.75fr)
    minmax(180px, 0.65fr);
  gap: 12px;
  align-items: end;
}

.collapsible-panel.is-collapsed .setup-combined-content,
.collapsible-panel.is-collapsed .panel-content {
  display: none;
}

.collapsible-panel.is-collapsed {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(15, 18, 32, 0.56);
  box-shadow: var(--soft-shadow);
}

.competition-panel {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(125, 235, 225, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(100deg, rgba(53, 214, 201, 0.11), transparent 36%, rgba(255, 209, 102, 0.09)),
    rgba(11, 14, 24, 0.8);
  box-shadow:
    5px 6px 0 rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.setup-panel .competition-panel {
  margin-top: 14px;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid rgba(125, 235, 225, 0.32);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.competition-panel[hidden] {
  display: none !important;
}

.competition-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.competition-heading > div:first-child {
  display: grid;
  gap: 2px;
}

.competition-heading > div:first-child span,
.competition-save-status {
  color: #7debe1;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.competition-heading > div:first-child strong {
  color: #fff9e8;
  font-size: 20px;
  line-height: 1.05;
}

.competition-settings {
  display: grid;
  grid-template-columns: minmax(110px, 0.5fr) minmax(190px, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.competition-count-field select {
  min-height: 40px;
}

.competition-switch {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.competition-switch input {
  width: 19px;
  height: 19px;
  accent-color: #35d6c9;
}

.new-competition-button {
  min-height: 40px;
  border: 1px solid rgba(255, 209, 102, 0.58);
  border-radius: 8px;
  padding: 0 13px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(180deg, #3b4055, #171a28);
  color: #ffffff;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.58);
  font-weight: 1000;
  cursor: pointer;
}

.competition-scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 7px;
}

.competition-team {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(90px, 1fr) repeat(3, auto);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--team-color);
  border-radius: 7px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.17), transparent 36%),
    rgba(255, 255, 255, 0.065);
  box-shadow: inset 4px 0 0 var(--team-color);
}

.competition-team > strong {
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 13px;
}

.competition-metric {
  display: grid;
  justify-items: center;
  gap: 1px;
}

.competition-metric b {
  color: #ffe28d;
  font-size: 15px;
}

.competition-metric span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.competition-save-status {
  margin: 0;
  color: var(--muted);
  text-align: right;
  text-transform: none;
}

.stage-note {
  min-height: 62px;
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 11px 13px;
  border: 1px solid rgba(125, 235, 225, 0.46);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(53, 214, 201, 0.14), rgba(255, 209, 102, 0.08)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 24px rgba(53, 214, 201, 0.1);
}

.stage-note strong {
  color: #7debe1;
  font-size: 13px;
  text-transform: uppercase;
}

.stage-note span {
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
}

.mode-control {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-control legend {
  margin-bottom: 5px;
  padding: 0;
  color: #7debe1;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(8, 11, 20, 0.62);
}

.mode-options label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.mode-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-options span {
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
  text-align: center;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.mode-options input:checked + span {
  border-color: rgba(125, 235, 225, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 38%),
    linear-gradient(180deg, #35d6c9, #277da1);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(53, 214, 201, 0.24);
}

.mode-options input:focus-visible + span {
  outline: 2px solid #ffd166;
  outline-offset: 2px;
}

.instant-confirm-switch {
  min-height: 44px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(8, 11, 20, 0.62);
  cursor: pointer;
}

.instant-confirm-switch input {
  width: 30px;
  height: 18px;
  margin: 0;
  accent-color: #35d6c9;
  cursor: pointer;
}

.instant-confirm-switch span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.instant-confirm-switch strong {
  color: #ffffff;
  font-size: 12px;
  font-weight: 1000;
}

.instant-confirm-switch small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
}

.instant-confirm-switch:has(input:checked) {
  border-color: rgba(53, 214, 201, 0.78);
  background: rgba(53, 214, 201, 0.14);
  box-shadow: 0 0 18px rgba(53, 214, 201, 0.16);
}

.team-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 8px;
}

.team-field {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(120px, 1fr) minmax(82px, 0.42fr);
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.team-field.solo {
  grid-template-columns: auto minmax(0, 1fr);
}

.team-field input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--team-color);
  cursor: pointer;
}

.team-swatch {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: var(--team-color);
  box-shadow: 0 0 15px var(--team-color);
}

.team-field input[type="text"] {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(8, 11, 20, 0.66);
  color: var(--text);
  padding: 0 10px;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.team-field input[type="text"]:focus {
  outline: 2px solid var(--team-color);
  outline-offset: 2px;
}

.team-time {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.team-time span {
  color: #ffe28d;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.team-time select {
  min-height: 42px;
  padding: 0 7px;
  border-color: var(--team-color);
}

.starter-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(276px, 1fr) minmax(310px, 444px) minmax(276px, 1fr);
  align-items: start;
  gap: clamp(14px, 2.5vw, 30px);
  padding: clamp(12px, 2vw, 22px);
  overflow: hidden;
}

.board::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.055), transparent),
    linear-gradient(180deg, rgba(255, 209, 102, 0.08), transparent 35%, rgba(53, 214, 201, 0.08));
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  grid-template-rows: repeat(4, minmax(92px, 1fr));
  gap: 12px;
  min-height: 520px;
}

.letter-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.board-action-button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  padding: 7px 12px 7px 8px;
  color: #ffffff;
  box-shadow:
    5px 6px 0 rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  cursor: pointer;
  text-align: left;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    opacity 160ms ease;
}

.board-start-button {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.25), transparent 38%),
    linear-gradient(180deg, #4d5367, #232737);
}

.board-end-button {
  grid-template-columns: minmax(0, 1fr) 44px;
  padding: 7px 8px 7px 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.25), transparent 38%),
    linear-gradient(180deg, #ff766c, var(--danger-dark));
  text-align: right;
}

.board-action-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 7px;
  background: rgba(8, 11, 20, 0.28);
  font-size: 17px;
  line-height: 1;
}

.board-action-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.board-action-copy small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.board-action-copy strong {
  overflow-wrap: anywhere;
  font-size: 17px;
  font-weight: 1000;
  line-height: 1;
}

.board-action-button:hover:not(:disabled),
.board-action-button:focus-visible:not(:disabled) {
  transform: translate(2px, 2px);
  filter: brightness(1.08) saturate(1.06);
  box-shadow:
    3px 4px 0 rgba(0, 0, 0, 0.72),
    0 0 24px rgba(255, 209, 102, 0.18);
}

.board-action-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7) brightness(0.72);
  opacity: 0.58;
}

.letter-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
}

.letter-tile {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.07)),
    linear-gradient(180deg, rgba(255, 247, 223, 0.98), rgba(255, 225, 127, 0.92));
  color: #11131c;
  font-size: clamp(50px, 6.3vw, 92px);
  line-height: 1;
  font-weight: 1000;
  cursor: pointer;
  box-shadow:
    var(--hard-shadow),
    0 0 22px rgba(255, 209, 102, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.72),
    inset 0 -10px 20px rgba(0, 0, 0, 0.08);
  text-shadow:
    1px 2px 0 rgba(255, 255, 255, 0.8),
    3px 5px 0 rgba(0, 0, 0, 0.18),
    0 0 18px rgba(255, 255, 255, 0.6);
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    opacity 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.letter-symbol {
  display: block;
  min-width: 0;
  font-size: 1em;
  line-height: 1;
}

.letter-answer {
  display: none;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.12;
  letter-spacing: 0;
  text-align: center;
}

.correction-button {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(9, 12, 21, 0.82);
  color: var(--text);
  box-shadow:
    2px 3px 0 rgba(0, 0, 0, 0.66),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.correction-button:hover,
.correction-button:focus-visible {
  background: rgba(255, 209, 102, 0.96);
  color: #11131c;
  transform: translate(1px, 1px);
  box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.66);
}

.correction-button[hidden] {
  display: none;
}

.letter-tile[data-letter="W"] {
  font-size: clamp(36px, 4.8vw, 68px);
}

.letter-tile:hover:not(:disabled),
.letter-tile:focus-visible:not(:disabled) {
  transform: translate(2px, 2px);
  border-color: rgba(255, 255, 255, 0.92);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.1)),
    linear-gradient(180deg, #fff9e8 0%, #ffd166 100%);
  box-shadow:
    4px 5px 0 rgba(0, 0, 0, 0.78),
    0 0 30px rgba(255, 209, 102, 0.42);
}

.letter-tile.pending:not(:disabled) {
  transform: translate(3px, 3px);
  border-color: rgba(125, 235, 225, 1);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08)),
    linear-gradient(180deg, #dffbff 0%, #7debe1 100%);
  box-shadow:
    3px 4px 0 rgba(0, 0, 0, 0.78),
    0 0 0 4px rgba(53, 214, 201, 0.24),
    0 0 34px rgba(53, 214, 201, 0.42);
}

.letter-tile:disabled {
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  opacity: 0.44;
  transform: translate(7px, 7px);
  text-shadow: none;
}

.letter-tile.owned {
  color: #ffffff;
  border-color: var(--team-color);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(180deg, var(--team-color), var(--team-dark));
  opacity: 1;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.28),
    0 0 18px rgba(255, 255, 255, 0.3);
}

.letter-tile.owned:not(:disabled) {
  cursor: pointer;
  box-shadow:
    4px 5px 0 rgba(0, 0, 0, 0.72),
    0 0 0 4px rgba(255, 255, 255, 0.12),
    0 0 30px var(--team-color);
}

.letter-tile.unavailable {
  opacity: 0.22;
  filter: grayscale(1);
}

.letter-tile.answer-revealed:not(.unavailable) {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 5px;
  opacity: 1;
  transform: none;
  color: #11131c;
  border-color: rgba(255, 255, 255, 0.66);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.08)),
    linear-gradient(180deg, rgba(255, 247, 223, 0.98), rgba(255, 225, 127, 0.92));
  box-shadow:
    4px 5px 0 rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 0 22px rgba(255, 209, 102, 0.18);
  text-shadow: none;
}

.letter-tile.answer-revealed.owned {
  color: #ffffff;
  border-color: var(--team-color);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(180deg, var(--team-color), var(--team-dark));
}

.letter-tile.answer-revealed .letter-symbol {
  justify-self: start;
  font-size: 24px;
  line-height: 1;
}

.letter-tile.answer-revealed .letter-answer {
  display: grid;
  place-items: center;
}

.letter-tile.answer-revealed.unavailable .letter-answer {
  display: none;
}

.letter-tile.answer-revealed.explainable {
  cursor: help;
}

.letter-tile.answer-revealed.explainable::after {
  content: "i";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: rgba(8, 11, 20, 0.82);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(125, 235, 225, 0.36);
  font-size: 13px;
  font-weight: 1000;
  line-height: 1;
  text-shadow: none;
}

.letter-tile.answer-revealed.explainable:hover,
.letter-tile.answer-revealed.explainable:focus-visible {
  border-color: #7debe1;
  box-shadow:
    4px 5px 0 rgba(0, 0, 0, 0.72),
    0 0 0 3px rgba(125, 235, 225, 0.2),
    0 0 28px rgba(125, 235, 225, 0.32);
}

.definition-tooltip {
  position: fixed;
  z-index: 120;
  width: min(340px, calc(100vw - 24px));
  display: grid;
  gap: 7px;
  padding: 13px 15px;
  border: 1px solid rgba(125, 235, 225, 0.76);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 40%),
    rgba(8, 11, 20, 0.97);
  color: var(--text);
  box-shadow:
    5px 6px 0 rgba(0, 0, 0, 0.72),
    0 0 30px rgba(53, 214, 201, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.definition-tooltip[hidden] {
  display: none;
}

.definition-tooltip strong {
  color: #ffe28d;
  font-size: 17px;
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.definition-tooltip p {
  margin: 0;
  color: #f4f2e9;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.38;
}

.tile-spacer {
  visibility: hidden;
}

.center-panel {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  align-self: stretch;
  align-content: start;
  padding: 10px;
}

.center-panel::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: -1;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 40px rgba(255, 209, 102, 0.08);
}

.turn-control-row {
  width: min(370px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  align-items: center;
  gap: 12px;
}

.turn-card {
  width: 100%;
  min-height: 72px;
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--team-color, var(--danger));
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.26), transparent 38%),
    linear-gradient(180deg, var(--team-color, var(--danger)), var(--team-dark, var(--danger-dark)));
  color: #ffffff;
  text-align: center;
  box-shadow:
    5px 6px 0 rgba(0, 0, 0, 0.74),
    0 0 28px var(--team-color, var(--danger));
}

.turn-card span {
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
  opacity: 0.86;
}

.turn-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.1;
}

.timer-row {
  width: min(370px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 10px;
  align-items: stretch;
}

.timer {
  width: 100%;
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.06)),
    rgba(7, 10, 18, 0.82);
  color: #fff9e8;
  box-shadow:
    6px 7px 0 rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 32px rgba(255, 209, 102, 0.18);
  font-size: clamp(52px, 8vw, 86px);
  font-weight: 1000;
  line-height: 1;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.38),
    0 0 22px rgba(255, 209, 102, 0.36);
}

.timer-actions {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(150px, 190px);
  justify-content: center;
  gap: 10px;
}

.pause-button,
.end-button {
  min-width: 0;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  color: var(--text);
  box-shadow:
    5px 6px 0 rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-weight: 1000;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    border-color 160ms ease;
}

.pause-button {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.3), transparent 36%),
    linear-gradient(180deg, #ffd166, #e2a400);
  color: #11131c;
}

.end-button {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 36%),
    linear-gradient(180deg, #ff766c 0%, var(--danger) 100%);
}

.pause-button:hover,
.pause-button:focus-visible,
.pause-button.active,
.end-button:hover,
.end-button:focus-visible {
  transform: translate(2px, 2px);
  box-shadow:
    3px 4px 0 rgba(0, 0, 0, 0.72),
    0 0 22px rgba(255, 209, 102, 0.24);
}

.end-button:hover,
.end-button:focus-visible {
  filter: brightness(1.08) saturate(1.08);
  border-color: rgba(255, 150, 140, 0.9);
}

.timer.warning {
  color: #ff938b;
  border-color: rgba(255, 147, 139, 0.9);
  box-shadow:
    6px 7px 0 rgba(0, 0, 0, 0.78),
    0 0 36px rgba(212, 55, 42, 0.42);
}

.available-letters {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: clamp(13px, 1.5vw, 17px);
  font-weight: 850;
}

.round-button {
  position: relative;
  z-index: 2;
  width: min(292px, 72vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: clamp(13px, 2.1vw, 21px) solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.3), transparent 32%),
    linear-gradient(180deg, var(--team-color, var(--danger)) 0%, var(--team-color, var(--danger)) 52%, var(--team-dark, var(--danger-dark)) 100%);
  color: #ffffff;
  cursor: pointer;
  box-shadow:
    0 16px 0 rgba(0, 0, 0, 0.68),
    0 0 0 7px rgba(255, 255, 255, 0.12),
    0 30px 46px var(--team-color, rgba(212, 55, 42, 0.28));
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.24);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    filter 160ms ease;
}

.round-button-label {
  max-width: 100%;
  font-size: 34px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: normal;
}

.round-button-team {
  max-width: 92%;
  overflow-wrap: anywhere;
  font-size: clamp(15px, 2vw, 24px);
  font-weight: 1000;
  line-height: 1.05;
  text-transform: none;
}

.round-button:hover,
.round-button:focus-visible {
  transform: translateY(4px);
  box-shadow:
    0 12px 0 rgba(0, 0, 0, 0.68),
    0 0 0 9px rgba(255, 255, 255, 0.14),
    0 24px 38px var(--team-color, rgba(212, 55, 42, 0.34));
  filter: saturate(1.1) brightness(1.03);
}

.round-button.running {
  animation: button-pulse 880ms ease-in-out infinite alternate;
}

.round-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.55) brightness(0.72);
  animation: none;
}

.round-button.waiting {
  --team-color: #3b4055 !important;
  --team-dark: #171a28 !important;
}

@keyframes button-pulse {
  from {
    box-shadow:
      0 15px 0 rgba(0, 0, 0, 0.7),
      0 0 0 6px rgba(255, 255, 255, 0.12),
      0 28px 42px var(--team-color, rgba(212, 55, 42, 0.28));
  }

  to {
    box-shadow:
      0 12px 0 rgba(0, 0, 0, 0.72),
      0 0 0 16px rgba(255, 255, 255, 0.14),
      0 30px 52px var(--team-color, rgba(212, 55, 42, 0.42));
  }
}

.turn-instruction {
  width: min(372px, 100%);
  min-height: 34px;
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
}

.turn-instruction.attention {
  animation: instruction-shake 260ms ease-in-out;
  color: #ff938b;
}

@keyframes instruction-shake {
  0%,
  100% {
    transform: translateX(0);
  }

  33% {
    transform: translateX(-5px);
  }

  66% {
    transform: translateX(5px);
  }
}

.category-card {
  position: relative;
  width: min(372px, 100%);
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.055)),
    linear-gradient(180deg, rgba(255, 209, 102, 0.18), rgba(53, 214, 201, 0.08)),
    rgba(12, 16, 28, 0.72);
  text-align: center;
  box-shadow:
    6px 7px 0 rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.category-label {
  text-transform: uppercase;
  color: #7debe1;
  font-size: 14px;
  font-weight: 1000;
}

.category-card strong {
  color: #fff9e8;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.1;
  font-weight: 1000;
}

.category-strip {
  width: 100%;
  min-height: 76px;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  align-content: initial;
  column-gap: 18px;
  padding: 12px 64px;
  text-align: center;
  box-shadow:
    5px 6px 0 rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 26px rgba(53, 214, 201, 0.1);
}

.category-strip .category-label {
  white-space: nowrap;
}

.category-strip strong {
  padding-right: 0;
  font-size: clamp(22px, 2.6vw, 34px);
  text-align: center;
  overflow-wrap: anywhere;
}

.category-hint-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(125, 235, 225, 0.68);
  border-radius: 50%;
  background: rgba(8, 11, 20, 0.72);
  color: #7debe1;
  box-shadow:
    2px 3px 0 rgba(0, 0, 0, 0.62),
    0 0 16px rgba(53, 214, 201, 0.2);
  cursor: help;
  font-size: 17px;
  font-weight: 1000;
  line-height: 1;
}

.category-hint-button:hover,
.category-hint-button:focus-visible,
.category-hint-button[aria-expanded="true"] {
  border-color: #ffe28d;
  background: #35d6c9;
  color: #10131d;
  transform: translate(1px, 1px);
}

.site-footer {
  display: grid;
  align-items: center;
  justify-content: center;
  justify-items: center;
  gap: 7px;
  padding: 9px 4px 1px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.footer-credit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 9px;
}

.footer-credit strong {
  color: #fff9e8;
  font-size: 12px;
  font-weight: 950;
}

.footer-credit a {
  color: #7debe1;
  font-weight: 900;
  text-decoration-color: rgba(125, 235, 225, 0.5);
  text-underline-offset: 3px;
}

.footer-credit a:hover,
.footer-credit a:focus-visible {
  color: #ffe28d;
  text-decoration-color: currentColor;
}

.facebook-group-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 3px 8px 3px 4px;
  border: 1px solid rgba(255, 209, 102, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: #d8deea;
  font-size: 9px;
  font-weight: 850;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.facebook-group-link img {
  width: 76px;
  height: auto;
  display: block;
  border-radius: 3px;
}

.facebook-group-link:hover,
.facebook-group-link:focus-visible {
  border-color: rgba(255, 209, 102, 0.68);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.category-hint-tooltip {
  position: fixed;
  z-index: 125;
  width: min(420px, calc(100vw - 24px));
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid rgba(125, 235, 225, 0.76);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(110deg, rgba(53, 214, 201, 0.13), rgba(255, 209, 102, 0.07)),
    rgba(8, 11, 20, 0.98);
  color: var(--text);
  box-shadow:
    6px 7px 0 rgba(0, 0, 0, 0.72),
    0 0 34px rgba(53, 214, 201, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.category-hint-tooltip[hidden] {
  display: none;
}

.category-hint-kicker,
.category-hint-examples small {
  color: #7debe1;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.category-hint-tooltip > strong {
  padding-right: 24px;
  color: #fff9e8;
  font-size: 22px;
  line-height: 1.08;
}

.category-hint-tooltip > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 780;
  line-height: 1.38;
}

.category-hint-examples {
  display: grid;
  gap: 7px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.17);
}

.category-hint-examples > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.category-example {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 209, 102, 0.55);
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 209, 102, 0.12);
  color: #ffe28d;
  font-size: 14px;
  font-weight: 950;
}

.safe-reset-button {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 0;
  background: rgba(8, 11, 20, 0.58);
  color: var(--muted);
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.56);
  cursor: pointer;
  font-size: 13px;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.safe-reset-button > span {
  font-size: 25px;
  line-height: 1;
}

.safe-reset-button:hover,
.safe-reset-button:focus-visible {
  border-color: rgba(255, 209, 102, 0.65);
  color: #ffffff;
  transform: translate(1px, 1px);
}

.safe-reset-button.armed {
  border-color: #ff766c;
  background: rgba(212, 55, 42, 0.28);
  color: #ffffff;
  box-shadow:
    3px 4px 0 rgba(0, 0, 0, 0.56),
    0 0 22px rgba(212, 55, 42, 0.28);
}

.controls-content {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(130px, 0.65fr) minmax(190px, 1fr) minmax(240px, 1.35fr) auto;
  gap: 10px;
  align-items: end;
}

.subject-tabs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 209, 102, 0.16), rgba(53, 214, 201, 0.12)),
    rgba(255, 255, 255, 0.06);
}

.subject-tab {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 1000;
  cursor: pointer;
  box-shadow:
    3px 4px 0 rgba(0, 0, 0, 0.54),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.subject-tab--homeroom,
.subject-tab--education,
.subject-tab--language {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  line-height: 1.15;
}

.subject-tab--education {
  min-width: 130px;
  padding-inline: 12px;
}

.subject-language-group,
.subject-education-group {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(255, 209, 102, 0.4);
  border-radius: 8px;
  background: rgba(255, 209, 102, 0.08);
  box-shadow: inset 0 0 16px rgba(255, 209, 102, 0.07);
}

.subject-education-group {
  border-color: rgba(53, 214, 201, 0.42);
  background: rgba(53, 214, 201, 0.08);
  box-shadow: inset 0 0 16px rgba(53, 214, 201, 0.08);
}

.subject-tab--education .subject-label-line-0 {
  font-size: 16px;
}

.subject-tab--education .subject-label-line-1 {
  font-size: 12px;
  color: #8ff5eb;
}

.subject-tab--language {
  min-width: 116px;
  padding-inline: 12px;
}

.subject-tab--language .subject-label-line-0 {
  font-size: 16px;
}

.subject-tab--language .subject-label-line-1 {
  font-size: 12px;
  color: #ffe28d;
}

.subject-label-line-0 { font-size: 18px; }
.subject-label-line-1 { font-size: 14px; font-weight: 700; }
.subject-label-line-2 { font-size: 12px; color: #ffe08a; margin-top: 5px; }
.safety-teacher-material { grid-column: 1 / -1; color: #80e6dc; font-size: 16px; }
.safety-teacher-material[hidden] { display: none; }

.subject-tab:hover,
.subject-tab:focus-visible {
  transform: translate(2px, 2px);
  border-color: rgba(255, 209, 102, 0.72);
  box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.54);
}

.subject-tab[aria-pressed="true"] {
  border-color: #ff8c85;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 36%),
    linear-gradient(180deg, #f35b55, #b51f25);
  color: #ffffff;
  box-shadow:
    3px 4px 0 rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 0 22px rgba(239, 61, 62, 0.42);
}

.limit-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
    rgba(255, 209, 102, 0.16);
  color: var(--text);
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.limit-control span {
  color: #ffe28d;
}

.limit-control label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.limit-control input {
  accent-color: var(--gold);
}

.solo-time-field[hidden],
.team-count-field[hidden],
.starting-team-field[hidden],
.end-rule-field[hidden],
.grade-field[hidden],
.topic-field[hidden] {
  display: none !important;
}

.select-field {
  display: grid;
  gap: 5px;
  font-weight: 850;
}

.select-field > span:first-child,
.select-field > label:first-child {
  color: #7debe1;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.solo-time-control,
.custom-category-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.solo-time-control input,
.custom-category-control input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(8, 11, 20, 0.76);
  color: var(--text);
  padding: 0 11px;
  font-weight: 850;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.solo-time-control input:focus,
.custom-category-control input:focus {
  outline: 2px solid rgba(53, 214, 201, 0.82);
  outline-offset: 2px;
}

.solo-time-control select {
  width: 112px;
}

.custom-category-field {
  grid-column: span 2;
}

.custom-category-field.active > label:first-child {
  color: #ffe28d;
}

.custom-category-control button {
  width: 46px;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.custom-category-control button:disabled {
  opacity: 0.35;
  cursor: default;
}

select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(8, 11, 20, 0.76);
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
  font-weight: 850;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

select:focus {
  outline: 2px solid rgba(53, 214, 201, 0.82);
  outline-offset: 2px;
}

.reset-button,
.random-button {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  padding: 0 16px;
  color: white;
  font-weight: 1000;
  cursor: pointer;
  box-shadow:
    4px 5px 0 rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    border-color 160ms ease;
}

.reset-button {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 36%),
    linear-gradient(180deg, #2c3142, #11131c);
}

.random-button {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(180deg, #35d6c9, #277da1);
}

.reset-button:hover,
.reset-button:focus-visible,
.random-button:hover,
.random-button:focus-visible {
  filter: brightness(1.12);
  transform: translate(2px, 2px);
  border-color: rgba(255, 209, 102, 0.8);
  box-shadow:
    2px 3px 0 rgba(0, 0, 0, 0.72),
    0 0 24px rgba(53, 214, 201, 0.18);
}

.result-modal[hidden] {
  display: none;
}

.result-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(120deg, rgba(7, 9, 18, 0.86), rgba(20, 24, 42, 0.78)),
    rgba(0, 0, 0, 0.48);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.result-dialog {
  width: min(580px, 100%);
  max-height: calc(100dvh - 40px);
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 28px);
  overflow-y: auto;
}

.result-kicker {
  color: #7debe1;
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}

.result-dialog h2 {
  margin: 0;
  color: #fff9e8;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

.result-list {
  display: grid;
  gap: 8px;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--team-color);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(90deg, var(--team-color), var(--team-dark));
  color: #ffffff;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.54);
  font-weight: 1000;
}

.result-row span {
  overflow-wrap: anywhere;
}

.result-row strong {
  white-space: nowrap;
}

.result-row.winner {
  box-shadow:
    3px 4px 0 rgba(0, 0, 0, 0.54),
    0 0 0 3px rgba(255, 226, 141, 0.3),
    0 0 28px color-mix(in srgb, var(--team-color) 62%, transparent);
}

.result-metrics {
  min-width: max-content;
  display: grid;
  justify-items: end;
  gap: 2px;
}

.result-metrics span {
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 850;
}

.result-actions {
  display: grid;
  gap: 10px;
}

.next-game-button {
  border-color: rgba(255, 209, 102, 0.58);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 36%),
    linear-gradient(180deg, #3b4055, #171a28);
}

.modal-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.35;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.correction-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.correction-team {
  min-height: 46px;
  border: 1px solid var(--team-color);
  border-radius: 8px;
  padding: 0 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(180deg, var(--team-color), var(--team-dark));
  color: #ffffff;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.62);
  font-weight: 1000;
  cursor: pointer;
}

.correction-team:hover,
.correction-team:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.62);
}

.help-dialog {
  width: min(940px, 100%);
  gap: 24px;
  padding: clamp(20px, 3vw, 36px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.035)),
    linear-gradient(110deg, rgba(255, 209, 102, 0.09), transparent 38%),
    linear-gradient(250deg, rgba(53, 214, 201, 0.11), transparent 42%),
    rgba(13, 17, 30, 0.96);
}

.help-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.help-topline > div {
  display: grid;
  gap: 8px;
}

.help-topline h2 {
  font-size: clamp(42px, 6vw, 72px);
}

.help-intro {
  margin: 0;
  color: #ffe28d;
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 950;
  line-height: 1.18;
}

.help-close-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.help-close-icon:hover,
.help-close-icon:focus-visible {
  transform: rotate(6deg) scale(1.06);
  border-color: #ff938b;
  background: rgba(212, 55, 42, 0.28);
}

.help-steps {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
  list-style: none;
}

.help-step {
  --step-color: var(--gold);
  --step-ink: #11131c;
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 20px 0;
  border-top: 2px solid color-mix(in srgb, var(--step-color) 58%, transparent);
}

.help-step-number {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), transparent 42%),
    var(--step-color);
  color: var(--step-ink);
  box-shadow:
    3px 4px 0 rgba(0, 0, 0, 0.58),
    0 0 22px color-mix(in srgb, var(--step-color) 32%, transparent);
  font-size: 25px;
  font-weight: 1000;
}

.help-step > div {
  display: grid;
  gap: 5px;
}

.help-step-label {
  color: var(--step-color);
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}

.help-step strong {
  color: #ffffff;
  font-size: clamp(18px, 2.1vw, 23px);
  line-height: 1.12;
}

.help-step p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.35;
}

.step-aqua {
  --step-color: #58e6da;
}

.step-red {
  --step-color: #ff766c;
  --step-ink: #ffffff;
}

.step-violet {
  --step-color: #a581f2;
  --step-ink: #ffffff;
}

.step-blue {
  --step-color: #63bde3;
}

.step-green {
  --step-color: #65d48e;
}

.help-score {
  display: grid;
  gap: 18px;
  padding: 22px 0;
  border-top: 2px solid rgba(255, 209, 102, 0.62);
  border-bottom: 2px solid rgba(255, 209, 102, 0.28);
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.11), transparent 72%);
}

.help-section-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.help-section-title > span {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #11131c;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.56);
  font-size: 24px;
  font-weight: 1000;
}

.help-section-title > div {
  display: grid;
  gap: 2px;
}

.help-section-title small {
  color: #ffe28d;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.help-section-title h3 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.help-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.help-score-grid > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 4px 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.help-score-grid > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.help-score-grid strong {
  color: #ffe28d;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1;
}

.help-score-grid span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.help-tools {
  display: grid;
  gap: 17px;
}

.help-section-title.compact > span {
  width: 44px;
  height: 44px;
  background: #58e6da;
  font-size: 22px;
}

.help-section-title.compact small {
  color: #7debe1;
}

.help-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
}

.help-tool {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.help-tool > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(125, 235, 225, 0.56);
  border-radius: 50%;
  color: #7debe1;
  font-size: 20px;
  font-weight: 1000;
}

.help-tool p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
}

.help-tool strong {
  display: block;
  margin-bottom: 2px;
  color: #ffffff;
  font-size: 17px;
}

.help-solo-note {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 0 16px 18px;
  border-left: 5px solid #a581f2;
  background: linear-gradient(90deg, rgba(165, 129, 242, 0.15), transparent 80%);
}

.help-solo-note span {
  color: #c7adff;
  font-size: 14px;
  font-weight: 1000;
  text-transform: uppercase;
}

.help-solo-note strong {
  color: #ffffff;
  font-size: 16px;
  line-height: 1.3;
}

.help-start-button {
  min-height: 62px;
  font-size: 19px;
}

.creature {
  position: absolute;
  z-index: 0;
  width: 66px;
  height: 74px;
  border: 2px solid rgba(255, 255, 255, 0.54);
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.42));
}

.creature::before,
.creature::after {
  content: "";
  position: absolute;
}

.creature-eye {
  position: absolute;
  top: 27px;
  width: 8px;
  height: 12px;
  border-radius: 50%;
  background: #09101b;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.38);
}

.creature-eye:first-of-type {
  left: 21px;
}

.creature-eye:nth-of-type(2) {
  right: 21px;
}

.creature-mouth {
  position: absolute;
  left: 50%;
  bottom: 19px;
  width: 18px;
  height: 8px;
  border-bottom: 3px solid rgba(9, 16, 27, 0.82);
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

.creature-spark {
  left: clamp(4px, 1vw, 18px);
  bottom: 13%;
  border-radius: 48% 48% 45% 45%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 32%),
    linear-gradient(180deg, #ffd166, #ff6f3d 70%, #d4372a);
  animation: creature-bob 3.2s ease-in-out infinite;
}

.creature-spark::before {
  top: -28px;
  left: 17px;
  width: 29px;
  height: 38px;
  border-radius: 68% 32% 58% 42%;
  background: #ffd166;
  transform: rotate(28deg);
}

.creature-sprout {
  left: 9%;
  bottom: 3%;
  border-radius: 36% 36% 48% 48%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 32%),
    linear-gradient(180deg, #6de37f, #18a999);
  animation: creature-bob 3.6s ease-in-out 340ms infinite;
}

.leaf {
  position: absolute;
  top: -25px;
  width: 32px;
  height: 20px;
  border-radius: 999px 0 999px 0;
  background: #8ff29c;
}

.leaf-left {
  left: 8px;
  transform: rotate(-18deg);
}

.leaf-right {
  right: 8px;
  transform: scaleX(-1) rotate(-18deg);
}

.creature-cube {
  right: 9%;
  bottom: 4%;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 32%),
    linear-gradient(180deg, #b68cff, #7b4dd6);
  transform: rotate(-3deg);
  animation: creature-bob 3.8s ease-in-out 520ms infinite;
}

.creature-cube::before {
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
}

.creature-bubble {
  right: clamp(4px, 1vw, 18px);
  bottom: 14%;
  border-radius: 42% 58% 42% 58%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 32%),
    linear-gradient(180deg, #7debe1, #277da1);
  animation: creature-bob 3.4s ease-in-out 820ms infinite;
}

.creature-bubble::before {
  top: 12px;
  right: -13px;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.44);
  border-radius: 50%;
  background: rgba(53, 214, 201, 0.34);
}

@keyframes creature-bob {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1180px) {
  .brand-signature {
    width: 160px;
    height: 94px;
  }

  h1 {
    padding-left: 160px;
    font-size: clamp(34px, 4.8vw, 58px);
  }

  .creature-layer {
    opacity: 0.52;
  }

  .setup-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls-content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .team-fields {
    grid-column: 1 / -1;
  }

  .creature-sprout,
  .creature-cube {
    display: none;
  }
}

@media (max-width: 900px) {
  .game {
    min-height: auto;
  }

  .topbar,
  .setup-content,
  .controls-content {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .custom-category-field {
    grid-column: 1 / -1;
  }

  .topbar {
    justify-items: center;
    grid-template-columns: 1fr;
  }

  .brand-signature {
    position: relative;
    top: auto;
    left: auto;
    width: 174px;
    height: 102px;
    transform: none;
  }

  h1 {
    padding-left: 0;
    font-size: clamp(25px, 8vw, 46px);
  }

  .header-actions {
    justify-content: center;
  }

  .competition-heading {
    display: grid;
    align-items: stretch;
  }

  .competition-settings {
    grid-template-columns: 1fr 1fr;
  }

  .new-competition-button {
    grid-column: 1 / -1;
  }

  .limit-control {
    justify-content: center;
  }

  .board {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .center-panel {
    order: -1;
  }

  .letter-grid {
    min-height: auto;
    grid-template-columns: repeat(4, minmax(64px, 1fr));
    grid-template-rows: auto;
  }

  .tile-spacer {
    display: none;
  }

  .letter-tile {
    aspect-ratio: 1;
    font-size: clamp(42px, 16vw, 70px);
    box-shadow:
      5px 6px 0 rgba(0, 0, 0, 0.78),
      0 0 20px rgba(255, 209, 102, 0.18);
  }

  .letter-tile[data-letter="W"] {
    font-size: clamp(32px, 12.5vw, 54px);
  }

  .letter-tile.answer-revealed .letter-symbol {
    font-size: 18px;
  }

  .letter-tile.answer-revealed {
    min-height: 88px;
    aspect-ratio: auto;
  }

  .letter-tile.answer-revealed .letter-answer {
    font-size: 10px;
    line-height: 1.06;
  }

  .team-fields {
    grid-template-columns: 1fr;
  }

  .creature-layer {
    display: none;
  }
}

@media (max-width: 720px) {
  .subject-education-group {
    width: 100%;
    box-sizing: border-box;
  }

  .subject-tab--education {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 5px;
  }

  .subject-tab--education .subject-label-line-0 {
    font-size: 14px;
  }

  .subject-tab--education .subject-label-line-1 {
    font-size: 10px;
  }

  .settings-view-tabs {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .settings-step-arrow {
    width: 32px;
    height: 32px;
    margin: -2px auto;
    transform: rotate(90deg);
    font-size: 20px;
  }

  .settings-view-tab,
  .settings-view-tab > span {
    min-height: 62px;
  }

  .settings-view-tab > span {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .settings-view-tab small {
    font-size: 18px;
  }

  .settings-view-tab strong {
    padding: 9px 12px;
    font-size: 16px;
  }

  .mode-choice-grid {
    grid-template-columns: 1fr;
  }

  .category-strip {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 54px;
    text-align: center;
  }

  .category-strip .category-label {
    white-space: normal;
  }

  .help-dialog {
    gap: 20px;
  }

  .help-steps,
  .help-tool-grid {
    grid-template-columns: 1fr;
  }

  .help-score-grid {
    grid-template-columns: 1fr;
  }

  .help-score-grid > div,
  .help-score-grid > div:first-child {
    padding: 11px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.17);
    border-left: 0;
  }

  .help-score-grid > div:first-child {
    border-top: 0;
  }
}

@media (max-width: 520px) {
  .competition-settings {
    grid-template-columns: 1fr;
  }

  .new-competition-button {
    grid-column: auto;
  }

  .competition-team {
    grid-template-columns: minmax(80px, 1fr) repeat(3, auto);
    gap: 6px;
  }

  .round-button {
    width: min(260px, 74vw);
  }

  .round-button-label {
    font-size: 30px;
  }

  .category-hint-tooltip {
    padding: 14px;
  }

  .category-hint-tooltip > strong {
    font-size: 19px;
  }

  .result-modal {
    padding: 8px;
  }

  .help-dialog {
    max-height: calc(100dvh - 16px);
    padding: 18px 16px;
  }

  .help-topline {
    gap: 12px;
  }

  .help-topline h2 {
    font-size: 42px;
  }

  .help-close-icon {
    width: 42px;
    height: 42px;
  }

  .help-step {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    padding: 17px 0;
  }

  .help-step-number {
    width: 46px;
    height: 46px;
    font-size: 21px;
  }

  .help-step strong {
    font-size: 18px;
  }

  .help-solo-note {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
.color-palette {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 0;
}

.color-palette[hidden] { display: none; }
#domainField[hidden] { display: none; }

.color-choice {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 76px;
  padding: 10px;
  color: #fff;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.color-choice-swatch {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #b7c3c8;
}

.color-choice[aria-pressed="true"] {
  border-color: #ff746d;
  background: #442527;
}

.color-choice:hover, .color-choice:focus-visible {
  outline: 2px solid #f5d46e;
  outline-offset: 2px;
}
