.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background-color: rgba(255, 255, 255, 0.92);
  padding: 1.25rem 1.75rem;
  border-radius: 20px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.app-header h1 {
  margin: 0 0 0.35rem;
  font-size: 2rem;
  color: #0f172a;
}

.subtitle {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 1.5rem;
}

.config-column,
.results-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.config-column {
  position: sticky;
  top: 1.5rem;
  align-self: start;
}

.game-viewer {
  margin-top: 0.5rem;
}

.game-viewer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.game-viewer__actions {
  display: flex;
  gap: 0.5rem;
}

.game-viewer__canvas {
  position: relative;
  width: 100%;
  min-height: 320px;
  height: 440px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: radial-gradient(circle at 25% 25%, #0b1224, #050816 65%);
  overflow: hidden;
}

.game-viewer__controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #1e293b;
}

.control-field select {
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1px solid #d4d4d8;
  background: #fff;
}

.control-field.slider input[type='range'] {
  width: 180px;
}

.game-viewer__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 40% 30%, rgba(37, 99, 235, 0.12), rgba(5, 8, 22, 0.9));
  color: #e2e8f0;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 1rem;
}

.section-card {
  background-color: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-card h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.section-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: #1f2937;
  gap: 0.35rem;
}

.form-grid input,
.form-grid select {
  border: 1px solid #d4d4d8;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-grid input:focus,
.form-grid select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-label {
  display: block;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.35rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #1f2937;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.primary-button {
  padding: 0.65rem 1.5rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 16px 24px rgba(37, 99, 235, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.primary-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 30px rgba(37, 99, 235, 0.25);
}

.ghost-button {
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  border: 1px solid #94a3b8;
  background: transparent;
  color: #1e293b;
  cursor: pointer;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ghost-button:not(:disabled):hover {
  color: #1d4ed8;
  border-color: #1d4ed8;
}

.results-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.summary-header p {
  margin: 0.35rem 0 0;
  color: #64748b;
}

.summary-duration {
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  font-weight: 600;
  align-self: center;
}

.summary-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.summary-grid h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: #0f172a;
}

.summary-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: #475569;
  font-size: 0.9rem;
}

.summary-grid li strong {
  color: #0f172a;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

th {
  color: #0f172a;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:hover {
  background-color: #f8fafc;
}

.error-banner {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.error-banner strong {
  font-size: 0.95rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  color: #ffffff;
  gap: 1rem;
  z-index: 1000;
}

.loading-overlay p {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  animation: spin 1s linear infinite;
}

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

.prediction-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.prediction-header p {
  margin: 0.25rem 0 0;
  color: #64748b;
}

.prediction-stats {
  display: flex;
  gap: 1rem;
  background: rgba(37, 99, 235, 0.08);
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
}

.prediction-stats div {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.prediction-stats span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1d4ed8;
}

.prediction-stats strong {
  font-size: 1rem;
  color: #1e293b;
}

.prediction-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}

.prediction-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #1f2937;
  font-size: 0.9rem;
}

.slider-label {
  flex: 1;
  min-width: 200px;
}

.slider-label input[type='range'] {
  width: 100%;
}

.slider-value {
  font-size: 0.85rem;
  color: #1e293b;
  font-weight: 600;
}

.heatmap-grid {
  display: grid;
  gap: 1.2rem;
}

.comparison-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.comparison-panels h3 {
  margin: 0 0 0.35rem;
  color: #0f172a;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.section-heading h2 {
  margin-bottom: 0.35rem;
}

.experience-card {
  gap: 1.1rem;
}

.accent-pill {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  align-self: center;
}

.playground-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.experience-panel {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.7), rgba(255, 255, 255, 0.9));
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-heading h3 {
  margin: 0;
}

.hint-text {
  color: #64748b;
  margin: 0;
  font-size: 0.85rem;
}

.mode-toggle {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.mode-pill {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  font-weight: 600;
  color: #1e293b;
  transition: all 0.15s ease;
}

.mode-pill.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.control-slider {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.slider-stack {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-width: 160px;
}

.toggle-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.progress-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-track.compact {
  height: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #2563eb, #22c55e);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.progress-fill.accent {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

.unlock-pill {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.85rem;
  color: #475569;
}

.unlock-pill.unlocked {
  background: rgba(34, 197, 94, 0.12);
  color: #047857;
  border-color: #34d399;
}

.unlock-text {
  margin: 0;
  font-size: 0.88rem;
  color: #1e293b;
}

.probe-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}

.probe-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.probe-card.active {
  border-color: #1d4ed8;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.15);
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.4), #fff);
}

.probe-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
}

.probe-toggle {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.accent-badge {
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  font-size: 0.8rem;
  text-align: right;
}

@media (max-width: 1100px) {
  .app-main {
    grid-template-columns: 1fr;
  }

  .config-column {
    position: relative;
    top: 0;
  }
}
