/* ==========================================================================
   Planning Poker — tema dark, verde neon + toques quentes
   ========================================================================== */

:root {
  --bg: #0a0b0d;
  --surface: #121418;
  --surface-2: #16191e;
  --glass: rgba(22, 25, 30, .55);
  --line: rgba(255, 255, 255, .06);
  --border: #2a2d31;
  --text: #e8eaed;
  --text-strong: #ffffff;
  --muted: #9aa0a6;
  --dim: #5f6368;

  --accent: #00ffa3;
  --accent-hover: #6bffcb;
  --accent-ink: #05120c;
  --accent-soft: rgba(0, 255, 163, .12);
  --accent-line: rgba(0, 255, 163, .3);
  --warm: #ffb86c;
  --warm-soft: rgba(255, 184, 108, .14);
  --danger: #ff6b6b;

  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --card-w: 50px;
  --card-h: 74px;
  --player-w: 100px;

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grade sutil + brilho verde no topo (identidade visual) */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 80%);
}
body::after {
  background: radial-gradient(640px 420px at 50% -8%, rgba(0, 255, 163, .11), transparent 70%);
}

[hidden] { display: none !important; }

button,
input { font: inherit; color: inherit; }

h1, h2, h3, p { margin: 0; }

a { color: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

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

.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); }
.accent { color: var(--accent); }

.noscript { padding: 24px; text-align: center; }

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--accent);
}

.wordmark {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.03em;
  color: var(--text-strong);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .dot { color: var(--accent); }
.wordmark-sm { font-size: 16px; }

.chip-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: blink 2.2s ease-in-out infinite;
  flex-shrink: 0;
}

/* ========================= Botões ========================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .2s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 0 28px rgba(0, 255, 163, .35);
}

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.btn-lg { width: 100%; min-height: 50px; font-size: 15px; }
.btn-xl { min-height: 52px; padding: 0 26px; font-size: 15px; }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: 13px; }
.btn-icon { width: 40px; height: 40px; min-height: 40px; padding: 0; }
.btn-xs { width: 32px; height: 32px; min-height: 32px; font-size: 13px; }

.btn.is-copied { border-color: var(--accent); color: var(--accent); }
.btn-primary.is-copied { background: var(--accent-hover); color: var(--accent-ink); }

.icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ========================= Landing ========================= */

.landing { min-height: 100vh; display: flex; flex-direction: column; }
.landing > main { flex: 1; }

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(20px, 5vw, 48px);
  background: rgba(10, 11, 13, .72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-links { display: flex; gap: 28px; }
.nav-link {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: color .15s;
}
.nav-link:hover { color: var(--text-strong); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 40px;
  padding: clamp(56px, 11vh, 120px) 0 72px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(0, 255, 163, .05);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 24px 0 22px;
  font-size: clamp(42px, 6.2vw, 76px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.04em;
  color: var(--text-strong);
}
.hero-title em {
  position: relative;
  font-style: normal;
  color: var(--accent);
  white-space: nowrap;
}
.hero-title em::after {
  content: '';
  position: absolute;
  left: 0;
  right: .2em;
  bottom: .02em;
  height: .09em;
  border-radius: 99px;
  background: var(--accent);
  opacity: .35;
  transform-origin: left;
  animation: underline 1s .4s cubic-bezier(.2, .8, .2, 1) both;
}

.hero-sub {
  max-width: 33em;
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--muted);
}
.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* Leque de cartas */
.fan {
  --spread: 1;
  position: relative;
  height: 380px;
  display: grid;
  place-items: center;
}
.fan:hover { --spread: 1.28; }

.fan-card {
  position: absolute;
  width: 124px;
  height: 180px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-family: var(--mono);
  font-size: 46px;
  font-weight: 700;
  transform-origin: 50% 130%;
  transform: translateX(calc(var(--x) * var(--spread) * 1px)) rotate(calc(var(--r) * var(--spread) * 1deg));
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .55);
}
.fan-card.back {
  border: 1.5px solid rgba(0, 255, 163, .45);
  background:
    repeating-linear-gradient(135deg, rgba(0, 255, 163, .14) 0 3px, transparent 3px 9px),
    #0d1a14;
}
.fan-card.front { background: var(--text); color: var(--bg); border: 2px solid var(--border); }
.fan-card.hot {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  box-shadow: 0 0 60px rgba(0, 255, 163, .35), 0 30px 60px rgba(0, 0, 0, .55);
  animation: float 4s ease-in-out infinite;
}

