/* Design tokens globais — todas as simulações herdam daqui. */
:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #18233a;
  --text-muted: #5a6a82;
  --border: #d8e0ec;
  --primary: #2f6fed;
  --primary-soft: #e3ecff;
  --acid: #e5484d;
  --base: #3e63dd;
  --neutral: #8a94a6;
  --success: #2a9d61;
  --warning: #d98a1c;

  --wall-top: #e8eef7;
  --wall-bottom: #dbe4f0;
  --table: #c9b79c;
  --table-edge: #a8957a;
  --glass-stroke: #6f8099;
  --glass-fill: rgba(255, 255, 255, 0.28);

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(20, 40, 80, 0.08), 0 8px 24px rgba(20, 40, 80, 0.06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1522;
    --surface: #172034;
    --surface-2: #1e2940;
    --text: #e7ecf5;
    --text-muted: #9aa8bf;
    --border: #2b3854;
    --primary: #6b9bff;
    --primary-soft: #22325a;
    --wall-top: #1a2335;
    --wall-bottom: #141c2c;
    --table: #5b4c39;
    --table-edge: #43382a;
    --glass-stroke: #9fb0c8;
    --glass-fill: rgba(255, 255, 255, 0.06);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

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

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

a {
  color: var(--primary);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

body.is-dragging-something,
body.is-dragging-something * {
  cursor: grabbing !important;
  user-select: none;
}

/* ===== Dicas estilo jogo (core/hints.js) ===== */
.hint-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 900;
  display: none;
}
.hint-layer.is-active {
  display: block;
}
.hint-hand {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 0;
  will-change: transform;
}
.hint-finger {
  position: absolute;
  left: -15px;
  top: -6px;
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}
.hint-ripple {
  position: absolute;
  left: -22px;
  top: -22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #ffd43b;
  opacity: 0;
  transform: scale(0.3);
}
.hint-ripple.is-on {
  animation: hint-ripple 0.5s ease-out;
}
@keyframes hint-ripple {
  from {
    opacity: 1;
    transform: scale(0.3);
  }
  to {
    opacity: 0;
    transform: scale(1.4);
  }
}
.hint-callout {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.hint-callout:not(:empty) {
  padding: 6px 12px;
  border-radius: 999px;
  background: #ffd43b;
  color: #3a2c00;
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  translate: -50% -100%;
  animation: hint-bounce 0.9s ease-in-out infinite;
}
.hint-callout[data-side='bottom']:not(:empty) {
  translate: -50% 0;
}
@keyframes hint-bounce {
  0%,
  100% {
    margin-top: 0;
  }
  50% {
    margin-top: -6px;
  }
}
.hint-glow {
  animation: hint-glow 1.1s ease-in-out infinite !important;
  border-radius: 12px;
}
@keyframes hint-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 196, 0, 0.85), 0 0 0 3px rgba(255, 196, 0, 0.9);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(255, 196, 0, 0), 0 0 0 3px rgba(255, 196, 0, 0.35);
  }
}

/* dica discreta: contorno suave que "respira" depois de um tempo sem interação */
.hint-soft {
  animation: hint-soft 2.4s ease-in-out infinite !important;
  border-radius: 12px;
}
@keyframes hint-soft {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(47, 111, 237, 0.12);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.45), 0 0 16px rgba(47, 111, 237, 0.25);
  }
}

/* ===== Barra de volume com marcas de encaixe (core/volume-slider.js) ===== */
.vol-slider {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 10px;
  font-size: 12px;
}
.vol-slider-label {
  font-weight: 700;
  color: var(--text-muted);
}
.vol-slider-value {
  min-width: 64px;
  text-align: right;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
}
.vol-slider input[type='range'] {
  width: 100%;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.vol-slider-ticks {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  margin: -2px 0 0;
  padding: 0 4px;
}
.vol-slider-ticks button {
  border: 0;
  background: none;
  padding: 2px 0;
  width: 0;
  display: flex;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.vol-slider-ticks button[aria-pressed='true'] {
  color: var(--primary);
  font-weight: 800;
}

/* ===== Aviso de segurança / aceite dos Termos (platform/notice.js) ===== */
.terms-notice {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 1000;
  width: min(560px, calc(100% - 24px));
  transform: translateX(-50%);
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(20, 30, 60, 0.25);
  font-size: 14.5px;
  line-height: 1.5;
  animation: terms-in 0.35s ease-out;
}
.terms-notice p {
  margin: 0 0 8px;
}
.terms-notice-title {
  font-weight: 800;
  color: #a35a00;
}
.terms-notice a {
  color: var(--primary);
  font-weight: 600;
}
.terms-notice-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}
.terms-notice-ok {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: #18233a;
  color: #fff;
  font-weight: 700;
}
.terms-notice-ok:hover {
  background: #6d4ae0;
}
.terms-notice.is-closing {
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s, transform 0.25s;
}
@keyframes terms-in {
  from {
    opacity: 0;
    transform: translate(-50%, 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
