:root {
  --bg: #f6efe4;
  --bg-deep: #21342a;
  --panel: rgba(255, 250, 243, 0.88);
  --panel-strong: #f4ebde;
  --ink: #1c2a24;
  --muted: #687266;
  --line: rgba(33, 52, 42, 0.12);
  --orange: #dd7a34;
  --orange-dark: #b55c1f;
  --blue: #5d8576;
  --green: #3f6b55;
  --purple: #6d6858;
  --pink: #c88f72;
  --yellow: #d7b066;
  --danger: #d4443f;
  --shadow-sm: 0 10px 24px rgba(37, 49, 38, 0.08);
  --shadow-md: 0 20px 50px rgba(37, 49, 38, 0.14);
  --shadow-lg: 0 34px 80px rgba(37, 49, 38, 0.2);
  --shadow-pop: 0 18px 44px rgba(63, 107, 85, 0.14), 0 12px 32px rgba(221, 122, 52, 0.14);
  --sans: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --builder-font: "Caveat", "Bricolage Grotesque", "Outfit", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 10% 6%, rgba(221, 122, 52, 0.18), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(63, 107, 85, 0.14), transparent 30%),
    radial-gradient(circle at 78% 84%, rgba(200, 143, 114, 0.12), transparent 24%),
    linear-gradient(180deg, #f8f0e5 0%, #f7f2e9 48%, #edf3ee 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(37, 49, 38, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 49, 38, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

body.launch-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.nav-pill {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 239, 228, 0.78));
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.nav-pill.active {
  color: #fff;
  background: linear-gradient(135deg, var(--bg-deep), #31503e);
  box-shadow: var(--shadow-sm);
}

.stage {
  flex: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(14px, 2.4vw, 26px) 0 20px;
}

.screen {
  display: none;
  animation: screenIn 0.35s ease both;
}

.screen.active {
  display: block;
}

.setup-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(16px, 2vw, 22px);
  align-items: stretch;
}

.setup-side,
.control-panel,
.question-card,
.over-wrap {
  border: 1px solid rgba(37, 49, 38, 0.1);
  background: var(--panel);
  border-radius: 34px;
  box-shadow: var(--shadow-md);
  animation: cardFloatIn 0.55s cubic-bezier(0.2, 1.35, 0.28, 1) both;
}

.setup-side {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 24px;
  color: #26312b;
  background: linear-gradient(180deg, #fffaf3 0%, #f4ebde 100%);
  border-color: rgba(37, 49, 38, 0.1);
}

.setup-side-head {
  display: grid;
  gap: 10px;
}

.setup-side-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.setup-side-copy {
  margin: 0;
  color: #687266;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 600;
}

.setup-live-strip,
.setup-hero-card {
  display: none;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0 0 14px;
  color: #f6b275;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

.control-panel {
  display: grid;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: clamp(22px, 3.2vw, 32px);
  background:
    radial-gradient(circle at 100% 0%, rgba(221, 122, 52, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 251, 245, 0.95), rgba(246, 239, 228, 0.88));
}

.setup-main {
  align-content: start;
}

.launcher-head {
  display: grid;
  gap: 10px;
  padding-bottom: 6px;
}

.launcher-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.launcher-head p {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 600;
}

.launcher-eyebrow {
  color: var(--orange-dark);
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.section-label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 900;
  font-size: 15px;
}

.grade-picker,
.segmented {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: rgba(37, 49, 38, 0.06);
  border-radius: 22px;
}

.grade-btn,
.mode-btn {
  flex: 1;
  border: 0;
  border-radius: 16px;
  padding: 13px 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.grade-btn:hover,
.mode-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.grade-btn.active,
.mode-btn.active {
  color: #fff;
  background: var(--bg-deep);
  box-shadow: var(--shadow-sm);
}

.grade-btn.disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.grade-btn.disabled:hover {
  color: var(--muted);
  background: transparent;
}

.selector-block {
  border: 1px solid rgba(37, 49, 38, 0.08);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 28px rgba(37, 49, 38, 0.06);
  overflow: hidden;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.selector-block:hover {
  border-color: rgba(63, 107, 85, 0.16);
  box-shadow: 0 18px 34px rgba(37, 49, 38, 0.08);
}

.accordion-block.open {
  border-color: rgba(221, 122, 52, 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(221, 122, 52, 0.08), transparent 32%),
    rgba(255, 255, 255, 0.7);
  box-shadow: 0 22px 44px rgba(37, 49, 38, 0.1);
}

.selector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 6px 2px 0;
}

.tiny-btn {
  border: 1px solid var(--line);
  color: var(--orange-dark);
  background: rgba(233, 111, 44, 0.08);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(221, 122, 52, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.tiny-btn:hover {
  transform: translateY(-2px);
  background: rgba(221, 122, 52, 0.16);
  border-color: rgba(221, 122, 52, 0.2);
  box-shadow: 0 14px 26px rgba(221, 122, 52, 0.14);
}

.selector-toggle {
  width: 100%;
  border: 0;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
  background: transparent;
  transition: background 0.22s ease;
}

.selector-toggle:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08));
}

.selector-toggle-copy {
  display: grid;
  gap: 4px;
}

.selector-toggle-copy strong {
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.selector-toggle-copy small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.selector-toggle-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.selector-toggle-meta em {
  font-style: normal;
  color: var(--orange-dark);
  font-size: 13px;
  font-weight: 950;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(221, 122, 52, 0.08);
}

.selector-caret {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.accordion-block.open .selector-caret {
  transform: rotate(225deg);
}

.selector-body {
  display: grid;
  gap: 18px;
  padding: 6px 18px 18px;
}

.accordion-block.open .selector-body {
  animation: accordionReveal 0.32s ease both;
}

.type-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.type-card {
  min-height: 112px;
  text-align: left;
  border: 1px solid rgba(37, 49, 38, 0.12);
  border-radius: 24px;
  padding: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 22px rgba(37, 49, 38, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
}

.type-card::before,
.unit-card::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 5px;
  opacity: 0.34;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--type-color, var(--orange)), rgba(255, 255, 255, 0));
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.type-card:hover,
.unit-card:hover,
.qoption:hover,
.word-tile:hover {
  transform: translateY(-5px) scale(1.015);
}

.type-card.selected {
  border-color: color-mix(in srgb, var(--type-color) 70%, transparent);
  box-shadow:
    0 24px 48px color-mix(in srgb, var(--type-color) 24%, transparent),
    0 0 0 1px color-mix(in srgb, var(--type-color) 18%, transparent);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.62)),
    linear-gradient(145deg, color-mix(in srgb, var(--type-color) 17%, transparent), transparent);
  transform: translateY(-4px);
}

.type-card.unavailable {
  opacity: 0.48;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(245, 240, 232, 0.5));
  box-shadow: inset 0 0 0 1px rgba(37, 49, 38, 0.04);
}

.type-card.unavailable:hover {
  transform: none;
}

.type-card.unavailable span,
.type-card.unavailable small {
  color: rgba(28, 42, 36, 0.64);
}

