/* Component stylesheet for game.ble-advertising-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 > h1,
html.iot-component-frame #interactive-game > h2,
html.iot-component-frame #reference-material > h2,
html.iot-component-frame #scenario-walkthroughs > h2,
html.iot-component-frame #real-world-scenarios-walkthrough > 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.iot-component-frame #bleGame,
html.iot-component-frame .reference-material {
  max-width: 100%;
  margin-right: 0;
  margin-left: 0;
  box-shadow: none;
}

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

html.iot-resource-frame-standalone #bleGame .ble-hero {
  display: none;
}

#bleGame,
#bleGame * {
  box-sizing: border-box;
}

#bleGame {
  display: block;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto 28px;
  padding: 18px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20343d;
  background: #f2f8fb;
  border: 1px solid #d7e5eb;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(28, 55, 63, 0.1);
}

#bleGame h2,
#bleGame h3,
#bleGame p {
  margin: 0;
}

.ble-hero {
  padding: 22px;
  margin-bottom: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #1264a3 0%, #20343d 100%);
  border-radius: 8px;
}

.ble-kicker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ble-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ble-hero h2 {
  color: #ffffff;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: 0;
  margin-bottom: 10px;
}

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

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

.ble-metric {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.ble-metric strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1;
}

.ble-metric span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
}

.ble-status {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ble-progress-card,
.ble-stat {
  min-height: 78px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #d7e5eb;
  border-radius: 8px;
}

.ble-progress-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.ble-progress-track {
  height: 10px;
  overflow: hidden;
  background: #e8f1f5;
  border-radius: 999px;
}

.ble-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #1264a3, #0f8b8d);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.ble-progress-text {
  color: #60757d;
  font-size: 0.82rem;
  font-weight: 750;
}

.ble-stat strong {
  display: block;
  color: #20343d;
  font-size: 1.55rem;
  line-height: 1;
}

.ble-stat span {
  display: block;
  margin-top: 7px;
  color: #627982;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ble-scenario {
  padding: 18px;
  margin-bottom: 14px;
  background: #ffffff;
  border: 1px solid #d7e5eb;
  border-left: 5px solid #1264a3;
  border-radius: 8px;
}

.ble-scenario-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.ble-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #0e5489;
  background: #e4f1fb;
  border: 1px solid #b7d8ef;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ble-scenario h3 {
  color: #20343d;
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 9px;
}

.ble-scenario p {
  color: #49616a;
  line-height: 1.58;
}

.ble-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.ble-req {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: #20343d;
  background: #f7fbfc;
  border: 1px solid #d4e2e5;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
}

.ble-config-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 14px;
  align-items: start;
}

#bleGame .ble-config-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 290px) !important;
}

#bleGame .ble-config-shell > * {
  grid-column: auto !important;
}

.ble-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ble-config-item {
  padding: 14px;
  background: #ffffff;
  border: 1px solid #d7e5eb;
  border-radius: 8px;
}

.ble-config-item label {
  display: block;
  color: #20343d;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 9px;
}

.ble-slider-row {
  display: grid;
  grid-template-columns: 1fr 82px;
  gap: 10px;
  align-items: center;
}

.ble-slider-row input[type="range"] {
  width: 100%;
  accent-color: #1264a3;
}

.ble-slider-val {
  color: #1264a3;
  font-size: 0.88rem;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.ble-help-card {
  padding: 14px;
  background: #ffffff;
  border: 1px solid #d7e5eb;
  border-radius: 8px;
}

.ble-help-card h3 {
  color: #20343d;
  font-size: 1rem;
  margin-bottom: 8px;
}

.ble-help-card dl {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 7px 10px;
  margin: 0;
}

.ble-help-card dt {
  color: #60757d;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ble-help-card dd {
  margin: 0;
  color: #40575f;
  line-height: 1.35;
}

.ble-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 14px 0;
}

.ble-btn {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #ffffff;
  background: #1264a3;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 850;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.ble-btn:hover:not(:disabled) {
  background: #0e5489;
  transform: translateY(-1px);
}

.ble-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ble-btn.secondary {
  color: #20343d;
  background: #ffffff;
  border-color: #cbd9dd;
}

.ble-btn.secondary:hover:not(:disabled) {
  background: #f2f7f8;
}

.ble-results {
  display: none;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #d7e5eb;
  border-radius: 8px;
}

.ble-results-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.ble-result-item {
  padding: 12px;
  text-align: center;
  background: #f7fbfc;
  border: 1px solid #dce8ec;
  border-radius: 8px;
}

.ble-result-val {
  color: #20343d;
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1;
}

.ble-result-label {
  margin-top: 7px;
  color: #627982;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ble-score-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 850;
}

.ble-score-great {
  background: #2e7d32;
}

.ble-score-good {
  background: #b76412;
}

.ble-score-poor {
  background: #b94a48;
}

.ble-feedback {
  margin-top: 10px;
  color: #40575f;
  line-height: 1.5;
}

.ble-final {
  display: none;
  padding: 30px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #d7e5eb;
  border-radius: 8px;
}

.ble-final h3 {
  color: #20343d;
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.ble-final-score {
  color: #1264a3;
  font-size: 2.8rem;
  line-height: 1;
  font-weight: 900;
  margin-bottom: 8px;
}

.ble-final p {
  color: #60757d;
  line-height: 1.45;
  margin-bottom: 16px;
}

.reference-intro {
  margin: 0 0 12px;
  color: #52656e;
  line-height: 1.5;
}

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

#interactive-game > #reference-material,
#interactive-game > #scenario-walkthroughs {
  grid-column: screen-start / screen-end !important;
  width: 100%;
  max-width: 1040px;
  margin-right: auto;
  margin-left: auto;
}

.reference-scan {
  overflow-x: auto;
  margin: 12px 0 18px;
  border: 1px solid #dbe5e9;
  border-radius: 8px;
  background: #ffffff;
}

.reference-scan-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  margin: 0;
  font-size: 0.88rem;
}

.reference-scan-table th,
.reference-scan-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e6eef1;
  text-align: left;
  vertical-align: top;
}

.reference-scan-table th {
  color: #17313b;
  background: #edf6f7;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.reference-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}

.reference-mini,
.reference-card {
  padding: 14px;
  border: 1px solid #dbe5e9;
  border-radius: 8px;
  background: #ffffff;
}

.reference-mini strong,
.reference-card h4 {
  display: block;
  margin: 0 0 5px;
  color: #17313b;
}

.reference-mini span,
.reference-role {
  color: #52656e;
  line-height: 1.4;
}

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

.reference-card h4 {
  font-size: 1rem;
  line-height: 1.25;
}

.reference-role {
  margin: 0 0 10px;
}

.reference-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.reference-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #20343d;
  background: #e9f1f3;
  font-size: 0.72rem;
  font-weight: 800;
}

.reference-card dl {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 7px 10px;
  margin: 0;
}

.reference-card dt {
  color: #627982;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reference-card dd {
  margin: 0;
  color: #2f3f47;
  line-height: 1.42;
}

.reference-card ol,
.reference-card ul {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  color: #2f3f47;
}

.reference-card li {
  margin: 4px 0;
  line-height: 1.4;
}

.reference-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.reference-map-item {
  padding: 12px;
  border: 1px solid #dbe5e9;
  border-radius: 8px;
  background: #ffffff;
}

.reference-map-item strong,
.reference-map-item span {
  display: block;
}

.reference-map-item strong {
  color: #17313b;
  font-size: 0.92rem;
}

.reference-map-item span {
  margin-top: 4px;
  color: #5c6d76;
  font-size: 0.82rem;
  line-height: 1.35;
}

.reference-loading {
  padding: 14px;
  border: 1px solid #dbe5e9;
  border-radius: 8px;
  background: #ffffff;
  color: #52656e;
}

.reference-section {
  margin: 10px 0;
  border: 1px solid #dbe5e9;
  border-left: 5px solid #1264a3;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.reference-section-tip {
  border-left-color: #0f8b8d;
}

.reference-section-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 12px;
  color: #3d454b;
  background: #e7f1ff;
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}

.reference-section-tip .reference-section-summary {
  background: #e6f5f2;
}

.reference-section-summary::-webkit-details-marker {
  display: none;
}

.reference-section-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: #1264a3;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}

.reference-section-tip .reference-section-icon {
  color: #0f8b8d;
}

.reference-section-chevron {
  margin-left: auto;
  color: #52656e;
  transition: transform 0.2s ease;
}

.reference-section[open] .reference-section-chevron {
  transform: rotate(90deg);
}

.reference-section-body {
  padding: 14px 12px 16px;
  background: #ffffff;
}

@media (max-width: 820px) {
  #bleGame {
    padding: 14px;
  }

  .ble-status,
  .ble-config-shell,
  .ble-config,
  .reference-card-grid {
    grid-template-columns: 1fr;
  }

  #bleGame .ble-config-shell {
    grid-template-columns: 1fr !important;
  }

  .ble-metrics,
  .ble-results-grid {
    grid-template-columns: 1fr 1fr;
  }

  .reference-scan-table {
    min-width: 0;
  }

  .reference-scan-table th:nth-child(n+3),
  .reference-scan-table td:nth-child(n+3) {
    display: none;
  }

  .reference-card dl,
  .ble-help-card dl {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
