/* Fair or Rigged? */

:root {
  --accent:       #004445;
  --accent-light: #006668;
  --focus-glow:   #FFD166;
  --ink:          #2C3E3E;
  --muted:        #5A6E6E;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #F5F1E5;
  font-family: Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#sim-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#stage-panel {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#sim-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#sim-canvas:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: -2px;
}

/* ── Accessibility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Info dialog ──
   Color contract: header = var(--accent) with white text. Tabs/footer = #F8FBFB.
   Body text = var(--ink). H3s = var(--accent). Shared across sims. */
#info-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow: hidden;
  margin: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
  background: #ffffff;
}

#info-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--accent);
  color: #ffffff;
}

.dialog-header h2 { font-size: 16px; font-weight: 600; }

#dialog-close-btn {
  background: transparent; border: none; color: #ffffff; font-size: 18px;
  cursor: pointer; width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
#dialog-close-btn:hover { background: rgba(255, 255, 255, 0.15); }
#dialog-close-btn:focus-visible { outline: 3px solid var(--focus-glow); outline-offset: 2px; }

.dialog-tabs { display: flex; border-bottom: 2px solid #E5EAE9; background: #F8FBFB; }

.tab-btn {
  flex: 1; background: none; border: none; border-bottom: 3px solid transparent;
  margin-bottom: -2px; padding: 10px 0; font-family: Roboto, Arial, sans-serif;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--accent); }
.tab-btn.active, .tab-btn[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:focus-visible { outline: 3px solid var(--focus-glow); outline-offset: -3px; }

.dialog-body {
  padding: 16px 20px; overflow-y: auto; max-height: calc(100vh - 240px);
  color: var(--ink); font-size: 14px; line-height: 1.55;
}
.dialog-body h3 { font-size: 14px; font-weight: 600; color: var(--accent); margin-top: 14px; margin-bottom: 6px; }
.dialog-body h3:first-child { margin-top: 0; }
.dialog-body p { margin-bottom: 8px; }
.dialog-body ul, .dialog-body ol { padding-left: 20px; margin-bottom: 8px; }
.dialog-body li { margin-bottom: 4px; }

.dialog-footer {
  display: flex; justify-content: flex-end; padding: 12px 20px;
  border-top: 1px solid #E5EAE9; background: #F8FBFB;
}
.dialog-close-footer {
  background: var(--accent); color: #ffffff; border: none; border-radius: 6px;
  padding: 8px 20px; font-family: Roboto, Arial, sans-serif; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.dialog-close-footer:hover { background: var(--accent-light); }
.dialog-close-footer:focus-visible { outline: 3px solid var(--focus-glow); outline-offset: 2px; }
