/* ============================================================
   Entre Capivaras 2.0 — estilos
   Linguagem visual: "adesivos" com contorno de tinta (o mesmo traço #2b1d14 dos personagens
   e do mapa), sombra dura deslocada, cantos bem arredondados e cores de fim de tarde na lagoa.
   Tipografia: Lilita One (títulos, botões, números) + Nunito (texto).
   Mobile-first: funciona em celular (em pé ou deitado), tablet e PC.
   ============================================================ */
:root {
  --ink: #2b1d14;
  --ink-2: #4e3a2c;
  --ink-soft: #7a6553;
  --cream: #fff4e0;
  --cream-2: #fbe7c4;
  --sand: #f2d6a6;
  --line: #e6cc9f;
  --white: #fffdf8;

  --night: #1d1b33;
  --dusk: #2c2a4a;
  --dusk-2: #403c6e;

  --coral: #ff7a59;
  --coral-2: #ffa071;
  --coral-d: #d4512f;
  --sun: #ffcc4d;
  --sun-2: #ffe08a;
  --sun-d: #d99a12;
  --leaf: #5cbf5a;
  --leaf-2: #8ee07a;
  --leaf-d: #2f8a45;
  --teal: #2fb5a8;
  --teal-2: #62d8c9;
  --teal-d: #1d857b;
  --water: #3fb0d0;
  --water-d: #1f7a9c;
  --berry: #e2557b;
  --grape: #7b5cd6;
  --grape-2: #a58af0;
  --grape-d: #5139a8;
  --danger: #ff4b55;
  --danger-2: #ff7d84;
  --danger-d: #c4283a;

  /* nomes antigos (usados pelos minigames) */
  --paper: var(--cream);
  --paper-2: var(--cream-2);
  --wood: #8a5a34;
  --wood-dark: #5a3a1e;
  --orange: var(--coral);
  --orange-2: var(--coral-2);
  --orange-dark: var(--coral-d);
  --leaf-dark: var(--leaf-d);
  --water-dark: var(--water-d);
  --red: var(--danger);
  --red-dark: var(--danger-d);
  --purple: var(--grape);
  --gold: var(--sun);

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --pop: 0 5px 0 var(--ink);
  --pop-sm: 0 3px 0 var(--ink);
  --shadow: 0 18px 40px rgba(12, 8, 30, 0.45);
  --shadow-sm: 0 6px 16px rgba(12, 8, 30, 0.3);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Lilita One', 'Nunito', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);

  --gap: clamp(10px, 2vw, 18px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  font-weight: 700;
  color: var(--ink);
  background: var(--night);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

button,
input,
select {
  font-family: inherit;
  color: inherit;
}

button {
  touch-action: manipulation;
}

.hidden {
  display: none !important;
}

.ico {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

[data-icon] {
  display: inline-flex;
  vertical-align: middle;
}

b,
strong {
  font-weight: 900;
}

kbd {
  font-family: var(--display);
  font-size: 0.78rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 7px;
  padding: 0 6px;
  box-shadow: 0 2px 0 var(--ink);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--sand);
  border: 3px solid transparent;
  border-radius: 99px;
  background-clip: padding-box;
}

/* ------------------------------------------------------------ animações base */
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.95);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes float {
  50% {
    transform: translateY(-6px);
  }
}

@keyframes wiggle {
  25% {
    transform: rotate(-5deg);
  }
  75% {
    transform: rotate(5deg);
  }
}

@keyframes pulse {
  50% {
    transform: scale(1.05);
  }
}

@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  50% {
    transform: translateX(6px);
  }
  75% {
    transform: translateX(-3px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes blink {
  50% {
    filter: brightness(0.7);
  }
}

@keyframes stripes {
  to {
    background-position: 28px 0;
  }
}

@keyframes rays {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.stagger > * {
  animation: pop-in 0.45s var(--ease-out) both;
}
.stagger > *:nth-child(2) { animation-delay: 0.04s; }
.stagger > *:nth-child(3) { animation-delay: 0.08s; }
.stagger > *:nth-child(4) { animation-delay: 0.12s; }
.stagger > *:nth-child(5) { animation-delay: 0.16s; }
.stagger > *:nth-child(6) { animation-delay: 0.2s; }
.stagger > *:nth-child(7) { animation-delay: 0.24s; }
.stagger > *:nth-child(8) { animation-delay: 0.28s; }
.stagger > *:nth-child(n + 9) { animation-delay: 0.32s; }

.shake {
  animation: shake 0.35s;
}

.gulp {
  animation: pop-in 0.25s var(--ease-back);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------ telas e superfícies */
.bg-scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

body.in-game .bg-scene {
  display: none;
}

.screen {
  position: fixed;
  inset: 0;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-t) + var(--gap)) calc(var(--safe-r) + var(--gap)) calc(var(--safe-b) + var(--gap)) calc(var(--safe-l) + var(--gap));
}

.screen.active {
  display: block;
  animation: fade-in 0.35s ease;
}

#screen-game {
  padding: 0;
  overflow: hidden;
  background: #16301f;
}

/* cartão "adesivo": creme, contorno de tinta e sombra dura */
.card {
  position: relative;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.7), transparent 40%),
    radial-gradient(rgba(122, 90, 50, 0.07) 1px, transparent 1.5px) 0 0 / 14px 14px,
    var(--cream);
  border: 3px solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: 0 6px 0 var(--ink), var(--shadow);
  padding: clamp(14px, 3vw, 22px);
}

h1,
h2,
h3 {
  line-height: 1.05;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.3px;
}

.card-title,
.modal-head h2,
.modal-head h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.2rem, 3.4vw, 1.5rem);
}

.card-title .ico {
  color: var(--coral);
  filter: drop-shadow(0 2px 0 var(--ink));
}

.lobby-pane > .card-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

/* ------------------------------------------------------------ botões */
.btn {
  --bg: var(--white);
  --bg2: var(--cream-2);
  --fg: var(--ink);
  position: relative;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 9px 18px;
  min-height: 48px;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  color: var(--fg);
  background: linear-gradient(180deg, var(--bg), var(--bg2));
  box-shadow: 0 5px 0 var(--ink);
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s var(--ease-out), box-shadow 0.1s, filter 0.15s;
  white-space: nowrap;
  isolation: isolate;
}

/* brilho no topo do botão */
.btn::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 3px;
  height: 32%;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  pointer-events: none;
  z-index: -1;
}

.btn .ico {
  filter: drop-shadow(0 2px 0 rgba(43, 29, 20, 0.35));
}

.btn:hover:not(:disabled) {
  filter: brightness(1.06) saturate(1.05);
  transform: translateY(-1px);
  box-shadow: 0 6px 0 var(--ink);
}

.btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.btn-primary {
  --bg: var(--coral-2);
  --bg2: var(--coral);
  --fg: #fff;
  text-shadow: 0 2px 0 rgba(43, 29, 20, 0.45);
}

.btn-secondary {
  --bg: var(--teal-2);
  --bg2: var(--teal);
  --fg: #fff;
  text-shadow: 0 2px 0 rgba(43, 29, 20, 0.45);
}

.btn-soft {
  --bg: var(--white);
  --bg2: var(--cream-2);
  width: 100%;
}

.btn-ghost {
  --bg: var(--cream);
  --bg2: var(--sand);
}

.btn-dark {
  --bg: var(--dusk-2);
  --bg2: var(--dusk);
  --fg: #fff;
}

.btn-big {
  font-size: 1.3rem;
  min-height: 58px;
  padding: 10px 26px;
  border-radius: 18px;
}

.btn-small {
  min-height: 38px;
  padding: 5px 12px;
  font-size: 0.92rem;
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--ink);
}

.btn-icon-only {
  width: 48px;
  padding: 0;
  flex-shrink: 0;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, var(--white), var(--cream-2));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.12s var(--ease-back), box-shadow 0.12s;
}

.icon-btn:hover {
  transform: translateY(-1px) rotate(-3deg);
}

.icon-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.icon-btn.danger {
  color: var(--danger-d);
}

/* ------------------------------------------------------------ campos */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.field-label,
.field > span {
  font-weight: 900;
  color: var(--ink-2);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.field input,
.field select,
.code-input,
.chat-form input {
  font-size: 16px; /* evita zoom automático no iPhone */
  padding: 11px 14px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  outline: none;
  font-weight: 800;
  width: 100%;
  box-shadow: inset 0 3px 0 rgba(43, 29, 20, 0.08);
  transition: box-shadow 0.15s, background 0.15s;
}

.field input::placeholder,
.code-input::placeholder,
.chat-form input::placeholder {
  color: #bba48a;
}

.field input:focus,
.field select:focus,
.code-input:focus,
.chat-form input:focus {
  background: #fff;
  box-shadow: inset 0 3px 0 rgba(43, 29, 20, 0.08), 0 0 0 4px rgba(255, 122, 89, 0.35);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%232b1d14' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
  padding-right: 36px;
  cursor: pointer;
}

.field select:disabled {
  background-color: var(--cream-2);
  color: var(--ink-soft);
  cursor: default;
  border-style: dashed;
}

.error {
  color: var(--danger-d);
  font-weight: 900;
  min-height: 1.2em;
  margin: 8px 0 0;
  text-align: center;
}

.error:not(:empty) {
  animation: shake 0.35s;
}

.hint {
  color: var(--ink-soft);
  margin: 6px 0;
  font-weight: 700;
}

.hint.small {
  font-size: 0.85rem;
}

details > summary {
  cursor: pointer;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

details > summary .ico {
  color: var(--teal);
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(-45deg);
  margin-left: auto;
  transition: transform 0.25s var(--ease-out);
}

details[open] > summary::after {
  transform: rotate(45deg);
}

details[open] > *:not(summary) {
  animation: pop-in 0.3s var(--ease-out);
}

/* interruptor */
.switch-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.switch-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  width: 48px;
  height: 28px;
  border-radius: 99px;
  background: var(--sand);
  border: 3px solid var(--ink);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ink);
  transition: transform 0.2s var(--ease-back);
}

