:root {
  --mint: #54c3a7;
  --mint-dark: #29a989;
  --mint-soft: #e9f8f4;
  --blue: #4f8de7;
  --cyan: #43b9c8;
  --orange: #f6a51a;
  --yellow: #ffc42e;
  --pink: #ff6fae;
  --purple: #8a7cf6;
  --lime: #95d84f;
  --red: #ff6b5f;
  --ink: #1d2f3a;
  --muted: #6b7d86;
  --line: #dce9e6;
  --paper: #fffdfa;
  --surface: #ffffff;
  --shadow: 0 18px 50px rgba(49, 102, 99, 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  background: linear-gradient(180deg, #fffdf8 0%, #f1fbf8 100%);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(860px, 1fr);
  min-height: 100vh;
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  background: rgba(255, 255, 255, 0.84);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.brand {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}

.brand img {
  width: 58px;
  height: 42px;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #40545d;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: var(--mint-soft);
  border-color: #c6eee4;
  color: var(--mint-dark);
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--mint);
}

.quota {
  margin-top: auto;
  padding: 16px;
  border: 1px solid #cfeee6;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #edf9f5 100%);
}

.quota-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.quota-head strong {
  color: var(--mint-dark);
}

.quota-bar {
  height: 8px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #dcefe9;
}

.quota-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--blue));
}

.quota button,
.primary-button,
.ghost-button,
.small-button,
.screen-footer button {
  height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.quota button {
  width: 100%;
  color: #fff;
  background: var(--mint-dark);
}

.workspace {
  padding: 40px 28px 36px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--mint-dark);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.primary-button {
  min-width: 128px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--mint), var(--cyan));
  color: #fff;
  box-shadow: 0 10px 24px rgba(41, 169, 137, 0.22);
}

.ghost-button,
.small-button {
  padding: 0 14px;
  color: #37505a;
  background: #fff;
  border-color: var(--line);
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(310px, 0.9fr) minmax(300px, 0.85fr) minmax(380px, 1.15fr);
  gap: 16px;
  align-items: stretch;
}

.creator-panel,
.games-panel,
.preview-panel {
  min-height: 560px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-title > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  background: var(--orange);
}

.field-label {
  display: block;
  margin: 15px 0 8px;
  color: #3e535c;
  font-size: 13px;
  font-weight: 700;
}

.text-input,
.word-input,
select {
  width: 100%;
  border: 1px solid #cfe2df;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.text-input {
  height: 44px;
  padding: 0 12px;
}

.word-input {
  min-height: 208px;
  resize: vertical;
  padding: 12px;
  line-height: 1.8;
  tab-size: 12;
}

.text-input:focus,
.word-input:focus,
select:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(84, 195, 167, 0.16);
}

.format-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.teacher-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.teacher-tabs button {
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid #cfe2df;
  border-radius: 8px;
  background: #fff;
  color: #3c535d;
  font-size: 13px;
  font-weight: 700;
}

.teacher-tabs button.active {
  border-color: var(--mint);
  background: var(--mint-soft);
  color: var(--mint-dark);
}

.settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settings label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

select {
  height: 42px;
  padding: 0 10px;
}

.auto-status {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 700;
}

.game-list {
  display: grid;
  max-height: 484px;
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
}

.game-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  min-height: 86px;
  padding: 13px;
  border: 2px solid #d9e8e4;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 18px rgba(42, 89, 87, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.game-card.active {
  border-color: var(--mint);
  background: linear-gradient(135deg, #ffffff 0%, #f0fffa 100%);
  box-shadow: inset 5px 0 0 var(--mint), 0 14px 28px rgba(42, 132, 120, 0.15);
  transform: translateY(-1px);
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(42, 89, 87, 0.14);
}

.game-icon {
  grid-row: 1 / span 2;
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  color: #fff;
  overflow: hidden;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--mint));
  box-shadow: 0 10px 20px rgba(58, 103, 121, 0.18);
}

