.question-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 24px, 1100px);
  margin: 40px auto;
}

.question-hero {
  position: relative;
  overflow: hidden;
  padding: 28px 24px 24px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03)),
    var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.question-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(440px 220px at 0% 0%, rgba(56, 189, 248, 0.18), transparent 70%),
    radial-gradient(400px 220px at 100% 0%, rgba(14, 165, 233, 0.14), transparent 70%);
  pointer-events: none;
}

.question-kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  background: rgba(8, 47, 73, 0.46);
  color: #effbff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.question-title {
  position: relative;
  margin: 16px 0 0;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.1;
  font-weight: 900;
  color: #111827;
  text-shadow: none;
}

.question-subtitle {
  position: relative;
  margin: 12px 0 0;
  padding: 16px 20px;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #0f172a;
  font-size: 15px;
  line-height: 1.7;
  font-weight: 700;
}

.question-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 18px;
  margin-top: 22px;
}

.question-card,
.simulation-letterbox {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255,255,255,0.94);
  box-shadow: 0 18px 36px rgba(2, 8, 22, 0.12);
}

.question-card {
  padding: 22px;
}

.question-card h2,
.simulation-letterbox h2 {
  margin: 0 0 12px;
  font-size: 22px;
  color: #0f172a;
}

.question-card p,
.question-card li {
  color: #334155;
  line-height: 1.72;
}

.question-card ul {
  margin: 0;
  padding-left: 18px;
}

.question-image-wrap {
  border-radius: 20px;
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.question-image-wrap img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.choice-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.choice-list li {
  color: #0f172a;
  font-weight: 700;
}

.question-note-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.16);
  background: rgba(239, 246, 255, 0.7);
}

.question-note-box strong {
  color: #1d4ed8;
  font-size: 15px;
}

.question-note {
  margin: 8px 0 0;
}

.question-answer {
  font-weight: 900;
  color: #1d4ed8;
}

.question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.question-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(135deg, #1d9bf0, #2563eb);
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.question-btn.secondary,
.answer-btn {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
}

.answer-box {
  display: none;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(239, 246, 255, 0.9);
  color: #0f172a;
  line-height: 1.65;
}

.answer-box.is-open {
  display: block;
}

.answer-box strong {
  color: #1d4ed8;
}

.simulation-letterbox {
  position: relative;
  margin-top: 18px;
  padding: 22px;
}

.simulation-head-copy {
  margin: 0 0 14px;
  color: #475569;
  line-height: 1.68;
  font-size: 14px;
  font-weight: 700;
}

.sim-shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sim-panel {
  min-width: 0;
  border-radius: 20px;
  border: 1px solid rgba(59, 130, 246, 0.24);
  background: linear-gradient(180deg, rgba(219,234,254,0.96), rgba(191,219,254,0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sim-panel-status,
.judge-grid,
.footer-answer {
  grid-column: 1 / -1;
}

.sim-panel-transit {
  grid-column: 1;
  grid-row: 2 / span 2;
}

.sim-panel-brightness {
  grid-column: 2;
  grid-row: 2;
}

.sim-panel-velocity {
  grid-column: 2;
  grid-row: 3;
}

.sim-panel-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 40px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.sim-panel-body {
  border-radius: 16px;
  background: rgba(255,255,255,0.84);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 12px;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.96));
  border: 1px solid rgba(20, 35, 58, 0.08);
}

#transitCanvas {
  aspect-ratio: 64 / 33;
}

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

.status-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(20, 35, 58, 0.08);
}

.status-label {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-value {
  display: block;
  font-size: 20px;
  line-height: 1.2;
  color: #0f172a;
}

.status-copy {
  margin: 6px 0 0;
  color: #334155;
  line-height: 1.48;
  font-size: 13px;
}

.warn {
  color: #d97706;
}

.good {
  color: #15803d;
}

.bad {
  color: #dc2626;
}

.blue {
  color: #1d4ed8;
}

.control-top-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.readout-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.18);
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 800;
}

.simulation-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sim-start-btn,
.sim-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
}

.sim-start-btn {
  border: 1px solid rgba(37, 99, 235, 0.24);
  background: linear-gradient(135deg, #ffffff, #dbeafe);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.sim-reset-btn {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(135deg, #ffffff, #f1f5f9 52%, #dbeafe 100%);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255,255,255,0.85);
}

.sim-start-btn img,
.sim-reset-btn img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.simulation-slider {
  display: block;
  width: 100%;
  margin-top: 12px;
  accent-color: #2563eb;
}

.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-buttons button {
  border: 0;
  cursor: pointer;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.1);
  color: #1d4ed8;
  font-weight: 900;
  font-size: 13px;
}

.control-copy,
.control-hint {
  margin: 0;
  line-height: 1.58;
  font-size: 13px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.control-hint {
  margin-top: 12px;
  font-weight: 800;
}

.answer-toggle-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}

