/* Component stylesheet for game.microservices-architect-game. */
html.iot-component-frame body {
  margin: 0;
  padding: 0;
  background: transparent;
}

html.iot-component-frame main,
html.iot-component-frame .page-columns,
html.iot-component-frame .content,
html.iot-component-frame #quarto-content,
html.iot-component-frame #quarto-document-content {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

html.iot-component-frame h1.title,
html.iot-component-frame #interactive-game > h2,
html.iot-component-frame #reference-material > h2,
html.iot-component-frame #related-resources,
html.iot-component-frame header,
html.iot-component-frame .quarto-title-block,
html.iot-component-frame nav,
html.iot-component-frame .sidebar,
html.iot-component-frame .toc-active,
html.iot-component-frame #quarto-header {
  display: none !important;
}

html.msa-page:not(.iot-component-frame) main.content,
html.msa-page:not(.iot-component-frame) .page-columns,
html.msa-page:not(.iot-component-frame) #quarto-content,
html.msa-page:not(.iot-component-frame) #quarto-document-content {
  width: min(1160px, calc(100vw - 32px));
  max-width: none;
  margin-right: auto;
  margin-left: auto;
}

html.msa-page:not(.iot-component-frame) .page-columns {
  display: block;
}

html.iot-component-frame #msaGame,
html.iot-component-frame .msa-reference-material {
  max-width: 100%;
  margin-right: 0;
  margin-left: 0;
  box-shadow: none;
}

html.iot-resource-frame-standalone #msaGame {
  margin-bottom: 22px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

html.iot-resource-frame-standalone #msaGame .msa-hero {
  display: none;
}

#msaGame,
#msaGame *,
.msa-reference-material,
.msa-reference-material * {
  box-sizing: border-box;
}

#msaGame {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto 28px;
  padding: 18px;
  color: #243641;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #f7f9f5;
  border: 1px solid #e2e5dc;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(36, 54, 65, 0.1);
}

#msaGame h2,
#msaGame h3,
#msaGame h4,
#msaGame h5,
#msaGame p {
  margin: 0;
  letter-spacing: 0;
}

.msa-hero {
  padding: 22px;
  margin-bottom: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #223441 0%, #0e7c80 58%, #b66b20 100%);
  border-radius: 8px;
}

.msa-kicker,
.msa-reqs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.msa-kicker {
  margin-bottom: 14px;
}

.msa-pill,
.msa-reqs span,
.msa-scenario-tag,
.msa-scenario-score {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.msa-pill {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  text-transform: uppercase;
}

.msa-hero h2 {
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1.1;
}

.msa-hero p {
  max-width: 860px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.msa-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 660px;
  margin-top: 18px;
}

.msa-metric {
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.msa-metric strong {
  display: block;
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1;
}

.msa-metric span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
  font-weight: 800;
}

.msa-status {
  display: grid;
  grid-template-columns: minmax(210px, 1.4fr) repeat(3, minmax(100px, 0.6fr));
  gap: 10px;
  margin-bottom: 16px;
}

.msa-progress-card,
.msa-stat,
.msa-scenario-card,
.msa-panel,
.msa-design-summary,
.msa-feedback,
.msa-final-card {
  background: #ffffff;
  border: 1px solid #dfe4e2;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(34, 48, 54, 0.06);
}

.msa-progress-card {
  min-height: 68px;
  padding: 12px 14px;
}

.msa-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #34454e;
  font-size: 0.82rem;
  font-weight: 800;
}

.msa-progress-label span {
  color: #708189;
}

.msa-progress-track {
  height: 8px;
  overflow: hidden;
  background: #e5ece7;
  border-radius: 999px;
}