.type-card.unavailable i {
  color: rgba(28, 42, 36, 0.82);
  background: rgba(37, 49, 38, 0.08);
}

.type-card.selected::after {
  content: "ON";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: var(--type-color);
  box-shadow: 0 10px 18px color-mix(in srgb, var(--type-color) 28%, transparent);
}

.type-card i {
  display: inline-flex;
  margin-bottom: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: var(--bg-deep);
  font-style: normal;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.type-card.selected i {
  background: color-mix(in srgb, var(--type-color) 82%, var(--bg-deep));
  box-shadow: 0 12px 22px color-mix(in srgb, var(--type-color) 24%, transparent);
}

.type-card.selected::before {
  opacity: 0.8;
  transform: scaleX(1.02);
}

.type-card span,
.type-card small {
  display: block;
}

.type-card span {
  color: var(--ink);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.type-card small {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.disabled-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.disabled-types em {
  font-style: normal;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(37, 49, 38, 0.08);
}

.unit-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.unit-card {
  border: 1px solid rgba(37, 49, 38, 0.12);
  border-radius: 18px;
  padding: 14px 16px;
  min-height: 64px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 18px rgba(37, 49, 38, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.unit-card.selected {
  color: #fff;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 244, 227, 0.16), transparent 28%),
    linear-gradient(160deg, #2f4f3e 0%, #437159 58%, #cf7442 130%);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 22px 40px rgba(63, 107, 85, 0.2),
    0 16px 28px rgba(221, 122, 52, 0.18);
  transform: translateY(-2px);
}

.unit-card strong {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 900;
}

.unit-card.selected::before {
  opacity: 0.8;
  transform: scaleX(1.02);
}

.unit-check {
  position: relative;
  z-index: 1;
  width: 28px;
  min-width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: transparent;
  background: rgba(63, 107, 85, 0.08);
  box-shadow: inset 0 0 0 1px rgba(63, 107, 85, 0.08);
  font-size: 16px;
  font-weight: 900;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.unit-card.selected .unit-check {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transform: scale(1.04);
}

.type-card:focus-visible,
.unit-card:focus-visible,
.tiny-btn:focus-visible,
.selector-toggle:focus-visible {
  outline: 3px solid rgba(221, 122, 52, 0.26);
  outline-offset: 3px;
}

.type-card.just-picked,
.unit-card.just-picked {
  animation: puffySelect 0.42s cubic-bezier(0.2, 1.55, 0.3, 1) both;
}

.type-card.just-dropped,
.unit-card.just-dropped {
  animation: cardSettle 0.28s ease both;
}

.hud-menu-btn {
  min-height: 58px;
  border-radius: 20px;
  padding-inline: 16px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(246, 239, 228, 0.84));
  border-color: rgba(37, 49, 38, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.hud-menu-btn::before {
  content: "\2190";
  margin-right: 7px;
  color: var(--orange-dark);
  font-weight: 950;
}

.hud-menu-btn:hover {
  color: var(--orange-dark);
  transform: translateY(-1px);
}

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

.duel-name-fields {
  margin-top: -6px;
}

.leaderboard-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 0;
  padding: 16px;
  border: 1px solid rgba(37, 49, 38, 0.09);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 248, 238, 0.68));
  box-shadow: 0 16px 34px rgba(37, 49, 38, 0.07);
  min-height: 0;
}

.setup-side .leaderboard-panel {
  border-color: rgba(37, 49, 38, 0.1);
}

.leaderboard-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.leaderboard-head span {
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.leaderboard-head strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.leaderboard-list {
  display: grid;
  gap: 7px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(37, 49, 38, 0.08);
  box-shadow: 0 8px 18px rgba(37, 49, 38, 0.035);
}

.leaderboard-row:first-child {
  background:
    linear-gradient(135deg, rgba(255, 247, 224, 0.96), rgba(255, 255, 255, 0.86));
  border-color: rgba(215, 176, 102, 0.42);
}

.leaderboard-row:nth-child(2),
.leaderboard-row:nth-child(3) {
  background: rgba(255, 255, 255, 0.9);
}

.leaderboard-rank,
.leaderboard-score {
  font-weight: 950;
}

.leaderboard-rank {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: var(--orange-dark);
  background: rgba(221, 122, 52, 0.11);
  font-size: 12px;
}

.leaderboard-row:first-child .leaderboard-rank {
  color: #6f4914;
  background: rgba(215, 176, 102, 0.28);
}

.leaderboard-score {
  min-width: 46px;
  border-radius: 999px;
  padding: 7px 9px;
  color: #fff;
  background: linear-gradient(135deg, var(--bg-deep), #355742);
  box-shadow: 0 8px 16px rgba(37, 49, 38, 0.12);
  font-size: 13px;
  text-align: center;
}

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

.leaderboard-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.launch-hint-card {
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 16px 18px;
  border: 1px solid rgba(33, 52, 42, 0.1);
  border-radius: 22px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 235, 222, 0.72));
  box-shadow: 0 12px 30px rgba(33, 52, 42, 0.06);
}

.launch-hint-card strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.launch-hint-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.leaderboard-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.leaderboard-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  outline: none;
  font-weight: 800;
}

.btn-primary,
.btn-ghost {
  border: 0;
  border-radius: 20px;
  padding: 15px 20px;
  font-weight: 950;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #f19b38);
  box-shadow: 0 18px 38px rgba(233, 111, 44, 0.28);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: -70%;
  left: -35%;
  width: 55%;
  height: 240%;
  background: rgba(255, 255, 255, 0.22);
  transform: rotate(18deg);
  animation: buttonShine 4s ease-in-out infinite;
}

.btn-primary:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.btn-small {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
}

.btn-primary:not(:disabled):hover,
.btn-ghost:hover {
  transform: translateY(-2px);
}

#start-btn {
  width: 100%;
  margin-top: 24px;
  min-height: 58px;
  font-size: 17px;
}

.setup-warning {
  margin: 12px 0 0;
  color: var(--danger);
  font-weight: 900;
}

.launch-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 24px;
  overflow-y: auto;
  background: rgba(23, 32, 25, 0.34);
  backdrop-filter: blur(10px);
}

.launch-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 18px;
  margin: min(56px, 6vh) auto 24px;
  padding: 28px;
  overflow-y: auto;
  border: 1px solid rgba(33, 52, 42, 0.1);
  border-radius: 30px;
  background:
    radial-gradient(circle at 100% 0%, rgba(221, 122, 52, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(244, 235, 222, 0.92));
  box-shadow: var(--shadow-lg);
  animation: cardFloatIn 0.3s cubic-bezier(0.2, 1.35, 0.28, 1) both;
}

.launch-dialog h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 40px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.launch-dialog p {
  margin: -4px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 600;
}

.launch-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(33, 52, 42, 0.1);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-size: 24px;
  line-height: 1;
}

.launch-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.game-shell {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.game-hud {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(37, 49, 38, 0.1);
  background: rgba(255, 248, 236, 0.82);
  border-radius: 28px;
  box-shadow: var(--shadow-sm);
  width: min(980px, 100%);
  animation: slideDownPop 0.45s cubic-bezier(0.2, 1.35, 0.28, 1) both;
}

.hud-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 18px;
  border-radius: 20px;
  background: var(--bg-deep);
  color: #fff;
}

.hud-score small {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 900;
}

.hud-score strong {
  font-size: 34px;
  line-height: 1;
}

.hud-count {
  min-width: 88px;
  text-align: center;
  color: var(--muted);
  font-weight: 950;
}

.question-card {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 42px);
  background:
    radial-gradient(circle at 14% 0%, rgba(249, 115, 22, 0.18), transparent 26%),
    radial-gradient(circle at 94% 18%, rgba(14, 165, 233, 0.16), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(239, 93, 168, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 236, 0.92));
  box-shadow: var(--shadow-pop);
}