.game-icon::before,
.game-icon::after,
.game-icon span::before,
.game-icon span::after {
  content: "";
  position: absolute;
  display: block;
}

.game-icon > span {
  position: relative;
  z-index: 2;
}

.game-card:nth-child(2) .game-icon {
  background: linear-gradient(135deg, var(--mint), var(--orange));
}

.game-card:nth-child(3) .game-icon {
  background: linear-gradient(135deg, var(--orange), var(--yellow));
}

.game-card:nth-child(4) .game-icon {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.game-card:nth-child(5) .game-icon {
  background: linear-gradient(135deg, #ee7a46, var(--orange));
}

.game-card:nth-child(6) .game-icon {
  background: linear-gradient(135deg, #7d7be8, var(--blue));
}

.game-card:nth-child(7) .game-icon {
  background: linear-gradient(135deg, var(--mint-dark), var(--cyan));
}

.game-card:nth-child(8) .game-icon {
  background: linear-gradient(135deg, #334e68, var(--blue));
}

.game-card:nth-child(1) {
  background: linear-gradient(135deg, #ffffff 0%, #eef9ff 100%);
}

.game-card:nth-child(2) {
  background: linear-gradient(135deg, #ffffff 0%, #fff8e9 100%);
}

.game-card:nth-child(3) {
  background: linear-gradient(135deg, #ffffff 0%, #fff4e8 100%);
}

.game-card:nth-child(4) {
  background: linear-gradient(135deg, #ffffff 0%, #edf5ff 100%);
}

.game-card:nth-child(5) {
  background: linear-gradient(135deg, #ffffff 0%, #fff0f6 100%);
}

.game-card:nth-child(6) {
  background: linear-gradient(135deg, #ffffff 0%, #f3f0ff 100%);
}

.game-card:nth-child(7) {
  background: linear-gradient(135deg, #ffffff 0%, #effff0 100%);
}

.game-card:nth-child(8) {
  background: linear-gradient(135deg, #ffffff 0%, #eef7ff 100%);
}

.icon-flash {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.icon-flash::before,
.icon-flash::after {
  width: 34px;
  height: 24px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  transform: rotate(-10deg);
}

.icon-flash::after {
  transform: translate(6px, 6px) rotate(8deg);
  background: #ffdd72;
}

.icon-flash span {
  color: #24556a;
  font-size: 17px;
}

.icon-match {
  background: linear-gradient(135deg, var(--mint), var(--orange));
}

.icon-match::before,
.icon-match::after {
  width: 20px;
  height: 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.08);
}

.icon-match::before {
  left: 10px;
  top: 14px;
}

.icon-match::after {
  right: 10px;
  bottom: 14px;
}

.icon-match span {
  width: 26px;
  height: 4px;
  border-radius: 999px;
  background: #fff;
  transform: rotate(-32deg);
}

.icon-wheel {
  background: #fff;
}

.icon-wheel span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: conic-gradient(var(--pink) 0 25%, var(--yellow) 0 50%, var(--mint) 0 75%, var(--blue) 0 100%);
  box-shadow: inset 0 0 0 5px #fff;
}

.icon-wheel::after {
  top: 4px;
  left: 26px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 13px solid var(--red);
}

.icon-quiz {
  background: linear-gradient(135deg, var(--purple), var(--blue));
}

.icon-quiz::before {
  width: 38px;
  height: 30px;
  border-radius: 15px 15px 15px 5px;
  background: #fff;
}

.icon-quiz span {
  color: var(--blue);
  font-size: 22px;
}

.icon-spelling {
  background: linear-gradient(135deg, var(--pink), var(--orange));
}

.icon-spelling::before,
.icon-spelling::after {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #fff;
  box-shadow: 16px 16px 0 #ffdf77;
}

.icon-spelling::before {
  left: 9px;
  top: 9px;
}

.icon-spelling span {
  color: var(--pink);
  font-size: 20px;
}

.icon-sentence {
  background: linear-gradient(135deg, var(--purple), var(--pink));
}

.icon-sentence span {
  width: 34px;
  height: 9px;
  border-radius: 999px;
  background: #fff;
  transform: rotate(-35deg);
}

.icon-sentence span::after {
  right: -8px;
  top: 0;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 10px solid #ffdf77;
}

.icon-bingo {
  background: linear-gradient(135deg, var(--lime), var(--mint));
}

.icon-bingo span {
  width: 38px;
  height: 38px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.icon-bingo span::before {
  inset: 0;
  background:
    linear-gradient(#fff 0 0) 0 0 / 10px 10px,
    linear-gradient(#fff 0 0) 14px 0 / 10px 10px,
    linear-gradient(#fff 0 0) 28px 0 / 10px 10px,
    linear-gradient(#fff 0 0) 0 14px / 10px 10px,
    linear-gradient(#ffdf77 0 0) 14px 14px / 10px 10px,
    linear-gradient(#fff 0 0) 28px 14px / 10px 10px,
    linear-gradient(#fff 0 0) 0 28px / 10px 10px,
    linear-gradient(#fff 0 0) 14px 28px / 10px 10px,
    linear-gradient(#fff 0 0) 28px 28px / 10px 10px;
  background-repeat: no-repeat;
}

.icon-odd {
  background: linear-gradient(135deg, #314e68, var(--cyan));
}

.icon-odd::before,
.icon-odd::after {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffdf77;
}

.icon-odd::before {
  left: 12px;
  bottom: 12px;
}

.icon-odd::after {
  right: 12px;
  top: 12px;
}

.icon-odd span {
  font-size: 26px;
  text-shadow: 0 2px rgba(0, 0, 0, 0.12);
}

.icon-tiles {
  background: linear-gradient(135deg, var(--pink), var(--blue));
}

.icon-tiles span {
  width: 38px;
  height: 38px;
  background:
    linear-gradient(#fff 0 0) 0 0 / 16px 16px,
    linear-gradient(#ffdf77 0 0) 22px 0 / 16px 16px,
    linear-gradient(#95d84f 0 0) 0 22px / 16px 16px,
    linear-gradient(#fff 0 0) 22px 22px / 16px 16px;
  background-repeat: no-repeat;
}

.icon-hangman {
  background: linear-gradient(135deg, #ff7c7c, var(--orange));
}

.icon-hangman span {
  width: 36px;
  height: 28px;
  border-bottom: 5px solid #fff;
  border-left: 5px solid #fff;
  border-radius: 4px;
}

.icon-hangman span::after {
  right: -8px;
  top: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
}

.icon-picture {
  background: linear-gradient(135deg, var(--lime), var(--cyan));
}

.icon-picture span {
  width: 38px;
  height: 30px;
  border: 4px solid #fff;
  border-radius: 8px;
}

.icon-picture span::before {
  left: 5px;
  bottom: 4px;
  width: 26px;
  height: 12px;
  border-radius: 10px 10px 3px 3px;
  background: #ffdf77;
  clip-path: polygon(0 100%, 38% 35%, 56% 70%, 72% 18%, 100% 100%);
}

.icon-maze {
  background: linear-gradient(135deg, #3d7cff, var(--purple));
}

.icon-maze span {
  width: 38px;
  height: 38px;
  border: 4px solid #fff;
  border-radius: 8px;
  background:
    linear-gradient(#fff 0 0) 10px 0 / 4px 26px,
    linear-gradient(#fff 0 0) 22px 12px / 4px 26px,
    radial-gradient(circle, #ffdf77 0 5px, transparent 6px);
  background-repeat: no-repeat;
}

.icon-pop {
  background: linear-gradient(135deg, var(--pink), var(--yellow));
}

.icon-pop span {
  width: 30px;
  height: 38px;
  border-radius: 50% 50% 45% 45%;
  background: #fff;
}

.icon-pop span::after {
  left: 12px;
  bottom: -7px;
  width: 6px;
  height: 10px;
  border-radius: 2px;
  background: #fff;
}

.game-card strong {
  align-self: end;
  font-size: 16px;
}

.game-card small {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
}

.device-toggle {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5faf8;
}

.device-toggle button {
  height: 28px;
  min-width: 54px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.device-toggle button.active {
  background: #fff;
  color: var(--mint-dark);
  box-shadow: 0 4px 12px rgba(47, 100, 93, 0.12);
}

.screen-preview {
  position: relative;
  display: grid;
  grid-template-rows: 58px 1fr 64px;
  min-height: 484px;
  overflow: hidden;
  border: 10px solid #263b46;
  border-radius: 20px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 111, 174, 0.2) 0 18px, transparent 19px),
    radial-gradient(circle at 88% 20%, rgba(255, 196, 46, 0.26) 0 20px, transparent 21px),
    radial-gradient(circle at 16% 86%, rgba(84, 195, 167, 0.2) 0 22px, transparent 23px),
    radial-gradient(circle at 84% 80%, rgba(79, 141, 231, 0.18) 0 24px, transparent 25px),
    linear-gradient(90deg, rgba(255, 196, 46, 0.16) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(79, 141, 231, 0.12) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #f7fffc 0%, #fff9f0 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 28px 28px, 28px 28px, 100% 100%;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.screen-preview::before,
.screen-preview::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.screen-preview::before {
  top: 78px;
  right: 24px;
  width: 30px;
  height: 30px;
  background: #ffdf77;
  clip-path: polygon(50% 0, 61% 34%, 96% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 4% 35%, 39% 34%);
  filter: drop-shadow(0 6px 8px rgba(246, 165, 26, 0.22));
}

.screen-preview::after {
  left: 24px;
  bottom: 76px;
  width: 48px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 111, 174, 0.18);
  box-shadow: 278px -248px 0 rgba(84, 195, 167, 0.14), 316px 2px 0 rgba(79, 141, 231, 0.14);
}

.screen-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  color: #fff;
  background:
    radial-gradient(circle at 18px 14px, rgba(255, 255, 255, 0.28) 0 5px, transparent 6px),
    radial-gradient(circle at 72px 42px, rgba(255, 255, 255, 0.2) 0 4px, transparent 5px),
    linear-gradient(90deg, var(--mint-dark), var(--blue), var(--purple));
  font-size: 14px;
  font-weight: 700;
}

.screen-top span {
  position: relative;
  z-index: 2;
}

.screen-top span:last-child {
  padding: 8px 12px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 -2px rgba(0, 0, 0, 0.08);
}

.preview-content {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 28px;
}

.flash-preview {
  width: min(100%, 360px);
  min-height: 270px;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 30px;
  border: 4px solid #bfece0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 22px 22px, #ffdf77 0 9px, transparent 10px),
    radial-gradient(circle at calc(100% - 24px) 30px, #95d84f 0 7px, transparent 8px),
    linear-gradient(135deg, rgba(255, 223, 119, 0.28) 0 18%, transparent 18% 100%),
    linear-gradient(315deg, rgba(255, 111, 174, 0.16) 0 22%, transparent 22% 100%),
    #fff;
  text-align: center;
  box-shadow: 0 18px 34px rgba(42, 89, 87, 0.16), inset 0 -8px rgba(84, 195, 167, 0.08);
}

.flash-preview strong {
  color: var(--mint-dark);
  font-size: 60px;
  line-height: 1;
  text-shadow: 0 4px 0 rgba(84, 195, 167, 0.16);
}

.flash-preview span {
  color: #35505a;
  font-size: 30px;
}

.flash-preview p {
  color: var(--muted);
}

.definition-text {
  max-width: 310px;
  color: #4a6470;
  font-size: 18px;
  line-height: 1.5;
}

.game-stage {
  width: min(100%, 390px);
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.stage-title {
  display: inline-grid;
  gap: 3px;
  justify-items: center;
  padding: 8px 18px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mint), var(--blue));
  color: #fff;
  box-shadow: 0 12px 22px rgba(42, 89, 87, 0.15);
}

.stage-title span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.stage-title strong {
  font-size: 16px;
}

.match-board {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 42px 1fr;
  gap: 8px;
  align-items: center;
  padding: 14px;
  border: 3px solid #ffe4a3;
  border-radius: 24px;
  background:
    radial-gradient(circle at 18px 20px, rgba(255, 111, 174, 0.2) 0 9px, transparent 10px),
    linear-gradient(180deg, #fffdf5 0%, #fff6df 100%);
  box-shadow: 0 16px 30px rgba(128, 93, 36, 0.12);
}

.match-lane {
  display: grid;
  gap: 8px;
}

.match-bridge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 8px 14px rgba(246, 165, 26, 0.24);
}

.match-chip {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: 8px;
  border: 2px solid #cbe8e0;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #f8fffc 100%);
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(42, 89, 87, 0.1), inset 0 -4px rgba(84, 195, 167, 0.06);
}

.word-chip {
  border-color: #b8e7ff;
  color: #2b6fbb;
}

.clue-chip {
  border-color: #ffe1a6;
  color: #7a5a16;
  font-size: 13px;
  line-height: 1.25;
}

.wheel-stage .stage-title {
  background: linear-gradient(135deg, var(--orange), var(--pink));
}

.wheel-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.wheel-wrap::before,
.wheel-wrap::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.wheel-wrap::before {
  width: 48px;
  height: 18px;
  left: -26px;
  top: 56px;
  background: rgba(255, 111, 174, 0.18);
}

.wheel-wrap::after {
  width: 54px;
  height: 20px;
  right: -28px;
  bottom: 46px;
  background: rgba(79, 141, 231, 0.16);
}

.task-pill {
  padding: 9px 16px;
  border-radius: 999px;
  background: #fff;
  color: #6b4d12;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(42, 89, 87, 0.1), inset 0 -4px rgba(255, 196, 46, 0.18);
}

.wheel-preview {
  position: relative;
  width: 278px;
  height: 278px;
  border: 14px solid #fff;
  border-radius: 50%;
  background: conic-gradient(var(--mint) 0 25%, var(--blue) 0 50%, var(--orange) 0 75%, var(--cyan) 0 100%);
  box-shadow: 0 18px 38px rgba(30, 80, 76, 0.2), inset 0 0 0 6px rgba(255, 255, 255, 0.35);
}

.wheel-preview::before {
  content: "";
  position: absolute;
  inset: 66px;
  border-radius: 50%;
  background: #fff;
}

.wheel-preview::after {
  content: "";
  position: absolute;
  top: -18px;
  left: calc(50% - 14px);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid var(--red);
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.15));
}

.wheel-preview strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 34px;
}

.quiz-stage .stage-title {
  background: linear-gradient(135deg, var(--purple), var(--blue));
}

.quiz-question {
  padding: 18px;
  border: 3px solid #d9f0ea;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff 0%, #f8fffc 100%);
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(42, 89, 87, 0.12);
}

.team-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.team-score {
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff 0%, #efffff 100%);
  text-align: center;
  box-shadow: 0 12px 24px rgba(42, 89, 87, 0.1);
}

.team-a {
  border: 3px solid rgba(84, 195, 167, 0.32);
}

.team-b {
  border: 3px solid rgba(255, 111, 174, 0.24);
}

.team-score strong {
  display: block;
  margin-top: 6px;
  color: var(--mint-dark);
  font-size: 34px;
}

.spelling-stage .stage-title {
  background: linear-gradient(135deg, var(--pink), var(--orange));
}

.sentence-stage .stage-title {
  background: linear-gradient(135deg, var(--purple), var(--pink));
}

.bingo-stage .stage-title {
  background: linear-gradient(135deg, var(--lime), var(--mint-dark));
}

.odd-stage .stage-title {
  background: linear-gradient(135deg, #334e68, var(--cyan));
}

.tiles-stage .stage-title {
  background: linear-gradient(135deg, var(--pink), var(--blue));
}

.hangman-stage .stage-title {
  background: linear-gradient(135deg, #ff7c7c, var(--orange));
}

.picture-stage .stage-title {
  background: linear-gradient(135deg, var(--lime), var(--cyan));
}

.maze-stage .stage-title {
  background: linear-gradient(135deg, #3d7cff, var(--purple));
}

.pop-stage .stage-title {
  background: linear-gradient(135deg, var(--pink), var(--yellow));
}

.letter-boxes {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.letter-boxes span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 48px;
  border: 3px solid #bfece0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #f9fffd 100%);
  color: var(--mint-dark);
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(42, 89, 87, 0.12), inset 0 -5px rgba(255, 196, 46, 0.12);
}

.sentence-card,
.odd-card {
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 28px 24px, rgba(255, 196, 46, 0.3) 0 9px, transparent 10px),
    #fff;
  box-shadow: inset 0 0 0 3px #d9eee8, 0 16px 30px rgba(42, 89, 87, 0.12);
}

.sentence-card strong {
  color: var(--blue);
  font-size: 30px;
}

.sentence-card p,
.odd-card p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.bingo-grid {
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  border: 3px solid rgba(149, 216, 79, 0.28);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f4fff2 100%);
  box-shadow: 0 16px 30px rgba(42, 89, 87, 0.1);
}

.bingo-cell {
  display: grid;
  place-items: center;
  min-height: 76px;
  padding: 8px;
  border: 2px solid #cfe7e0;
  border-radius: 18px;
  background: #fff;
  color: #29444f;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 8px 16px rgba(42, 89, 87, 0.1), inset 0 -5px rgba(84, 195, 167, 0.08);
}

.bingo-cell.called {
  color: #fff;
  background: linear-gradient(135deg, var(--mint), var(--blue));
  transform: rotate(-2deg) scale(1.04);
}

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

.mystery-chip {
  border-color: #ffc7df;
  background: linear-gradient(180deg, #fff 0%, #fff3f8 100%);
  color: #b83f79;
  transform: rotate(2deg);
}

.tile-board {
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px;
  border: 3px solid rgba(255, 111, 174, 0.24);
  border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, #fff4fa 100%);
  box-shadow: 0 16px 30px rgba(42, 89, 87, 0.1);
}

.tile-block {
  display: grid;
  place-items: center;
  min-height: 62px;
  padding: 8px;
  border-radius: 18px;
  color: #fff;
  font-weight: 900;
  line-height: 1.15;
  box-shadow: 0 10px 18px rgba(42, 89, 87, 0.12), inset 0 -6px rgba(0, 0, 0, 0.08);
}

.word-tile {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.clue-tile {
  background: linear-gradient(135deg, var(--orange), var(--pink));
  font-size: 12px;
}

.hangman-card {
  width: min(100%, 360px);
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 3px solid rgba(255, 124, 124, 0.28);
  border-radius: 24px;
  background:
    radial-gradient(circle at 32px 32px, rgba(255, 196, 46, 0.28) 0 10px, transparent 11px),
    linear-gradient(180deg, #fff 0%, #fff6f0 100%);
  box-shadow: 0 16px 30px rgba(42, 89, 87, 0.1);
}

.heart-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.heart-row span {
  width: 22px;
  height: 20px;
  background: var(--red);
  transform: rotate(-45deg);
  border-radius: 6px;
  position: relative;
  box-shadow: 0 6px 12px rgba(255, 107, 95, 0.22);
}

.heart-row span::before,
.heart-row span::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red);
}

.heart-row span::before {
  top: -11px;
  left: 0;
}

.heart-row span::after {
  left: 11px;
  top: 0;
}

.word-blanks {
  display: flex;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
}

.word-blanks span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 42px;
  border-bottom: 5px solid var(--orange);
  color: var(--orange);
  font-size: 23px;
  font-weight: 900;
}

.letter-cloud {
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  color: #7b5360;
  font-weight: 900;
  word-spacing: 8px;
  box-shadow: inset 0 -5px rgba(255, 196, 46, 0.14);
}

.picture-prompt,
.balloon-clue {
  max-width: 350px;
  padding: 12px 16px;
  border-radius: 18px;
  background: #fff;
  color: #425c67;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: 0 10px 20px rgba(42, 89, 87, 0.1);
}

.picture-grid {
  width: min(100%, 350px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.picture-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 105px;
  padding: 12px;
  border: 3px solid #daf0e3;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, #f5fff4 100%);
  box-shadow: 0 12px 24px rgba(42, 89, 87, 0.1);
}

.picture-card span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.picture-card strong {
  color: #2c5964;
}

.correct-picture {
  border-color: var(--lime);
  transform: rotate(-1deg);
}

.maze-board {
  position: relative;
  width: min(100%, 360px);
  height: 250px;
  border: 4px solid rgba(61, 124, 255, 0.25);
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(61, 124, 255, 0.12) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(138, 124, 246, 0.12) 0 1px, transparent 1px 100%),
    #f7fbff;
  background-size: 36px 36px;
  box-shadow: 0 16px 30px rgba(42, 89, 87, 0.1);
}

.runner {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--pink));
  box-shadow: 0 8px 16px rgba(255, 111, 174, 0.22);
}

.maze-word {
  position: absolute;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  color: #2f4d72;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(42, 89, 87, 0.1);
}

.maze-0 { right: 20px; top: 20px; }
.maze-1 { left: 76px; top: 52px; }
.maze-2 { right: 54px; top: 102px; }
.maze-3 { left: 42px; bottom: 78px; }
.maze-4 { right: 24px; bottom: 36px; }

.maze-wall {
  position: absolute;
  border-radius: 999px;
  background: rgba(61, 124, 255, 0.2);
}

.wall-a { left: 70px; top: 108px; width: 150px; height: 14px; }
.wall-b { right: 100px; top: 54px; width: 14px; height: 116px; }
.wall-c { left: 32px; bottom: 54px; width: 120px; height: 14px; }

.balloon-board {
  position: relative;
  width: min(100%, 360px);
  height: 250px;
}

.balloon {
  position: absolute;
  display: grid;
  place-items: center;
  width: 92px;
  height: 112px;
  padding: 14px;
  border-radius: 52% 52% 48% 48%;
  color: #fff;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 14px 24px rgba(42, 89, 87, 0.16), inset 0 -10px rgba(0, 0, 0, 0.08);
}

.balloon::after {
  content: "";
  position: absolute;
  bottom: -26px;
  left: 50%;
  width: 2px;
  height: 30px;
  background: rgba(51, 78, 104, 0.25);
}

.balloon-0 { left: 18px; top: 8px; background: linear-gradient(135deg, var(--mint), var(--blue)); }
.balloon-1 { left: 130px; top: 34px; background: linear-gradient(135deg, var(--pink), var(--orange)); }
.balloon-2 { right: 20px; top: 10px; background: linear-gradient(135deg, var(--purple), var(--blue)); }
.balloon-3 { left: 70px; bottom: 6px; background: linear-gradient(135deg, var(--lime), var(--mint)); }
.balloon-4 { right: 66px; bottom: 0; background: linear-gradient(135deg, var(--yellow), var(--orange)); }

.screen-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  border-top: 1px solid #d9eee8;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
}

.screen-footer button {
  min-width: 96px;
  height: 40px;
  border: 2px solid #cfe6df;
  border-radius: 14px;
  color: #31515b;
  background: #fff;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(42, 89, 87, 0.1);
}

.screen-footer button:last-child {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--mint), var(--blue));
}

.library-band {
  margin-top: 16px;
}

.template-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.template-card {
  min-height: 140px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.template-card span {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 800;
}

.template-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.template-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.template-card.premium {
  border-color: #ffe1a6;
  background: linear-gradient(135deg, #ffffff 0%, #fff7df 100%);
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .app-shell,
  .builder-grid,
  .template-strip {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    height: auto;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
  }
}
