/* Domain Discovery — full-viewport canvas sim */

:root {
  --bench-bg: #f0ebe0;
  --bench-border: #d4c8b0;
  --bench-text: #3a3028;
  --dialog-bg: #fff;
  --dialog-header: #1a1008;
  --dialog-text: #2a2018;
  --accent: #004445;
  --accent-light: #006667;
  --tab-active: #004445;
  --tab-text: #5a4a30;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: #0d0a04;
  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;
}

/* Back-to-map button — rounded square minimap thumbnail */
#back-btn {
  position: absolute;
  top: 10px;
  left: 12px;
  width: 64px;
  padding: 0;
  border: 2px solid #dcaf41;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #111008;
  box-shadow: 0 2px 8px rgba(0,0,0,0.55);
  transition: border-color 0.15s, transform 0.1s;
  z-index: 10;
}

#back-btn:hover {
  border-color: #26aebc;
  transform: scale(1.06);
}

#back-btn:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

#back-map-canvas {
  display: block;
  width: 60px;
  height: 60px;
}

#back-btn-label {
  display: block;
  color: #dcaf41;
  font-family: Roboto, Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 0 5px;
  letter-spacing: 0.06em;
  text-align: center;
  background: rgba(0,0,0,0.55);
  width: 100%;
  transition: color 0.15s;
}

#back-btn:hover #back-btn-label {
  color: #26aebc;
}

/* ── 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 ── */
#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 16px 48px rgba(0, 0, 0, 0.45);
  background: var(--dialog-bg);
}

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

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

.dialog-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#dialog-close-btn {
  background: none;
  border: none;
  color: #a09080;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}

#dialog-close-btn:hover {
  color: #f0e8c8;
  background: rgba(255, 255, 255, 0.1);
}

.dialog-tabs {
  display: flex;
  border-bottom: 1px solid #e0d8c8;
  background: #f8f4ec;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-family: Roboto, Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--tab-text);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn.active,
.tab-btn[aria-selected="true"] {
  color: var(--tab-active);
  border-bottom-color: var(--tab-active);
  font-weight: 700;
}

.tab-btn:hover:not(.active) {
  color: var(--accent-light);
}

.dialog-body {
  padding: 18px 20px;
  overflow-y: auto;
  max-height: calc(100vh - 240px);
  color: var(--dialog-text);
  font-size: 0.875rem;
  line-height: 1.55;
}

.dialog-body h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1008;
  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: 18px;
  margin-bottom: 8px;
}

.dialog-body li {
  margin-bottom: 4px;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid #e0d8c8;
  background: #f8f4ec;
}

.dialog-close-footer {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-family: Roboto, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.dialog-close-footer:hover {
  background: var(--accent-light);
}

.dialog-close-footer:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}