.question-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(circle at 50% 0%, rgba(212, 68, 63, 0), transparent 58%);
  transition: opacity 0.28s ease, background 0.28s ease;
}

.question-card > * {
  position: relative;
  z-index: 1;
}

.question-card.time-warning::after {
  opacity: 1;
  background: radial-gradient(circle at 50% 0%, rgba(245, 134, 52, 0.22), transparent 56%);
}

.question-card.time-danger {
  animation: dangerTremble 0.34s ease-in-out infinite;
}

.question-card.time-danger::after {
  opacity: 1;
  background: radial-gradient(circle at 50% 0%, rgba(212, 68, 63, 0.3), transparent 60%);
}

.question-card.streak-burst {
  animation: streakBurst 0.52s cubic-bezier(0.2, 1.55, 0.3, 1) both;
}

.question-card.streak-mega-burst {
  animation: streakMegaBurst 0.7s cubic-bezier(0.2, 1.6, 0.28, 1) both;
}

.question-card.streak-inferno-burst {
  animation: streakInfernoBurst 0.92s cubic-bezier(0.2, 1.7, 0.28, 1) both;
}

.question-card.streak-hot::before,
.question-card.streak-legend::before,
.question-card.streak-inferno::before,
.duel-player.streak-hot::before,
.duel-player.streak-legend::before,
.duel-player.streak-inferno::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 65% 32% at 18% 102%, rgba(255, 196, 64, 0.55), transparent 70%),
    radial-gradient(ellipse 55% 28% at 50% 105%, rgba(255, 137, 36, 0.7), transparent 72%),
    radial-gradient(ellipse 65% 32% at 82% 102%, rgba(255, 196, 64, 0.55), transparent 70%);
  --flame-opacity: 0.7;
  --flame-blur: 8px;
  animation: flameFlicker 1.4s ease-in-out infinite;
}

.question-card.streak-legend::before,
.duel-player.streak-legend::before {
  inset: -14px;
  --flame-opacity: 0.85;
  --flame-blur: 10px;
  background:
    radial-gradient(ellipse 70% 36% at 18% 102%, rgba(255, 213, 96, 0.7), transparent 70%),
    radial-gradient(ellipse 60% 32% at 50% 106%, rgba(255, 117, 36, 0.85), transparent 72%),
    radial-gradient(ellipse 70% 36% at 82% 102%, rgba(255, 213, 96, 0.7), transparent 70%),
    radial-gradient(ellipse 32% 70% at -2% 50%, rgba(255, 165, 56, 0.4), transparent 70%),
    radial-gradient(ellipse 32% 70% at 102% 50%, rgba(255, 165, 56, 0.4), transparent 70%);
  animation: flameFlicker 1.05s ease-in-out infinite;
}

.question-card.streak-inferno::before,
.duel-player.streak-inferno::before {
  inset: -22px;
  --flame-opacity: 0.95;
  --flame-blur: 12px;
  background:
    radial-gradient(ellipse 80% 42% at 18% 104%, rgba(255, 226, 120, 0.85), transparent 72%),
    radial-gradient(ellipse 70% 38% at 50% 108%, rgba(255, 96, 24, 1), transparent 74%),
    radial-gradient(ellipse 80% 42% at 82% 104%, rgba(255, 226, 120, 0.85), transparent 72%),
    radial-gradient(ellipse 38% 78% at -4% 50%, rgba(255, 137, 36, 0.7), transparent 70%),
    radial-gradient(ellipse 38% 78% at 104% 50%, rgba(255, 137, 36, 0.7), transparent 70%),
    radial-gradient(ellipse 70% 36% at 18% -4%, rgba(255, 213, 96, 0.6), transparent 70%),
    radial-gradient(ellipse 60% 30% at 50% -6%, rgba(255, 165, 56, 0.55), transparent 72%),
    radial-gradient(ellipse 70% 36% at 82% -4%, rgba(255, 213, 96, 0.6), transparent 70%);
  animation: flameFlicker 0.7s ease-in-out infinite;
}

.card-timer {
  position: relative;
  overflow: hidden;
  height: 20px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: rgba(37, 49, 38, 0.09);
  box-shadow: inset 0 2px 8px rgba(37, 49, 38, 0.08);
}

.card-timer-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #8edb73, var(--orange));
  transition: width 0.34s ease, background 0.28s ease;
  background-size: 160% 100%;
  animation: timerGlow 2.2s linear infinite;
}