.fan-emoji {
  position: absolute;
  font-size: 34px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .5));
}
.fan-egg { top: 22px; right: 12%; animation: bob 3.2s ease-in-out infinite; }
.fan-plane { top: 70px; left: 6%; animation: glide 5s ease-in-out infinite; }
.fan-coffee { bottom: 58px; right: 4%; font-size: 28px; animation: bob 3.8s .6s ease-in-out infinite; }

.fan-tag {
  position: absolute;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--glass);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* Faixa de números */
.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.strip-item { padding: 28px 24px; }
.strip-item + .strip-item { border-left: 1px solid var(--line); }
.strip-num {
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--text-strong);
}
.strip-num span { color: var(--accent); }
.strip-label {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* Seções */
.section { padding: clamp(72px, 12vh, 120px) 0 0; }
.section-head { margin-bottom: 40px; }
.section-title {
  margin-top: 12px;
  max-width: 18em;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--text-strong);
}
.lead { margin-top: 18px; max-width: 34em; font-size: 17px; color: var(--muted); }

.split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 56px;
}

.demo {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--glass);
}
.demo-label { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.demo-cards {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 24px 0;
}
.demo-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.demo-card {
  display: grid;
  place-items: center;
  width: 58px;
  height: 84px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--text);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
}
.demo-card.low { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.demo-card.high { border-color: var(--warm); box-shadow: 0 0 0 3px var(--warm-soft); }
.demo-comment {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
.demo-comment span { color: var(--accent); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.step,
.feature {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass);
  transition: border-color .2s, transform .2s;
}
.step:hover,
.feature:hover { border-color: var(--accent-line); transform: translateY(-3px); }
.step h3,
.feature h3 { font-size: 19px; font-weight: 600; color: var(--text-strong); }
.step p,
.feature p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.step-num {
  display: block;
  margin-bottom: 26px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 22px;
}

.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: clamp(40px, 7vw, 72px) 24px;
  border: 1px solid var(--accent-line);
  border-radius: 28px;
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(0, 255, 163, .14), transparent 70%),
    var(--surface);
  text-align: center;
}
.cta-title {
  max-width: 16em;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--text-strong);
}

.footer {
  margin-top: clamp(72px, 12vh, 120px);
  padding: 28px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.footer-credit { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.footer-credit a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
  transition: border-color .15s;
}
.footer-credit a:hover { border-color: var(--accent); }

/* Revelação ao rolar */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ========================= Telas centrais ========================= */

.screen-center {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 72px 20px 40px;
  text-align: center;
}

.back-link {
  position: absolute;
  top: 20px;
  left: clamp(20px, 5vw, 48px);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.back-link:hover { color: var(--accent); }

.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.brand-title {
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.05;
  color: var(--text-strong);
}
.brand-tagline { max-width: 420px; color: var(--muted); }

.panel {
  width: min(430px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
  text-align: left;
}
.panel-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text-strong);
  overflow-wrap: anywhere;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--dim); }
.field input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field input[aria-invalid="true"] { border-color: var(--danger); }

.field-error {
  min-height: 1.25em;
  margin-top: 4px;
  font-size: 13px;
  color: var(--danger);
}

.footnote { font-size: 12px; color: var(--dim); }

.panel-message { align-items: center; text-align: center; }
.message-icon { font-size: 52px; line-height: 1; }
.message-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ========================= Sala ========================= */

.room {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 11, 13, .6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.room-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.room-logo {
  padding-right: 12px;
  border-right: 1px solid var(--border);
}
.room-title h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill {
  flex-shrink: 0;
  padding: 3px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(0, 255, 163, .06);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.sound-ctrl { display: flex; align-items: center; gap: 6px; }
.volume { width: 84px; accent-color: var(--accent); cursor: pointer; }

/* Botão de som "chamando atenção" quando um efeito tocou com o áudio mudo */
#btn-sound { position: relative; }
#btn-sound[aria-pressed="true"] { color: var(--muted); }
#btn-sound.is-nudging {
  border-color: var(--accent);
  animation: nudge 1s ease-in-out infinite;
}
#btn-sound.is-nudging::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
}

