/* =========================================================================
   STOP! — sistema visual "ficha de jogo"
   Papel + tinta + carimbo. Uma identidade de mesa de jogo, não de painel SaaS.
   ========================================================================= */

:root {
  color-scheme: light;

  --paper: #efe9db;
  --paper-deep: #e4dcc6;
  --surface: #fffdf6;
  --surface-2: #f4efe1;
  --surface-3: #ece4cf;
  --ink: #21232c;
  --muted: #6b6a63;
  --line: #d9cfb2;
  --line-strong: #c7b98f;

  --accent: #23408a;
  --accent-soft: #e4e9f5;
  --ochre: #a3650f;
  --ochre-soft: #f3e5cc;
  --plum: #6a4e8f;
  --plum-soft: #ece3f4;
  --forest: #2f6b46;
  --forest-soft: #e1ecdf;
  --stamp: #a3291f;
  --stamp-soft: #f3dfd7;
  --danger: #a3291f;

  --shadow-sm: 0 2px 6px rgba(33, 24, 10, .08);
  --shadow: 0 10px 24px rgba(33, 24, 10, .12);
  --shadow-lg: 0 20px 48px rgba(20, 14, 6, .18);
  --radius: 14px;
  --radius-sm: 9px;

  --font-display: 'Space Grotesk', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #16171c;
  --paper-deep: #101116;
  --surface: #1e2027;
  --surface-2: #262832;
  --surface-3: #2e3140;
  --ink: #efe9db;
  --muted: #9a988e;
  --line: #383a46;
  --line-strong: #474a59;

  --accent: #7f9aec;
  --accent-soft: #232a41;
  --ochre: #d99c4a;
  --ochre-soft: #362a17;
  --plum: #b79bdb;
  --plum-soft: #2c2438;
  --forest: #78c194;
  --forest-soft: #1c2c22;
  --stamp: #e2695b;
  --stamp-soft: #3a1f1b;
  --danger: #e2695b;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, .28);
  --shadow: 0 12px 28px rgba(0, 0, 0, .38);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, .5);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 1.5px 1.5px, rgba(33, 24, 10, .05) 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

html[data-theme="dark"] body {
  background-image: radial-gradient(circle at 1.5px 1.5px, rgba(255, 255, 255, .045) 1px, transparent 0);
}

button,
input,
select {
  font: inherit;
}

input::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
  opacity: 1;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.w-full {
  width: 100%;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -.01em;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 24px 16px 38px;
  flex: 1;
  position: relative;
  z-index: 1;
}

.page-main.wide {
  width: min(1000px, 100%);
}

/* ---------------------------- Hero (carimbo) ---------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(44px, 8vw, 76px) 16px clamp(30px, 5vw, 46px);
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.hero-letters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-letter {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 700;
  color: color-mix(in srgb, var(--ink) 6%, transparent);
  font-size: clamp(22px, 4vw, 42px);
  animation: float-letter 7s ease-in-out infinite;
}

.hero-title {
  position: relative;
  display: inline-block;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(52px, 11vw, 88px);
  line-height: .9;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--stamp);
  transform: rotate(-2.5deg);
  padding: .05em .18em;
  border: 4px solid var(--stamp);
  border-radius: 10px;
  animation: stamp-in .5s cubic-bezier(.2, .8, .2, 1) both;
}

.hero-title::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--stamp);
  border-radius: 6px;
  opacity: .55;
}

.hero-subtitle {
  position: relative;
  margin: 20px auto 0;
  font-size: clamp(14px, 2.2vw, 17px);
  font-weight: 600;
  color: var(--ink);
}

.hero-caption {
  position: relative;
  margin: 6px auto 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------------------------- Menu ---------------------------- */

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  position: relative;
}

.menu-grid.one-col {
  grid-template-columns: 1fr;
  max-width: 460px;
  margin: 0 auto;
}

.menu-grid.one-col .mode-card {
  padding: 26px;
}

.cta-card {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ochre);
  border-radius: var(--radius);
  padding: 34px 26px 28px;
  box-shadow: var(--shadow);
}

.cta-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--ochre);
  color: #fff;
  font-size: 34px;
  transform: rotate(-4deg);
  box-shadow: var(--shadow-sm);
}

.cta-card h2 {
  margin: 0 0 10px;
  font-size: 25px;
}

.cta-card p {
  margin: 0 auto;
  max-width: 340px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.cta-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0;
}