.time-warning .card-timer-fill {
  background: linear-gradient(90deg, #f7b733, var(--orange));
}

.time-danger .card-timer-fill {
  background: linear-gradient(90deg, var(--danger), #ff7d6b);
}

.card-timer span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--bg-deep);
  font-size: 11px;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.qmeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.qmeta span {
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  background: rgba(37, 49, 38, 0.07);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qmeta-type {
  color: #fff !important;
  background: var(--bg-deep) !important;
  letter-spacing: 0.1em;
}

[data-qtype="daily_vocab"] .qmeta-type { background: linear-gradient(135deg, #b88a3e, #d7b066) !important; }
[data-qtype="quick_vocab"] .qmeta-type { background: linear-gradient(135deg, #3f6b55, #5d8576) !important; }
[data-qtype="gapfill"] .qmeta-type { background: linear-gradient(135deg, #b8615f, #c88f72) !important; }
[data-qtype="sentence_builder"] .qmeta-type { background: linear-gradient(135deg, #6d6858, #8b8576) !important; }

[data-difficulty="easy"] #q-diff,
[data-difficulty="easy"] #duel-diff {
  color: #2f5a44;
  background: rgba(63, 107, 85, 0.18);
}
[data-difficulty="medium"] #q-diff,
[data-difficulty="medium"] #duel-diff {
  color: #8a6a1f;
  background: rgba(215, 176, 102, 0.28);
}
[data-difficulty="hard"] #q-diff,
[data-difficulty="hard"] #duel-diff {
  color: #b43730;
  background: rgba(212, 68, 63, 0.18);
}

.question-card[data-qtype],
.duel-question-card[data-qtype] {
  --type-tint: rgba(249, 115, 22, 0.14);
  --diff-tint: rgba(63, 107, 85, 0);
}

.question-card[data-qtype="daily_vocab"],
.duel-question-card[data-qtype="daily_vocab"] { --type-tint: rgba(215, 176, 102, 0.24); }
.question-card[data-qtype="quick_vocab"],
.duel-question-card[data-qtype="quick_vocab"] { --type-tint: rgba(93, 133, 118, 0.24); }
.question-card[data-qtype="gapfill"],
.duel-question-card[data-qtype="gapfill"] { --type-tint: rgba(200, 143, 114, 0.26); }
.question-card[data-qtype="sentence_builder"],
.duel-question-card[data-qtype="sentence_builder"] { --type-tint: rgba(125, 116, 92, 0.22); }

.question-card[data-difficulty="medium"],
.duel-question-card[data-difficulty="medium"] { --diff-tint: rgba(215, 176, 102, 0.2); }
.question-card[data-difficulty="hard"],
.duel-question-card[data-difficulty="hard"] { --diff-tint: rgba(212, 68, 63, 0.2); }

.question-card[data-qtype],
.duel-question-card[data-qtype] {
  background:
    radial-gradient(circle at 14% -8%, var(--type-tint), transparent 32%),
    radial-gradient(circle at 92% 110%, var(--diff-tint), transparent 32%),
    radial-gradient(circle at 94% 18%, rgba(14, 165, 233, 0.12), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(239, 93, 168, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 236, 0.92));
  transition: background 0.45s ease, box-shadow 0.3s ease;
}

.question-card[data-difficulty="hard"]:not(.streak-hot):not(.streak-legend):not(.streak-inferno),
.duel-question-card[data-difficulty="hard"] {
  box-shadow: 0 0 0 2px rgba(212, 68, 63, 0.12), var(--shadow-pop);
}

.question-card[data-difficulty="medium"]:not(.streak-hot):not(.streak-legend):not(.streak-inferno),
.duel-question-card[data-difficulty="medium"] {
  box-shadow: 0 0 0 2px rgba(215, 176, 102, 0.18), var(--shadow-pop);
}

#q-streak {
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--pink)) !important;
  box-shadow: 0 12px 24px rgba(233, 111, 44, 0.24);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.question-card.streak-legend #q-streak {
  background: linear-gradient(135deg, #ff5b3b, #ff118a) !important;
  box-shadow: 0 14px 30px rgba(255, 91, 59, 0.4);
}

.question-card.streak-inferno #q-streak {
  background: linear-gradient(135deg, #ffc640, #ff5b3b 50%, #ff118a) !important;
  box-shadow: 0 16px 34px rgba(255, 91, 59, 0.55), 0 0 0 2px rgba(255, 255, 255, 0.4) inset;
  animation: streakBadgePulse 0.62s ease-in-out infinite;
}

.question-card.streak-inferno #q-streak::before {
  content: "\1F525  ";
}

#q-streak.burst-live {
  animation: streakBadgeBlast 0.76s cubic-bezier(0.2, 1.55, 0.3, 1) both;
}

@keyframes streakBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.duel-player.streak-hot {
  box-shadow:
    0 0 0 2px rgba(255, 165, 56, 0.3),
    0 22px 44px rgba(255, 137, 36, 0.18),
    var(--shadow-md);
}

.duel-player.streak-legend {
  box-shadow:
    0 0 0 3px rgba(255, 137, 36, 0.42),
    0 0 0 10px rgba(255, 196, 64, 0.18),
    0 28px 56px rgba(255, 117, 36, 0.26),
    var(--shadow-lg);
}

.duel-player.streak-inferno {
  box-shadow:
    0 0 0 3px rgba(255, 117, 36, 0.55),
    0 0 0 12px rgba(255, 196, 64, 0.24),
    0 0 0 24px rgba(255, 226, 120, 0.14),
    0 32px 64px rgba(255, 96, 24, 0.4),
    var(--shadow-lg);
}

.question-card.streak-hot,
.question-card.streak-legend,
.question-card.streak-inferno,
.duel-player.streak-hot,
.duel-player.streak-legend,
.duel-player.streak-inferno {
  overflow: visible;
}

.duel-player.streak-hot::after,
.duel-player.streak-legend::after,
.duel-player.streak-inferno::after {
  display: none;
}

.duel-player.streak-inferno .duel-streak,
.duel-player.streak-legend .duel-streak {
  color: #ff5b3b;
  font-weight: 950;
}

.duel-player.streak-inferno .duel-streak::before {
  content: "\1F525  ";
}

.q-helper {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
}

.qstem {
  margin: 0 0 30px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-align: center;
  color: var(--bg-deep);
  animation: stemPop 0.42s cubic-bezier(0.2, 1.35, 0.28, 1) both;
}

.qstem mark {
  display: inline-block;
  color: var(--orange-dark);
  background: rgba(233, 111, 44, 0.15);
  border-radius: 14px;
  padding: 0 10px 4px;
}

.word-focus,
.example-line,
.question-line,
.builder-prompt {
  display: block;
}

.word-focus {
  font-family: var(--display);
  color: var(--orange-dark);
  font-size: 1.22em;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.example-line {
  margin-top: 14px;
  font-family: var(--sans);
  color: var(--muted);
  font-size: 0.42em;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0;
  line-height: 1.45;
}

.question-line,
.builder-prompt {
  margin-top: 14px;
  font-family: var(--sans);
  color: var(--muted);
  font-size: 0.3em;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.qoptions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: min(720px, 100%);
  margin: 0 auto;
}

.qoption {
  position: relative;
  overflow: hidden;
  min-height: 76px;
  border: 1px solid rgba(37, 49, 38, 0.12);
  border-radius: 22px;
  padding: 16px 18px 16px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 236, 0.82));
  box-shadow: 0 14px 30px rgba(37, 49, 38, 0.08);
  text-align: left;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.005em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  transform-origin: center;
}

.qoption::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, var(--orange), var(--pink), var(--blue));
  opacity: 0.92;
}

.qoption:hover {
  border-color: rgba(233, 111, 44, 0.22);
  box-shadow: 0 20px 36px rgba(249, 115, 22, 0.12);
}

.qoption:nth-child(1) { animation: optionFloatIn 0.36s 0.02s both; }
.qoption:nth-child(2) { animation: optionFloatIn 0.36s 0.08s both; }
.qoption:nth-child(3) { animation: optionFloatIn 0.36s 0.14s both; }
.qoption:nth-child(4) { animation: optionFloatIn 0.36s 0.20s both; }
.qoption:nth-child(5) { animation: optionFloatIn 0.36s 0.26s both; }

.letter {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--bg-deep), #31503e);
  font-size: 14px;
  box-shadow: 0 10px 16px rgba(37, 49, 38, 0.14);
}

.qoption.correct {
  color: #fff;
  background: var(--green);
  border-color: transparent;
  animation: happyBounce 0.45s cubic-bezier(0.2, 1.55, 0.3, 1) both;
}