.banner {
  padding: 7px 16px;
  border-bottom: 1px solid rgba(255, 184, 108, .25);
  background: var(--warm-soft);
  color: var(--warm);
  font-family: var(--mono);
  font-size: 13px;
  text-align: center;
}

.table-area {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px 16px 12px;
}

.players-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 14px;
  min-height: calc(var(--card-h) + 34px);
  max-width: 100%;
}

/* Mesa em formato de "estádio", com anel tracejado */
.table {
  position: relative;
  width: min(600px, 100%);
  min-height: 184px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 48px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  background:
    radial-gradient(ellipse 70% 90% at 50% 50%, rgba(0, 255, 163, .07), transparent 70%),
    #0f1114;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .04);
  text-align: center;
  transition: box-shadow .4s, border-color .4s;
}
.table::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(0, 255, 163, .16);
  border-radius: inherit;
  pointer-events: none;
}
.table::after {
  content: '// mesa';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 8px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}
.table.is-consensus {
  border-color: var(--accent-line);
  box-shadow: 0 0 70px rgba(0, 255, 163, .2), 0 30px 70px rgba(0, 0, 0, .5);
}

.table-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.center-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text-strong);
}
.center-sub { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 380px;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-strong);
  animation: pop-in .4s ease-out both;
}
.stat:first-child .stat-value { color: var(--accent); text-shadow: 0 0 24px rgba(0, 255, 163, .4); }
.stat-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.consensus-badge {
  padding: 4px 14px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  animation: pop-in .5s ease-out both;
}

.divergence-badge {
  border-color: rgba(255, 184, 108, .45);
  background: var(--warm-soft);
  color: var(--warm);
}

.dist { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.dist-chip {
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.invite { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-width: 420px; }
.invite-row { display: flex; gap: 6px; width: 100%; }
.invite-input {
  flex: 1;
  min-width: 0;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

/* ========================= Jogadores ========================= */

.player {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: var(--player-w);
  transition: opacity .3s;
}

.pcard-wrap {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  perspective: 600px;
  transition: transform .2s;
}

.pcard {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
}
button.pcard { cursor: pointer; }
.player:not(.is-self) .pcard-wrap:hover { transform: translateY(-4px) rotate(-3deg); }

.pcard-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.2, .7, .2, 1);
}
.is-revealed .pcard-inner { transform: rotateY(180deg); }

.pcard-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Verso vazio (ainda não votou) */
.pcard-back {
  background: rgba(255, 255, 255, .02);
  border: 1.5px dashed var(--border);
  transition: background .25s, border-color .25s, box-shadow .25s;
}
/* Verso preenchido (já votou, virado para baixo) */
.is-voted .pcard-back {
  border: 1.5px solid var(--accent);
  background:
    repeating-linear-gradient(135deg, rgba(0, 255, 163, .2) 0 3px, transparent 3px 8px),
    #0d1a14;
  box-shadow: 0 0 18px rgba(0, 255, 163, .22);
  animation: card-in .3s cubic-bezier(.2, .9, .3, 1.4);
}

/* Frente: valor revelado */
.pcard-front {
  transform: rotateY(180deg);
  background: var(--text);
  border: 2px solid var(--border);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
}

.is-self .pcard-face { outline: 2px solid rgba(255, 255, 255, .55); outline-offset: 3px; }
.is-low .pcard-front { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 22px rgba(0, 255, 163, .3); }
.is-high .pcard-front { border-color: var(--warm); box-shadow: 0 0 0 3px var(--warm-soft), 0 0 22px rgba(255, 184, 108, .3); }

.ptag {
  position: absolute;
  top: -20px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: lowercase;
}
.ptag:not(:empty)::before { content: '// '; opacity: .6; }
.is-low .ptag { color: var(--accent); }
.is-high .ptag { color: var(--warm); }

.pname {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.3;
  color: var(--muted);
}
.pname-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-voted .pname-text { color: var(--text); }
.is-self .pname-text { color: var(--text-strong); font-weight: 700; }
.host-badge { font-size: 12px; flex-shrink: 0; }

.is-offline { opacity: .35; }

/* ========================= Efeitos residuais ========================= */

.residue { position: absolute; inset: 0; pointer-events: none; }

.residue-item { position: absolute; left: 50%; top: 50%; }
.residue-item.is-fading { animation: fade-out .6s ease-in forwards; }

.splat {
  width: 54px;
  height: 46px;
  border-radius: 48% 52% 40% 60% / 55% 42% 58% 45%;
  background: rgba(255, 255, 255, .95);
  box-shadow:
    14px -10px 0 -7px rgba(255, 255, 255, .95),
    -15px 11px 0 -8px rgba(255, 255, 255, .95),
    16px 14px 0 -10px rgba(255, 255, 255, .9),
    -8px -16px 0 -10px rgba(255, 255, 255, .9);
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  animation: splat-in .22s ease-out both;
}
.splat-yolk {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fef08a, #facc15 45%, #eab308);
  box-shadow: inset -2px -3px 0 rgba(161, 98, 7, .35);
  transform: translate(-50%, -50%);
}

.dart-stuck {
  font-size: 22px;
  line-height: 1;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5));
  animation: dart-in .45s ease-out both;
}

