:root {
  color-scheme: light;
  --paper: #f1eee6;
  --paper-deep: #e8e3d8;
  --surface: #fffdf8;
  --surface-subtle: #f8f5ee;
  --ink: #20231f;
  --ink-soft: #3f443d;
  --muted: #6d726a;
  --line: #d7d2c6;
  --line-strong: #bdb7aa;
  --amber: #a36524;
  --amber-dark: #754719;
  --amber-pale: #f3e6d4;
  --teal: #2f766d;
  --teal-dark: #235850;
  --teal-pale: #dfece8;
  --danger: #9c4e46;
  --danger-pale: #f2dfdc;
  --shadow: 0 12px 36px rgba(49, 43, 32, 0.07);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --control-height: 44px;
  --accent-dynamic: #a36524;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

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

button,
label[for],
select,
input[type="color"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:not(:disabled),
label[for],
select,
input[type="color"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
label.button:focus-within,
.upload-zone:focus-within {
  outline: 3px solid rgba(47, 118, 109, 0.26);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 82px;
  padding: 14px clamp(20px, 3.2vw, 52px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand-lockup,
.brand-title-row,
.brand-controls,
.logo-control,
.panel-heading,
.feasibility-topline,
.section-heading-inline,
.game-titlebar,
.spin-controls,
.asset-actions {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  color: var(--surface);
  background: var(--ink);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-title-row {
  gap: 10px;
}

.brand-title {
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.environment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  color: var(--amber-dark);
  background: var(--amber-pale);
  border: 1px solid #ddc4a3;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.brand-subtitle {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.brand-controls {
  justify-content: flex-end;
  gap: 16px;
}

.compact-field {
  display: grid;
  grid-template-columns: auto minmax(150px, 220px);
  align-items: center;
  gap: 8px;
}

.compact-field label,
.accent-field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-field input {
  min-height: 40px;
}

.logo-control {
  gap: 8px;
}

.logo-control input,
.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.file-state {
  max-width: 90px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow {
  position: relative;
  z-index: 2;
  padding: 0 clamp(20px, 3.2vw, 52px);
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--line);
}

.workflow ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 940px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.workflow-step {
  position: relative;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}

.workflow-step:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -12px;
  width: 24px;
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.workflow-step.is-current {
  color: var(--ink);
  border-bottom-color: var(--amber);
}

.workflow-step.is-complete {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
}

.step-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.workflow-step strong,
.workflow-step small {
  display: block;
}

.workflow-step strong {
  font-size: 13px;
}

.workflow-step small {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 500;
}

.page-shell {
  width: min(1800px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 2.4vw, 38px) 48px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(290px, 0.85fr) minmax(420px, 1.35fr) minmax(340px, 1fr);
  gap: 16px;
  align-items: start;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(460px, 1.15fr) minmax(310px, 0.75fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.analytics-panel {
  margin-top: 16px;
}

.analytics-panel-heading {
  align-items: flex-start;
}

.analytics-scope {
  max-width: 760px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-wrap: pretty;
}

.analytics-charts {
  min-height: 260px;
}

.analytics-empty {
  display: grid;
  min-height: 260px;
  place-content: center;
  gap: 5px;
  padding: 28px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  text-align: center;
}

.analytics-empty strong {
  color: var(--ink-soft);
  font-size: 14px;
}

.analytics-empty span {
  max-width: 520px;
  font-size: 11px;
  line-height: 1.55;
  text-wrap: pretty;
}

.analytics-scroll-hint {
  display: none;
}

.analytics-charts:not(.analytics-charts--empty) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 22px;
}

.analytics-chart {
  min-width: 0;
  margin: 0;
  padding: 18px 0 4px;
  border-top: 1px solid var(--line);
}

.analytics-chart--rtp {
  grid-column: 1 / -1;
}

.analytics-chart__caption {
  min-height: 70px;
}

.analytics-chart__eyebrow {
  display: block;
  color: var(--teal-dark);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.analytics-chart__title {
  margin: 4px 0 3px;
  font-size: 16px;
  line-height: 1.2;
}

.analytics-chart__summary {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-wrap: pretty;
}

.analytics-chart__canvas {
  width: 100%;
  overflow-x: auto;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.analytics-chart__svg {
  display: block;
  width: 100%;
  min-width: 650px;
  max-width: 900px;
  height: auto;
  margin: 0 auto;
}

.analytics-chart__grid-line {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.analytics-chart__axis-line,
.analytics-chart__axis-tick {
  stroke: var(--line-strong);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.analytics-chart__tick-label,
.analytics-chart__axis-label,
.analytics-chart__target-label {
  fill: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.analytics-chart__axis-label {
  fill: var(--ink-soft);
  font-family: inherit;
  font-size: 11px;
  font-weight: 750;
}

.analytics-chart__target-label {
  fill: var(--ink);
  font-weight: 800;
}

.analytics-chart__band {
  stroke: none;
}

.analytics-chart__band--current {
  fill: color-mix(in srgb, var(--teal) 15%, transparent);
}

.analytics-chart__band--previous {
  fill: color-mix(in srgb, var(--ink) 6%, transparent);
}

.analytics-chart__line,
.analytics-chart__target-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.analytics-chart__line--current {
  stroke: var(--teal-dark);
  stroke-width: 2.2;
}

.analytics-chart__line--previous {
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-dasharray: 6 5;
}

.analytics-chart__target-line {
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-dasharray: 2 4;
}

.analytics-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin: 3px 0 0;
  padding: 0;
  list-style: none;
}

.analytics-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.analytics-chart__legend-swatch {
  display: inline-block;
  width: 24px;
  height: 8px;
  border-top: 2px solid var(--teal-dark);
}

.analytics-chart__legend-swatch--previous {
  border-top-color: var(--muted);
  border-top-style: dashed;
}

.analytics-chart__legend-swatch--interval {
  height: 10px;
  background: color-mix(in srgb, var(--teal) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--teal-dark) 35%, transparent);
}

.analytics-chart__legend-swatch--target {
  border-top-color: var(--ink);
  border-top-style: dotted;
}

.analytics-chart__method-note,
.analytics-chart__scale-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-wrap: pretty;
}

.analytics-chart__empty {
  margin: 24px 0;
  color: var(--muted);
  font-size: 12px;
}

.analytics-charts__empty {
  display: grid;
  min-height: 260px;
  place-content: center;
  gap: 5px;
  padding: 28px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.analytics-charts__empty-title {
  color: var(--ink-soft);
  font-size: 14px;
}

.analytics-charts__empty-message {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-wrap: pretty;
}

.panel {
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel h1,
.panel h2,
.panel h3,
.panel p {
  margin-top: 0;
}

.panel h1,
.panel h2 {
  margin-bottom: 0;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.panel h3 {
  margin-bottom: 0;
  font-size: 14px;
}

.eyebrow,
.section-kicker {
  margin-bottom: 4px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.status-chip {
  display: inline-flex;
  min-height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-neutral {
  color: var(--muted);
  background: var(--surface-subtle);
  border-color: var(--line);
}

.status-play,
.status-success {
  color: var(--teal-dark);
  background: var(--teal-pale);
  border-color: #a9ccc4;
}

.status-warning {
  color: var(--amber-dark);
  background: var(--amber-pale);
  border-color: #ddc4a3;
}

.status-danger {
  color: var(--danger);
  background: var(--danger-pale);
  border-color: #dcb5af;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  width: 100%;
  margin-bottom: 14px;
  padding-bottom: 9px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.field {
  min-width: 0;
  margin-bottom: 15px;
}

.field > label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 9px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #918a7d;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}

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

.input-suffix {
  position: relative;
}

.input-suffix input {
  padding-right: 36px;
}

.input-suffix > span {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  transform: translateY(-50%);
  pointer-events: none;
}

.field-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.label-technical {
  color: var(--muted);
  font-weight: 600;
}

.field-explainer {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
  text-wrap: pretty;
}

.constraint-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 2px 0 14px;
  padding: 10px;
  color: var(--amber-dark);
  background: #fbf6ed;
  border: 1px solid #e4d3b9;
  border-radius: var(--radius-sm);
}

.constraint-note p {
  margin-bottom: 0;
  font-size: 10px;
}

.constraint-mark {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 800;
}

.button {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button-primary {
  color: #fffdf8;
  background: var(--ink);
  border-color: var(--ink);
}

.button-primary:not(:disabled):hover {
  background: #343830;
  border-color: #343830;
}

.button-secondary {
  color: var(--ink-soft);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button-secondary:not(:disabled):hover {
  color: var(--ink);
  background: var(--surface-subtle);
  border-color: #918a7d;
}

.button-compact {
  min-height: 40px;
  padding-block: 7px;
}

.button-full {
  width: 100%;
}

.generation-progress {
  margin-bottom: 14px;
  padding: 13px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.generation-progress[hidden],
.validation-skeleton[hidden],
.modal-root[hidden] {
  display: none;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 11px;
}

.progress-copy span,
.generation-progress p {
  color: var(--muted);
}

.generation-progress p {
  margin: 7px 0 0;
  font-size: 10px;
}

.progress-track,
.contribution-track {
  overflow: hidden;
  background: var(--paper-deep);
  border-radius: 999px;
}

.progress-track {
  height: 7px;
}

.progress-track span,
.contribution-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--teal);
  border-radius: inherit;
  transition: width 260ms ease;
}

.validation-skeleton {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.validation-skeleton span {
  min-height: 78px;
  background: var(--paper-deep);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse 1.25s ease-in-out infinite alternate;
}

@keyframes skeleton-pulse {
  to { opacity: 0.48; }
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.metric {
  min-width: 0;
  min-height: 100px;
  padding: 11px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.metric-primary {
  background: #fbf6ed;
  border-color: #ddc4a3;
}

.metric dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.metric dd {
  overflow: hidden;
  margin: 7px 0 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(19px, 1.6vw, 25px);
  font-weight: 750;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#bonusRate {
  font-size: clamp(14px, 1.25vw, 20px);
  line-height: 1.2;
  white-space: normal;
}

.metric dd.metric-text {
  padding-top: 4px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0;
}

.metric small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feasibility-card,
.contribution-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.feasibility-card {
  margin-bottom: 12px;
  background: var(--surface-subtle);
}

.feasibility-topline,
.section-heading-inline {
  justify-content: space-between;
  gap: 12px;
}

.feasibility-message {
  margin: 11px 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.check-list {
  display: grid;
  gap: 6px;
}

.check-list > div {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 8px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 10px;
}

.check-list strong {
  color: var(--muted);
  font-size: 9px;
}

.check-dot {
  width: 7px;
  height: 7px;
  background: var(--line-strong);
  border-radius: 50%;
}

.check-list .is-pass .check-dot {
  background: var(--teal);
}

.check-list .is-pass strong {
  color: var(--teal-dark);
}

.check-list .is-fail .check-dot {
  background: var(--danger);
}

.check-list .is-fail strong {
  color: var(--danger);
}

.section-heading-inline {
  margin-bottom: 12px;
}

.section-heading-inline small {
  color: var(--muted);
  font-size: 9px;
}

.contribution-row {
  margin-top: 10px;
}

.contribution-row > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
}

.contribution-row strong {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.contribution-track {
  height: 6px;
}

.contribution-row:nth-child(3) .contribution-track span {
  background: var(--amber);
}

.contribution-total {
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.preview-panel {
  background: #f9f7f1;
}

.game-frame {
  padding: 16px;
  color: #f4f1e8;
  background: #252a27;
  border: 1px solid #111410;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.game-titlebar {
  gap: 10px;
  min-height: 44px;
  padding-bottom: 13px;
}

.game-logo {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #252a27;
  background: #d7b47d;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 800;
}

.game-titlebar strong,
.game-titlebar span {
  display: block;
}

.game-titlebar strong {
  overflow: hidden;
  max-width: 240px;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-titlebar span {
  margin-top: 2px;
  color: #aeb6ae;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.reel-bezel {
  position: relative;
  overflow: hidden;
  padding: 7px;
  background: #171a18;
  border: 1px solid #515851;
  border-radius: var(--radius-sm);
}

.reel-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: minmax(62px, 9.2vh);
  gap: 3px;
  background: #b9b4a9;
  border: 1px solid #848177;
}

.reel-grid[data-rows="4"] {
  grid-auto-rows: minmax(52px, 7.2vh);
}

.reel-cell {
  display: grid;
  min-width: 0;
  place-items: center;
  color: #2f332e;
  background: #eee9de;
  border: 1px solid #d0c8b8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 2vw, 33px);
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 0 #fff;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.reel-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-cell.is-word-symbol {
  overflow: hidden;
  padding-inline: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(9px, 0.9vw, 13px);
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reel-cell.symbol-7 {
  color: #9a5521;
  background: #f1e2cf;
}

.reel-cell.symbol-a,
.reel-cell.symbol-k {
  color: #2b655e;
}

.reel-cell.is-winning {
  color: #fffdf8;
  background: var(--accent-dynamic);
  text-shadow: none;
}

.reel-cell.is-spinning {
  color: transparent;
  background: #d8d2c6;
  transform: scaleY(0.94);
}

.payline-guide {
  position: absolute;
  top: 50%;
  right: 7px;
  left: 7px;
  height: 1px;
  pointer-events: none;
}

.payline-guide span {
  display: block;
  height: 1px;
  background: rgba(163, 101, 36, 0.48);
}

.spin-message {
  min-height: 38px;
  padding: 11px 2px 7px;
  color: #b7beb7;
  font-size: 10px;
  text-align: center;
}

.wallet-readouts {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 5px;
  margin: 0 0 11px;
}

.wallet-readouts > div {
  min-width: 0;
  padding: 8px;
  background: #1c201d;
  border: 1px solid #3c423c;
  border-radius: 4px;
}

.wallet-readouts dt {
  overflow: hidden;
  color: #8f988f;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-readouts dd {
  overflow: hidden;
  margin: 3px 0 0;
  color: #f3eadc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.spin-controls {
  justify-content: space-between;
  gap: 12px;
}

.bet-stepper {
  display: grid;
  grid-template-columns: 44px auto 44px;
  min-height: 44px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #535b54;
  border-radius: 999px;
}

.bet-stepper button {
  width: 44px;
  height: 44px;
  padding: 0;
  color: #f3eadc;
  background: transparent;
  border: 0;
  font-size: 19px;
}

.bet-stepper button:not(:disabled):hover {
  background: #343a35;
}

.bet-stepper span {
  color: #939c94;
  font-size: 8px;
  font-weight: 800;
}

.spin-button {
  display: grid;
  width: 92px;
  height: 60px;
  flex: 0 0 92px;
  place-items: center;
  padding: 6px;
  color: #252a27;
  background: #d7b47d;
  border: 1px solid #efd7ad;
  border-radius: 999px;
  box-shadow: inset 0 0 0 3px #303630;
}

.spin-button:not(:disabled):hover {
  background: #e4c796;
}

.spin-button span,
.spin-button small {
  display: block;
}

.spin-button span {
  align-self: end;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.spin-button small {
  align-self: start;
  font-size: 8px;
}

.preview-disclaimer {
  margin: 11px 2px 0;
  color: var(--muted);
  font-size: 9px;
}

.asset-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 0 16px;
}

.asset-prompt-field {
  grid-row: span 2;
}

.asset-actions {
  align-content: start;
  flex-direction: column;
  gap: 10px;
}

.asset-actions .button {
  width: 100%;
}

.accent-field {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.upload-zone {
  grid-column: 1 / -1;
  margin-top: 3px;
}

.upload-zone label {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 14px;
  background: var(--surface-subtle);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  text-align: center;
}

.upload-zone label:hover {
  border-color: var(--teal);
  background: var(--teal-pale);
}

.upload-zone strong {
  font-size: 12px;
}

.upload-zone span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.asset-preview {
  display: flex;
  min-height: 42px;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
}

.asset-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.asset-thumb {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  overflow: hidden;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.asset-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.text-button {
  min-height: 44px;
  padding: 8px;
  color: var(--teal-dark);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 800;
}

.text-button:not(:disabled):hover {
  text-decoration: underline;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.table-scroll-hint {
  display: none;
}

.symbol-table-wrap {
  margin-top: 10px;
}

table {
  width: 100%;
  min-width: 430px;
  border-collapse: collapse;
  font-size: 10px;
}

caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

thead th {
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 9px;
  letter-spacing: 0.03em;
}

th:first-child,
td:first-child {
  text-align: left;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fbfaf6;
}

.table-state {
  display: inline-flex;
  padding: 2px 6px;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
}

.table-state.is-pass {
  color: var(--teal-dark);
  background: var(--teal-pale);
  border-color: #a9ccc4;
}

.table-state.is-fail {
  color: var(--danger);
  background: var(--danger-pale);
  border-color: #dcb5af;
}

.empty-cell {
  height: 54px;
  color: var(--muted);
  text-align: center;
}

.release-metadata {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.release-metadata > div {
  display: grid;
  grid-template-columns: minmax(100px, 0.7fr) minmax(0, 1fr);
  gap: 10px;
  min-height: 40px;
  align-items: center;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

.release-metadata > div:last-child {
  border-bottom: 0;
}

.release-metadata dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.release-metadata dd {
  overflow: hidden;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-gate {
  margin-top: 12px;
  padding: 11px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.release-gate > strong {
  font-size: 11px;
}

.release-gate ul {
  margin: 7px 0 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 9px;
}

.release-gate li + li {
  margin-top: 3px;
}

.release-gate li::marker {
  color: var(--line-strong);
}

.release-gate li.is-ready {
  color: var(--teal-dark);
}

.release-gate li.is-ready::marker {
  color: var(--teal);
}

.release-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.release-footnote {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(360px, calc(100vw - 40px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  color: #fffdf8;
  background: var(--ink);
  border: 1px solid #4c514a;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(24, 26, 23, 0.24);
  font-size: 11px;
  pointer-events: auto;
}

.toast.is-success {
  background: var(--teal-dark);
  border-color: var(--teal);
}

.toast.is-error {
  background: #713a35;
  border-color: var(--danger);
}

.modal-root {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(27, 29, 26, 0.58);
}

.modal-dialog {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(24, 26, 23, 0.28);
}

.modal-dialog code {
  display: block;
  margin: 14px 0;
  padding: 12px;
  overflow-wrap: anywhere;
  color: var(--teal-dark);
  background: var(--teal-pale);
  border: 1px solid #a9ccc4;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.noscript-note {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  left: 18px;
  padding: 12px;
  color: #fff;
  background: var(--danger);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 12px;
}

@media (max-width: 1320px) {
  .workspace-grid {
    grid-template-columns: 320px minmax(410px, 1fr);
  }

  .preview-panel {
    grid-column: 1 / -1;
  }

  .preview-panel .game-frame {
    max-width: 560px;
    margin: 0 auto;
  }

  .preview-panel .preview-disclaimer {
    max-width: 560px;
    margin-right: auto;
    margin-left: auto;
  }

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

  .release-panel {
    grid-column: 1 / -1;
  }

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

@media (max-width: 960px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .brand-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .workspace-grid,
  .lower-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-panel,
  .release-panel {
    grid-column: auto;
  }

  .spec-panel,
  .validation-panel,
  .preview-panel {
    width: min(720px, 100%);
    margin: 0 auto;
  }

  .preview-panel .game-frame {
    max-width: none;
  }

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

@media (max-width: 680px) {
  .topbar {
    padding: 13px 16px;
  }

  .brand-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .brand-title {
    font-size: 18px;
  }

  .brand-subtitle {
    display: none;
  }

  .brand-controls {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .compact-field {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .logo-control {
    justify-content: space-between;
  }

  .workflow {
    overflow: visible;
    padding: 0;
  }

  .workflow ol {
    width: 100%;
  }

  .workflow-step {
    min-width: 0;
    min-height: 58px;
    gap: 4px;
    padding: 8px 3px;
  }

  .workflow-step strong {
    font-size: 9px;
  }

  .workflow-step small {
    display: none;
  }

  .workflow-step .step-number {
    font-size: 8px;
  }

  .page-shell {
    padding: 14px 10px 32px;
  }

  .workspace-grid,
  .lower-grid {
    gap: 10px;
  }

  .lower-grid {
    margin-top: 10px;
  }

  .analytics-panel {
    margin-top: 10px;
  }

  .analytics-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .analytics-scope,
  .analytics-empty span {
    font-size: 12px;
    line-height: 1.6;
  }

  .analytics-scroll-hint {
    display: block;
    margin: -3px 0 8px;
    color: var(--muted);
    font-size: 11px;
  }

  .analytics-charts:not(.analytics-charts--empty) {
    grid-template-columns: minmax(0, 1fr);
  }

  .analytics-chart--rtp {
    grid-column: auto;
  }

  .analytics-chart__caption {
    min-height: 0;
    margin-bottom: 8px;
  }

  .analytics-chart__summary,
  .analytics-chart__method-note,
  .analytics-chart__scale-note,
  .analytics-charts__empty-message {
    font-size: 12px;
    line-height: 1.6;
  }

  .analytics-chart__legend-item {
    font-size: 11px;
  }

  .panel {
    padding: 15px;
    border-radius: var(--radius-md);
  }

  .panel-heading {
    margin-bottom: 14px;
  }

  .form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

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

  .metric {
    min-height: 94px;
  }

  .field-help,
  .metric small,
  .preview-disclaimer,
  .asset-preview p,
  .release-footnote {
    font-size: 11px;
    line-height: 1.45;
  }

  .field-explainer {
    font-size: 12px;
    line-height: 1.6;
  }

  .metric small {
    white-space: normal;
  }

  .table-scroll-hint {
    display: block;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 11px;
  }

  .table-wrap + .table-scroll-hint {
    margin-top: 8px;
  }

  .symbol-table-wrap {
    margin-top: 0;
  }

  table {
    font-size: 11px;
  }

  thead th {
    font-size: 10px;
  }

  .validation-skeleton {
    grid-template-columns: repeat(2, 1fr);
  }

  .asset-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .asset-prompt-field {
    grid-row: auto;
  }

  .asset-actions {
    align-items: stretch;
    margin-bottom: 12px;
  }

  .upload-zone,
  .asset-preview {
    grid-column: auto;
  }

  .release-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .game-frame {
    padding: 11px;
  }

  .reel-grid {
    grid-auto-rows: minmax(54px, 17vw);
  }

  .reel-grid[data-rows="4"] {
    grid-auto-rows: minmax(45px, 14vw);
  }

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

  .wallet-readouts > div {
    padding: 7px 5px;
  }

  .wallet-readouts dd {
    font-size: 11px;
  }

  .spin-controls {
    align-items: center;
  }
}

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