.qoption.wrong {
  color: #fff;
  background: var(--danger);
  border-color: transparent;
  animation: softShake 0.32s ease both;
}

.qoption.dim {
  opacity: 0.45;
}

.sentence-workbench {
  display: grid;
  gap: 16px;
}

.answer-chip,
.word-tile,
.tray-placeholder,
.word-bank-empty {
  font-family: var(--builder-font);
}

.question-card.builder-mode .qstem strong,
.duel-question-card.duel-builder-mode .qstem strong {
  display: block;
  margin-top: 12px;
  font-family: var(--display);
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 800;
  color: var(--bg-deep);
}

.builder-prompt {
  font-family: var(--sans);
}

.answer-tray,
.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 70px;
  align-items: center;
  border-radius: 24px;
  justify-content: center;
}

.answer-tray {
  padding: 14px;
  background: rgba(37, 49, 38, 0.07);
  border: 1px dashed rgba(37, 49, 38, 0.24);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.answer-tray.drop-ready {
  background: rgba(233, 111, 44, 0.14);
  border-color: rgba(233, 111, 44, 0.5);
  transform: scale(1.012);
}

.answer-chip {
  border: 0;
  border-radius: 14px;
  padding: 10px 13px;
  color: #fff;
  background: var(--bg-deep);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(37, 49, 38, 0.12);
  animation: chipPop 0.2s ease both;
  cursor: grab;
  touch-action: none;
}

.answer-chip.ghost-chip {
  color: rgba(28, 42, 36, 0.66);
  background: linear-gradient(180deg, rgba(255, 244, 230, 0.92), rgba(249, 213, 185, 0.84));
  border: 1px dashed rgba(221, 122, 52, 0.54);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
  cursor: default;
  opacity: 0.82;
}

.answer-chip.locked-chip {
  color: rgba(255, 255, 255, 0.95);
  background: linear-gradient(180deg, #5d8576, #3f6b55);
  border: 0;
  box-shadow: 0 6px 12px rgba(63, 107, 85, 0.22), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  cursor: default;
  position: relative;
  padding-right: 26px;
}

.answer-chip.locked-chip::after {
  content: "\1F512";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.7;
}

.answer-chip:active {
  cursor: grabbing;
}

.answer-chip.dragging {
  opacity: 0.3;
  transform: scale(0.92);
}

.answer-chip.pointer-dragging {
  position: relative;
  z-index: 8;
  cursor: grabbing;
  box-shadow: var(--shadow-lg);
  transition: none;
}

.answer-chip.chip-target {
  outline: 3px solid rgba(249, 115, 22, 0.35);
  transform: translateY(-4px) scale(1.05);
}

.tray-placeholder {
  color: var(--muted);
  font-weight: 900;
}

.builder-answer {
  width: 100%;
  color: var(--danger);
  font-weight: 950;
}

.word-bank {
  padding: 0;
}

.word-tile {
  border: 1px solid rgba(37, 49, 38, 0.12);
  border-radius: 16px;
  padding: 13px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 20px rgba(37, 49, 38, 0.08);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
  animation: tileWiggleIn 0.34s cubic-bezier(0.2, 1.35, 0.28, 1) both;
}

.word-bank-empty {
  padding: 16px 18px;
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.54);
  border: 1px dashed rgba(37, 49, 38, 0.14);
  font-weight: 800;
}

.word-tile:nth-child(2n) {
  animation-delay: 0.04s;
}

.word-tile:nth-child(3n) {
  animation-delay: 0.08s;
}

.word-tile:disabled {
  opacity: 0.42;
  transform: none;
}

.word-tile.dragging {
  opacity: 0.06;
  transform: scale(0.86);
  filter: saturate(0.65);
}

.word-tile.correct {
  background: rgba(27, 143, 97, 0.2);
}

.word-tile.wrong {
  background: rgba(212, 68, 63, 0.18);
}

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

.duel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
  animation: slideDownPop 0.42s cubic-bezier(0.2, 1.35, 0.28, 1) both;
}

.duel-round-pill {
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  background: rgba(37, 49, 38, 0.07);
  font-size: 13px;
  font-weight: 950;
}

.duel-round-pill.hot {
  color: #fff;
  background: var(--orange);
  box-shadow: 0 12px 24px rgba(249, 115, 22, 0.22);
}

.duel-question-card {
  align-self: center;
  width: 100%;
  min-width: 280px;
  margin: 0;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid rgba(37, 49, 38, 0.1);
  border-radius: 32px;
  background:
    radial-gradient(circle at 50% 0%, rgba(249, 115, 22, 0.18), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(14, 165, 233, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-pop);
  animation: stemPop 0.42s cubic-bezier(0.2, 1.35, 0.28, 1) both;
}

.duel-question-card.duel-streak-burst {
  animation: streakBurst 0.56s cubic-bezier(0.2, 1.55, 0.3, 1) both;
}

.duel-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 0.9fr) minmax(280px, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
}

.duel-player {
  position: relative;
  overflow: hidden;
  min-height: 500px;
  padding: 18px;
  border: 1px solid rgba(37, 49, 38, 0.1);
  border-radius: 32px;
  background:
    radial-gradient(circle at 10% 0%, rgba(14, 165, 233, 0.16), transparent 32%),
    radial-gradient(circle at 100% 100%, rgba(239, 93, 168, 0.08), transparent 26%),
    rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-md);
  animation: duelPanelIn 0.52s cubic-bezier(0.2, 1.35, 0.28, 1) both;
}

.duel-player.right {
  animation-delay: 0.08s;
}

.duel-player::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -70px;
  top: -70px;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.12);
  animation: jellyBlob 6s ease-in-out infinite;
}

.duel-player-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 22px;
  color: #fff;
  background: var(--bg-deep);
}

.duel-player-head span {
  font-weight: 950;
}

.duel-player-head strong {
  font-size: 32px;
  line-height: 1;
}

.duel-timer {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 50%;
  color: var(--bg-deep);
  background: #fff;
  box-shadow: inset 0 0 0 8px rgba(27, 143, 97, 0.22), var(--shadow-sm);
  font-size: 24px;
  font-weight: 950;
  animation: pulseTimer 1.3s ease-in-out infinite;
}

.duel-streak {
  min-height: 24px;
  margin-bottom: 8px;
  text-align: center;
  color: var(--orange-dark);
  font-weight: 950;
  animation: puffySelect 0.42s ease both;
}