.switch-label input:checked + .switch {
  background: var(--leaf);
}

.switch-label input:checked + .switch::after {
  transform: translateX(20px);
}

.switch-label input:focus-visible + .switch {
  outline: 3px solid var(--water);
  outline-offset: 2px;
}

/* controle deslizante */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: min(180px, 40vw);
  height: 14px;
  border-radius: 99px;
  border: 3px solid var(--ink);
  background: linear-gradient(90deg, var(--teal) var(--v, 70%), var(--sand) var(--v, 70%));
  outline: none;
  cursor: pointer;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

.range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--ink);
}

/* ------------------------------------------------------------ cores */
.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
  max-width: 340px;
}

.color-grid.small {
  grid-template-columns: repeat(12, 1fr);
  max-width: 520px;
  gap: 6px;
}

.swatch {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.55), transparent 42%), var(--c);
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.2s var(--ease-back), box-shadow 0.2s;
  position: relative;
  min-width: 0;
  padding: 0;
}

.swatch:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.06);
}

.swatch.selected {
  transform: translateY(-2px) scale(1.12);
  box-shadow: 0 0 0 3px var(--white), 0 0 0 6px var(--ink), 0 5px 0 3px var(--ink);
  z-index: 1;
}

.swatch.selected::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 46%;
  width: 28%;
  height: 46%;
  border-right: 3.5px solid #fff;
  border-bottom: 3.5px solid #fff;
  transform: translate(-50%, -50%) rotate(40deg);
  filter: drop-shadow(0 1px 0 var(--ink));
}

.swatch.taken {
  opacity: 0.32;
  cursor: not-allowed;
}

.swatch.taken::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 3px;
  background: var(--ink);
  transform: rotate(-45deg);
}

/* ------------------------------------------------------------ tela inicial */
.home-wrap {
  width: min(1080px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding-bottom: 12px;
}

.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  animation: pop-in 0.6s var(--ease-back) both;
}

.logo {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

.logo-mark {
  width: clamp(58px, 12vw, 78px);
  height: auto;
  animation: float 3.4s ease-in-out infinite;
  filter: drop-shadow(0 4px 0 var(--ink));
}

.logo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.9;
}

.logo-top {
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  color: #fff;
  background: var(--coral);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 2px 10px 1px;
  letter-spacing: 3px;
  text-transform: uppercase;
  box-shadow: 0 3px 0 var(--ink);
  transform: rotate(-4deg);
  margin-bottom: -2px;
  margin-left: 4px;
}

.logo-main {
  font-size: clamp(2.6rem, 10vw, 3.8rem);
  color: var(--sun);
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink);
  letter-spacing: 1px;
}

.home-menu {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.menu-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 7px 12px;
  background: rgba(255, 244, 224, 0.95);
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.98rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.12s var(--ease-back), box-shadow 0.12s;
}

.menu-btn .ico {
  color: var(--coral);
}

.menu-btn:hover {
  transform: translateY(-2px);
}

.menu-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.new-dot {
  position: absolute;
  top: -11px;
  right: -8px;
  background: var(--danger);
  color: #fff;
  font-family: var(--display);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 2.5px solid var(--ink);
  border-radius: 99px;
  padding: 1px 7px;
  box-shadow: 0 2px 0 var(--ink);
  animation: wiggle 1.6s ease-in-out infinite;
}

.tagline {
  margin: -6px 0 0;
  color: var(--cream);
  font-weight: 800;
  text-shadow: 0 2px 0 rgba(29, 27, 51, 0.8);
  animation: pop-in 0.6s 0.1s var(--ease-out) both;
}

.home-cols {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.home-panel {
  padding-top: 14px;
}

.home-stage {
  position: relative;
  height: 156px;
  margin: 0 0 18px;
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 30% at 50% 100%, #7ccf6a 60%, transparent 61%),
    radial-gradient(ellipse 80% 40% at 50% 104%, #4fa858 70%, transparent 71%),
    linear-gradient(180deg, #ffd59a 0%, #ffb27a 45%, #9fd6e8 46%, #9fd6e8 100%);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.08);
}

/* solzinho e montanhas no palco */
.home-stage::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 22%;
  width: 72px;
  height: 72px;
  margin-left: -36px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff3c4, #ffcc4d 70%);
  opacity: 0.85;
}

.home-preview {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 170px;
  height: 150px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.25s var(--ease-back);
}

.home-preview canvas {
  animation: float 3s ease-in-out infinite;
}

.home-preview:hover {
  transform: translateX(-50%) scale(1.05);
}

.stage-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 4px 10px;
  background: var(--white);
  font-family: var(--display);
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.12s var(--ease-back);
}

.stage-btn .ico {
  color: var(--grape);
}

.stage-btn:hover {
  transform: translateY(-2px) rotate(-2deg);
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-weight: 800;
  font-size: 0.84rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
}

.join-row {
  display: flex;
  gap: 8px;
}

.code-input {
  flex: 1;
  min-width: 0;
  text-align: center;
  letter-spacing: 7px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.45rem !important;
  font-variant-numeric: tabular-nums;
}

.home-status {
  margin: 10px 0 0;
  font-weight: 900;
  color: var(--water-d);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.home-status::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #cfe3f2;
  border-top-color: var(--water);
  animation: spin 0.8s linear infinite;
}

.info-panel {
  padding: 12px 18px;
  animation: pop-in 0.5s 0.2s var(--ease-out) both;
}

.online-steps {
  margin: 10px 0 6px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  font-size: 0.92rem;
}

.controls-help {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 8px 0 0;
  line-height: 2;
}

/* ------------------------------------------------------------ partidas online */
.visibility-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  font-size: 0.7rem;
  vertical-align: middle;
}

.visibility-chip.public {
  background: #d9f5d1;
  color: var(--leaf-d);
}

.visibility-chip.private {
  background: var(--cream-2);
  color: var(--ink-soft);
}

.rooms-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: pop-in 0.5s 0.12s var(--ease-out) both;
}

.rooms-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rooms-head .card-title .ico {
  color: var(--teal);
}

.rooms-live {
  position: relative;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 3px 10px 3px 24px;
  border-radius: 99px;
  border: 2.5px solid var(--ink);
  white-space: nowrap;
}

.rooms-live::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: currentColor;
}

.rooms-live.on {
  background: #d9f5d1;
  color: var(--leaf-d);
}

.rooms-live.on::before {
  animation: live-pulse 1.4s ease-out infinite;
}

.rooms-live.connecting {
  background: #dcefff;
  color: var(--water-d);
}

.rooms-live.connecting::before {
  animation: blink 0.9s steps(2) infinite;
}

.rooms-live.off {
  background: #ffe0e0;
  color: var(--danger-d);
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 138, 69, 0.55);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(47, 138, 69, 0);
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.rooms-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.rooms-count {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.rooms-list {
  list-style: none;
  margin: 0;
  padding: 2px 4px 6px 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(52vh, 460px);
  overflow-y: auto;
}

.room-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 4px 0 var(--ink);
  animation: pop-in 0.35s var(--ease-back) both;
  transition: transform 0.15s var(--ease-out), opacity 0.25s;
}

.room-item:hover {
  transform: translateY(-2px);
}

.room-item.closed {
  background: var(--cream-2);
}

.room-item.closed .room-avatar {
  filter: saturate(0.5);
}

.room-item.leaving {
  opacity: 0;
  transform: scale(0.95);
}

.room-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 120%, #7ccf6a 40%, transparent 41%), linear-gradient(#ffd59a, #9fd6e8);
  border: 3px solid var(--ink);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.room-avatar canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.room-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.room-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 900;
}

.room-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 8px;
  border-radius: 99px;
  border: 2px solid var(--ink);
}

.room-chip.open {
  background: #d9f5d1;
  color: var(--leaf-d);
}

.room-chip.full {
  background: #ffe7c4;
  color: var(--coral-d);
}

.room-chip.playing {
  background: #e6defc;
  color: var(--grape-d);
}

.room-chip.soft {
  background: #ffe0e0;
  color: var(--danger-d);
}

.room-code-small {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.room-slots {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

.room-slots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
  border: 1.5px solid rgba(43, 29, 20, 0.35);
}

.room-slots i.on {
  background: var(--coral);
  border-color: var(--ink);
}

.room-slots-text {
  margin-left: 4px;
  font-size: 0.74rem;
  font-weight: 900;
  color: var(--ink-soft);
}

.room-join {
  white-space: nowrap;
}

.rooms-panel.busy .room-join {
  pointer-events: none;
  opacity: 0.6;
}

.rooms-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 12px;
  text-align: center;
  color: var(--ink-soft);
}

.rooms-empty p {
  margin: 0;
}

.rooms-empty .btn-soft {
  width: auto;
}

.rooms-empty-art {
  position: relative;
  animation: float 3s ease-in-out infinite;
}

.rooms-empty-art::after {
  content: 'z z z';
  position: absolute;
  right: -28px;
  top: 4px;
  font-family: var(--display);
  color: var(--water-d);
  letter-spacing: 2px;
  animation: blink 2.4s ease-in-out infinite;
}

