@import url("https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;500;600;700&family=Roboto+Condensed:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
  --balatro-felt: #1e5c42;
  --balatro-felt-deep: #0f2e22;
  --balatro-panel: #161210;
  --balatro-panel-mid: #221a16;
  --balatro-border: #4a3828;
  --balatro-border-light: #6b5340;
  --balatro-red: #eb3b4f;
  --balatro-red-dark: #8b1e2b;
  --balatro-gold: #f5c842;
  --balatro-gold-dark: #a67c12;
  --balatro-cream: #fff4dc;
  --balatro-cream-muted: #b8a078;
  --balatro-teal: #3ecfad;

  --text-shadow-red: color-mix(in srgb, var(--balatro-red-dark) 60%, #000);
  --text-shadow-gold: color-mix(in srgb, var(--balatro-gold-dark) 60%, #000);
  --text-shadow-glow-red: rgba(141, 35, 47, 0.45);

  --bg: #000000;
  --surface: var(--balatro-panel);
  --surface-2: var(--balatro-panel-mid);
  --border: var(--balatro-border);
  --text: var(--balatro-cream);
  --muted: var(--balatro-cream-muted);
  --accent: var(--balatro-red);
  --accent-2: var(--balatro-gold);
  --green: #6ee07a;
  --radius: 8px;
  --font: "Roboto Condensed", "Segoe UI", sans-serif;
  --font-display: "Pixelify Sans", cursive;
  --lan-accent: var(--balatro-gold);
  --shadow-chunky: 0 4px 0 rgba(0, 0, 0, 0.45);
  --shadow-inset: inset 0 1px 0 rgba(255, 244, 220, 0.07);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #000;
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font);
  background: #000;
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--lan-vh, 100dvh);
  position: relative;
}

body.lan-crt-on::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.62) 100%);
}

body.lan-crt-on::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.035;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.45) 2px,
    rgba(0, 0, 0, 0.45) 4px
  );
}

a {
  color: var(--balatro-teal);
  text-decoration-color: rgba(62, 207, 173, 0.45);
}

.lan-app {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.lan-header { margin-bottom: 24px; }
.lan-header--center { text-align: center; }

.lan-back {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.9rem;
  text-decoration: none;
}

.lan-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.lan-title--sm { font-size: 1.1rem; }

.lan-header--brand { text-align: center; }

.lan-header__tools {
  margin: 14px 0 0;
}

.lan-header__tools .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* Barra fixa: início + fazedor de decks (+ APK no navegador) */
.lan-nav-bar {
  position: sticky;
  top: 0;
  z-index: 9000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(6, 8, 14, 0.96);
  border-bottom: 1px solid rgba(255, 244, 220, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lan-nav-bar__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 244, 220, 0.18);
  white-space: nowrap;
}

.lan-nav-bar__link:hover {
  border-color: var(--accent-2);
  background: rgba(76, 143, 232, 0.12);
}

.lan-nav-bar__link--home {
  border-color: rgba(76, 143, 232, 0.35);
  color: var(--accent-2);
}

.lan-nav-bar__link--apk {
  border-color: rgba(245, 197, 24, 0.35);
  color: var(--accent);
}

.lan-nav-bar__link--leave {
  border-color: rgba(232, 93, 76, 0.45);
  color: #ff8a7a;
  background: rgba(232, 93, 76, 0.1);
  cursor: pointer;
  font: inherit;
}

.lan-nav-bar__link--leave:hover {
  border-color: #e85d4c;
  background: rgba(232, 93, 76, 0.2);
}

button.lan-nav-bar__link {
  appearance: none;
  -webkit-appearance: none;
}

body.lan-has-nav-bar #hostToolsRow {
  display: none;
}

body.lan-has-nav-bar.lan-body--playing .lan-nav-bar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  padding-top: max(4px, env(safe-area-inset-top));
  padding-bottom: 4px;
  gap: 6px;
}