.duel-options {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.duel-options.duel-builder {
  gap: 14px;
}

.duel-option {
  min-height: 62px;
  font-size: 15px;
}

.duel-answer-tray {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  min-height: 96px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(37, 49, 38, 0.07);
  border: 1px dashed rgba(37, 49, 38, 0.24);
  justify-content: center;
  align-items: center;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.duel-answer-tray.has-words {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(37, 49, 38, 0.16);
  border-style: solid;
  align-items: flex-start;
  justify-content: flex-start;
}

.duel-answer-tray .tray-placeholder {
  color: var(--muted);
  font-weight: 700;
  font-size: 22px;
  text-align: center;
  width: 100%;
}

.duel-answer-tray .duel-answer-chip {
  font-size: 22px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 0;
  color: #fff;
  background: var(--bg-deep);
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 12px rgba(37, 49, 38, 0.16);
  cursor: pointer;
  animation: chipPop 0.2s ease both;
}

.duel-answer-tray .duel-answer-chip.correct {
  background: var(--green);
}

.duel-answer-tray .duel-answer-chip.wrong {
  background: var(--danger);
}

.duel-answer-tray .duel-answer-chip.locked-chip {
  background: linear-gradient(180deg, #5d8576, #3f6b55);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 12px rgba(63, 107, 85, 0.22), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  cursor: default;
  padding-right: 26px;
  position: relative;
}

.duel-answer-tray .duel-answer-chip.locked-chip::after {
  content: "\1F512";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.7;
}

.duel-answer-tray .builder-answer {
  width: 100%;
  margin-top: 8px;
  color: var(--danger);
  font-weight: 800;
  font-size: 13px;
  text-align: center;
}

.duel-word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 60px;
}

.duel-word-bank .duel-word-tile {
  font-size: 22px;
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
}

.duel-word-bank .duel-word-tile:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.duel-word-bank .word-bank-empty {
  width: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed rgba(37, 49, 38, 0.14);
}

.duel-builder-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.duel-builder-actions .btn-ghost,
.duel-builder-actions .btn-primary {
  flex: 1;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.winner-glow {
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25), var(--shadow-lg);
}

.duel-good {
  animation: happyBounce 0.42s cubic-bezier(0.2, 1.55, 0.3, 1) both;
}

.duel-bad {
  animation: softShake 0.32s ease both;
}

.duel-player.out {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.delta-floater {
  pointer-events: none;
  position: fixed;
  top: 48%;
  left: 50%;
  z-index: 70;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  padding: 14px 18px;
  border-radius: 999px;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  box-shadow: var(--shadow-lg);
}

.delta-floater.show {
  animation: floatDelta 0.52s ease both;
}

.delta-floater.plus {
  background: var(--green);
}

.delta-floater.minus {
  background: var(--danger);
}

@keyframes floatDelta {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.78);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, -58%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -95%) scale(0.92);
  }
}

@keyframes mascotFloat {
  0%, 100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-6px) rotate(1deg);
  }
}

@keyframes softPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes puffySelect {
  0% {
    transform: scale(0.96);
  }
  55% {
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes cardSettle {
  0% {
    transform: scale(1.02);
    opacity: 0.92;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes accordionReveal {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes softPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.02);
  }
}

@keyframes happyBounce {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.045) rotate(-0.5deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes softShake {
  0%, 100% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-6px);
  }
  65% {
    transform: translateX(5px);
  }
}

@keyframes dangerTremble {
  0%, 100% {
    transform: translateX(0) rotate(0);
  }
  25% {
    transform: translateX(-2px) rotate(-0.18deg);
  }
  55% {
    transform: translateX(2px) rotate(0.18deg);
  }
  80% {
    transform: translateX(-1px) rotate(-0.12deg);
  }
}

@keyframes streakBurst {
  0% {
    transform: scale(1);
    box-shadow: var(--shadow-pop);
  }
  35% {
    transform: scale(1.028) rotate(-0.28deg);
    box-shadow: 0 0 0 6px rgba(249, 115, 22, 0.24), 0 0 0 18px rgba(239, 93, 168, 0.08), var(--shadow-lg);
  }
  62% {
    transform: scale(1.02) rotate(0.22deg);
    box-shadow: 0 0 0 8px rgba(14, 165, 233, 0.14), 0 0 0 22px rgba(249, 115, 22, 0.08), var(--shadow-lg);
  }
  100% {
    transform: scale(1);
    box-shadow: var(--shadow-pop);
  }
}

@keyframes streakMegaBurst {
  0% {
    transform: scale(1) rotate(0);
  }
  30% {
    transform: scale(1.05) rotate(-0.6deg);
    box-shadow: 0 0 0 10px rgba(249, 115, 22, 0.32), 0 0 0 24px rgba(255, 86, 130, 0.16), var(--shadow-lg);
  }
  62% {
    transform: scale(1.035) rotate(0.5deg);
    box-shadow: 0 0 0 12px rgba(255, 196, 64, 0.22), 0 0 0 28px rgba(255, 86, 130, 0.16), var(--shadow-lg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes streakInfernoBurst {
  0% {
    transform: scale(1) rotate(0);
    filter: hue-rotate(0deg) saturate(1);
  }
  20% {
    transform: scale(1.08) rotate(-1.2deg);
    box-shadow: 0 0 0 14px rgba(255, 86, 50, 0.45), 0 0 0 30px rgba(255, 17, 138, 0.22), var(--shadow-lg);
    filter: hue-rotate(-12deg) saturate(1.4);
  }
  45% {
    transform: scale(1.04) rotate(1deg);
    box-shadow: 0 0 0 18px rgba(255, 196, 64, 0.34), 0 0 0 36px rgba(255, 86, 50, 0.22), var(--shadow-lg);
    filter: hue-rotate(8deg) saturate(1.5);
  }
  72% {
    transform: scale(1.06) rotate(-0.6deg);
    filter: hue-rotate(-6deg) saturate(1.3);
  }
  100% {
    transform: scale(1) rotate(0);
    filter: hue-rotate(0deg) saturate(1);
  }
}

@keyframes streakBreathe {
  0%, 100% {
    box-shadow:
      0 0 0 5px rgba(249, 115, 22, 0.28),
      0 0 0 14px rgba(255, 86, 130, 0.14),
      0 28px 56px rgba(249, 115, 22, 0.22),
      var(--shadow-lg);
  }
  50% {
    box-shadow:
      0 0 0 7px rgba(249, 115, 22, 0.38),
      0 0 0 18px rgba(255, 86, 130, 0.22),
      0 32px 64px rgba(249, 115, 22, 0.3),
      var(--shadow-lg);
  }
}

@keyframes streakInfernoBreathe {
  0%, 100% {
    box-shadow:
      0 0 0 5px rgba(255, 86, 50, 0.42),
      0 0 0 14px rgba(255, 17, 138, 0.22),
      0 0 0 26px rgba(255, 196, 64, 0.14),
      0 30px 60px rgba(255, 86, 50, 0.34),
      var(--shadow-lg);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(255, 86, 50, 0.6),
      0 0 0 20px rgba(255, 17, 138, 0.34),
      0 0 0 34px rgba(255, 196, 64, 0.24),
      0 36px 72px rgba(255, 86, 50, 0.46),
      var(--shadow-lg);
  }
}

@keyframes flameFlicker {
  0%, 100% {
    transform: translateY(0) scaleY(1);
    opacity: var(--flame-opacity, 0.8);
    filter: blur(var(--flame-blur, 8px)) brightness(1);
  }
  20% {
    transform: translateY(-2px) scaleY(1.06);
    opacity: calc(var(--flame-opacity, 0.8) * 1.1);
    filter: blur(calc(var(--flame-blur, 8px) - 1px)) brightness(1.1);
  }
  45% {
    transform: translateY(1px) scaleY(0.96);
    opacity: calc(var(--flame-opacity, 0.8) * 0.78);
    filter: blur(calc(var(--flame-blur, 8px) + 1px)) brightness(0.92);
  }
  70% {
    transform: translateY(-1px) scaleY(1.04);
    opacity: calc(var(--flame-opacity, 0.8) * 1.04);
    filter: blur(var(--flame-blur, 8px)) brightness(1.06);
  }
}

@keyframes streakBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.018) rotate(-0.18deg); }
  68% { transform: scale(1.008) rotate(0.14deg); }
  100% { transform: scale(1); }
}

.streak-bump {
  animation: streakBump 0.42s cubic-bezier(0.2, 1.5, 0.3, 1) both;
}

@keyframes stageShake {
  0% { transform: translate(0, 0); }
  18% { transform: translate(-2px, 1px); }
  38% { transform: translate(2px, -1px); }
  58% { transform: translate(-1.5px, 0.5px); }
  78% { transform: translate(1px, 0); }
  100% { transform: translate(0, 0); }
}

@keyframes stageShakeStrong {
  0% { transform: translate(0, 0); }
  16% { transform: translate(-3px, 2px); }
  36% { transform: translate(3px, -2px); }
  56% { transform: translate(-2px, 1px); }
  76% { transform: translate(2px, -1px); }
  100% { transform: translate(0, 0); }
}

.stage.streak-shake {
  animation: stageShake 0.34s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.stage.streak-shake-strong {
  animation: stageShakeStrong 0.46s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes scorePop {
  0% { transform: scale(1); color: inherit; }
  35% { transform: scale(1.32); color: var(--orange); }
  100% { transform: scale(1); color: inherit; }
}

.score-pop {
  display: inline-block;
  animation: scorePop 0.46s cubic-bezier(0.2, 1.55, 0.3, 1) both;
  transform-origin: center;
}

@keyframes streakBadgeBlast {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.22);
  }
  45% {
    transform: scale(1.14) rotate(-2deg);
    box-shadow: 0 0 0 10px rgba(249, 115, 22, 0.12);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 12px 24px rgba(233, 111, 44, 0.24);
  }
}

@keyframes haloSpin {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(360deg) scale(1.04);
  }
}