.rooms-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-skeleton {
  height: 74px;
  border-radius: var(--r-md);
  border: 3px solid var(--line);
  background: linear-gradient(90deg, var(--cream-2) 25%, #fffaf0 50%, var(--cream-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.rooms-offline {
  margin: 0;
  font-weight: 800;
  color: var(--danger-d);
  font-size: 0.9rem;
  text-align: center;
}

@media (min-width: 900px) {
  .home-cols {
    display: grid;
    grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
    align-items: start;
  }
  .rooms-list {
    max-height: 470px;
  }
}

@media (max-width: 520px) {
  .room-item {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 7px 8px;
  }
  .room-avatar {
    width: 46px;
    height: 46px;
  }
}

/* ------------------------------------------------------------ modais */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 10px) calc(var(--safe-b) + 10px) calc(var(--safe-l) + 10px);
}

.modal {
  background: rgba(20, 16, 40, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease;
}

.modal > .card {
  animation: pop-in 0.35s var(--ease-back);
}

.modal-card {
  width: min(560px, 100%);
  max-height: 100%;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 0 12px;
}

.settings-grid .field {
  margin: 8px 0;
}

.settings-advanced {
  margin-top: 6px;
  border-top: 3px dashed var(--line);
  padding-top: 10px;
}

.help-card {
  width: min(800px, 100%);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 10px;
  margin-top: 12px;
}

.help-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--white);
  border-radius: var(--r-md);
  padding: 10px 12px;
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--grape);
}

.help-item b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--ink);
}

.help-item p {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 700;
}

.help-item.crew {
  color: var(--leaf-d);
}

.help-item.imp {
  color: var(--danger);
}

/* ------------------------------------------------------------ atualizações */
.updates-card {
  width: min(680px, 100%);
}

.updates-intro {
  margin: 0;
  padding: 8px 12px;
  background: var(--sun-2);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--display);
  font-size: 1.05rem;
  text-align: center;
}

.updates-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.update {
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 4px 0 var(--ink);
  padding: 12px 14px;
  animation: pop-in 0.4s var(--ease-out) both;
}

.update:nth-child(2) {
  animation-delay: 0.06s;
}

.update-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.update-version {
  font-family: var(--display);
  background: var(--coral);
  color: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 1px 9px;
  box-shadow: 0 2px 0 var(--ink);
  text-shadow: 0 1px 0 rgba(43, 29, 20, 0.4);
}

.update.old .update-version {
  background: var(--sand);
  color: var(--ink);
  text-shadow: none;
}

.update-date {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 800;
}

.update-new {
  margin-left: auto;
  font-family: var(--display);
  font-size: 0.75rem;
  color: #fff;
  background: var(--danger);
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 0 8px;
}

.update h3 {
  margin: 8px 0 2px;
  font-size: 1.4rem;
}

.update-summary {
  margin: 0 0 6px;
  color: var(--ink-2);
  font-weight: 700;
}

.update-section {
  margin-top: 10px;
}

.update-section h4 {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1rem;
}

.update-section.news h4 {
  color: var(--coral-d);
}
.update-section.improvements h4 {
  color: var(--teal-d);
}
.update-section.fixes h4 {
  color: var(--grape-d);
}

.update-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.update-section li {
  position: relative;
  padding-left: 18px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.update-section li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  border: 2px solid var(--ink);
  transform: rotate(45deg);
  background: var(--sun);
}

.update-section.improvements li::before {
  background: var(--teal-2);
}
.update-section.fixes li::before {
  background: var(--grape-2);
}

/* ------------------------------------------------------------ ajustes */
.settings-card {
  width: min(480px, 100%);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  padding: 10px 12px;
  box-shadow: 0 3px 0 var(--ink);
}

.setting-row > .ico,
.setting-row > [data-icon] {
  color: var(--teal);
}

.setting-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.setting-text b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
}

.setting-text small {
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.8rem;
}

.settings-version {
  margin: 12px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

/* ------------------------------------------------------------ abas */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--cream-2);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 4px;
  box-shadow: 0 4px 0 var(--ink);
}

.tab {
  flex: 1;
  border: 2.5px solid transparent;
  background: transparent;
  border-radius: 11px;
  padding: 7px 10px;
  font-family: var(--display);
  font-size: 0.98rem;
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s, color 0.2s;
  position: relative;
}

.tab.active {
  background: var(--coral);
  color: #fff;
  border-color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  text-shadow: 0 1px 0 rgba(43, 29, 20, 0.4);
}

.tab-badge {
  background: var(--danger);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.7rem;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  font-family: var(--display);
  font-weight: 400;
  animation: pop-in 0.3s var(--ease-back);
}

/* ------------------------------------------------------------ lobby */
.lobby-wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: 100%;
}

.lobby-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  animation: pop-in 0.4s var(--ease-out) both;
}

.lobby-code-box small {
  color: var(--ink-2);
  font-weight: 900;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: block;
  margin-bottom: 4px;
}

.room-code {
  font-family: var(--display);
  font-size: clamp(1.9rem, 7vw, 2.5rem);
  letter-spacing: 6px;
  color: var(--ink);
  background: repeating-linear-gradient(-45deg, var(--sun-2) 0 14px, var(--sun) 14px 28px);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
  padding: 2px 16px 0;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: transform 0.2s var(--ease-back);
}

.room-code:hover {
  transform: rotate(-2deg) scale(1.03);
}

.lobby-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lobby-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.count-badge {
  font-family: var(--display);
  font-size: 1.5rem;
  background: linear-gradient(180deg, var(--leaf-2), var(--leaf));
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 0 14px;
  box-shadow: 0 4px 0 var(--ink);
  text-shadow: 0 2px 0 rgba(43, 29, 20, 0.45);
}

.ping {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 900;
  color: #fff;
  background: var(--leaf-d);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 1px 10px 1px 8px;
}

.ping.mid {
  background: var(--coral-d);
}

.ping.bad {
  background: var(--danger);
}

.ping.host {
  background: var(--sun-d);
}

.lobby-tabs {
  display: none;
}

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  grid-template-areas:
    'plaza settings'
    'players chat';
  gap: var(--gap);
  flex: 1;
}

#pane-plaza {
  grid-area: plaza;
}
#pane-players {
  grid-area: players;
}
#pane-settings {
  grid-area: settings;
}
#pane-chat {
  grid-area: chat;
}

.lobby-pane {
  animation: pop-in 0.45s var(--ease-out) both;
  min-width: 0;
}

#pane-settings {
  animation-delay: 0.06s;
}
#pane-chat {
  animation-delay: 0.12s;
}

.lobby-me {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 3px dashed var(--line);
}

.player-list {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 10px;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 3px 0 var(--ink);
  padding: 4px 8px 4px 4px;
  min-height: 60px;
  font-weight: 900;
}

.player-item.enter {
  animation: pop-in 0.35s var(--ease-back) both;
}

.player-item canvas {
  background: radial-gradient(circle at 50% 125%, #7ccf6a 42%, transparent 43%), linear-gradient(#ffe2b0, #a8dbec);
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  flex-shrink: 0;
}

.player-item.me {
  background: #fff0de;
  box-shadow: 0 3px 0 var(--ink), 0 0 0 3px var(--coral) inset;
}

.player-item.offline {
  opacity: 0.55;
}

.player-item.empty {
  border-style: dashed;
  border-color: rgba(43, 29, 20, 0.35);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: none;
  color: #b59c7a;
  justify-content: center;
  font-weight: 800;
  animation: none;
}

.player-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crown {
  color: var(--sun);
  display: inline-flex;
  filter: drop-shadow(0 2px 0 var(--ink));
  animation: wiggle 2.4s ease-in-out infinite;
}

.tag {
  font-size: 0.68rem;
  background: var(--coral);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0 7px;
  flex-shrink: 0;
  font-family: var(--display);
  font-weight: 400;
}

.tag-off {
  background: #9a8f86;
}

.kick-btn {
  border: 2.5px solid var(--ink);
  background: #ffe0e0;
  color: var(--danger-d);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 2px 0 var(--ink);
  transition: background 0.15s, color 0.15s;
}

.kick-btn:hover {
  background: var(--danger);
  color: #fff;
}

.lobby-chat {
  display: flex;
  flex-direction: column;
  min-height: 240px;
  max-height: 46vh;
}

.lobby-bottom {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  background: var(--dusk);
  color: var(--cream);
  border: 3px solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: 0 6px 0 var(--ink), var(--shadow);
  animation: pop-in 0.45s 0.15s var(--ease-out) both;
}

.lobby-bottom .hint {
  margin: 0;
  flex: 1;
  min-width: 180px;
  color: var(--cream-2);
}

.lobby-actions {
  display: flex;
  gap: 10px;
}

#btn-start:not(:disabled) {
  animation: pulse 1.6s ease-in-out infinite;
}

/* ------------------------------------------------------------ lobby: praça + botões por cima */
#screen-lobby {
  padding: 0;
  overflow: hidden;
  background: #16301f;
}

.plaza-wrap {
  position: absolute;
  inset: 0;
  touch-action: none;
  background: #16301f;
}

#plaza-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.lobby-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  --pad: clamp(8px, 1.8vmin, 16px);
}

.lobby-hud > * {
  pointer-events: auto;
}

.lobby-tl {
  position: absolute;
  top: calc(var(--safe-t) + var(--pad));
  left: calc(var(--safe-l) + var(--pad));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: calc(100vw - 2 * var(--pad) - 150px);
}

.lobby-codebar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 10px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink), var(--shadow-sm);
}

.lobby-codebar .room-code {
  font-size: 1.5rem;
  letter-spacing: 4px;
  padding: 0 10px;
  border-radius: 10px;
}

.lobby-codebar .visibility-chip {
  margin: 0;
}

.lobby-codebar .count-badge {
  font-size: 1.1rem;
  padding: 0 10px;
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--ink);
}

.icon-btn.small {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.plaza-hint {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--cream);
  text-shadow: 0 2px 0 rgba(20, 16, 40, 0.9);
  pointer-events: none;
}

