:root {
  color-scheme: dark;
  --vr-ink: #171711;
  --vr-ink-soft: #24231a;
  --vr-paper: #f6edcf;
  --vr-paper-dim: #d9caa1;
  --vr-magenta: #d80b72;
  --vr-magenta-light: #ff4ca0;
  --vr-ochre: #d99b35;
  --vr-green: #8bad55;
  --vr-blue: #29a9e8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--vr-ink);
  color: var(--vr-paper);
}

button,
a { font: inherit; }

.vr-app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 16% 12%, rgba(216, 11, 114, 0.2), transparent 34rem),
    radial-gradient(circle at 84% 90%, rgba(217, 155, 53, 0.18), transparent 38rem),
    linear-gradient(145deg, #10100d, #24231a 52%, #151711);
}

.vr-view {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
}

.vr-view[hidden] { display: none !important; }

.vr-view-active { animation: vr-view-in 260ms ease both; }

.vr-menu {
  display: grid;
  place-items: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.vr-menu-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 54%, rgba(246, 237, 207, 0.035) 54% 55%, transparent 55%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 6px);
}

.vr-site-exit {
  position: absolute;
  z-index: 3;
  top: max(14px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--vr-paper-dim);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-decoration: none;
}

.vr-site-exit:hover,
.vr-site-exit:focus-visible { color: #fff; }

.vr-menu-panel {
  position: relative;
  width: min(1120px, 100%);
  min-height: min(680px, calc(100dvh - 72px));
  overflow: hidden;
  border: 2px solid rgba(246, 237, 207, 0.74);
  border-radius: clamp(12px, 2vw, 24px);
  background:
    linear-gradient(105deg, rgba(23,23,17,0.98) 0 58%, rgba(69,75,38,0.93) 58% 100%),
    var(--vr-ink-soft);
  box-shadow: 0 30px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(216,11,114,0.34);
}

.vr-brand-row {
  position: absolute;
  z-index: 2;
  inset: 22px 24px auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.vr-association-logo {
  width: clamp(150px, 18vw, 230px);
  height: auto;
  object-fit: contain;
}

.vr-private-badge {
  padding: 8px 11px;
  border: 1px solid rgba(246,237,207,0.45);
  color: var(--vr-paper-dim);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.vr-menu-copy {
  position: relative;
  z-index: 2;
  width: 61%;
  padding: clamp(124px, 18vh, 170px) clamp(28px, 5vw, 72px) 40px;
}

.vr-kicker {
  margin: 0 0 8px;
  color: var(--vr-magenta-light);
  font-size: 0.75rem;
  font-weight: 1000;
  letter-spacing: 0.17em;
}

.vr-menu h1 {
  margin: 0;
  color: #fffaf0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(3.1rem, 7.7vw, 7rem);
  font-weight: 900;
  letter-spacing: 0.015em;
  line-height: 0.82;
}

.vr-menu h1 span { color: var(--vr-ochre); }

.vr-menu-copy > p:not(.vr-kicker) {
  max-width: 630px;
  margin: 24px 0 0;
  color: var(--vr-paper);
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  line-height: 1.45;
}

.vr-menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.vr-button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 1000;
  letter-spacing: 0.065em;
  touch-action: manipulation;
  transition: transform 120ms ease, filter 120ms ease, border-color 120ms ease;
}

.vr-button-primary {
  background: linear-gradient(180deg, #f1b34b, var(--vr-ochre));
  color: var(--vr-ink);
  box-shadow: 0 6px 0 #8a5420, 0 14px 28px rgba(0,0,0,0.28);
}

.vr-button-secondary {
  border: 1px solid rgba(246,237,207,0.34);
  background: rgba(246,237,207,0.08);
  color: var(--vr-paper);
}

.vr-button:hover { filter: brightness(1.1); }
.vr-button:active { transform: translateY(2px); }
.vr-button:focus-visible,
.vr-site-exit:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.vr-records {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.vr-records div {
  padding: 12px 14px;
  border: 1px solid rgba(246,237,207,0.18);
  background: rgba(0,0,0,0.2);
}

.vr-records span,
.vr-records small {
  display: block;
  color: var(--vr-paper-dim);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.vr-records strong {
  display: block;
  margin: 3px 0;
  color: #fff;
  font-size: 1.18rem;
}

.vr-valentim {
  position: absolute;
  z-index: 1;
  right: clamp(15px, 4vw, 62px);
  bottom: 0;
  width: min(39%, 440px);
  max-height: 82%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 22px 28px rgba(0,0,0,0.58));
}

.vr-overlay-view,
.vr-summary,
.vr-transition {
  display: grid;
  place-items: center;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 20%, rgba(216,11,114,0.14), transparent 28rem),
    linear-gradient(145deg, #11110d, #24231a);
}

.vr-dialog,
.vr-summary-card {
  width: min(720px, 100%);
  padding: clamp(24px, 5vw, 52px);
  border: 2px solid rgba(246,237,207,0.58);
  border-radius: 18px;
  background: rgba(23,23,17,0.96);
  box-shadow: 0 28px 80px rgba(0,0,0,0.5);
}

.vr-dialog h2,
.vr-summary h2,
.vr-transition h2 {
  margin: 0;
  color: #fffaf0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 0.94;
  letter-spacing: 0.025em;
}

.vr-instruction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.vr-instruction-grid article {
  padding: 16px;
  border: 1px solid rgba(246,237,207,0.22);
  background: rgba(246,237,207,0.05);
}

.vr-instruction-grid strong { color: var(--vr-ochre); }
.vr-instruction-grid p { margin: 8px 0 0; line-height: 1.45; }

.vr-module-view,
.vr-module-host {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.vr-module-host { position: relative; }

/* Integração: mantém o canvas 19:13 do Nível 1 integralmente visível em
   portáteis baixos, sem alterar a resolução lógica ou a jogabilidade. */
@media (min-width: 761px) and (max-height: 820px) {
  .vr-module-host[data-module="level1"] .game-shell {
    width: min(850px, 100%);
    min-height: 100%;
    height: 100%;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .vr-module-host[data-module="level1"] .game-header {
    margin-bottom: 6px;
  }

  .vr-module-host[data-module="level1"] .game-header h1 {
    font-size: 2.15rem;
  }

  .vr-module-host[data-module="level1"] .game-footer {
    padding-top: 5px;
  }
}

@media (min-width: 761px) and (max-height: 740px) {
  .vr-module-host[data-module="level1"] .game-shell {
    width: min(790px, 100%);
  }
}

.vr-transition {
  text-align: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(41,169,232,0.2), transparent 24rem),
    linear-gradient(145deg, #071927, #03101a);
}

.vr-transition > div { display: contents; }
.vr-transition p { margin: 18px 0 4px; color: var(--vr-blue); font-weight: 1000; letter-spacing: 0.15em; }
.vr-transition strong { margin-top: 14px; color: #ffe000; letter-spacing: 0.1em; }

.vr-transition-mark {
  display: grid !important;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 3px solid #ffe000;
  border-radius: 50%;
  color: #ffe000;
  font-size: 2.8rem;
  font-weight: 1000;
  animation: vr-pulse 1.1s ease-in-out infinite;
}

.vr-summary-card { text-align: center; }
.vr-summary-list { margin: 24px 0 18px; }
.vr-summary-list div { display: flex; justify-content: space-between; gap: 18px; padding: 12px 4px; border-bottom: 1px solid rgba(246,237,207,0.16); }
.vr-summary-list dt { color: var(--vr-paper-dim); }
.vr-summary-list dd { margin: 0; color: #fff; font-weight: 1000; font-variant-numeric: tabular-nums; }
.vr-summary-list .vr-summary-total { margin-top: 6px; border: 1px solid rgba(217,155,53,0.45); padding: 15px 13px; background: rgba(217,155,53,0.1); }
.vr-summary-total dt,
.vr-summary-total dd { color: var(--vr-ochre); font-size: 1.18rem; }
.vr-summary-value { margin: 0 auto 22px; max-width: 620px; color: var(--vr-paper); line-height: 1.45; }

.vr-error-card { text-align: center; }
.vr-error-card .vr-menu-actions { justify-content: center; }

.vr-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;
}

.vr-e2e-controls {
  position: fixed;
  z-index: 9999;
  top: 0;
  right: 0;
  display: flex;
  opacity: 0.015;
}

.vr-e2e-controls button {
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 0;
  color: transparent;
  background: transparent;
}

@media (max-width: 760px) {
  .vr-menu { padding: max(56px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
  .vr-site-exit { top: max(7px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); font-size: 0.67rem; }
  .vr-menu-panel { min-height: calc(100dvh - max(66px, env(safe-area-inset-top)) - max(10px, env(safe-area-inset-bottom))); }
  .vr-brand-row { inset: 13px 13px auto; align-items: center; }
  .vr-association-logo { width: 126px; }
  .vr-private-badge { max-width: 145px; padding: 6px 7px; font-size: 0.56rem; text-align: right; }
  .vr-menu-copy { width: 100%; padding: 118px 17px 190px; }
  .vr-menu h1 { font-size: clamp(3.15rem, 17vw, 5rem); }
  .vr-menu-copy > p:not(.vr-kicker) { margin-top: 16px; font-size: 0.96rem; line-height: 1.35; }
  .vr-menu-actions { margin-top: 17px; gap: 8px; }
  .vr-button { min-height: 45px; padding: 0 13px; font-size: 0.78rem; }
  .vr-records { margin-top: 16px; gap: 7px; }
  .vr-records div { padding: 9px 10px; }
  .vr-valentim { right: 50%; bottom: -64px; width: min(56%, 240px); max-height: 260px; transform: translateX(50%); opacity: 0.95; }
  .vr-instruction-grid { grid-template-columns: 1fr; }
  .vr-dialog,
  .vr-summary-card { padding: 22px 18px; }
  .vr-summary-list { margin-top: 18px; }
  .vr-summary-list div { padding: 10px 3px; }
}

@media (max-width: 380px) {
  .vr-menu-copy { padding-top: 105px; padding-bottom: 170px; }
  .vr-menu h1 { font-size: 3.2rem; }
  .vr-kicker { font-size: 0.64rem; }
  .vr-records span,
  .vr-records small { font-size: 0.6rem; }
  .vr-records strong { font-size: 1rem; }
}

@media (max-height: 700px) and (pointer: coarse) {
  .vr-menu-copy { padding-top: 92px; padding-bottom: 132px; }
  .vr-menu-copy > p:not(.vr-kicker) { margin-top: 11px; }
  .vr-menu-actions { margin-top: 12px; }
  .vr-records { margin-top: 12px; }
  .vr-valentim { bottom: -88px; max-height: 210px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@keyframes vr-view-in {
  from { opacity: 0; transform: scale(0.995); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes vr-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(255,224,0,0); }
  50% { transform: scale(1.06); box-shadow: 0 0 36px rgba(255,224,0,0.18); }
}