@keyframes timerGlow {
  0% {
    background-position: 0% 50%;
    filter: saturate(1);
  }
  50% {
    background-position: 100% 50%;
    filter: saturate(1.1);
  }
  100% {
    background-position: 0% 50%;
    filter: saturate(1);
  }
}

@keyframes chipPop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes buttonShine {
  0%, 58% {
    transform: translateX(-140%) rotate(18deg);
  }
  78%, 100% {
    transform: translateX(360%) rotate(18deg);
  }
}

@keyframes jellyBlob {
  0%, 100% {
    transform: scale(1) translate(0, 0);
  }
  45% {
    transform: scale(1.12) translate(-18px, 10px);
  }
}

@keyframes cardFloatIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideDownPop {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes stemPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  70% {
    transform: translateY(-2px) scale(1.015);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes optionFloatIn {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(-0.5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

@keyframes tileWiggleIn {
  from {
    opacity: 0;
    transform: translateY(12px) rotate(-2deg) scale(0.94);
  }
  68% {
    transform: translateY(-2px) rotate(1deg) scale(1.02);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes duelPanelIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulseTimer {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 16px 32px rgba(245, 134, 52, 0.22);
  }
  50% {
    transform: scale(1.055);
    box-shadow: 0 18px 38px rgba(245, 134, 52, 0.34);
  }
}

.over-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 54px);
  text-align: center;
}

.over-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.over-subtitle {
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
}

.over-score {
  width: min(360px, 100%);
  margin: 26px auto;
  padding: 22px;
  color: #fff;
  background: var(--bg-deep);
  border-radius: 30px;
  box-shadow: var(--shadow-md);
}

.over-score span,
.over-score strong {
  display: block;
}

.over-score span {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
}

.over-score strong {
  font-size: clamp(56px, 8vw, 90px);
  line-height: 1;
}

.over-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.over-stats div {
  padding: 16px 10px;
  border-radius: 22px;
  background: rgba(37, 49, 38, 0.07);
}

.over-stats strong,
.over-stats span {
  display: block;
}

.over-stats strong {
  font-size: 28px;
}

.over-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.over-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid #f3f4f6;
  background: #fff;
}

.site-footer-inner {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-footer-brand {
  text-align: left;
}

.site-footer-logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  transition: color 160ms ease;
}

.site-footer-logo-wrap:hover {
  color: #ff6501;
}

.site-footer-logo {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.site-footer-brand p {
  margin: 8px 0 4px;
  color: #9ca3af;
  font-size: 14px;
  font-style: italic;
  font-weight: 600;
}

.site-footer-brand small {
  display: block;
  color: #d1d5db;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.7;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 24px;
  max-width: 760px;
}

.site-footer-links a {
  color: #9ca3af;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-decoration: none;
  text-transform: uppercase;
  text-underline-offset: 8px;
  transition: color 160ms ease;
}

.site-footer-links a:hover {
  color: #111827;
  text-decoration: underline;
}

.game-shell {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-items: center;
}

.game-main {
  width: min(920px, 100%);
  min-width: 0;
  display: grid;
  gap: 18px;
}

.game-hud,
.question-card {
  width: 100%;
}

.question-card.time-critical {
  animation: dangerTremble 0.22s linear infinite, criticalFlash 0.62s ease-in-out infinite;
}

.question-card.time-critical::after {
  opacity: 1;
  background: radial-gradient(circle at 50% 0%, rgba(212, 68, 63, 0.38), transparent 64%);
}

.question-card.streak-hot {
  box-shadow:
    0 0 0 2px rgba(255, 165, 56, 0.28),
    0 22px 44px rgba(255, 137, 36, 0.18),
    var(--shadow-pop);
}

.question-card.streak-legend {
  box-shadow:
    0 0 0 3px rgba(255, 137, 36, 0.36),
    0 0 0 10px rgba(255, 196, 64, 0.16),
    0 28px 56px rgba(255, 117, 36, 0.26),
    var(--shadow-lg);
}

.question-card.streak-inferno {
  box-shadow:
    0 0 0 3px rgba(255, 117, 36, 0.5),
    0 0 0 12px rgba(255, 196, 64, 0.22),
    0 0 0 24px rgba(255, 226, 120, 0.12),
    0 32px 64px rgba(255, 96, 24, 0.36),
    var(--shadow-lg);
}

.sentence-workbench {
  gap: 18px;
}

.answer-tray {
  position: relative;
  display: grid;
  gap: 12px;
  justify-items: stretch;
  padding: 18px 18px 20px;
}

.answer-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  min-height: 52px;
}

.answer-flow.previewing .answer-chip:not(.ghost-chip) {
  transform: translateY(-5px) scale(0.985);
  box-shadow: 0 14px 26px rgba(37, 49, 38, 0.16);
}

.answer-flow.previewing .ghost-chip {
  animation: ghostPulse 0.9s ease-in-out infinite;
}

.answer-flow.is-empty {
  justify-content: center;
}

.answer-chip {
  position: relative;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.answer-chip.pointer-dragging {
  opacity: 0.94;
  box-shadow: 0 18px 30px rgba(37, 49, 38, 0.22);
}

.tray-placeholder {
  text-align: center;
}

.drop-indicator {
  position: absolute;
  z-index: 3;
  width: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.86), rgba(255, 202, 71, 0.96));
  box-shadow:
    0 0 0 4px rgba(249, 115, 22, 0.12),
    0 12px 24px rgba(249, 115, 22, 0.28);
  opacity: 0;
  transform: scaleY(0.72);
  transition:
    left 0.11s ease,
    top 0.11s ease,
    opacity 0.12s ease,
    transform 0.12s ease,
    height 0.12s ease;
  pointer-events: none;
}

.drop-indicator.visible {
  opacity: 1;
  transform: scaleY(1);
}

.drop-indicator::before,
.drop-indicator::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 24px;
  height: 6px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.34);
  transform: translateX(-50%);
}