.lobby-tr {
  position: absolute;
  top: calc(var(--safe-t) + var(--pad));
  right: calc(var(--safe-r) + var(--pad));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.menu-btn.admin {
  background: var(--sun);
}

.menu-btn.admin .ico {
  color: var(--ink);
}

.menu-btn.leave .ico {
  color: var(--danger);
}

.lobby-chat-panel {
  position: absolute;
  left: calc(var(--safe-l) + var(--pad));
  bottom: calc(var(--safe-b) + var(--pad) + 58px);
  width: min(340px, calc(100vw - 2 * var(--pad)));
  display: none;
  flex-direction: column;
  gap: 6px;
}

.lobby-chat-panel.open {
  display: flex;
}

.lobby-chat-panel .chat-log {
  flex: none;
  height: 150px;
  background: rgba(255, 253, 248, 0.9);
}

.lobby-chat-panel .chat-form {
  padding-top: 0;
}

.lobby-chat-toggle {
  position: absolute;
  left: calc(var(--safe-l) + var(--pad));
  bottom: calc(var(--safe-b) + var(--pad) + 4px);
  width: 50px;
  height: 50px;
  border-radius: 16px;
}

.lobby-chat-toggle .tab-badge {
  position: absolute;
  top: -8px;
  right: -8px;
}

.lobby-center {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-b) + var(--pad) + 4px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 230px);
  pointer-events: none;
}

.lobby-center > * {
  pointer-events: auto;
}

.lobby-hint {
  margin: 0;
  padding: 5px 12px;
  background: var(--dusk);
  color: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
}

.lobby-hud .act-visual {
  --btn: 84px;
  --c1: var(--grape-2);
  --c2: var(--grape-d);
  position: absolute;
  right: calc(var(--safe-r) + var(--pad) + 4px);
  bottom: calc(var(--safe-b) + var(--pad) + 4px);
}

.lobby-hud .act-visual.near {
  --c1: var(--sun-2);
  --c2: var(--sun-d);
  animation: pulse 0.9s infinite;
}

.sub-title {
  margin: 14px 0 6px;
  font-size: 1.15rem;
  color: var(--ink);
}

.room-card {
  width: min(680px, 100%);
}

/* telas médias e pequenas: o chat sobe para não ficar embaixo do botão de iniciar */
@media (max-width: 1100px) {
  .lobby-chat-panel {
    bottom: calc(var(--safe-b) + var(--pad) + 136px);
  }
  .lobby-chat-panel .chat-log {
    height: 120px;
  }
}

@media (max-width: 560px) {
  .lobby-tr .menu-btn span {
    display: none;
  }
  .lobby-tr .menu-btn {
    padding: 8px;
  }
  .lobby-tl {
    max-width: calc(100vw - 2 * var(--pad) - 60px);
  }
  .lobby-codebar .ping {
    display: none;
  }
  .lobby-hud .act-visual {
    --btn: 70px;
  }
  .lobby-center {
    max-width: calc(100vw - 170px);
  }
  .lobby-center .btn-big {
    min-height: 50px;
    font-size: 1.1rem;
    padding: 8px 16px;
  }
}

/* ------------------------------------------------------------ chat */
.chat-log {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  font-size: 0.95rem;
  min-height: 0;
  user-select: text;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: inset 0 3px 0 rgba(43, 29, 20, 0.06);
}

.chat-msg {
  padding: 5px 9px 7px;
  border-radius: 12px;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  background: var(--cream);
  animation: pop-in 0.25s var(--ease-out);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-avatar {
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: linear-gradient(#ffe2b0, #a8dbec);
}

.chat-msg.mine {
  background: #ffe7cf;
}

.chat-msg.ghost {
  background: #e3e6f7;
  color: #4a557a;
  font-style: italic;
}

.chat-name {
  font-size: 0.86rem;
  font-weight: 900;
}

.chat-text {
  display: block;
  padding-left: 32px;
  font-weight: 700;
}

.chat-text.censored {
  color: #9a6b3a;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding-top: 10px;
}

.chat-form input {
  border-radius: 14px;
  padding: 10px 14px;
}

/* ------------------------------------------------------------ jogo / HUD */
#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.touch-layer {
  position: absolute;
  inset: 0;
  touch-action: none;
}

.static-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.5) 0 2px, transparent 2px 4px);
  animation: blink 0.2s steps(2) infinite;
}

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  --hud-pad: clamp(8px, 1.8vmin, 16px);
}

.hud > * {
  pointer-events: auto;
}

.hud-left {
  position: absolute;
  top: calc(var(--safe-t) + var(--hud-pad));
  left: calc(var(--safe-l) + var(--hud-pad));
  width: min(290px, 40vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: pop-in 0.5s var(--ease-out) both;
}

.progress-wrap {
  background: rgba(29, 27, 51, 0.88);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
  padding: 4px 8px 7px;
  color: var(--cream);
}

.progress-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.4px;
}

.progress-label .ico {
  color: var(--leaf-2);
}

.progress {
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  border: 2.5px solid var(--ink);
  margin-top: 3px;
}

.progress-bar {
  height: 100%;
  width: 0;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.22) 0 7px, transparent 7px 14px),
    linear-gradient(180deg, var(--leaf-2), var(--leaf));
  background-size: 28px 100%, 100% 100%;
  animation: stripes 1s linear infinite;
  border-right: 2.5px solid var(--ink);
  transition: width 0.6s var(--ease-out);
}

.progress-wrap.jammed .progress-bar {
  width: 100% !important;
  background: repeating-linear-gradient(90deg, #666 0 6px, #999 6px 12px);
  animation: blink 0.2s steps(2) infinite;
}

.task-panel {
  background: var(--cream);
  border-radius: 14px;
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  overflow: hidden;
}

.task-toggle {
  width: 100%;
  border: none;
  border-bottom: 3px solid var(--ink);
  background: var(--coral);
  color: #fff;
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-shadow: 0 1px 0 rgba(43, 29, 20, 0.45);
}

.task-panel.collapsed .task-toggle {
  border-bottom: none;
}

.task-toggle::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.task-panel.collapsed .task-toggle::after {
  transform: rotate(-45deg);
}

.task-panel.collapsed .task-panel-body {
  display: none;
}

.task-panel-body {
  padding: 5px 10px 7px;
  max-height: 38vh;
  overflow-y: auto;
}

.task-panel-body small {
  color: var(--ink-soft);
  font-weight: 900;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

#task-list {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  font-size: 0.84rem;
  font-weight: 800;
}

#task-list li {
  padding: 2px 0 2px 20px;
  position: relative;
  transition: color 0.3s;
}

#task-list li::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 4px;
  border: 2.5px solid var(--ink);
  background: var(--white);
  transition: background 0.3s;
}

#task-list li.partial {
  color: var(--coral-d);
}

#task-list li.partial::before {
  background: linear-gradient(90deg, var(--sun) 50%, var(--white) 50%);
}

#task-list li.done {
  color: var(--leaf-d);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

#task-list li.done::before {
  background: var(--leaf);
}

#task-list.jammed li {
  color: transparent;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

.hud-center {
  position: absolute;
  top: calc(var(--safe-t) + var(--hud-pad));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  width: min(480px, 36vw);
  animation: fade-in 0.6s ease both;
}

.role-badge {
  border-radius: 999px;
  border: 3px solid var(--ink);
  padding: 3px 14px 3px 10px;
  color: #fff;
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  box-shadow: 0 3px 0 var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(43, 29, 20, 0.5);
}

.role-badge.crew {
  background: linear-gradient(180deg, var(--leaf-2), var(--leaf));
}

.role-badge.impostor {
  background: linear-gradient(180deg, var(--danger-2), var(--danger));
}

.area-name {
  color: #fff;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}

.sabotage-alert {
  border-radius: 14px;
  border: 3px solid var(--ink);
  padding: 5px 12px;
  font-weight: 900;
  color: #fff;
  text-align: center;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 0 var(--ink);
  animation: pop-in 0.3s var(--ease-back);
}

.sabotage-alert.blackout {
  background: var(--dusk-2);
}

.sabotage-alert.flood,
.sabotage-alert.interference {
  background: var(--danger);
  animation: blink 0.8s steps(2) infinite;
}

.hud-right {
  position: absolute;
  top: calc(var(--safe-t) + var(--hud-pad));
  right: calc(var(--safe-r) + var(--hud-pad));
  display: flex;
  align-items: center;
  gap: 8px;
  animation: pop-in 0.5s var(--ease-out) both;
}

.action-bar {
  --btn: clamp(64px, 13.5vmin, 96px);
  position: absolute;
  right: calc(var(--safe-r) + var(--hud-pad) + 4px);
  bottom: calc(var(--safe-b) + var(--hud-pad) + 8px);
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: flex-end;
  align-items: flex-end;
  gap: clamp(8px, 1.8vmin, 14px);
  max-width: calc(var(--btn) * 3 + 36px);
}

.action {
  --c1: var(--coral-2);
  --c2: var(--coral);
  position: relative;
  width: var(--btn);
  height: var(--btn);
  border-radius: 50%;
  border: 3.5px solid var(--ink);
  font-family: var(--display);
  font-size: calc(var(--btn) * 0.15);
  letter-spacing: 0.3px;
  color: #fff;
  cursor: pointer;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.55), transparent 32%), linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: 0 6px 0 var(--ink), 0 12px 18px rgba(0, 0, 0, 0.35);
  text-shadow: 0 2px 0 rgba(43, 29, 20, 0.55);
  line-height: 1.05;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.12s var(--ease-back), opacity 0.25s, filter 0.25s, box-shadow 0.12s;
  animation: pop-in 0.35s var(--ease-back) both;
}