.pwa-install-wrap {
  width: min(460px, 100%);
  margin: 12px auto 0;
  text-align: center;
}

.btn-install {
  width: 100%;
  min-height: 44px;
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-install:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.pwa-install-control {
  touch-action: manipulation;
}

.cta-tag {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.cta-divider {
  position: relative;
  height: 1px;
  margin: 24px -26px 22px;
  background-image: repeating-linear-gradient(to right, var(--line-strong) 0 6px, transparent 6px 12px);
}

.btn-cta {
  background: var(--ochre);
  color: #fff;
}

.mode-copy {
  min-width: 0;
  flex: 1;
}

.mode-copy h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
}

.mode-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13.5px;
}

.mode-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.mode-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.mode-card.local {
  border-color: var(--line);
  border-top: 3px solid var(--accent);
}

.mode-card.online {
  border-color: var(--line);
  border-top: 3px solid var(--ochre);
}

.mode-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: white;
  flex: 0 0 52px;
}

.mode-card.local .mode-icon {
  background: var(--accent);
}

.mode-card.online .mode-icon {
  background: var(--ochre);
}

.mode-action {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  border-top: 1px dashed var(--line-strong);
}

.mode-card.online .mode-action {
  color: var(--ochre);
}

.pill-new {
  display: inline-block;
  font-size: 10px;
  background: var(--ochre);
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 5px;
  font-weight: 800;
  letter-spacing: .04em;
}

.app-footer {
  padding: 13px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.floating-tools {
  position: fixed;
  z-index: 100;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, border-color .12s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--ink);
}

.brand-mini .brand-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--stamp);
  color: white;
  font-weight: 700;
}

.back-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
}

.back-button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ---------------------------- Cartões (fichas de jogo) ---------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  font-weight: 700;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--line-strong);
}

.card-head>span {
  min-width: 0;
}

.compact-head .head-main,
.compact-head .head-side {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-head .head-main {
  flex: 1;
}

.compact-head .head-side {
  flex: 0 1 auto;
  text-align: right;
  font-weight: 600;
}

.card-head.emerald {
  color: var(--forest);
  background: var(--forest-soft);
}

.card-head.amber {
  color: var(--ochre);
  background: var(--ochre-soft);
}

.card-head.sky {
  color: var(--accent);
  background: var(--accent-soft);
}

.card-head.rose {
  color: var(--stamp);
  background: var(--stamp-soft);
}

.card-head.purple {
  color: var(--plum);
  background: var(--plum-soft);
}

.card-body {
  padding: 18px;
}

.card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.section-stack {
  display: grid;
  gap: 16px;
}

.input-row {
  display: flex;
  gap: 9px;
}

.field {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 13px;
  transition: border .15s, box-shadow .15s;
}

.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: 0;
}

.field:disabled {
  background: var(--surface-2);
  color: var(--ink);
  opacity: .86;
}

.field.code {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-weight: 700;
  text-align: center;
}