/* ========================= Camadas de efeitos ========================= */

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  pointer-events: none;
}
.projectile {
  position: absolute;
  font-size: 30px;
  line-height: 1;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5));
}
.projectile-sm { font-size: 16px; }
.particle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ========================= Ações e baralho ========================= */

.actions { display: flex; justify-content: center; gap: 10px; padding: 4px 16px 12px; }

.deck-wrap {
  padding: 4px 0 calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: linear-gradient(to top, var(--bg) 40%, rgba(10, 11, 13, .6));
}
.deck-label {
  margin-top: 10px;
  padding: 0 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  text-align: center;
}
.deck-label::before { content: '// '; color: var(--accent); }

.deck {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 20px 16px 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.deck > :first-child { margin-left: auto; }
.deck > :last-child { margin-right: auto; }

.deck-card {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 82px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--text);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  scroll-snap-align: center;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1.3), background .18s, color .18s, border-color .18s, box-shadow .2s;
}
/* Cantinhos com o valor, como numa carta de baralho */
.deck-card::before,
.deck-card::after {
  content: attr(data-value);
  position: absolute;
  font-size: 9px;
  font-weight: 600;
  opacity: .45;
}
.deck-card::before { top: 5px; left: 7px; }
.deck-card::after { bottom: 5px; right: 7px; transform: rotate(180deg); }

.deck-card:hover:not(:disabled) {
  transform: translateY(-6px);
  border-color: var(--accent);
  color: var(--accent);
}
.deck-card[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-14px) rotate(-3deg);
  box-shadow: 0 0 30px rgba(0, 255, 163, .4), 0 14px 26px rgba(0, 0, 0, .5);
}
.deck-card[aria-pressed="true"]:hover:not(:disabled) { color: var(--accent-ink); transform: translateY(-16px) rotate(-3deg); }
.deck-card:disabled { opacity: .35; cursor: not-allowed; }
.deck-card[aria-pressed="true"]:disabled { opacity: .7; }

/* ========================= Menu de arremesso ========================= */

.throw-menu {
  position: fixed;
  z-index: 60;
  width: 320px;
  padding: 14px;
  background: rgba(18, 20, 24, .96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  animation: pop-in .15s ease-out;
}

.throw-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.throw-head h2 {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.throw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.throw-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, transform .15s, color .15s;
}
.throw-item:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px) rotate(-2deg); }
.throw-emo { font-size: 24px; line-height: 1.1; }

.throw-sub { margin: 12px 0 4px; font-family: var(--mono); font-size: 11px; color: var(--dim); }