.action .ico {
  width: calc(var(--btn) * 0.38);
  height: calc(var(--btn) * 0.38);
  filter: drop-shadow(0 2px 0 rgba(43, 29, 20, 0.55));
}

.action .cd {
  position: absolute;
  inset: -3.5px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3.5px solid var(--ink);
  background: rgba(29, 27, 51, 0.62);
  font-size: calc(var(--btn) * 0.38);
  font-weight: 400;
}

.action:not(:disabled):hover {
  transform: translateY(-2px) scale(1.04);
}

.action:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--ink), 0 4px 8px rgba(0, 0, 0, 0.3);
}

.action:disabled {
  opacity: 0.5;
  cursor: default;
  filter: grayscale(0.75) brightness(0.9);
}

.action:not(:disabled)::before {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.7);
  opacity: 0;
  animation: ring 1.6s ease-out infinite;
  pointer-events: none;
}

@keyframes ring {
  0% {
    opacity: 0.8;
    transform: scale(0.9);
  }
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

.act-use {
  --c1: var(--coral-2);
  --c2: var(--coral);
}

.act-report {
  --c1: var(--sun-2);
  --c2: var(--sun-d);
}

.act-kill {
  --c1: var(--danger-2);
  --c2: var(--danger-d);
}

.act-sabotage {
  --c1: var(--grape-2);
  --c2: var(--grape-d);
}

.act-shift {
  --c1: var(--teal-2);
  --c2: var(--teal-d);
}

.act-shift.active {
  opacity: 1 !important;
  filter: none !important;
  box-shadow: 0 0 0 4px #fff, 0 6px 0 4px var(--ink);
}

.act-panel {
  --c1: #7fcbff;
  --c2: var(--water-d);
  animation: pulse 0.9s infinite;
}

.act-panel.active {
  --c1: var(--leaf-2);
  --c2: var(--leaf-d);
  animation: none;
}

/* ------------------------------------------------------------ Cheirador */
/* botão Cheirar (verde) e botão da folha de anotações (cor de papel) */
.act-sniff {
  --c1: #7fe0a4;
  --c2: var(--leaf-d);
}

.act-notes {
  --c1: #ffe3a1;
  --c2: #c9902f;
}

/* o botão da folha pisca quando chega uma anotação nova */
.act-notes.ping {
  animation: pulse 0.5s 3;
}

/* contador no canto do botão (cheiradas que restam ou anotações feitas) */
.action .uses {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: calc(var(--btn) * 0.34);
  height: calc(var(--btn) * 0.34);
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  border: 3px solid var(--ink);
  background: var(--sun);
  color: var(--ink);
  font-size: calc(var(--btn) * 0.2);
  font-weight: 400;
  text-shadow: none;
  box-shadow: 0 2px 0 var(--ink);
}

/* a folha de anotações fica por cima da reunião (que usa z-index 60) */
.notes-modal {
  z-index: 75;
}

.notes-card {
  width: min(520px, 100%);
  background:
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(80, 120, 200, 0.2) 31px 33px),
    #fff9e2;
}

.notes-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note {
  background: #fffdf0;
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  padding: 10px 12px 10px 14px;
  box-shadow: 0 3px 0 var(--ink);
  transform: rotate(-0.4deg);
}

.note:nth-child(even) {
  transform: rotate(0.5deg);
}

.note-tag {
  display: inline-block;
  background: var(--sun);
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 0 10px;
  margin-bottom: 6px;
  font-family: var(--display);
  font-size: 0.8rem;
}

.note-who {
  margin: 0 0 6px;
  font-weight: 800;
}

.note-where {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 1.15rem;
  color: #b3402f;
}

.note-where .ico {
  color: #e0453a;
  flex-shrink: 0;
}

/* botão "Anotações" no cabeçalho da reunião: compacto; em telas estreitas fica só o ícone */
.meeting-notes-btn {
  flex: 0 0 auto;
}

@media (max-width: 560px) {
  .meeting-notes-btn span {
    display: none;
  }
}

.note-empty {
  padding: 12px;
  text-align: center;
  font-weight: 800;
  color: var(--ink-soft);
}

/* setas dos dutos */
.vent-arrows {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.vent-arrow {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, var(--danger-2), var(--danger));
  color: #fff;
  border-radius: 16px;
  padding: 4px 12px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--display);
  text-shadow: 0 1px 0 rgba(43, 29, 20, 0.5);
  box-shadow: 0 4px 0 var(--ink);
  animation: pulse 1s infinite;
}

.va-icon {
  display: inline-flex;
}

.vent-exit {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-b) + 130px);
  transform: translateX(-50%);
  pointer-events: auto;
  border: 3px solid var(--ink);
  background: var(--dusk);
  color: #fff;
  font-family: var(--display);
  font-size: 1rem;
  border-radius: 999px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
}

/* disfarce */
.shift-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.shift-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 3px 0 var(--ink);
  padding: 6px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.15s var(--ease-back);
}

.shift-option:hover {
  transform: translateY(-3px);
  background: #e3faf6;
}

/* joystick */
.joystick {
  position: fixed;
  width: 128px;
  height: 128px;
  margin: -64px 0 0 -64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.16));
  border: 3px solid rgba(255, 244, 224, 0.6);
  box-shadow: 0 0 0 3px rgba(43, 29, 20, 0.35);
  pointer-events: none;
  display: none;
  z-index: 5;
}

.joystick.active {
  display: block;
}

.joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--cream-2));
  border: 3px solid var(--ink);
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 0 var(--ink);
}

.joy-hint {
  position: absolute;
  left: calc(var(--safe-l) + 34px);
  bottom: calc(var(--safe-b) + 34px);
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 244, 224, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 244, 224, 0.75);
  font-family: var(--display);
  pointer-events: none;
  transition: opacity 0.3s;
  animation: float 2.4s ease-in-out infinite;
}

.flash {
  display: none;
}

/* animação de ataque (vítima) */
.kill-anim {
  z-index: 45;
  flex-direction: column;
  background: radial-gradient(circle, rgba(170, 30, 40, 0.94), rgba(40, 6, 12, 0.97));
  animation: fade-in 0.2s ease;
  pointer-events: none;
}

.kill-anim canvas {
  width: min(900px, 100%);
  height: min(60vh, 380px);
}

.kill-anim p {
  color: #fff;
  font-family: var(--display);
  font-size: clamp(1.5rem, 5vw, 2.6rem);
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--ink);
  margin: 0;
  text-align: center;
  animation: pop-in 0.4s 0.5s var(--ease-back) both;
}

/* revelação do papel */
.role-reveal {
  z-index: 45;
  cursor: pointer;
  overflow: hidden;
  animation: fade-in 0.35s ease;
}

.role-reveal::before,
.end-rays {
  content: '';
  position: absolute;
  left: 50%;
  top: 42%;
  width: 260vmax;
  height: 260vmax;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.08) 0 10deg, transparent 10deg 20deg);
  animation: rays 40s linear infinite;
  pointer-events: none;
}

.role-reveal.leaving {
  animation: fade-in 0.45s ease reverse forwards;
}

.role-reveal.crew {
  background: radial-gradient(ellipse at 50% 40%, #6fcf8a, #1f6a52 70%, #123a30);
}

.role-reveal.impostor {
  background: radial-gradient(ellipse at 50% 40%, #ff6b6b, #8a1f2e 70%, #3a0a14);
}

.reveal-card {
  position: relative;
  text-align: center;
  color: #fff;
  width: min(640px, 100%);
}

.reveal-art {
  width: 100%;
  height: min(40vh, 280px);
  display: block;
}

.reveal-kicker {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(0.85rem, 2.6vw, 1rem);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 99px;
  box-shadow: 0 3px 0 var(--ink);
  padding: 2px 14px;
  animation: pop-in 0.5s 0.7s var(--ease-back) both;
}

.reveal-title {
  font-size: clamp(2.2rem, 8vw, 3.8rem);
  margin: 10px 0 0;
  -webkit-text-stroke: 8px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink);
  animation: pop-in 0.6s 0.9s var(--ease-back) both;
}

.role-reveal.crew .reveal-title {
  color: var(--sun);
}

.role-reveal.impostor .reveal-title {
  color: #ffd2d2;
}

.reveal-sub {
  font-size: clamp(1rem, 3.2vw, 1.2rem);
  font-weight: 800;
  margin: 12px auto 8px;
  max-width: 520px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  animation: pop-in 0.5s 1.2s var(--ease-out) both;
}

.reveal-partners {
  display: inline-block;
  color: #fff;
  background: var(--danger-d);
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 4px 12px;
  font-weight: 900;
  animation: pop-in 0.5s 1.4s var(--ease-out) both;
}

.reveal-skip {
  display: block;
  margin-top: 10px;
  opacity: 0.75;
  font-weight: 800;
  animation: fade-in 0.5s 2s both;
}

/* ------------------------------------------------------------ minimapa */
.minimap {
  z-index: 35;
  background: rgba(20, 16, 40, 0.62);
  animation: fade-in 0.2s;
}

.minimap-card {
  padding: 10px;
  width: min(96vw, calc((100dvh - 120px) * 1.483));
  max-width: 1100px;
  animation: pop-in 0.3s var(--ease-back);
}

.minimap-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.minimap-head h3 {
  margin: 0;
  flex: 1;
}

.minimap-sabotage {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sab-btn {
  min-height: 40px;
  padding: 5px 12px;
  font-size: 0.9rem;
}

.minimap-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2640 / 1780;
}

#minimap-canvas {
  width: 100%;
  height: 100%;
  border-radius: var(--r-md);
  border: 3px solid var(--ink);
  display: block;
}

.minimap-layer {
  position: absolute;
  inset: 0;
}

