@font-face {
  font-family: "Bally Thrill";
  src: url("/assets/fonts/BallyThrill_Rg.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bally Thrill";
  src: url("/assets/fonts/BallyThrill_RgIt.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Bally Thrill";
  src: url("/assets/fonts/BallyThrill_CdBd.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bally Thrill";
  src: url("/assets/fonts/BallyThrill_CdBdIt.woff2") format("woff2");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Bally Thrill";
  src: url("/assets/fonts/BallyThrill_Bd.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bally Thrill";
  src: url("/assets/fonts/BallyThrill_BdIt.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Bally Thrill";
  src: url("/assets/fonts/BallyThrill_CdXBd.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bally Thrill";
  src: url("/assets/fonts/BallyThrill_CdXBdIt.woff2") format("woff2");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #fbfafb;
  --ink: #200833;
  --band: #190b2e;
  --red: #ec0000;
  --line: #e9e6eb;
  --muted: #736a90;
  --secondary: #4d395c;
  --gold: #d9a441;
  --card: #ffffff;
  --card-soft: rgba(32, 8, 51, 0.03);
  --shadow-sm: 0 8px 18px rgba(32, 8, 51, 0.06);
  --shadow-md: 0 18px 40px rgba(32, 8, 51, 0.08);
  --shadow-lg: 0 30px 60px rgba(17, 7, 31, 0.16);
  --radius-xs: 10px;
  --radius-sm: 16px;
  --radius-md: 22px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --container: 1180px;
  --content: 1040px;
  --header-h: 72px;
  --focus-ring: 0 0 0 3px rgba(236, 0, 0, 0.22);
  --game-ratio: 1.7787234043;
  --play-top-h: 182px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Bally Thrill", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

iframe {
  display: block;
  width: 100%;
  border: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
  text-decoration-color: rgba(32, 8, 51, 0.22);
}

p,
ul,
ol {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
}

main {
  display: block;
}

section {
  position: relative;
}

::selection {
  background: rgba(236, 0, 0, 0.14);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: rgba(236, 0, 0, 0.65);
}

.segmented input:focus-visible + label,
.toggle input:focus-visible + .toggle__track,
.toggle input:focus-visible + .toggle__track + .toggle__label {
  box-shadow: var(--focus-ring);
}

.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.container,
.section__inner,
.hero__inner,
.app-band__inner,
.footer__inner,
.play-layout,
.play-stage-grid,
.review-shell,
.editor-layout {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.stack > * + * {
  margin-top: 14px;
}

.inline,
.actions-row,
.pill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.muted,
.field-help,
.field-note,
.section-sub,
.helper-text,
.meta-text {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.surface,
.panel,
.card-surface,
.notice,
.success-panel,
.error-banner,
.preview-note,
.lineage-banner {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.surface--soft {
  background: var(--card-soft);
}

.display,
.page-title,
.hero__title,
.play-title,
.section-title,
.review-title,
.success-title {
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 0.92;
}

.page-title,
.section-title,
.review-title {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.hero {
  padding: clamp(32px, 7vw, 72px) 0 28px;
}

.hero__inner {
  display: grid;
  gap: 18px;
  align-items: start;
}

.hero__title {
  max-width: 12ch;
  font-size: clamp(2.4rem, 8vw, 5rem);
}

.hero__sub {
  max-width: 680px;
  color: var(--secondary);
  font-size: 1.08rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.page-section {
  padding: 26px 0;
}

.section-head,
.section-header,
.list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section-copy {
  max-width: 760px;
  color: var(--secondary);
}

.studio-header,
.site-header,
.gz-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--band);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 18px rgba(10, 6, 22, 0.18);
}

.studio-header__inner,
.site-header__inner,
.gz-header__inner {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.studio-brand,
.site-brand,
.gz-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.studio-brand img,
.site-brand img,
.gz-brand img {
  height: 26px;
  width: auto;
  flex: 0 0 auto;
}

.studio-brand__text,
.site-brand__text,
.gz-brand__text {
  color: #fff;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1.06rem;
  white-space: nowrap;
}

.studio-nav,
.site-nav,
.gz-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.studio-nav::-webkit-scrollbar,
.site-nav::-webkit-scrollbar,
.gz-nav::-webkit-scrollbar {
  display: none;
}

.studio-nav a,
.site-nav a,
.gz-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease,
    transform 0.16s ease;
}

.studio-nav a:hover,
.site-nav a:hover,
.gz-nav a:hover,
.studio-nav a[aria-current="page"],
.site-nav a[aria-current="page"],
.gz-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.chip,
.badge,
.config-chip,
.status-chip,
.community-chip,
.official-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip--community,
.community-chip {
  border-color: rgba(32, 8, 51, 0.2);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
}

.chip--official,
.official-chip {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.chip--gold,
.badge--gold {
  border-color: rgba(217, 164, 65, 0.36);
  background: rgba(217, 164, 65, 0.12);
  color: #7b5710;
}

.btn,
.button,
a.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--band);
  color: #fff;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease,
    background-color 0.16s ease, border-color 0.16s ease;
  box-shadow: 0 8px 16px rgba(32, 8, 51, 0.12);
}

.btn:hover,
.button:hover,
a.btn:hover,
button.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn:disabled,
.button:disabled,
button.btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.btn--primary,
.button--primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 18px rgba(236, 0, 0, 0.18);
}

.btn--ghost,
.button--ghost {
  background: #fff;
  color: var(--ink);
  border-color: rgba(32, 8, 51, 0.14);
  box-shadow: none;
}

.btn--soft,
.button--soft {
  background: rgba(32, 8, 51, 0.04);
  color: var(--ink);
  border-color: rgba(32, 8, 51, 0.08);
  box-shadow: none;
}

.btn--danger {
  background: var(--band);
  color: #fff;
}

.btn--full {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(32, 8, 51, 0.12);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.challenge-grid,
.community-grid,
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.challenge-card,
.studio-card,
.challenge-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
}

.challenge-card__cover,
.card-cover,
.review-item__media,
.cover-preview,
.generated-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: linear-gradient(155deg, #32115a, #190b2e 66%, #4d395c);
}

.challenge-card__cover img,
.card-cover img,
.review-item__media img,
.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-tile,
.generated-cover {
  display: grid;
  align-items: end;
  width: 100%;
  height: 100%;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(236, 0, 0, 0.22), transparent 34%),
    linear-gradient(155deg, #32115a, #190b2e 66%, #4d395c);
}

.cover-tile__title,
.generated-cover__title {
  max-width: 10ch;
  color: #fff;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 800;
  font-style: italic;
  line-height: 0.92;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
  word-break: break-word;
}

.challenge-card__body,
.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  min-width: 0;
}

.challenge-card__title,
.card-title {
  font-size: 1.34rem;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  word-break: break-word;
}

.challenge-card__title a,
.card-title a {
  text-decoration: none;
}

.challenge-card__meta,
.card-meta,
.byline {
  color: var(--muted);
  font-size: 0.96rem;
}

.challenge-card__desc,
.card-desc {
  color: var(--secondary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.challenge-card__chips,
.card-chips,
.config-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.challenge-card__lineage,
.lineage,
.lineage-text {
  color: var(--muted);
  font-size: 0.92rem;
}

.challenge-card__footer,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
}

.challenge-card__actions,
.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card-stat,
.finishes {
  color: var(--secondary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

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

.official-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
  padding: 20px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(236, 0, 0, 0.16), transparent 30%),
    linear-gradient(160deg, #241043, #190b2e 70%, #3f2c52);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.official-card .card-title,
.official-card .card-desc,
.official-card .card-meta {
  color: #fff;
}

.app-band {
  margin-top: 48px;
  background: var(--band);
  color: #fff;
}

.app-band__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 24px;
}

.app-band__copy {
  font-size: 1.06rem;
  color: rgba(255, 255, 255, 0.9);
}

.site-footer,
.footer {
  padding: 22px 0 40px;
  border-top: 1px solid var(--line);
}

.footer__inner {
  display: grid;
  gap: 6px;
  color: var(--secondary);
  font-size: 0.95rem;
}

.empty-state,
.loading-state,
.error-state {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 220px;
  padding: 28px 20px;
  text-align: center;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 24px;
  color: var(--secondary);
}

.loading-state::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid rgba(32, 8, 51, 0.12);
  border-top-color: var(--red);
  animation: gzs-spin 1s linear infinite;
}

.notice,
.lineage-banner,
.preview-note,
.success-panel,
.error-banner {
  padding: 16px 18px;
}

.lineage-banner,
.preview-note {
  background: rgba(32, 8, 51, 0.04);
}

.error-banner {
  border-color: rgba(236, 0, 0, 0.18);
  background: rgba(236, 0, 0, 0.05);
}

.success-panel {
  box-shadow: var(--shadow-md);
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: min(92vw, 320px);
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--band);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.toast--error {
  background: #5f111a;
}

form {
  min-width: 0;
}

.field,
.form-field,
.input-group {
  display: grid;
  gap: 8px;
}

.field + .field,
.form-field + .form-field {
  margin-top: 18px;
}

.field-row,
.inline-fields {
  display: grid;
  gap: 12px;
}

label,
.field-label {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="email"],
input[type="url"],
textarea,
select,
.input,
.textarea,
.select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease,
    background-color 0.16s ease;
}

textarea,
.textarea {
  min-height: 120px;
  resize: vertical;
}

::placeholder {
  color: #9187ad;
}

.char-count,
.count-label {
  justify-self: end;
  color: var(--muted);
  font-size: 0.82rem;
}

.field-error,
.error-text {
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 700;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--red);
}

input[type="file"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px dashed rgba(32, 8, 51, 0.18);
  border-radius: 16px;
  background: #fff;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(32, 8, 51, 0.14);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.range-field,
.slider-field {
  display: grid;
  gap: 12px;
}

.range-value,
.slider-value {
  color: var(--ink);
  font-weight: 700;
}

.range-steps,
.slider-steps {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

input[type="range"] {
  width: 100%;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  appearance: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #200833, #4d395c);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border: 3px solid var(--red);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 16px rgba(32, 8, 51, 0.14);
}

input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #200833, #4d395c);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 3px solid var(--red);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 16px rgba(32, 8, 51, 0.14);
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  max-width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.segmented--full {
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

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

.segmented label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.segmented input:checked + label {
  background: var(--band);
  color: #fff;
}

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

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

.toggle__track {
  position: relative;
  width: 54px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #d0cad8;
  transition: background-color 0.16s ease;
}

.toggle__track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(32, 8, 51, 0.16);
  transition: transform 0.16s ease;
}

.toggle input:checked + .toggle__track {
  background: var(--band);
}

.toggle input:checked + .toggle__track::after {
  transform: translateX(22px);
}

.toggle__label {
  color: var(--ink);
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cover-upload {
  display: grid;
  gap: 12px;
}

.cover-preview {
  width: 100%;
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.editor-layout {
  display: grid;
  gap: 24px;
  align-items: start;
  padding: 24px 0 40px;
}

.editor-form {
  min-width: 0;
}

.editor-preview {
  min-width: 0;
}

.editor-preview__sticky,
.preview-sticky {
  display: grid;
  gap: 12px;
}

.phone-shell,
.phone-frame,
.preview-phone {
  width: min(100%, 470px);
  margin-inline: auto;
  padding: 14px;
  border-radius: 38px;
  background: linear-gradient(180deg, #1a0d31, #120724);
  box-shadow: 0 24px 54px rgba(17, 7, 31, 0.24);
}

.phone-shell::before,
.phone-frame::before,
.preview-phone::before {
  content: "";
  display: block;
  width: 38%;
  height: 22px;
  margin: 0 auto 12px;
  border-radius: 0 0 16px 16px;
  background: #090511;
}

.phone-screen,
.phone-frame__screen,
.preview-phone__screen {
  overflow: hidden;
  border-radius: 28px;
  background: #000;
}

.phone-screen iframe,
.phone-frame iframe,
.preview-phone iframe {
  width: 100%;
  aspect-ratio: 470 / 836;
  background: #000;
}

.preview-caption,
.caption {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.play-page,
body.play-page,
.play-shell {
  --play-top-h: 182px;
}

.preview-banner,
.top-banner {
  background: rgba(236, 0, 0, 0.08);
  border-bottom: 1px solid rgba(236, 0, 0, 0.16);
}

.preview-banner__inner,
.top-banner__inner {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
  padding: 10px 0;
  font-weight: 700;
  color: var(--ink);
}

[data-theme="velvet"] {
  --theme-band: #200833;
  --theme-accent: #ec0000;
}

[data-theme="cavern"] {
  --theme-band: #0a0616;
  --theme-accent: #7a4fd0;
}

[data-theme="ocean"] {
  --theme-band: #0b2a44;
  --theme-accent: #1f8ac0;
}

[data-theme="ember"] {
  --theme-band: #2b0a0a;
  --theme-accent: #ec0000;
}

.play-header-band,
.play-band {
  background: var(--theme-band, var(--band));
  color: #fff;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.play-header-band .container,
.play-band .container {
  padding-block: 12px 14px;
}

.play-title-block,
.play-intro {
  display: grid;
  gap: 10px;
}

.play-title {
  color: #fff;
  font-size: clamp(1.8rem, 6vw, 3.1rem);
}

.play-byline,
.play-description,
.play-lineage,
.play-header-band .section-sub,
.play-band .section-sub {
  color: rgba(255, 255, 255, 0.84);
}

.play-chip-row,
.play-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.play-header-band .chip,
.play-band .chip {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.play-header-band .btn--primary,
.play-band .btn--primary {
  background: var(--theme-accent, var(--red));
}

.play-stage-grid,
.play-layout {
  display: grid;
  gap: 18px;
  padding: 16px 0 24px;
  align-items: start;
}

.play-stage,
.stage-panel,
.game-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 10px;
  border-radius: 30px;
  background: #0b0514;
  box-shadow: var(--shadow-lg);
}

.play-stage__frame,
.stage-frame,
.game-frame {
  width: min(
    100%,
    470px,
    calc((100dvh - var(--header-h) - var(--play-top-h) - 28px) / var(--game-ratio))
  );
  margin-inline: auto;
}

.play-stage__frame iframe,
.stage-frame iframe,
.game-frame iframe {
  width: 100%;
  aspect-ratio: 470 / 836;
  border-radius: 24px;
  background: #000;
}

.board-panel,
.leaderboard-panel,
.play-sidebar {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.leaderboard,
.board-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}

.leaderboard__head,
.board-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.leaderboard__title,
.board-title {
  font-size: 1.18rem;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.leaderboard__note,
.board-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.leaderboard-tabs,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-button,
.tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(32, 8, 51, 0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: none;
}

.tab-button[aria-selected="true"],
.tab-button.is-active,
.tabs button[aria-selected="true"],
.tabs button.is-active {
  background: var(--band);
  border-color: transparent;
  color: #fff;
}

.leaderboard-list,
.board-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.leaderboard-row,
.board-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(32, 8, 51, 0.03);
}

.leaderboard-row--you,
.board-row--you {
  border: 1px solid rgba(217, 164, 65, 0.34);
  background: rgba(217, 164, 65, 0.1);
}

.rank {
  color: var(--gold);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.board-empty,
.empty-note {
  padding: 12px 0 4px;
  color: var(--muted);
}

.review-shell {
  padding: 24px 0 48px;
}

.review-gate {
  width: min(100%, 460px);
  margin: 40px auto;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
}

.review-section + .review-section {
  margin-top: 28px;
}

.review-list,
.queue-list {
  display: grid;
  gap: 16px;
}

.review-item,
.queue-item {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}

.review-item__body,
.queue-item__body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.review-item__head,
.queue-item__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.review-item__title,
.queue-item__title {
  font-size: 1.24rem;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
  word-break: break-word;
}

.review-item__meta,
.queue-item__meta {
  color: var(--muted);
  font-size: 0.94rem;
}

.review-item__summary,
.queue-item__summary {
  color: var(--secondary);
}

.review-item__config,
.queue-item__config,
.config-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-item__actions,
.queue-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}

.list-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.list-table th,
.list-table td,
.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.list-table tr:last-child td,
.data-table tr:last-child td {
  border-bottom: 0;
}

.list-table th,
.data-table th {
  color: var(--secondary);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.link-inline,
.text-link {
  color: var(--red);
  font-weight: 700;
  text-decoration: none;
}

.link-inline:hover,
.text-link:hover {
  text-decoration: underline;
}

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

@media (min-width: 700px) {
  .challenge-grid,
  .community-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .field-row,
  .inline-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 860px) {
  .review-item,
  .queue-item {
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
  }

  .review-item__media,
  .queue-item__media {
    height: 100%;
  }
}

@media (min-width: 1024px) {
  :root {
    --header-h: 76px;
  }

  .challenge-grid,
  .community-grid,
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .editor-layout {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 470px);
  }

  .editor-preview__sticky,
  .preview-sticky {
    position: sticky;
    top: calc(var(--header-h) + 20px);
  }

  .play-stage-grid,
  .play-layout {
    grid-template-columns: minmax(0, 470px) minmax(320px, 1fr);
    gap: 22px;
  }

  .board-panel,
  .leaderboard-panel,
  .play-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }
}

@media (max-width: 640px) {
  .studio-header__inner,
  .site-header__inner,
  .gz-header__inner {
    width: min(100% - 24px, var(--container));
    gap: 12px;
  }

  .container,
  .section__inner,
  .hero__inner,
  .app-band__inner,
  .footer__inner,
  .play-layout,
  .play-stage-grid,
  .review-shell,
  .editor-layout {
    width: min(100% - 24px, var(--container));
  }

  .app-band__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn,
  .button,
  a.btn,
  button.btn {
    min-height: 46px;
    padding-inline: 16px;
  }

  .segment
  ed,
  .segmented--full {
    width: 100%;
  }

  .segmented {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }

  .list-table,
  .data-table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-height: 900px) {
  .play-page,
  body.play-page,
  .play-shell {
    --play-top-h: 148px;
  }

  .play-header-band .container,
  .play-band .container {
    padding-block: 10px 12px;
  }

  .play-title {
    font-size: clamp(1.5rem, 5.4vw, 2.2rem);
  }

  .play-chip-row,
  .play-actions {
    gap: 6px;
  }

  .play-header-band .chip,
  .play-band .chip {
    min-height: 24px;
    padding-inline: 8px;
    font-size: 0.72rem;
  }
}

@media (max-height: 780px) {
  .play-page,
  body.play-page,
  .play-shell {
    --play-top-h: 104px;
  }

  .play-description,
  .play-lineage {
    display: none;
  }
}

@media (max-height: 720px) {
  .play-page,
  body.play-page,
  .play-shell {
    --play-top-h: 84px;
  }

  .play-title-block,
  .play-intro {
    gap: 8px;
  }
}

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

@keyframes gzs-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Studio integration patch (Muse): pages use .site-footer__inner; the
   generated CSS named it .footer__inner. Alias it to the same treatment. */
.site-footer__inner{max-width:1200px;margin:0 auto;padding:22px 20px;display:flex;flex-wrap:wrap;gap:10px 22px;align-items:center;justify-content:space-between}