.msa-progress-track > div {
  height: 100%;
  width: 4%;
  background: linear-gradient(90deg, #0e7c80, #b66b20);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.msa-stat {
  display: grid;
  min-height: 68px;
  place-items: center;
  padding: 10px;
  text-align: center;
}

.msa-stat strong {
  color: #243641;
  font-size: 1.8rem;
  line-height: 1;
}

.msa-stat span {
  margin-top: 4px;
  color: #77858c;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.msa-loading,
.msa-error {
  padding: 18px;
  border: 1px solid #dde2d8;
  border-radius: 8px;
  background: #ffffff;
}

.msa-error {
  color: #842029;
  background: #fff4f3;
}

.msa-scenario-card {
  padding: 18px;
  margin-bottom: 14px;
}

.msa-scenario-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.msa-scenario-tag,
.msa-scenario-score {
  color: #0f6c73;
  background: #e2f3f2;
}

.msa-scenario-score {
  color: #7a4b00;
  background: #fff3d2;
  white-space: nowrap;
}

.msa-scenario-card h3 {
  margin-top: 8px;
  color: #20343d;
  font-size: 1.5rem;
  line-height: 1.2;
}

.msa-scenario-copy {
  max-width: 920px;
  color: #364f59;
  line-height: 1.55;
}

.msa-reqs {
  margin-top: 14px;
}

.msa-reqs span {
  color: #20343d;
  background: #edf3f1;
  font-size: 0.78rem;
  font-weight: 800;
}

.msa-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.msa-panel {
  min-width: 0;
  padding: 16px;
}

.msa-step-head {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.msa-step-head > span {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: #0e7c80;
  font-weight: 900;
}

.msa-step-head h4 {
  color: #20343d;
  font-size: 1rem;
}

.msa-step-head p {
  margin-top: 3px !important;
  color: #60757d;
  font-size: 0.88rem;
  line-height: 1.45;
}

.msa-option-grid {
  display: grid;
  gap: 10px;
}

.msa-option-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 5px 10px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid #d8e3e0;
  border-radius: 8px;
  color: #20343d;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.msa-option-card:hover,
.msa-option-card:focus-visible {
  border-color: #bf7528;
  box-shadow: 0 8px 18px rgba(194, 112, 27, 0.16);
  outline: none;
}

.msa-option-card.is-selected {
  border-color: #0e7c80;
  background: #eaf7f6;
}

.msa-option-card.is-correct {
  border-color: #1e8d58;
  background: #ecf8f0;
}

.msa-option-card.is-wrong {
  border-color: #bc4b3f;
  background: #fff1ef;
}

.msa-option-card:disabled {
  cursor: default;
}

.msa-option-card > span {
  display: inline-flex;
  width: 38px;
  height: 32px;
  align-items: center;
  justify-content: center;
  grid-row: span 3;
  border-radius: 8px;
  color: #ffffff;
  background: #20343d;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.msa-option-card strong {
  color: #20343d;
  font-size: 0.92rem;
  line-height: 1.2;
}

.msa-option-card em {
  color: #405761;
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.35;
}

.msa-option-card small {
  color: #6b7d84;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.msa-design-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
}

.msa-design-summary span {
  display: block;
  color: #6b7d84;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.msa-design-summary strong {
  display: block;
  margin-top: 4px;
  color: #20343d;
  font-size: 0.96rem;
}

.msa-submit {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: #0e7c80;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 900;
}

.msa-submit:hover,
.msa-submit:focus-visible {
  background: #0b686c;
  outline: none;
}

.msa-submit:disabled {
  background: #a4b2b5;
  cursor: not-allowed;
}

.msa-feedback {
  margin-top: 14px;
  padding: 16px;
}

.msa-feedback.great {
  border-color: #acd7bc;
  background: #f3fbf5;
}

.msa-feedback.ok {
  border-color: #edd08d;
  background: #fff9eb;
}

.msa-feedback.needs-work {
  border-color: #e4b1aa;
  background: #fff4f3;
}

.msa-feedback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.msa-feedback-head span {
  color: #708189;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.msa-feedback-head h4 {
  margin-top: 4px !important;
  color: #20343d;
  font-size: 1.12rem;
}

.msa-feedback-head > strong {
  color: #0e7c80;
  font-size: 1.7rem;
  line-height: 1;
}

.msa-score-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.msa-score-item {
  min-height: 62px;
  padding: 10px;
  border: 1px solid #dfe5df;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.msa-score-item strong {
  display: block;
  font-size: 1.15rem;
}

.msa-score-item strong.green {
  color: #1e8d58;
}

.msa-score-item strong.orange {
  color: #a86515;
}

.msa-score-item strong.red {
  color: #bc4b3f;
}

.msa-score-item span {
  display: block;
  margin-top: 4px;
  color: #6b7d84;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.msa-feedback-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
}

.msa-feedback-grid h5 {
  margin-bottom: 7px !important;
  color: #20343d;
  font-size: 0.9rem;
}

.msa-feedback-grid p,
.msa-feedback-grid li {
  color: #405761;
  font-size: 0.88rem;
  line-height: 1.5;
}

.msa-feedback-grid ul {
  margin: 0;
  padding-left: 18px;
}

.msa-next {
  margin-top: 14px;
}

.msa-final-card {
  padding: 24px;
  text-align: center;
}

.msa-final-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  color: #0f6c73;
  background: #e2f3f2;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.msa-final-card h3 {
  margin-top: 10px !important;
  color: #20343d;
  font-size: 1.5rem;
}

.msa-big-score {
  margin-top: 8px;
  color: #0e7c80;
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}

.msa-final-card p {
  max-width: 620px;
  margin: 10px auto 0 !important;
  color: #405761;
  line-height: 1.5;
}

.msa-final-chart {
  display: flex;
  min-height: 150px;
  align-items: end;
  justify-content: center;
  gap: 8px;
  margin: 20px auto;
  padding: 12px;
  border: 1px solid #dfe5df;
  border-radius: 8px;
  background: #f8faf8;
}

.msa-final-bar-wrap {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #6b7d84;
  font-size: 0.72rem;
  font-weight: 900;
}

.msa-final-bar {
  width: 20px;
  border-radius: 6px 6px 0 0;
  background: #bc4b3f;
}

.msa-final-bar.green {
  background: #1e8d58;
}

.msa-final-bar.orange {
  background: #b66b20;
}

.msa-final-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 520px;
  margin: 0 auto 18px;
}

.msa-final-stats div {
  padding: 12px;
  border: 1px solid #dfe5df;
  border-radius: 8px;
  background: #ffffff;
}

.msa-final-stats strong {
  display: block;
  color: #20343d;
  font-size: 1.35rem;
}

.msa-final-stats span {
  display: block;
  margin-top: 3px;
  color: #6b7d84;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.msa-reference-material {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto 28px;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.msa-reference-intro,
.msa-reference-loading {
  margin: 0 0 12px !important;
  padding: 14px 16px;
  border: 1px solid #dfe4e2;
  border-radius: 8px;
  color: #405761;
  background: #ffffff;
  line-height: 1.5;
}

.msa-reference-material details {
  margin-bottom: 10px;
  border: 1px solid #dfe4e2;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.msa-reference-material summary {
  min-height: 46px;
  padding: 13px 16px;
  color: #20343d;
  cursor: pointer;
  font-weight: 900;
}

.msa-reference-content {
  padding: 0 16px 16px;
  color: #405761;
}

.msa-reference-content > p {
  margin: 0 0 12px !important;
  line-height: 1.5;
}

.msa-reference-table-wrap {
  overflow-x: auto;
  border: 1px solid #dfe5df;
  border-radius: 8px;
}

.msa-reference-table-wrap table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.msa-reference-table-wrap th,
.msa-reference-table-wrap td {
  padding: 10px 12px;
  border-bottom: 1px solid #e6ece9;
  text-align: left;
  vertical-align: top;
  font-size: 0.84rem;
  line-height: 1.45;
}

.msa-reference-table-wrap th {
  color: #20343d;
  background: #edf4f2;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.msa-reference-table-wrap tr:last-child td {
  border-bottom: 0;
}

.msa-reference-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.msa-reference-card-grid article,
.msa-mini-card-grid article {
  padding: 12px;
  border: 1px solid #dfe5df;
  border-radius: 8px;
  background: #f8faf8;
}

.msa-reference-card-grid h5,
.msa-mini-card-grid h5 {
  margin: 0 0 6px !important;
  color: #20343d;
  font-size: 0.9rem;
}

.msa-reference-card-grid p,
.msa-mini-card-grid p {
  margin: 0 !important;
  color: #405761;
  font-size: 0.84rem;
  line-height: 1.45;
}

.msa-mini-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.msa-mini-card-grid article {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
}

.msa-mini-card-grid article > span {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: #0e7c80;
  font-size: 0.78rem;
  font-weight: 900;
}

@media (max-width: 900px) {
  .msa-status,
  .msa-workspace,
  .msa-feedback-grid {
    grid-template-columns: 1fr;
  }

  .msa-design-summary {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  #msaGame {
    padding: 12px;
  }

  .msa-hero,
  .msa-scenario-card,
  .msa-panel,
  .msa-feedback,
  .msa-final-card {
    padding: 14px;
  }

  .msa-hero h2 {
    font-size: 1.55rem;
  }

  .msa-metrics,
  .msa-score-detail,
  .msa-final-stats {
    grid-template-columns: 1fr;
  }

  .msa-scenario-top,
  .msa-feedback-head {
    display: grid;
  }

  .msa-scenario-score {
    justify-self: start;
  }

  .msa-option-card {
    grid-template-columns: 38px 1fr;
    min-height: 104px;
  }

  .msa-reference-table-wrap table {
    min-width: 560px;
  }
}

/* S3 rollout: design-patterns module recolor. */
#msaGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"],
#msaReferenceMaterial[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"] {
  --iot-sim-module-accent: #8f6b00;
  --iot-sim-module-strong: #5f4900;
  --iot-sim-module-tint: #fff7df;
  --iot-sim-module-tint-strong: #f3e2b8;
  --iot-sim-ink: #243641;
  --iot-sim-muted: #52666f;
  --iot-sim-border: color-mix(in srgb, var(--iot-sim-module-accent) 32%, #dfe7df);
  color: var(--iot-sim-ink);
  background: #fbfcf8;
  border-color: var(--iot-sim-border);
  box-shadow: none;
}

#msaGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"]
  :where(.msa-hero) {
  color: var(--iot-sim-ink);
  background: var(--iot-sim-module-tint);
  border: 1px solid var(--iot-sim-border);
  border-left: 4px solid var(--iot-sim-module-accent);
  box-shadow: none;
}

#msaGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"]
  :where(.msa-hero h2, .msa-hero p, .msa-metric strong, .msa-metric span) {
  color: var(--iot-sim-ink);
}

#msaGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"]
  :where(
    .msa-progress-card,
    .msa-stat,
    .msa-scenario-card,
    .msa-panel,
    .msa-design-summary,
    .msa-feedback,
    .msa-score-item,
    .msa-final-card,
    .msa-final-bar-wrap,
    .msa-option-card
  ),
#msaReferenceMaterial[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"]
  :where(
    .msa-reference-content,
    .msa-reference-table-wrap,
    .msa-reference-card-grid article,
    .msa-mini-card-grid article
  ) {
  background: #ffffff;
  border-color: var(--iot-sim-border);
  box-shadow: none;
}

#msaGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"]
  :where(
    .msa-pill,
    .msa-reqs span,
    .msa-scenario-tag,
    .msa-scenario-score,
    .msa-progress-track,
    .msa-final-badge,
    .msa-reference-loading,
    .msa-loading
  ),
#msaReferenceMaterial[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"]
  :where(.msa-reference-loading, .msa-reference-table-wrap th, .msa-mini-card-grid article > span) {
  color: var(--iot-sim-ink);
  background: var(--iot-sim-module-tint);
  border-color: var(--iot-sim-border);
}

#msaGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"]
  :where(
    .msa-submit,
    .msa-option-card.is-selected,
    .msa-option-card.is-correct,
    .msa-progress-track > div,
    .msa-final-bar,
    .msa-final-bar.green,
    .msa-score-item strong.green
  ) {
  color: #ffffff;
  background: var(--iot-sim-module-strong);
  border-color: var(--iot-sim-module-strong);
}

#msaGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"]
  :where(
    .msa-progress-label span,
    .msa-stat span,
    .msa-option-card small,
    .msa-design-summary span,
    .msa-progress-label strong,
    .msa-stat strong,
    .msa-scenario-card h3,
    .msa-panel h4,
    .msa-feedback h4,
    .msa-score-item strong,
    .msa-big-score,
    .msa-final-card h3
  ),
#msaReferenceMaterial[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"]
  :where(h3, h4, h5, .msa-reference-card-grid h5, .msa-mini-card-grid h5) {
  color: var(--iot-sim-module-strong);
}

#msaGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"]
  :where(.msa-option-card:hover, .msa-submit:focus-visible, .msa-submit:hover),
#msaReferenceMaterial[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="design-patterns"]
  :where(.msa-reference-card-grid article:hover, .msa-mini-card-grid article:hover) {
  border-color: var(--iot-sim-module-strong);
}