.answer-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.26);
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

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

.judge-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255,255,255,0.92);
}

.judge-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #0f172a;
}

.judge-card p {
  margin: 0;
  line-height: 1.58;
  font-size: 13px;
}

.footer-answer {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(21, 128, 61, 0.18);
  background: linear-gradient(180deg, rgba(21, 128, 61, 0.1), rgba(255, 255, 255, 0.98));
  color: #15803d;
  font-weight: 900;
  font-size: 16px;
}

[hidden] {
  display: none !important;
}

html[data-site-theme="dark"] .question-card h2,
html[data-site-theme="dark"] .simulation-letterbox h2 {
  color: #f8fbff;
}

html[data-site-theme="dark"] .question-title {
  color: #f8fbff !important;
}

html[data-site-theme="dark"] .question-hero {
  background:
    linear-gradient(180deg, rgba(8, 18, 34, 0.88), rgba(6, 14, 28, 0.92)),
    var(--card);
  border-color: rgba(154, 182, 214, 0.2);
  box-shadow: 0 24px 56px rgba(2, 8, 22, 0.34);
}

html[data-site-theme="dark"] .question-subtitle {
  background: rgba(8, 18, 34, 0.9);
  border-color: rgba(154, 182, 214, 0.2);
  color: #dbeafe;
  box-shadow: 0 20px 48px rgba(2, 8, 22, 0.32);
}

html[data-site-theme="dark"] .question-card,
html[data-site-theme="dark"] .simulation-letterbox {
  background: rgba(8, 18, 34, 0.9);
  border-color: rgba(154, 182, 214, 0.2);
  color: #dbeafe;
  box-shadow: 0 20px 48px rgba(2, 8, 22, 0.32);
}

html[data-site-theme="dark"] .question-kicker {
  background: rgba(8, 47, 73, 0.46);
  border-color: rgba(125, 211, 252, 0.24);
  color: #effbff;
}

html[data-site-theme="dark"] .question-card li,
html[data-site-theme="dark"] .simulation-head-copy,
html[data-site-theme="dark"] .status-copy,
html[data-site-theme="dark"] .control-copy,
html[data-site-theme="dark"] .control-hint,
html[data-site-theme="dark"] .judge-card p,
html[data-site-theme="dark"] .answer-box {
  color: #d6e5f6;
}

html[data-site-theme="dark"] .choice-list li,
html[data-site-theme="dark"] .status-value,
html[data-site-theme="dark"] .judge-card h3 {
  color: #eef6ff;
}

html[data-site-theme="dark"] .question-image-wrap,
html[data-site-theme="dark"] .sim-panel-body,
html[data-site-theme="dark"] .status-card,
html[data-site-theme="dark"] .judge-card,
html[data-site-theme="dark"] canvas {
  background: rgba(10, 22, 40, 0.92);
  border-color: rgba(154, 182, 214, 0.18);
}

html[data-site-theme="dark"] .sim-panel {
  background: linear-gradient(180deg, rgba(10, 32, 58, 0.95), rgba(7, 20, 36, 0.94));
  border-color: rgba(96, 165, 250, 0.22);
}

html[data-site-theme="dark"] .sim-panel-label,
html[data-site-theme="dark"] .status-label,
html[data-site-theme="dark"] .answer-box strong {
  color: #8ec5ff;
}

html[data-site-theme="dark"] .readout-pill,
html[data-site-theme="dark"] .quick-buttons button,
html[data-site-theme="dark"] .answer-toggle-btn,
html[data-site-theme="dark"] .question-btn.secondary,
html[data-site-theme="dark"] .answer-btn {
  background: linear-gradient(135deg, rgba(12, 37, 66, 0.96), rgba(17, 58, 104, 0.94));
  border-color: rgba(96, 165, 250, 0.24);
  color: #dbeafe;
}

html[data-site-theme="dark"] .footer-answer {
  background: linear-gradient(180deg, rgba(12, 56, 38, 0.92), rgba(10, 22, 40, 0.96));
  border-color: rgba(52, 211, 153, 0.22);
  color: #b7f7d0;
}

@media (max-width: 900px) {
  .question-grid,
  .sim-shell,
  .status-grid,
  .judge-grid {
    grid-template-columns: 1fr;
  }

  .question-shell {
    width: calc(100% - 10px);
    margin: 16px auto 24px;
  }

  .question-card,
  .simulation-letterbox {
    border-radius: 18px;
    padding: 14px;
  }

  .sim-panel {
    border-radius: 16px;
    padding: 10px;
  }

  .sim-panel-body {
    border-radius: 12px;
    padding: 10px;
  }

  .question-btn {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .sim-start-btn,
  .sim-reset-btn {
    width: 46px;
    height: 46px;
  }

  .sim-start-btn img,
  .sim-reset-btn img {
    width: 22px;
    height: 22px;
  }
}