.field.error {
  border-color: var(--danger);
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  min-height: 44px;
  padding: 0 17px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .12s, filter .12s, background .12s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn:active:not(:disabled) {
  transform: scale(.98);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-primary {
  color: white;
  background: var(--accent);
}

.btn-purple {
  color: white;
  background: var(--plum);
}

.btn-danger {
  color: white;
  background: var(--stamp);
}

.btn-ghost {
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.btn-big {
  min-height: 54px;
  font-size: 15.5px;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-top: 12px;
}

.btn-icon {
  width: 44px;
  padding: 0;
  flex: 0 0 44px;
}

.player-list {
  display: grid;
  gap: 8px;
}

.player-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.player-row .status-dot {
  flex: 0 0 auto;
}

.player-row .avatar {
  flex: 0 0 auto;
}

.player-row .player-name {
  flex: 1 1 140px;
  min-width: 0;
}

.player-row .host-badge,
.player-row .ready-badge,
.player-row .wait-badge {
  flex: 0 0 auto;
  margin-left: auto;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  flex: 0 0 auto;
  font-family: var(--font-display);
}

.player-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
}

.player-name strong {
  display: block;
  font-size: 15px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.player-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
}

.remove-player {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
}

.remove-player:hover {
  color: var(--danger);
  background: var(--stamp-soft);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  display: block;
}

.status-dot.on {
  background: var(--forest);
  box-shadow: 0 0 0 3px var(--forest-soft);
}

.ready-badge {
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  background: var(--forest-soft);
  color: var(--forest);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.wait-badge {
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  background: var(--ochre-soft);
  color: var(--ochre);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.host-badge {
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  background: var(--plum-soft);
  color: var(--plum);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 11px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}

.category-chip.active {
  background: var(--ochre);
  color: white;
  border-color: var(--ochre);
}

.category-chip:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.option {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.option.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.round-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.round-picker button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  background: var(--surface);
  color: var(--stamp);
}

.round-number {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--stamp);
  min-width: 44px;
  text-align: center;
}

/* ---------------------------- Jogo em si ---------------------------- */

.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.round-badge {
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.score-avatars {
  display: flex;
  justify-content: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.score-avatars::-webkit-scrollbar {
  display: none;
}

.avatar-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  opacity: .45;
  transform: scale(.92);
  transition: .16s;
}

.avatar-button.active {
  opacity: 1;
  transform: scale(1.06);
}

.avatar-button .avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.avatar-score {
  display: block;
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  margin-top: 2px;
  font-weight: 700;
}

.timer {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  min-width: 58px;
  justify-content: flex-end;
}

.timer.warning {
  color: var(--ochre);
}

.timer.urgent {
  color: var(--stamp);
  animation: pulse .65s infinite;
}

.timer-track {
  height: 4px;
  background: var(--line);
}

.timer-fill {
  height: 100%;
  background: var(--accent);
  transition: width .45s linear, background .2s;
}

.timer-fill.warning {
  background: var(--ochre);
}

.timer-fill.urgent {
  background: var(--stamp);
}

.letter-stage {
  text-align: center;
  padding: 22px 0 16px;
}

.letter-box {
  width: 84px;
  height: 84px;
  margin: 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  border: 2px solid var(--line-strong);
  box-shadow: inset 0 0 0 4px var(--surface), 0 4px 0 var(--line-strong);
  animation: tile-in .3s both;
}

.turn-label {
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 12px;
  color: var(--muted);
}

.answer-list {
  display: grid;
  gap: 9px;
}

.answer-row {
  display: grid;
  grid-template-columns: 26px minmax(96px, 140px) 1fr;
  gap: 9px;
  align-items: center;
}

.answer-index {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.answer-index.filled {
  color: white;
  background: var(--forest);
  border-color: var(--forest);
}

.answer-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.answer-row .field {
  height: 42px;
}

.game-actions {
  position: sticky;
  bottom: 0;
  padding: 15px 0 calc(15px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 78%, transparent);
}

.stop-button {
  width: 100%;
  min-height: 60px;
  border: 3px solid var(--stamp);
  border-radius: 12px;
  background: transparent;
  color: var(--stamp);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .14em;
  cursor: pointer;
  transition: transform .1s, background .12s, color .12s;
}

.stop-button:hover:not(:disabled) {
  background: var(--stamp);
  color: white;
}

.stop-button:active:not(:disabled) {
  transform: scale(.98) rotate(-.5deg);
}

.stop-button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.filled-summary {
  text-align: center;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.countdown-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--paper);
  text-align: center;
}

.countdown-number {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto;
  background: var(--surface);
  color: var(--stamp);
  font-family: var(--font-display);
  font-size: 92px;
  line-height: 1;
  font-weight: 700;
  border: 4px solid var(--stamp);
  animation: count-pop .72s infinite;
}

.countdown-letter {
  margin-top: 22px;
  font-weight: 700;
  color: var(--muted);
}

.countdown-letter strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 22px;
}

.online-join-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.join-choice {
  padding: 22px;
}

.join-choice h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.join-choice p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.join-form {
  display: grid;
  gap: 10px;
}

.join-card-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.join-card-copy {
  min-width: 0;
}

.join-card-copy h2 {
  margin: 0 0 6px;
}

.join-card-copy p {
  margin: 0;
}

/* ---------------------------- Ficha da sala (ticket) ---------------------------- */

.room-code-box {
  position: relative;
  text-align: center;
  padding: 24px 18px;
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  border-radius: var(--radius);
}

.room-code-box::before,
.room-code-box::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper);
  transform: translateY(-50%);
}

.room-code-box::before {
  left: -10px;
}

.room-code-box::after {
  right: -10px;
}

.room-code-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.room-code {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--plum);
  margin: 6px 0 10px;
}

.copy-button {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 6px 12px;
  background: var(--surface);
  color: var(--plum);
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}

.stop-alert {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 12, 8, .68);
  backdrop-filter: blur(6px);
}

.stop-alert-card {
  width: min(380px, 100%);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--stamp);
  transform: rotate(-1deg);
}