.drop-indicator::before {
  top: -8px;
}

.drop-indicator::after {
  bottom: -8px;
}

.answer-tray.drag-active {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(233, 111, 44, 0.4);
}

.word-bank {
  padding: 4px 0 0;
}

.duel-grid {
  grid-template-columns: minmax(250px, 1fr) minmax(360px, 0.9fr) minmax(250px, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.duel-arena {
  display: grid;
  align-content: center;
  gap: 14px;
}

.duel-question-card {
  position: relative;
}

.duel-question-card.duel-track-pulse {
  animation: streakBurst 0.46s cubic-bezier(0.2, 1.55, 0.3, 1) both;
}

.duel-question-card .qstem {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 32px);
  line-height: 1.12;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.duel-question-card.duel-builder-mode .qstem strong {
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.08;
  margin-top: 10px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.duel-finish-banner {
  min-height: 0;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  text-align: center;
  color: #fff;
  font-weight: 950;
  letter-spacing: -0.02em;
  pointer-events: none;
}

.duel-finish-banner.show {
  min-height: 54px;
  padding: 14px 18px;
  border-radius: 20px;
  opacity: 1;
  transform: translateY(0) scale(1);
  box-shadow: var(--shadow-lg);
  animation: streakBurst 0.66s cubic-bezier(0.2, 1.55, 0.3, 1) both;
}

.duel-finish-banner.p1 {
  background: linear-gradient(135deg, var(--orange), var(--pink));
}

.duel-finish-banner.p2 {
  background: linear-gradient(135deg, var(--blue), var(--purple));
}

.duel-finish-banner.draw {
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  overflow: hidden;
}

.spark-particle {
  position: fixed;
  width: var(--size, 12px);
  height: var(--size, 12px);
  margin-left: calc(var(--size, 12px) * -0.5);
  margin-top: calc(var(--size, 12px) * -0.5);
  border-radius: 999px;
  opacity: 0;
  animation: sparkleBurst 0.86s cubic-bezier(0.18, 0.82, 0.26, 1) forwards;
}

.spark-particle.good {
  background: radial-gradient(circle at 35% 35%, #fff, #8ee2a0 42%, var(--green));
}

.spark-particle.honey {
  background: radial-gradient(circle at 35% 35%, #fff8c7, #ffd86a 42%, var(--orange));
}

.spark-particle.danger {
  background: radial-gradient(circle at 35% 35%, #fff1f1, #ff9f95 42%, var(--danger));
}

.spark-particle.legend {
  background: radial-gradient(circle at 35% 35%, #ffffff, #ffe17c 30%, #ff7ac6 55%, #58bdf9 82%);
  box-shadow: 0 0 18px rgba(88, 189, 249, 0.35);
}

.spark-particle.inferno {
  background: radial-gradient(circle at 35% 35%, #fff, #ffd86a 24%, #ff5b3b 52%, #ff118a 88%);
  box-shadow: 0 0 22px rgba(255, 91, 59, 0.6), 0 0 40px rgba(255, 17, 138, 0.32);
}

@keyframes mapPulse {
  0%, 100% {
    transform: scale(1.06);
  }
  50% {
    transform: scale(1.18);
  }
}

@keyframes hiveFever {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.015);
  }
}

@keyframes mascotOrbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes criticalFlash {
  0%, 100% {
    filter: saturate(1);
  }
  50% {
    filter: saturate(1.18);
  }
}

@keyframes sparkleBurst {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.3) rotate(0deg);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--spin, 90deg));
  }
}

@keyframes heroPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes orbitDrift {
  0%, 100% {
    transform: translateY(0) rotate(0.5deg);
  }
  50% {
    transform: translateY(-8px) rotate(-1deg);
  }
}

@keyframes slowSpin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes slowSpinReverse {
  from {
    transform: translate(-50%, -50%) rotate(360deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(0deg);
  }
}

@keyframes liveBlink {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.18);
    opacity: 0.76;
  }
}

@keyframes ghostPulse {
  0%, 100% {
    transform: translateY(-2px) scale(0.98);
    opacity: 0.72;
  }
  50% {
    transform: translateY(-6px) scale(1.02);
    opacity: 0.96;
  }
}

@media (max-width: 940px) {
  .setup-shell {
    grid-template-columns: 1fr;
  }

  .game-hud {
    grid-template-columns: 1fr 1fr;
  }

  .duel-grid {
    grid-template-columns: 1fr;
  }

  .duel-arena {
    order: -1;
  }

  .hud-count {
    justify-self: end;
  }
}

@media (max-width: 680px) {
  .duel-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-side,
  .control-panel {
    padding: 24px;
  }

  .control-row,
  .bottom-controls,
  .type-picker,
  .qoptions,
  .over-stats {
    grid-template-columns: 1fr;
  }

  .answer-flow {
    justify-content: flex-start;
  }

  .unit-picker {
    grid-template-columns: repeat(3, 1fr);
  }

  .setup-orbit-field {
    min-height: 208px;
  }

  .orbit-core {
    width: 136px;
    height: 136px;
  }

  .orbit-core strong {
    font-size: 34px;
  }

  .orbit-chip {
    min-width: 92px;
    padding: 10px 12px;
  }

  .question-card {
    min-height: 0;
  }

  .duel-player {
    min-height: 0;
  }

  .qstem {
    font-size: 30px;
  }

  .launch-dialog {
    padding: 24px;
  }

  .site-footer-inner,
  .over-actions,
  .launch-actions {
    flex-direction: column;
  }

  .site-footer-inner {
    align-items: center;
    padding: 28px 18px;
    text-align: center;
  }

  .site-footer-brand {
    text-align: center;
  }
}