body.lan-has-nav-bar.lan-body--playing .lan-nav-bar__link {
  padding: 5px 10px;
  font-size: 0.72rem;
}

body.lan-has-nav-bar.lan-body--playing .lan-app {
  padding-top: calc(max(6px, env(safe-area-inset-top)) + 40px);
}

body.lan-has-nav-bar.lan-body--playing .lan-reveal-overlay__panel {
  padding-top: max(20px, calc(env(safe-area-inset-top) + 8px));
}

body.lan-has-nav-bar:not(.lan-body--launcher) .lan-app {
  padding-top: 4px;
}

/* legado — mesmas regras se alguma página antiga ainda usar a classe */
.lan-global-tools {
  position: sticky;
  top: 0;
  z-index: 9000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(6, 8, 14, 0.96);
  border-bottom: 1px solid rgba(255, 244, 220, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lan-global-tools__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 244, 220, 0.18);
  white-space: nowrap;
}

.lan-global-tools__link:hover {
  border-color: var(--accent-2);
  background: rgba(76, 143, 232, 0.12);
}

.lan-global-tools__link--apk {
  border-color: rgba(245, 197, 24, 0.35);
  color: var(--accent);
}

body.lan-has-global-tools #hostToolsRow {
  display: none;
}

body.lan-has-global-tools.lan-body--playing .lan-global-tools {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  padding-top: max(4px, env(safe-area-inset-top));
  padding-bottom: 4px;
  gap: 6px;
}

body.lan-has-global-tools.lan-body--playing .lan-global-tools__link {
  padding: 5px 10px;
  font-size: 0.72rem;
}

body.lan-has-global-tools.lan-body--playing .lan-app {
  padding-top: calc(max(6px, env(safe-area-inset-top)) + 40px);
}

body.lan-has-global-tools.lan-body--playing .lan-reveal-overlay__panel {
  padding-top: max(20px, calc(env(safe-area-inset-top) + 8px));
}

.lan-ready-tag {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--green);
}

.lan-expansion-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.lan-expansion-upload .lan-pdf-list {
  margin: 0;
}

.lan-deck-sources {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lan-deck-sources__empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 8px 0;
}

.lan-deck-sources__item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.lan-deck-sources__item--off {
  opacity: 0.55;
}

