/* ── RTP tab layout ── */
.rtp-layout {
  flex: 1;
  display: grid;
  grid-template-columns: var(--rtp-col-width, 420px) 5px 1fr;
  overflow: hidden;
}
.rtp-config-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface2);
}
.rtp-result-col { display: flex; flex-direction: column; overflow: hidden; }

/* ── RTP placeholder ── */
.rtp-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text3);
  font-size: 0.82rem;
}

/* ── Reel set chances ── */
.rtp-chances-input {
  width: 100%;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  box-sizing: border-box;
}
.rtp-chances-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.75rem;
  margin-top: 0.35rem;
}
.rtp-chance-legend-item {
  font-size: 0.68rem;
  color: var(--text2);
  white-space: nowrap;
}
.rtp-chance-legend-idx {
  font-weight: 700;
  color: var(--accent);
  margin-right: 0.15rem;
}
.rtp-chance-legend-active {
  color: var(--accent);
  font-weight: 700;
}
.rtp-chance-total {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
}
.rtp-chance-total.ok  { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.rtp-chance-total.err { color: var(--error);   background: color-mix(in srgb, var(--error)   12%, transparent); }
.rtp-chance-row { display: flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0; min-width: 0; }

/* ── Screen / payline definitions ── */
.rtp-lines-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 0.6rem; }
.rtp-line-row { display: flex; align-items: center; gap: 0.4rem; }
.rtp-line-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text3);
  width: 22px;
  flex-shrink: 0;
  text-align: right;
}
.rtp-line-input {
  flex: 1;
  min-width: 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
}
.rtp-line-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text3);
  background: var(--surface3);
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
}

/* ── Symbol configuration rows ── */
.rtp-sym-header {
  display: grid;
  grid-template-columns: 36px 110px 1fr 28px;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  background: var(--surface4);
}
.rtp-sym-row {
  display: grid;
  grid-template-columns: 36px 110px 1fr 28px;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.rtp-sym-row:last-child { border-bottom: none; }
.rtp-sym-id {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  width: 36px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  padding: 0 2px;
  height: 26px;
  flex-shrink: 0;
}
.rtp-sym-id:hover, .rtp-sym-id:focus {
  border-color: var(--accent);
  background: var(--surface2);
  outline: none;
}

.rtp-sym-row input[type=text],
.rtp-sym-row input[type=number] { height: 28px; font-size: 0.78rem; }
.rtp-sym-row select { height: 28px; font-size: 0.78rem; padding: 0 0.4rem; }

.rtp-paytable-cell { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.rtp-paytable-cell .rtp-interval-set-sel { width: 90px; flex-shrink: 0; }
.rtp-paytable-cell .rtp-paytable-input { flex: 1; min-width: 0; }

/* ── Wild multiplier fields ── */
.rtp-wild-fields {
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.3rem;
  grid-column: 1 / -1;
  padding-left: calc(36px + 110px + 0.8rem);
}
.rtp-wild-fields.visible { display: flex; }
.rtp-wild-fields label { font-size: 0.68rem; color: var(--text3); white-space: nowrap; }
.rtp-wild-top-row { display: flex; align-items: center; gap: 0.35rem; }
.rtp-wild-top-row .rtp-wild-mult-group { display: flex; align-items: center; gap: 0.35rem; }
.rtp-wild-top-row .rtp-wild-mult-group.hidden { display: none; }
.rtp-seq-row { display: none; align-items: center; gap: 0.35rem; }
.rtp-seq-row.visible { display: flex; }
.rtp-wild-seq { flex: 1; }

/* ── Progress bar ── */
.rtp-progress {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.25rem;
}
.rtp-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s ease;
  width: 0%;
}

/* ── Screen & Paytable JSON editor ── */
#rtp-sim-json-editor .CodeMirror {
  min-height: 320px;
  height: auto;
  max-height: 60vh;
}