.door-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(34px, 5vw, 46px);
  height: clamp(34px, 5vw, 46px);
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, var(--grape-2), var(--grape));
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 0 var(--ink);
  padding: 0;
  transition: transform 0.15s var(--ease-back), background 0.15s;
}

.door-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--danger-2), var(--danger));
  transform: translate(-50%, -50%) scale(1.12);
}

.door-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ------------------------------------------------------------ modal de tarefa */
.task-modal {
  background: rgba(20, 16, 40, 0.62);
  z-index: 30;
  animation: fade-in 0.2s;
}

.task-card {
  width: 420px;
  flex-shrink: 0;
  padding: 12px 16px 16px;
  transform-origin: center;
}

.task-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.task-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mg-hint {
  margin: 6px 0 8px;
  font-weight: 800;
  color: var(--ink-2);
  text-align: center;
}

.mg-status {
  margin: 6px 0 0;
  font-weight: 900;
  color: var(--leaf-d);
}

.mg-area {
  position: relative;
  width: 360px;
  height: 250px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 3px solid var(--ink);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.25), 0 4px 0 var(--ink);
}

.task-complete {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 2.2rem;
  color: #fff;
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
  background: rgba(92, 191, 90, 0.92);
  border-radius: var(--r-md);
  animation: pop-in 0.35s var(--ease-back);
  z-index: 10;
}

/* ------------------------------------------------------------ minigames */
/* laranjas */
.mg-tree {
  background: linear-gradient(#bfe6ff, #e6f6d8);
}

.tree-trunk {
  position: absolute;
  left: 160px;
  top: 150px;
  width: 36px;
  height: 110px;
  background: #7a4d28;
  border-radius: 8px;
}

.tree-canopy {
  position: absolute;
  left: 30px;
  top: 10px;
  width: 300px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #6cc257, #3f8a35);
}

.fruit {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
  padding: 0;
  transition: top 0.5s ease-in, opacity 0.5s, transform 0.15s var(--ease-back);
}

.fruit:hover {
  transform: scale(1.12);
}

.fruit::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 12px;
  width: 8px;
  height: 6px;
  background: #3f8a35;
  border-radius: 50% 50% 0 50%;
}