.lan-deck-sources__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.lan-deck-sources__toggle {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.lan-deck-sources__body {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.35;
}

.lan-deck-sources__meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.lan-deck-sources--readonly .lan-deck-sources__item {
  font-size: 0.88rem;
}

.lan-deck-sources__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.lan-deck-sources--gameover {
  margin-top: 8px;
}

.lan-gameover__steals {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: left;
}

.lan-gameover__steal-title {
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.lan-gameover__steal-hint {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.lan-reconnect {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.lan-pdf-zones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}

@media (max-width: 500px) {
  .lan-pdf-zones { grid-template-columns: 1fr; }
}

.lan-pdf-zone {
  padding: 14px;
  border-radius: 10px;
  border: 2px dashed var(--border);
}

.lan-pdf-zone--black { border-color: #444; background: rgba(0,0,0,0.25); }
.lan-pdf-zone--white { border-color: #666; background: rgba(255,255,255,0.05); }

.lan-pdf-zone h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.lan-pdf-list {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  font-size: 0.7rem;
  color: var(--muted);
  max-height: 80px;
  overflow-y: auto;
}

.lan-pdf-list li {
  padding: 2px 0;
  word-break: break-all;
}

.lan-expansion-log {
  margin-top: 8px;
  max-height: 120px;
}

.lan-expansion-log:empty {
  display: none;
}

.lan-hint a {
  color: var(--accent-2);
}

.lan-gameover {
  text-align: center;
  padding: 32px 16px;
}

.lan-gameover h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  color: var(--accent-2);
}

.lan-gameover__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 280px;
  margin: 20px auto 0;
}

.lan-gameover__hint {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

.lan-sub-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.lan-body--host {
  background: #000;
}

.lan-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.lan-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.lan-emoji { font-size: 2.5rem; display: block; margin-bottom: 8px; }

.lan-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.lan-panel h2 {
  margin: 20px 0 10px;
  font-size: 1rem;
}

.lan-panel h2:first-child { margin-top: 0; }

.lan-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 12px 0 6px;
}

.lan-input,
.lan-textarea {
  width: 100%;
  font: inherit;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.lan-textarea { resize: vertical; min-height: 80px; }

.lan-input { text-transform: uppercase; letter-spacing: 0.1em; }

.btn {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
}

.btn--block { width: 100%; margin-top: 12px; }
.btn--sm { padding: 8px 12px; font-size: 0.85rem; margin-top: 8px; }

.btn--primary { background: var(--accent); color: var(--balatro-cream); }
.btn--secondary { background: var(--accent-2); color: #2a1808; }
.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.lan-error { color: var(--accent); font-size: 0.9rem; }
.lan-status { color: var(--muted); font-size: 0.85rem; margin: 10px 0; }
.lan-hint { color: var(--muted); font-size: 0.8rem; margin: 8px 0 0; }
.lan-leave-btn { margin-top: 16px; opacity: 0.85; }
.lan-paused { text-align: center; padding: 16px 0; }
.lan-input--name { text-transform: none; letter-spacing: 0; margin-bottom: 12px; }
.lan-bday-row { display: flex; gap: 10px; margin-bottom: 12px; }
.lan-bday-input { flex: 1; min-width: 0; }
.lan-hint--profile { margin-bottom: 12px; }
.lan-ip-pick { display: block; margin: 10px 0 0; font-size: 0.85rem; color: var(--muted); }
.lan-ip-select { margin-top: 6px; width: 100%; max-width: 320px; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: inherit; }
.lan-hint--center { text-align: center; }

.lan-qr-block {
  text-align: center;
  margin-bottom: 20px;
}

.lan-qr {
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  max-width: 100%;
}

.lan-room-code { font-size: 1.1rem; margin: 12px 0 4px; }
.lan-url {
  font-size: 0.75rem;
  word-break: break-all;
  color: var(--muted);
  margin: 0;
}

.lan-players {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lan-players li {
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.lan-decks { display: flex; flex-direction: column; gap: 4px; }

.lan-deck-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.lan-deck-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: monospace;
}

.lan-details {
  margin: 8px 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.lan-details summary {
  cursor: pointer;
  margin-bottom: 8px;
  color: var(--accent-2);
}

.lan-cards--images {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.lan-wait {
  text-align: center;
  font-size: 1.1rem;
  margin: 0 0 16px;
}

.lan-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  align-items: center;
}

.lan-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

button.lan-pill,
button.lan-seat__pts {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button.lan-pill--score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
}

button.lan-pill--score .lan-pill__name {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

button.lan-pill--score .lan-pill__pts {
  font-weight: 800;
  min-width: 1.2em;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 1px 5px;
  border-radius: 6px;
}

.lan-pill--meta {
  font-size: 0.72rem;
  padding: 4px 8px;
  color: var(--muted);
}

button.lan-pill--score:hover,
button.lan-seat__pts--btn:hover {
  border-color: var(--accent-2);
  background: rgba(76, 143, 232, 0.1);
}

button.lan-pill--score:active,
button.lan-seat__pts--btn:active {
  transform: scale(0.98);
}

.lan-pill--leader { border-color: var(--accent); }
.lan-pill--you { border-color: var(--accent-2); }

.lan-phase-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.lan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.lan-card {
  border: none;
  border-radius: 8px;
  padding: 8px 8px 10px;
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  text-align: left;
  line-height: 1.25;
  cursor: pointer;
  min-height: 100px;
  transition: transform 0.1s;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  position: relative;
}

.lan-card:active { transform: scale(0.98); }

.lan-card--black {
  background: #111;
  color: #fff;
}

.lan-card--white {
  background: #fff;
  color: #111;
}

.lan-card--pick-black {
  position: relative;
  cursor: pointer;
}

.lan-card--image {
  padding: 0;
  min-height: 0;
  aspect-ratio: 63.5 / 88.9;
  background: transparent;
}

.lan-card--image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.lan-card--disabled {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.lan-card--played { opacity: 0.35; pointer-events: none; }

.lan-card--selected {
  outline: 3px solid var(--lan-accent, #f5c518);
  outline-offset: 2px;
}

/* Legacy badge (mantido se algum HTML antigo ainda usar) */
.lan-card-pick-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #fff;
  color: #111;
  pointer-events: none;
}

/* Ícone “Escolha N” — canto inferior esquerdo da preta (estilo CAH) */
.lan-card-pick-icon {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  line-height: 1;
}

.lan-card-pick-icon__boxes {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.lan-card-pick-icon__box {
  width: 9px;
  height: 9px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.lan-card-pick-icon__label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
}

.lan-card--black:has(.lan-card-pick-icon):not(.lan-card--image) {
  padding-bottom: 22px;
}

.lan-card--xl .lan-card-pick-icon__box {
  width: 12px;
  height: 12px;
}

.lan-card--xl .lan-card-pick-icon__label {
  font-size: 0.72rem;
}

.lan-card--lg .lan-card-pick-icon__box {
  width: 10px;
  height: 10px;
}

.lan-card--lg .lan-card-pick-icon__label {
  font-size: 0.64rem;
}

.lan-table__sub-item--multi {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
}

.lan-table__sub-item--multi .lan-card {
  flex: 0 0 auto;
}

.lan-table__sub-item--multi .lan-card + .lan-card {
  margin-left: -12px;
  z-index: 1;
}

.lan-table__sub-item--multi .lan-card:nth-child(2) { z-index: 2; }
.lan-table__sub-item--multi .lan-card:nth-child(3) { z-index: 3; }

.lan-table__sub-item--multi .lan-card.lan-card--table {
  width: 96px;
  max-width: 96px;
}

.lan-landing-cards {
  display: grid;
  gap: 16px;
}

.lan-landing-card {
  display: block;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.lan-landing-card:hover { border-color: var(--accent-2); }

.lan-landing-card__icon { font-size: 2rem; display: block; margin-bottom: 8px; }

.lan-landing-card h2 { margin: 0 0 6px; font-size: 1.15rem; }
.lan-landing-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.lan-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 100;
  max-width: 90%;
  text-align: center;
}

/* Launcher (splash PC) */
.lan-body--launcher {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--lan-vh, 100dvh);
  background: radial-gradient(ellipse at 50% 0%, #1a2030 0%, var(--bg) 55%);
}

.lan-launcher {
  width: min(400px, 92vw);
  padding: 32px 24px;
  text-align: center;
}

.lan-launcher__cards {
  position: relative;
  width: 120px;
  height: 90px;
  margin: 0 auto 20px;
}

.lan-launcher__card {
  position: absolute;
  width: 64px;
  height: 88px;
  border-radius: 8px;
  border: 2px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.lan-launcher__card--black {
  background: linear-gradient(145deg, #1a1a1a, #000);
  left: 8px;
  top: 0;
  transform: rotate(-8deg);
}

.lan-launcher__card--white {
  background: linear-gradient(145deg, #fff, #e8e8e8);
  right: 8px;
  top: 4px;
  transform: rotate(8deg);
}

.lan-launcher__status { margin-top: 28px; }

.lan-launcher__spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: lan-spin 0.8s linear infinite;
}

@keyframes lan-spin { to { transform: rotate(360deg); } }

.lan-launcher__text {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.lan-launcher__bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.lan-launcher__bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}

.lan-launcher__bar-fill--error { background: var(--accent); }

.lan-launcher__error { margin-top: 16px; }

/* Mesa de jogo */
.lan-body--playing .lan-app { max-width: 1100px; }

.lan-game-view { min-height: 280px; }

.lan-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.lan-table__meta {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.lan-table__top {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(200px, 3fr) minmax(72px, 1fr);
  gap: 12px;
  align-items: end;
  min-height: 200px;
  padding: 14px 8px 18px;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, 0.45) 0%, transparent 62%),
    radial-gradient(ellipse at 50% 100%, var(--balatro-felt-deep) 0%, transparent 72%);
  border: 1px solid rgba(255, 244, 220, 0.07);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.28);
}

.lan-table__center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.lan-table__on-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.lan-card--table-black.lan-card--table {
  max-width: 200px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.lan-table__submissions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 100%;
}

.lan-table__sub-item {
  position: relative;
  display: inline-flex;
  vertical-align: top;
}

.lan-table__sub-item .lan-card--table {
  width: 120px;
  min-height: 0;
}

.lan-table__piles-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.lan-deck-pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 4px;
  color: inherit;
  font: inherit;
}

.lan-deck-pile--clickable {
  cursor: pointer;
}

.lan-deck-pile--clickable:hover .lan-deck-pile__stack {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.lan-deck-pile:disabled {
  cursor: default;
  opacity: 1;
}

.lan-deck-pile__label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.lan-deck-pile__stack {
  position: relative;
  width: 56px;
  height: 78px;
}

.lan-deck-pile__layer {
  position: absolute;
  inset: 0;
  transform: translate(calc(var(--i) * 2px), calc(var(--i) * -2px));
}

.lan-deck-pile__layer .lan-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  cursor: default;
}

.lan-deck-pile__count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 999px;
}

.lan-deck-pile--empty { opacity: 0.35; }

.lan-table__play { padding-top: 8px; }

.lan-cards--hand {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

/* Mão: grid que cabe na área (JS define cols + --strip-card-w/h) */
.lan-cards.lan-hand-grid {
  display: grid;
  grid-template-columns: repeat(var(--hand-cols, 4), var(--strip-card-w, 110px));
  justify-content: center;
  align-content: center;
  align-items: stretch;
  justify-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  padding: 2px 0 4px;
  overflow: hidden;
  box-sizing: border-box;
}

.lan-hand-grid > .lan-card {
  flex: none;
  width: var(--strip-card-w, 110px);
  min-width: 0;
  max-width: var(--strip-card-w, 110px);
  height: auto;
  max-height: var(--strip-card-h, none);
  min-height: 0;
  aspect-ratio: 63.5 / 88.9;
  padding: 7px 6px;
  font-size: clamp(0.62rem, calc(var(--strip-card-w, 110px) * 0.112), 0.88rem);
  line-height: 1.2;
  transform: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  word-break: break-word;
  position: relative;
  box-sizing: border-box;
}

.lan-hand-grid > .lan-card.lan-card--image {
  padding: 0;
}

.lan-hand-grid > .lan-card.lan-card--selected,
.lan-hand-grid > .lan-card:focus-visible {
  transform: translateY(-3px);
  z-index: 40;
  outline: 2px solid var(--accent, #f5c518);
  outline-offset: 2px;
}

/* Legado strip (respostas / fallback) */
.lan-cards.lan-hand-strip {
  display: flex;
  flex-wrap: nowrap;
  grid-template-columns: unset;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  width: 100%;
  min-height: 0;
  max-width: none;
  padding: 2px 0 4px;
  overflow: hidden;
}

.lan-hand-strip > .lan-card {
  flex: 0 0 auto;
  flex-basis: var(--strip-card-w, 110px);
  width: var(--strip-card-w, 110px);
  min-width: var(--strip-card-w, 110px);
  min-height: 0;
  aspect-ratio: 63.5 / 88.9;
  height: auto;
  max-height: var(--strip-card-h, none);
  padding: 8px 7px;
  font-size: clamp(0.65rem, calc(var(--strip-card-w, 110px) * 0.115), 0.88rem);
  line-height: 1.22;
  transform: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  word-break: break-word;
  position: relative;
}

.lan-hand-strip > .lan-card + .lan-card {
  margin-left: var(--strip-overlap, 0px);
}

.lan-hand-strip > .lan-card.lan-card--image {
  padding: 0;
  width: var(--strip-card-w, 96px);
  min-width: var(--strip-card-w, 96px);
}

.lan-hand-strip > .lan-card.lan-card--selected,
.lan-hand-strip > .lan-card:focus-visible {
  transform: translateY(-4px);
  z-index: 40 !important;
}

.lan-hand-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
  position: sticky;
  bottom: 8px;
  z-index: 130;
  padding: 8px 0;
}

.lan-hand-actions .btn {
  min-width: 120px;
  flex: 1 1 auto;
  max-width: 200px;
}

.lan-reveal-overlay__skip .lan-reveal-skip-btn {
  display: none;
}

.lan-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.lan-input-row .lan-input {
  flex: 1 1 auto;
  min-width: 0;
}

.lan-input-row .btn {
  flex: 0 0 auto;
  align-self: stretch;
  min-width: 52px;
  padding-inline: 12px;
}

.lan-reveal-overlay__skip {
  margin-top: 12px;
  padding-top: 0;
  background: none;
  position: static;
}

.lan-reveal-skip-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.lan-reveal-skip-btn {
  min-height: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

@media (min-width: 700px) {
  .lan-cards--hand {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

.lan-card--lg {
  min-height: 120px;
}

.lan-card--lg.lan-card--image,
.lan-card--table.lan-card--lg {
  width: 100%;
  max-width: 200px;
}

.lan-card--xl {
  min-height: 0;
}

.lan-card--xl.lan-card--image,
.lan-card--table.lan-card--xl {
  width: 100%;
  max-width: min(280px, 42vw);
}

.lan-round-reveal {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  padding: 8px 4px;
}

.lan-round-reveal .lan-card--xl {
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}

.lan-phase-title--reveal {
  text-align: center;
  font-size: 1.15rem;
  margin-top: 4px;
}

.lan-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  overflow: hidden;
  background: rgba(6, 8, 14, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  animation: lan-reveal-fade-in 0.25s ease-out;
}

@keyframes lan-reveal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lan-body--reveal {
  overflow: hidden;
}

.lan-reveal-overlay__panel {
  width: min(560px, 100%);
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
  max-height: calc(var(--lan-vh, 100dvh) - 72px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 14px 12px 10px;
  padding-top: max(14px, env(safe-area-inset-top));
  margin: 0 auto;
  background: var(--surface);
  border: none;
  border-bottom: 1px solid rgba(255, 244, 220, 0.08);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.45);
  animation: lan-reveal-pop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-sizing: border-box;
}

.lan-reveal-skip-bar-fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100001;
  width: 100%;
  padding: 12px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: rgba(8, 10, 16, 0.98);
  border-top: 2px solid rgba(245, 197, 24, 0.45);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.55);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.lan-reveal-skip-bar-fixed .lan-reveal-skip-btn {
  min-height: 56px;
  font-size: 1.05rem;
  font-weight: 800;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.lan-reveal-overlay__skip-bar {
  flex-shrink: 0;
  width: min(560px, 100%);
  padding: 10px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(8, 10, 16, 0.98);
  border-top: 1px solid rgba(255, 244, 220, 0.14);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 2;
}

.lan-reveal-overlay__skip-bar .lan-reveal-skip-btn {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 800;
}

@keyframes lan-reveal-pop {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.lan-reveal-overlay__title {
  margin: 0 0 10px;
  font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  line-height: 1.25;
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
}

.lan-reveal-overlay__phrase {
  margin: 0 0 10px;
  padding: 12px 12px;
  background: #0d0d0d;
  color: #f2f2f2;
  border-radius: 12px;
  font-size: clamp(0.95rem, 3.8vw, 1.2rem);
  line-height: 1.45;
  text-align: left;
  font-weight: 600;
  border: 2px solid #1f1f1f;
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
  word-break: break-word;
  hyphens: auto;
}

.lan-reveal-overlay__phrase--visual,
.lan-reveal-overlay__phrase--missing {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted, #aaa);
  font-weight: 500;
  background: rgba(245, 197, 24, 0.08);
  border-style: dashed;
  border-color: rgba(245, 197, 24, 0.35);
}

.lan-reveal-overlay__phrase--missing strong,
.lan-reveal-overlay__phrase--missing em {
  color: var(--accent, #f5c518);
}

.lan-phrase-answer {
  display: inline;
  background: #fff;
  color: #111;
  padding: 2px 8px;
  margin: 0 2px;
  border-radius: 8px;
  font-weight: 800;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.lan-phrase-blank {
  display: inline;
  opacity: 0.45;
  letter-spacing: 0.05em;
  margin: 0 2px;
}

.lan-reveal-overlay__cards--compact {
  max-width: none;
  gap: 8px;
}

.lan-reveal-overlay__cards--compact .lan-card--xl {
  max-width: none;
  margin: 0;
}

.lan-reveal-overlay__cards {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 8px 0;
}

.lan-reveal-overlay__cards--multi .lan-card + .lan-card {
  margin-left: 0;
}

.lan-reveal-overlay__cards .lan-card--xl {
  width: var(--reveal-card-w, clamp(140px, 40vmin, 210px)) !important;
  max-width: var(--reveal-card-w, clamp(140px, 42vw, 210px)) !important;
  min-width: 0;
  min-height: 0;
  height: var(--reveal-card-h, auto) !important;
  max-height: var(--reveal-card-h, min(56dvh, 320px)) !important;
  aspect-ratio: 63.5 / 88.9;
  flex: 0 0 auto;
  font-size: clamp(0.78rem, 3vmin, 1.05rem);
  padding: 9px 8px;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.lan-reveal-overlay__cards .lan-card--image {
  padding: 0;
}

.lan-reveal-overlay__cards .lan-card--image img {
  object-fit: contain;
  width: 100%;
  height: 100%;
  max-height: 100%;
}

.lan-reveal-countdown {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 6px 0 0;
  flex-shrink: 0;
}

.lan-reveal-overlay__skip {
  flex-shrink: 0;
  margin-top: 4px;
}

.lan-table__on-table--dim {
  min-height: 80px;
  opacity: 0.25;
}

@media (max-width: 699px) {
  .lan-reveal-overlay__cards .lan-card--xl {
    width: var(--reveal-card-w, clamp(148px, 42vw, 200px)) !important;
    max-width: var(--reveal-card-w, clamp(148px, 42vw, 200px)) !important;
  }

  .lan-reveal-overlay__phrase {
    font-size: clamp(0.92rem, 4vw, 1.1rem);
    padding: 10px 12px;
  }
}

@media (max-height: 560px) {
  .lan-reveal-overlay__phrase {
    padding: 8px 10px;
    font-size: clamp(0.82rem, 3.2vw, 1rem);
  }

  .lan-reveal-overlay__title {
    font-size: clamp(0.95rem, 3.8vw, 1.15rem);
    margin-bottom: 6px;
  }
}

.lan-card--prize.lan-card--image,
.lan-card--prize {
  width: 100%;
  max-width: 118px;
  min-height: 0;
}

.lan-card--table {
  aspect-ratio: 63.5 / 88.9;
  padding: 0;
  min-height: 0;
}

.lan-card--back {
  padding: 0;
  min-height: 0;
  aspect-ratio: 63.5 / 88.9;
  overflow: hidden;
  cursor: default;
}

.lan-card--back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.lan-card--back-fallback-preta {
  background: repeating-linear-gradient(
    -45deg,
    #0a0a0a,
    #0a0a0a 6px,
    #1a1a1a 6px,
    #1a1a1a 12px
  );
  border: 2px solid #333;
}

.lan-card--back-fallback-branca {
  background: repeating-linear-gradient(
    -45deg,
    #f5f5f5,
    #f5f5f5 6px,
    #e0e0e0 6px,
    #e0e0e0 12px
  );
  border: 2px solid #ccc;
}

.lan-pill--leader,
.lan-pill--czar {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(232, 93, 76, 0.35);
}

.lan-pill--leader-badge {
  border-color: var(--accent);
  background: rgba(232, 93, 76, 0.12);
}

/* Prêmios na frente de cada jogador */
.lan-table__seats {
  margin: 14px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.lan-seats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.lan-seat {
  flex: 1 1 160px;
  max-width: 220px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.lan-seat--you {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(76, 143, 232, 0.25);
}

.lan-seat--leader {
  border-color: var(--accent);
}

.lan-seat__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.lan-seat__name {
  font-size: 0.85rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lan-seat__pts {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}

.lan-seat__prizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 100px;
  align-items: flex-start;
}

.lan-seat__empty {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 100px;
}

.lan-prize-pair {
  flex: 0 0 auto;
}

.lan-prize-pair--btn {
  cursor: pointer;
}

.lan-prize-pair--btn:hover {
  filter: brightness(1.08);
}

.lan-prize-pair__stack {
  position: relative;
  width: 118px;
  height: 150px;
}

.lan-prize-pair__stack .lan-card--prize:first-child {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform: rotate(-4deg);
  z-index: 1;
}

.lan-prize-pair__stack .lan-card--prize:last-child {
  position: absolute;
  top: 28px;
  left: 8px;
  right: 0;
  transform: rotate(3deg);
  z-index: 2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

@media (max-width: 520px) {
  .lan-table__top {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .lan-table__piles-right {
    flex-direction: row;
    justify-content: center;
  }
}

/* Partida: ver public/css/lan-play-layout.css */

/* Modal — vitórias de um jogador */
.lan-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lan-modal[hidden] {
  display: none;
}

.lan-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 16, 0.82);
  backdrop-filter: blur(4px);
}

.lan-modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lan-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.lan-modal__close:hover {
  background: var(--border);
}

.lan-modal__title {
  margin: 0 32px 4px 0;
  font-size: 1.2rem;
}

.lan-modal__subtitle {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.lan-modal__empty {
  margin: 0;
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
}

.lan-prize-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lan-prize-detail {
  padding: 14px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.lan-prize-detail__round {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.lan-prize-detail__pair {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.lan-prize-detail__pair .lan-card--lg {
  max-width: min(168px, 46vw);
  width: auto;
  flex: 0 1 auto;
}

.lan-prize-detail__pair .lan-card--image img {
  object-fit: contain;
}

.lan-launcher__choices {
  width: min(360px, 100%);
  margin: 0 auto;
}

.lan-launcher__pick-label {
  text-align: center;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 14px;
}

.lan-launcher__choice {
  margin-top: 10px;
  display: block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.lan-launcher__choice--decks {
  margin-top: 14px;
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 244, 220, 0.28);
}

.lan-launcher__choice--decks:hover {
  border-color: var(--accent-2);
  background: rgba(255, 255, 255, 0.06);
}

.lan-launcher__pick-hint {
  margin-top: 14px;
}

.lan-install-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 2px solid var(--accent-2);
  border-radius: 10px;
  background: rgba(245, 200, 66, 0.08);
}

.lan-install-bar__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  color: var(--text);
}

.lan-install-bar__text strong {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: var(--accent-2);
}

.lan-install-bar__text span {
  color: var(--muted);
  font-size: 0.78rem;
}

.lan-install-bar__btn {
  margin-top: 0;
  white-space: nowrap;
}

#joinUrl a {
  color: var(--balatro-teal);
  word-break: break-all;
}
