/* ============================================================
   Playground Page
   ============================================================ */

.playground-header {
  text-align: center;
  padding: var(--space-3xl) 0 var(--space-xl);
}

.playground-header h1 {
  margin-bottom: var(--space-md);
}

.playground-header p {
  max-width: 600px;
  margin: 0 auto;
}

/* Main layout */
.playground-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

@media (min-width: 1024px) {
  .playground-layout {
    grid-template-columns: 1fr 1.5fr;
  }
}

/* Input panel */
.playground-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.playground-input__label {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
  display: block;
}

.playground-input__string {
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-code);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.15em;
  transition: border-color var(--transition-fast);
  margin-bottom: var(--space-md);
}

.playground-input__string:focus {
  border-color: var(--accent-primary);
}

.playground-input__info {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.playground-input__error {
  color: #ef4444;
  font-size: var(--text-xs);
  margin-top: var(--space-xs);
}

/* Presets */
.playground-presets {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.playground-presets__label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
  display: block;
  font-weight: 600;
}

.playground-presets__grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.preset-btn {
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Output panel */
.playground-output {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  min-height: 400px;
  position: relative;
}

.playground-output__viz {
  width: 100%;
  height: 400px;
}

.playground-output__viz svg {
  width: 100%;
  height: 100%;
}

/* Trace section */
.playground-trace {
  margin-top: var(--space-xl);
}

.trace-timeline {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.trace-timeline__slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border-default);
  border-radius: 2px;
}

.trace-timeline__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  cursor: pointer;
}

/* G2S mode specific */
.g2s-controls {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.g2s-controls select {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-code);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  cursor: pointer;
}

/* Output string display */
.output-string {
  padding: var(--space-lg);
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
}

/* Graph editor */
.graph-editor {
  width: 100%;
  height: 400px;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: crosshair;
  margin-bottom: var(--space-md);
}

.graph-editor svg {
  width: 100%;
  height: 100%;
}

.graph-editor__hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-align: center;
  margin-top: var(--space-sm);
}

/* ============================================================
   Round-Trip Panel
   ============================================================ */

.rt-step {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.rt-step__graph {
  width: 100%;
  height: 220px;
  margin: var(--space-md) 0;
}

.rt-step__info {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.rt-verdict {
  text-align: center;
  padding: var(--space-xl);
  border-radius: var(--radius-md);
  font-size: var(--text-lg);
  font-weight: 700;
}

.rt-verdict--success {
  background: rgba(52, 211, 153, 0.12);
  border: 2px solid var(--accent-tertiary);
  color: var(--accent-tertiary);
}

.rt-verdict--fail {
  background: rgba(239, 68, 68, 0.12);
  border: 2px solid #ef4444;
  color: #ef4444;
}