.fruit.ripe {
  background: radial-gradient(circle at 35% 30%, #ffc36e, #f28c28);
}

.fruit.green {
  background: radial-gradient(circle at 35% 30%, #c9ec8f, #8cc24a);
}

.fruit.picked {
  top: 260px !important;
  opacity: 0;
  pointer-events: none;
}

.basket {
  position: absolute;
  right: 10px;
  bottom: 8px;
  background: #fff8ec;
  border-radius: 10px;
  padding: 2px 10px;
  font-weight: 800;
  border: 2px solid var(--wood);
  display: flex;
  align-items: center;
  gap: 6px;
}

.basket svg {
  width: 34px;
  height: 26px;
}

/* ponte */
.mg-bridge {
  background: #6fb14f;
}

.bridge-water {
  position: absolute;
  left: 150px;
  top: 0;
  bottom: 0;
  right: 0;
  background: repeating-linear-gradient(170deg, #3a9ad9 0 18px, #4aa8e6 18px 36px);
}

.plank-slot {
  position: absolute;
  height: 34px;
  border: 3px dashed #fff;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
}

.plank {
  position: absolute;
  height: 34px;
  border-radius: 6px;
  background: repeating-linear-gradient(90deg, #c9965c 0 30px, #b8844b 30px 32px);
  border: 2px solid #6b4424;
  cursor: grab;
  z-index: 2;
  touch-action: none;
}

.dragging {
  cursor: grabbing !important;
  z-index: 5 !important;
  filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.35));
}

.locked {
  cursor: default !important;
}

/* lagoa */
.mg-pond {
  background: radial-gradient(circle at 40% 45%, #66bdf0, #2d7fb6);
}

.bin {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 80px;
  height: 92px;
}

.bin svg {
  width: 100%;
  height: 100%;
}

.trash {
  position: absolute;
  width: 48px;
  height: 48px;
  cursor: grab;
  animation: bob 2.4s ease-in-out infinite;
  z-index: 2;
  touch-action: none;
}

.trash svg {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@keyframes bob {
  50% {
    translate: 0 -5px;
  }
}

/* rádio */
.radio-screen {
  width: 360px;
  border-radius: var(--r-sm);
  border: 4px solid #555c66;
}

.radio-slider {
  width: 100%;
  margin-top: 12px;
  accent-color: var(--orange);
  height: 34px;
}

/* luneta */
.scope-view {
  width: min(300px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 10px solid #b8872f;
  box-shadow: 0 0 0 4px #6b4424, inset 0 0 30px rgba(0, 0, 0, 0.6);
  cursor: grab;
  background: #0b1230;
}

.scope-view:active {
  cursor: grabbing;
}

/* suco */
.mg-juice {
  background: linear-gradient(#fff3dc, #f6d9b0);
  display: grid;
  grid-template-columns: 1fr 120px;
  grid-template-rows: auto 1fr;
  gap: 6px;
  padding: 10px;
}

.juice-recipe {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fff;
  border: 2px dashed var(--wood);
  border-radius: var(--r-sm);
}

.juice-recipe::before {
  content: 'Receita:';
  font-weight: 800;
  color: var(--wood-dark);
  margin-right: 4px;
}

.recipe-slot {
  width: 38px;
  height: 38px;
  position: relative;
}

.recipe-slot.done::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.45);
  border: 3px solid var(--leaf-dark);
}

.juice-fruits {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  align-content: center;
}

.juice-fruit {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: #fff;
  padding: 6px;
  cursor: pointer;
  transition: transform 0.15s var(--ease-back);
}

.juice-fruit:hover {
  transform: scale(1.1);
}

.juice-blender {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.juice-jar {
  width: 86px;
  height: 140px;
  border: 4px solid #8fb7cc;
  border-top-width: 6px;
  border-radius: 10px 10px 18px 18px;
  background: rgba(220, 240, 255, 0.6);
  position: relative;
  overflow: hidden;
}

.juice-jar.spinning {
  animation: wiggle 0.12s linear infinite;
}

.juice-liquid {
  position: absolute;
  inset: 0;
  transition: filter 0.3s;
}

.juice-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  transition: height 0.35s var(--ease-out);
}

.juice-base {
  width: 104px;
  height: 34px;
  background: #5d6470;
  border-radius: 8px 8px 12px 12px;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.2);
}

.juice-blend {
  margin-top: 10px;
  user-select: none;
  touch-action: none;
}

/* regador */
.mg-water {
  width: 280px;
  height: 200px;
  background: linear-gradient(#cfeeff, #eaf6de);
  display: flex;
  align-items: center;
  justify-content: center;
}

.can-svg {
  width: 220px;
  height: 176px;
}

.can-pct {
  position: absolute;
  left: 0;
  right: 50px;
  top: 88px;
  text-align: center;
  font-weight: 800;
  font-size: 1.4rem;
}

.tap {
  position: absolute;
  left: 50%;
  top: 0;
  margin-left: -20px;
  width: 12px;
  height: 0;
  background: repeating-linear-gradient(#6fc3ff 0 6px, transparent 6px 10px);
}

.mg-water.pouring .tap {
  height: 70px;
  animation: pour 0.3s linear infinite;
}

@keyframes pour {
  to {
    background-position: 0 10px;
  }
}

.hold-btn {
  margin-top: 12px;
  touch-action: none;
}

.hold-btn.active {
  filter: brightness(1.2);
  transform: translateY(4px);
}

/* folhas */
.leaf-pile {
  width: 360px;
  min-height: 110px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: #8a6a4a;
  border-radius: var(--r-md);
  padding: 10px;
  border: 3px solid var(--wood-dark);
}

.leaf-shelf {
  width: 360px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 10px;
}

.leaf-slot {
  flex: 1;
  height: 80px;
  border: 3px dashed #bca783;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
}

.leaf {
  width: calc(56px * var(--s));
  height: calc(34px * var(--s));
  border-radius: 0 100% 0 100%;
  background: linear-gradient(135deg, #8fd05e, #4f9e3a);
  border: 2px solid #3a7a2a;
  transform: rotate(var(--rot));
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s var(--ease-back);
}

.leaf:hover {
  transform: rotate(var(--rot)) scale(1.1);
}

.leaf.placed {
  transform: rotate(-20deg);
  cursor: default;
}

/* fios */
.mg-wires {
  background: #3b4048;
}

.wire-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wire-node {
  position: absolute;
  width: 34px;
  height: 28px;
  border-radius: 6px;
  border: 3px solid #1f2328;
  cursor: grab;
  touch-action: none;
  z-index: 2;
}

.wire-node.left {
  left: 8px;
  border-radius: 6px 14px 14px 6px;
}

.wire-node.right {
  right: 8px;
  border-radius: 14px 6px 6px 14px;
  cursor: default;
}

.wire-node.locked {
  box-shadow: 0 0 0 3px #7dff9a;
}

/* sementes */
.mg-seeds {
  background: linear-gradient(#b8e0a0, #8a6a4a 60%);
}

.pot {
  position: absolute;
  bottom: 8px;
  width: 100px;
  height: 80px;
}

.pot svg {
  width: 100%;
  height: 100%;
}

.seed {
  position: absolute;
  width: 24px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.35);
  cursor: grab;
  z-index: 2;
  touch-action: none;
}

/* peixes */
.mg-fish {
  background: linear-gradient(#6fc3ff, #1f6fa6);
}

.fishy {
  position: absolute;
  left: 0;
  width: 60px;
  height: 36px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  animation: swim 5s ease-in-out infinite alternate;
}

.fishy svg {
  width: 100%;
  height: 100%;
}

.fishy.full {
  filter: saturate(1.5) drop-shadow(0 0 6px #fff);
  cursor: default;
}

@keyframes swim {
  from {
    left: 4px;
  }
  to {
    left: 290px;
  }
}

.pellet {
  position: absolute;
  width: 18px;
  height: 18px;
  animation: drop 0.6s ease-in forwards;
  pointer-events: none;
}

@keyframes drop {
  from {
    transform: translateY(-20px);
    opacity: 1;
  }
  to {
    transform: translateY(14px);
    opacity: 0;
  }
}

/* caixas */
.mg-crate,
.mg-shelf {
  background: #c2a27a;
}

.crate-box {
  position: absolute;
  right: 20px;
  top: 70px;
  width: 170px;
  height: 128px;
}

.crate-box svg {
  width: 100%;
  height: 100%;
}

.crate-box.closed::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  top: 8px;
  height: 22px;
  background: #8a5a34;
  border-radius: 4px;
}

.crate-count {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -26px;
  text-align: center;
  font-weight: 800;
}

.crate-item {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffc36e, #f28c28);
  border: 2px solid #c96a12;
  cursor: grab;
  z-index: 2;
  touch-action: none;
}

.shelf-slot {
  position: absolute;
  top: 30px;
  width: 62px;
  height: 52px;
  border-bottom: 8px solid #6b4424;
}

.shelf-slot svg {
  width: 100%;
  height: 100%;
}

.shelf-slot.target {
  border: 3px dashed #fff;
  border-bottom: 8px solid #6b4424;
  background: rgba(255, 255, 255, 0.2);
  animation: pulse 1s infinite;
}

.deliver-box {
  position: absolute;
  left: 20px;
  top: 150px;
  width: 74px;
  height: 56px;
  cursor: grab;
  z-index: 2;
  touch-action: none;
}

.deliver-box svg {
  width: 100%;
  height: 100%;
  pointer-events: none;
}


/* ------------------------------------------------------------ reunião */
.meeting {
  z-index: 60;
  background: rgba(20, 16, 40, 0.78);
  padding: calc(var(--safe-t) + 8px) calc(var(--safe-r) + 8px) calc(var(--safe-b) + 8px) calc(var(--safe-l) + 8px);
  animation: fade-in 0.3s;
}

.meeting-card {
  width: min(1120px, 100%);
  height: min(740px, 100%);
  background:
    radial-gradient(rgba(122, 90, 50, 0.07) 1px, transparent 1.5px) 0 0 / 14px 14px,
    var(--cream);
  border: 3px solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: 0 6px 0 var(--ink), var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop-in 0.4s var(--ease-back);
}

.meeting-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: linear-gradient(180deg, var(--dusk-2), var(--dusk));
  color: #fff;
  border-bottom: 3px solid var(--ink);
}

.meeting-art {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  background: linear-gradient(#ffe2b0, #a8dbec);
  border: 3px solid var(--ink);
  border-radius: 16px;
  color: var(--sun);
  flex-shrink: 0;
  overflow: hidden;
}

.meeting-titles {
  flex: 1;
  min-width: 0;
}

.meeting-header h2 {
  margin: 0;
  font-size: clamp(1.2rem, 3.8vw, 1.8rem);
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  color: var(--sun);
}

.meeting-header p {
  margin: 2px 0 0;
  font-weight: 800;
  opacity: 0.92;
  font-size: clamp(0.8rem, 2.4vw, 0.95rem);
}

.timer {
  font-family: var(--display);
  font-size: clamp(1.1rem, 3.2vw, 1.5rem);
  color: var(--ink);
  background: var(--sun);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink);
  padding: 1px 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.timer.urgent {
  background: var(--danger);
  color: #fff;
  animation: pulse 0.6s infinite;
}

.meeting-tabs {
  display: none;
  margin: 8px 10px 0;
}

.meeting-body {
  flex: 1;
  display: flex;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

.vote-area {
  flex: 1.6;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.vote-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  grid-auto-rows: min-content;
  gap: 14px 10px;
  overflow-y: auto;
  padding: 12px 6px 8px;
}

.vote-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 4px 0 var(--ink);
  padding: 4px 8px 4px 4px;
  cursor: pointer;
  text-align: left;
  min-height: 66px;
  font-family: var(--font);
  transition: transform 0.15s var(--ease-back), box-shadow 0.15s, background 0.15s;
  animation: pop-in 0.35s var(--ease-back) both;
}

.vote-card:nth-child(2) { animation-delay: 0.03s; }
.vote-card:nth-child(3) { animation-delay: 0.06s; }
.vote-card:nth-child(4) { animation-delay: 0.09s; }
.vote-card:nth-child(5) { animation-delay: 0.12s; }
.vote-card:nth-child(6) { animation-delay: 0.15s; }
.vote-card:nth-child(n + 7) { animation-delay: 0.18s; }

.vote-card:hover:not(:disabled) {
  transform: translateY(-3px);
}

.vote-card:disabled {
  cursor: default;
}

.vote-card.selected {
  background: #fff0de;
  box-shadow: 0 4px 0 var(--ink), 0 0 0 3px var(--coral) inset;
}

.vote-card.my-vote {
  box-shadow: 0 4px 0 var(--ink), 0 0 0 3px var(--leaf) inset;
}

.vote-card.me {
  background: #fff8ea;
}

.vote-card.dead {
  opacity: 0.55;
  background: #e8dcc6;
}

.vote-card.dead .vote-name {
  text-decoration: line-through;
}

.vote-card.ejected {
  background: #d5ecff;
  animation: wiggle 0.5s 3;
}

.vote-card.has-voted::after {
  content: 'votou';
  position: absolute;
  top: -12px;
  right: 6px;
  background: var(--leaf);
  color: #fff;
  font-family: var(--display);
  font-size: 0.72rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0 8px;
  animation: pop-in 0.3s var(--ease-back);
}

.vote-confirm {
  display: none;
  gap: 4px;
  margin-left: auto;
}

.vote-card.selected .vote-confirm {
  display: flex;
  animation: pop-in 0.2s var(--ease-back);
}

.vc-yes,
.vc-no {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

.vc-yes {
  background: var(--leaf);
}

.vc-no {
  background: var(--danger);
}

.vote-count {
  position: absolute;
  right: -8px;
  bottom: -10px;
  background: var(--danger);
  color: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  box-shadow: 0 2px 0 var(--ink);
  animation: pop-in 0.3s var(--ease-back);
}

.vote-portrait {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  background: radial-gradient(circle at 50% 125%, #7ccf6a 42%, transparent 43%), linear-gradient(#ffe2b0, #a8dbec);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.vote-info {
  flex: 1;
  min-width: 0;
}

.vote-name {
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vote-status {
  font-size: 0.75rem;
  color: var(--ink-soft);
  font-weight: 800;
  min-height: 0.9em;
  display: flex;
  align-items: center;
  gap: 3px;
}

.caller-badge {
  position: absolute;
  left: -10px;
  top: -12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--sun);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 0 var(--ink);
}

.impostor-name {
  color: var(--danger) !important;
}

.voter-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  min-height: 18px;
}

.voter-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e5f1d8;
  border: 2px solid var(--ink);
  overflow: hidden;
  display: grid;
  place-items: center;
  animation: pop-in 0.35s var(--ease-back) both;
}

.voter-dot.anon {
  background: #8a8a8a;
  color: #fff;
}

.vote-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  flex-wrap: wrap;
}

.vote-status-text {
  margin-left: auto;
  font-family: var(--display);
  color: var(--ink-2);
}

#btn-skip.selected {
  box-shadow: 0 0 0 3px #fff, 0 5px 0 3px var(--ink);
}

.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.meeting-splash {
  position: fixed;
  left: 0;
  right: 0;
  top: 30%;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--display);
  font-size: clamp(1.6rem, 6vw, 3.4rem);
  color: #fff;
  -webkit-text-stroke: 8px var(--ink);
  paint-order: stroke fill;
  background: repeating-linear-gradient(-45deg, var(--danger) 0 26px, var(--danger-d) 26px 52px);
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  padding: 14px;
  pointer-events: none;
  opacity: 0;
  transform: scaleY(0);
  text-shadow: 0 5px 0 var(--ink);
  box-shadow: var(--shadow);
}

.meeting-splash .ico {
  color: var(--sun);
  filter: drop-shadow(0 3px 0 var(--ink));
  animation: wiggle 0.3s infinite;
}

.meeting-splash.show {
  animation: splash 2.3s var(--ease-out) forwards;
}

@keyframes splash {
  0% {
    opacity: 0;
    transform: scaleY(0);
  }
  12%,
  80% {
    opacity: 1;
    transform: scaleY(1);
  }
  100% {
    opacity: 0;
    transform: scaleY(0);
  }
}

/* ------------------------------------------------------------ correnteza */
.ejection {
  z-index: 65;
  flex-direction: column;
  justify-content: flex-start;
  /* a mesma cor em que a cena (riverScene.ts) esmaece embaixo, para o texto ficar sobre a lagoa */
  background: #0f1b2d;
  padding: 0;
  animation: fade-in 0.4s;
}

#eject-canvas {
  display: block;
  width: 100%;
  height: 65%;
}

.eject-text {
  color: #fff;
  font-family: var(--display);
  font-size: clamp(1.15rem, 3.6vw, 1.9rem);
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-align: center;
  /* borda preta (o traço é desenhado por trás do preenchimento, então só metade dele aparece) */
  -webkit-text-stroke: 6px #000;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
  padding: 0 20px;
  min-height: 3.2em;
  margin: 14px auto 0;
  max-width: 34ch;
}

.eject-extra {
  display: block;
  margin-top: 6px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 0.62em;
  letter-spacing: 0.02em;
  /* borda preta fina por sombras (o traço comeria as letras pequenas) */
  -webkit-text-stroke: 0;
  text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000, -1px -1px #000, 1px 1px #000, -1px 1px #000, 1px -1px #000;
  color: var(--sun);
  animation: pop-in 0.4s var(--ease-back);
}

/* ------------------------------------------------------------ tela final */
.end-screen {
  z-index: 80;
  overflow: hidden auto;
  animation: fade-in 0.4s;
}

.end-screen.crew-win {
  background: radial-gradient(ellipse at 50% 35%, #6fcf8a, #1f6a52 70%, #123a30);
}

.end-screen.impostor-win {
  background: radial-gradient(ellipse at 50% 35%, #ff6b6b, #8a1f2e 70%, #3a0a14);
}

.end-card {
  position: relative;
  text-align: center;
  color: #fff;
  width: min(720px, 100%);
  margin: auto;
}

#end-art {
  width: 100%;
  height: min(30vh, 210px);
  display: block;
}

.end-card h1 {
  font-size: clamp(2.1rem, 7.5vw, 3.8rem);
  margin: 0;
  color: var(--sun);
  -webkit-text-stroke: 9px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 7px 0 var(--ink);
}

.impostor-win .end-card h1 {
  color: #ffd2d2;
}

.end-card h2 {
  display: inline-block;
  margin: 12px 0 0;
  font-size: 1.3rem;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
  padding: 3px 16px;
  transform: rotate(-2deg);
}

.end-card p {
  font-size: 1.1rem;
  font-weight: 800;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.end-impostors h3 {
  margin: 4px 0 8px;
  font-size: 1.15rem;
}

.end-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.end-imp {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 900;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 4px 0 var(--ink);
  padding: 6px 14px;
  animation: pop-in 0.4s 0.4s var(--ease-back) both;
}

.end-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* ------------------------------------------------------------ guarda-roupa */
.wardrobe-card {
  width: min(940px, 100%);
}

.wardrobe-body {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  min-height: 0;
}

.wardrobe-side {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#wardrobe-preview {
  width: 260px;
  height: 220px;
  border-radius: var(--r-md);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  background: linear-gradient(180deg, #ffd59a 0%, #ffb27a 40%, #9fd6e8 41%, #c8ecf5 100%);
}

.wardrobe-label {
  margin: 0;
  text-align: center;
  font-weight: 800;
  color: var(--ink-2);
  font-size: 0.85rem;
  min-height: 2.4em;
}

.wardrobe-side-actions {
  display: flex;
  gap: 8px;
}

.wardrobe-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wardrobe-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 6px;
}

.wardrobe-tab {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 3px solid var(--ink);
  background: var(--white);
  border-radius: 12px;
  padding: 6px 10px;
  font-family: var(--display);
  font-size: 0.92rem;
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.12s var(--ease-back), background 0.15s;
}

.wardrobe-tab .ico {
  color: var(--grape);
}

.wardrobe-tab.active {
  background: var(--coral);
  color: #fff;
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
  text-shadow: 0 1px 0 rgba(43, 29, 20, 0.4);
}

.wardrobe-tab.active .ico {
  color: #fff;
}

.wardrobe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 4px 4px 8px;
}

.wardrobe-grid.sets {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}

.wardrobe-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 3px 0 var(--ink);
  padding: 4px 2px 6px;
  cursor: pointer;
  color: var(--ink-2);
  font-family: var(--font);
  transition: transform 0.15s var(--ease-back), background 0.15s;
}

.wardrobe-item canvas {
  background: radial-gradient(circle at 50% 135%, #c6eeb8 45%, transparent 46%);
  border-radius: 12px;
}

.wardrobe-grid.animate .wardrobe-item {
  animation: pop-in 0.3s var(--ease-back) both;
}

.wardrobe-item:hover {
  transform: translateY(-3px);
}

.wardrobe-item small {
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  padding: 0 2px;
}

.wardrobe-item.selected {
  background: #fff0de;
  color: var(--coral-d);
  box-shadow: 0 3px 0 var(--ink), 0 0 0 3px var(--coral) inset;
}

.set-item {
  flex-direction: row;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  text-align: left;
}

.set-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.set-text b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--ink);
}

.set-text small {
  text-align: left;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------ reconexão */
.reconnect {
  z-index: 90;
  background: rgba(20, 16, 40, 0.72);
  animation: fade-in 0.2s;
}

.reconnect-card {
  text-align: center;
  width: min(380px, 100%);
}

.reconnect-card p {
  font-weight: 900;
  margin: 10px 0 14px;
}

.spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  border: 6px solid var(--line);
  border-top-color: var(--coral);
  animation: spin 0.8s linear infinite;
}

/* ------------------------------------------------------------ toasts */
.toasts {
  position: fixed;
  bottom: calc(var(--safe-b) + 140px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(520px, 92vw);
}

.toast {
  background: var(--dusk);
  color: #fff;
  padding: 7px 16px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 4px 0 var(--ink), 0 10px 20px rgba(0, 0, 0, 0.3);
  animation: toast-in 0.35s var(--ease-back);
  transition: opacity 0.4s, transform 0.4s;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.9);
  }
}

.toast-error {
  background: var(--danger-d);
}

.toast-good {
  background: var(--leaf-d);
}

.toast.out {
  opacity: 0;
  transform: translateY(-10px);
}

/* modo de teste local */
body.sandbox .hud-left,
body.sandbox .hud-center {
  opacity: 0.85;
}

/* ============================================================
   Responsivo
   ============================================================ */

/* tablets e celulares: lobby em abas */
@media (max-width: 820px) {
  .lobby-tabs {
    display: flex;
  }
  .lobby-grid {
    display: block;
  }
  .lobby-pane {
    display: none;
  }
  .lobby-pane.active {
    display: flex;
    flex-direction: column;
  }
  .lobby-chat {
    height: 50vh;
    max-height: none;
  }
  .color-grid.small {
    grid-template-columns: repeat(6, 1fr);
    max-width: 340px;
  }
  .wardrobe-body {
    flex-direction: column;
  }
  .wardrobe-side {
    flex: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  #wardrobe-preview {
    width: 200px;
    height: 150px;
  }
  .wardrobe-label {
    flex: 1 1 140px;
    text-align: left;
  }
  .wardrobe-grid {
    max-height: 40vh;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
  .wardrobe-tab span {
    display: none;
  }
  .wardrobe-tab.active span {
    display: inline;
  }
}

/* reunião em abas quando a tela é estreita */
@media (max-width: 760px) {
  .meeting-tabs {
    display: flex;
  }
  .meeting-pane {
    display: none !important;
  }
  .meeting-pane.active {
    display: flex !important;
  }
  .vote-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 145px), 1fr));
  }
  .meeting-art {
    width: 46px;
    height: 46px;
  }
  .meeting-art canvas,
  .meeting-art svg {
    width: 40px !important;
    height: 40px !important;
  }
}