.stop-alert-icon {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin: 0 auto 15px;
  border: 3px solid var(--stamp);
  color: var(--stamp);
  font-size: 36px;
}

.stop-alert-card h2 {
  margin: 0;
  font-size: 26px;
  color: var(--stamp);
  font-family: var(--font-display);
  letter-spacing: .04em;
}

.stop-alert-card p {
  color: var(--muted);
}

.stop-alert-count {
  font-size: 56px;
  font-weight: 700;
  color: var(--stamp);
  font-family: var(--font-display);
}

.validation-player {
  margin-bottom: 18px;
}

.validation-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-weight: 700;
}

.validation-columns,
.vote-row {
  display: grid;
  grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.validation-columns {
  padding: 0 0 7px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.validation-columns span:last-child {
  justify-self: end;
  padding-right: 2px;
}

.vote-row {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.vote-category {
  min-width: 0;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.vote-word {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.vote-actions {
  display: flex;
  gap: 5px;
  justify-self: end;
  flex-shrink: 0;
}

.vote-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
  font-size: 15px;
  color: var(--ink);
}

.vote-btn.approve.active {
  background: var(--forest-soft);
  color: var(--forest);
  border-color: var(--forest);
}

.vote-btn.reject.active {
  background: var(--stamp-soft);
  color: var(--stamp);
  border-color: var(--stamp);
}

.waiting-panel {
  text-align: center;
  padding: 34px 18px;
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--plum);
  animation: spin .8s linear infinite;
  margin: 0 auto 15px;
}

.score-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.score-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}

.score-table th,
.score-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 12px;
  width: 104px;
}

.score-table th:first-child,
.score-table td:first-child {
  width: 118px;
}

.score-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 10.5px;
  position: sticky;
  top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-table td:first-child {
  font-weight: 700;
  white-space: normal;
  word-break: break-word;
}

.score-word {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.score-word span:first-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.points {
  font-weight: 800;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.points.good {
  color: var(--forest);
}

.points.half {
  color: var(--ochre);
}

.points.zero {
  color: var(--stamp);
}

.round-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.round-player-score {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.round-player-score strong {
  display: block;
  font-size: 18px;
  margin-top: 4px;
  font-family: var(--font-display);
}

/* ---------------------------- Pódio ---------------------------- */

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  min-height: 225px;
  padding: 24px 5px 8px;
}

.podium-item {
  width: min(148px, 31%);
  text-align: center;
}

.podium-avatar {
  width: 54px;
  height: 54px;
  margin: 0 auto 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 20px;
  font-family: var(--font-display);
}

.podium-name {
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.podium-score {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 7px;
  font-family: var(--font-mono);
}

.podium-step {
  border-radius: 6px 6px 2px 2px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-display);
}

.podium-item.first .podium-step {
  height: 110px;
  background: #b8862a;
}

.podium-item.second .podium-step {
  height: 80px;
  background: #8a8f97;
}

.podium-item.third .podium-step {
  height: 60px;
  background: #9c5a34;
}

.ranking-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.rank-row {
  display: grid;
  grid-template-columns: 32px 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.rank-number {
  font-weight: 800;
  color: var(--muted);
  text-align: center;
  font-family: var(--font-mono);
}

.rank-score {
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
}

.lobby-stack {
  display: grid;
  gap: 16px;
}

.action-stack {
  display: grid;
  gap: 12px;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.mini-stat {
  padding: 11px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.mini-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  margin-bottom: 5px;
}

.mini-stat-value {
  display: block;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--font-display);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.info-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-align: left;
}

.info-card strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.25;
}

.info-card .mini-stat-label {
  margin-bottom: 4px;
}

.quick-note {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  font-size: 12px;
  color: var(--muted);
}

.room-code-box .copy-button {
  margin-top: 4px;
}

body[data-view="online-lobby"] .page-main,
body[data-view="online-playing"] .page-main,
body[data-view="online-validating"] .page-main,
body[data-view="online-scoring"] .page-main,
body[data-view="online-gameOver"] .page-main {
  width: min(540px, 100%);
}

body[data-view="online-join"] .page-main {
  width: min(960px, 100%);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 18px 8px;
  font-size: 13px;
}

.help {
  margin: 8px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 15px 0;
}

.toast-root {
  position: fixed;
  z-index: 200;
  right: 16px;
  top: 16px;
  display: grid;
  gap: 9px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 600;
  animation: slide-in .22s both;
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.warning {
  border-left-color: var(--ochre);
}

@keyframes stamp-in {
  from {
    opacity: 0;
    transform: scale(1.3) rotate(-2.5deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(-2.5deg);
  }
}

@keyframes tile-in {
  from {
    opacity: 0;
    transform: scale(.7) rotate(-8deg);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(35px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes float-letter {

  0%,
  100% {
    transform: translateY(8px) rotate(-2deg);
    opacity: .5;
  }

  50% {
    transform: translateY(-8px) rotate(2deg);
    opacity: 1;
  }
}

@keyframes pulse {
  50% {
    transform: scale(1.06);
  }
}

@keyframes count-pop {
  0% {
    transform: scale(.85);
    opacity: .7;
  }

  55% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(.96);
    opacity: .9;
  }
}

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

@media (prefers-reduced-motion: reduce) {

  .hero-letter,
  .hero-title,
  .letter-box,
  .stop-alert-card,
  .countdown-number {
    animation: none !important;
  }
}

@media (max-width: 720px) {

  .menu-grid,
  .online-join-grid {
    grid-template-columns: 1fr;
  }

  .lobby-stack {
    gap: 14px;
  }

  .mode-card {
    padding: 16px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .page-main {
    padding-top: 18px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero {
    padding-top: 44px;
    padding-bottom: 36px;
  }

  .answer-row {
    grid-template-columns: 26px minmax(82px, 105px) 1fr;
    gap: 7px;
  }

  .topbar-inner {
    padding-left: 9px;
    padding-right: 9px;
  }

  .compact-head {
    gap: 10px;
  }

  .compact-head .head-main,
  .compact-head .head-side {
    font-size: 13px;
  }

  .brand-mini span:last-child {
    display: none;
  }

  .validation-columns,
  .vote-row {
    grid-template-columns: minmax(72px, 30%) minmax(0, 1fr) auto;
    gap: 7px;
  }

  .vote-actions {
    grid-column: auto;
    justify-self: end;
  }

  .room-code {
    font-size: 29px;
  }

  .player-row {
    padding: 11px;
    gap: 8px 10px;
  }

  .join-card-hero {
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .cta-card {
    padding: 26px 18px 22px;
  }

  .cta-divider {
    margin: 20px -18px 18px;
  }

  .cta-icon {
    width: 62px;
    height: 62px;
    font-size: 28px;
    border-radius: 15px;
  }

  .cta-card h2 {
    font-size: 21px;
  }

  .hero-title {
    font-size: 44px;
  }

  .mode-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 20px;
    border-radius: 10px;
  }

  .mode-copy h2 {
    font-size: 19px;
  }

  .info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-strip {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .player-row .player-name {
    flex-basis: 100px;
  }

  .compact-head {
    gap: 8px;
  }

  .compact-head .head-main,
  .compact-head .head-side {
    font-size: 12.5px;
  }

  .room-code-box {
    padding: 20px 16px;
  }

  .mini-stat {
    padding: 10px 11px;
  }

  .copy-button {
    width: 100%;
    justify-content: center;
  }

  .join-card-hero {
    gap: 12px;
  }

  .join-card-hero .mode-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 0;
    flex: 0 0 52px;
  }

  .card-body {
    padding: 14px;
  }

  .card-head {
    padding: 11px 14px;
  }

  .validation-columns,
  .vote-row {
    grid-template-columns: minmax(62px, 29%) minmax(0, 1fr) auto;
    gap: 5px;
  }

  .validation-columns {
    font-size: 8.5px;
    letter-spacing: .035em;
  }

  .vote-category {
    font-size: 10px;
    line-height: 1.2;
  }

  .vote-word {
    font-size: 12.5px;
  }

  .vote-actions {
    gap: 4px;
  }

  .vote-btn {
    width: 31px;
    height: 31px;
    border-radius: 7px;
  }

  .answer-label {
    font-size: 10.5px;
  }

  .answer-row {
    grid-template-columns: 24px 86px minmax(0, 1fr);
    gap: 6px;
  }

  .field {
    padding-left: 10px;
    padding-right: 10px;
  }

  .game-top {
    gap: 5px;
  }

  .round-badge {
    padding: 4px 7px;
    font-size: 10px;
  }

  .score-avatars {
    max-width: 155px;
  }

  .timer {
    font-size: 18px;
    min-width: 50px;
  }

  .letter-box {
    width: 72px;
    height: 72px;
    font-size: 36px;
  }
}