.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-btn {
  padding: 4px 0;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 20px;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.emoji-btn:hover { background: var(--surface-2); transform: scale(1.15); }

.custom-emoji { display: flex; gap: 6px; margin-top: 10px; }
.custom-emoji input {
  flex: 1;
  min-width: 0;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
}

/* ========================= Soundboard ========================= */

.board-hint { margin: -4px 0 12px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.board-grid {
  grid-template-columns: repeat(4, 1fr);
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.board-item.is-playing {
  border-color: var(--accent);
  color: var(--accent);
  animation: board-pulse .9s ease-out;
}
#btn-board[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }

/* Balão com o emoji do som em cima de quem tocou */
.sound-bubble {
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 17px;
  box-shadow: 0 0 18px rgba(0, 255, 163, .3);
  pointer-events: none;
  animation: bubble-up 1.8s ease-out forwards;
}

/* ========================= Toast ========================= */

.toast-area {
  position: fixed;
  left: 50%;
  top: 72px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 9px 16px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(18, 20, 24, .95);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  animation: toast-in .25s ease-out;
  text-align: center;
  pointer-events: none;
}
.toast::before { content: '● '; color: var(--accent); }
.toast.is-leaving { animation: fade-out .3s ease-in forwards; }

/* ========================= Responsivo ========================= */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 12px; padding-top: 48px; }
  .fan { height: 320px; }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .steps, .features { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  :root {
    --card-w: 42px;
    --card-h: 62px;
    --player-w: 74px;
  }
  .nav-links { display: none; }
  .hero-title { font-size: clamp(38px, 11vw, 52px); }
  .fan { --spread: .8; height: 280px; }
  .fan:hover { --spread: .95; }
  .fan-card { width: 100px; height: 146px; font-size: 36px; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip-item:nth-child(3) { border-left: 0; }
  .strip-item:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .steps, .features { grid-template-columns: 1fr; }
  .demo-cards { gap: 10px; }
  .demo-card { width: 50px; height: 74px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  .room-header { padding: 8px 10px; gap: 8px; }
  .room-logo { display: none; }
  .header-actions { gap: 4px; }
  /* Rótulos do cabeçalho ficam só para leitores de tela */
  .room-header .btn-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .room-header .btn-sm { width: 40px; padding: 0; }
  .volume { display: none; }
  .table-area { gap: 16px; padding: 22px 10px 8px; }
  .players-row { gap: 14px 6px; }
  .table { min-height: 140px; padding: 22px 20px; border-radius: 70px; }
  .stat-value { font-size: 21px; }
  .pname { font-size: 12px; }
  .deck-card { width: 48px; height: 74px; font-size: 17px; }
  .toast-area { top: 64px; }
}

@media (max-width: 560px) {
  /* Menu de arremesso vira "bottom sheet" */
  .throw-menu { left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; }
}

@media (max-height: 620px) {
  .table { min-height: 120px; }
  .table-area { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
}

/* ========================= Keyframes ========================= */

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes blink { 50% { opacity: .35; } }

@keyframes nudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 163, .55); transform: rotate(0); }
  15% { transform: rotate(-12deg); }
  30% { transform: rotate(10deg); }
  45% { transform: rotate(0); }
  70% { box-shadow: 0 0 0 10px rgba(0, 255, 163, 0); }
}

@keyframes underline { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@keyframes float { 50% { translate: 0 -14px; } }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-12px) rotate(6deg); }
}

@keyframes glide {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(18px, -10px) rotate(-6deg); }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes card-in {
  from { transform: scale(.8); }
  to { transform: scale(1); }
}

@keyframes splat-in {
  from { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(.2); }
  70% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1.12); }
  to { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1); }
}

@keyframes dart-in {
  0% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1.3); }
  40% { transform: translate(-50%, -50%) rotate(calc(var(--rot, 0deg) + 8deg)) scale(1); }
  70% { transform: translate(-50%, -50%) rotate(calc(var(--rot, 0deg) - 5deg)); }
  100% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); }
}

@keyframes fade-out { to { opacity: 0; } }

@keyframes board-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 163, .5); }
  100% { box-shadow: 0 0 0 12px rgba(0, 255, 163, 0); }
}

@keyframes bubble-up {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); }
  15% { opacity: 1; transform: translate(-50%, -6px) scale(1.1); }
  30% { transform: translate(-50%, -10px) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(.9); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