/* celular em pé */
@media (max-width: 560px) {
  .lobby-tabs .tab {
    padding: 7px 6px;
  }
  .lobby-tabs .tab:not(.active) span {
    display: none;
  }
  .lobby-tabs .tab.active span {
    display: inline;
  }
  .home-top {
    justify-content: center;
  }
  .home-menu {
    width: 100%;
    justify-content: center;
  }
  .menu-btn {
    flex: 1;
    justify-content: center;
    padding: 6px 8px;
    font-size: 0.88rem;
  }
  .tagline {
    text-align: center;
  }
  .hud-left {
    width: min(200px, 50vw);
  }
  .hud-center {
    top: calc(var(--safe-t) + 104px);
    width: 90vw;
  }
  .hud-right {
    gap: 5px;
  }
  .hud-right .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .hud-right .ping {
    display: none;
  }
  .progress-label {
    font-size: 0.72rem;
  }
  .role-badge,
  .area-name,
  .sabotage-alert {
    font-size: 0.78rem;
  }
  .lobby-top {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .lobby-top-actions {
    justify-content: center;
  }
  .lobby-badges {
    flex-direction: row;
    align-items: center;
  }
  .lobby-bottom {
    padding: 8px 10px;
  }
  .lobby-actions {
    width: 100%;
  }
  .lobby-actions .btn {
    flex: 1;
  }
  .vote-footer .btn {
    padding: 6px 12px;
    min-height: 40px;
  }
}

/* celular deitado (pouca altura) */
@media (max-height: 520px) {
  .logo-main {
    font-size: 2.2rem;
  }
  .logo-mark {
    width: 50px;
  }
  .home-stage {
    height: 120px;
  }
  .home-preview {
    width: 130px;
    height: 116px;
  }
  .hud-left {
    width: min(230px, 30vw);
  }
  .task-toggle {
    font-size: 0.82rem;
    padding: 2px 8px;
  }
  #task-list {
    font-size: 0.74rem;
  }
  .task-panel-body {
    max-height: 48vh;
  }
  .role-badge,
  .area-name,
  .sabotage-alert {
    font-size: 0.76rem;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
  }
  .meeting-header {
    padding: 4px 10px;
  }
  .meeting-art {
    width: 40px;
    height: 40px;
  }
  .meeting-art canvas,
  .meeting-art svg {
    width: 34px !important;
    height: 34px !important;
  }
  .meeting-header p {
    display: none;
  }
  .meeting-body {
    padding: 6px;
    gap: 6px;
  }
  .vote-grid {
    gap: 12px 6px;
  }
  .vote-card {
    min-height: 50px;
  }
  .vote-portrait {
    width: 40px;
    height: 40px;
  }
  .vote-footer .btn {
    min-height: 38px;
    padding: 5px 12px;
    font-size: 0.88rem;
  }
  .reveal-art {
    height: 34vh;
  }
  .reveal-sub {
    margin: 2px auto;
  }
  .lobby-chat {
    height: 60vh;
  }
}
