/* ============================================================
   UNO — Estilo (remixicon + Google Fonts via CDN)
   ============================================================ */

:root {
  --font-display: "Bungee", "Arial Black", sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;

  --felt-1: #1f8a56;
  --felt-2: #0f4c31;
  --felt-3: #06251a;
  --bg-1: #0a100e;
  --bg-2: #111b17;

  --ink: #f4f8f6;
  --ink-dim: #9db3aa;
  --gold: #ffd24b;
  --gold-2: #f2b32e;
  --red: #ef5350;
  --yellow: #ffce3a;
  --green: #43c47c;
  --blue: #5596ec;

  --panel: rgba(17, 27, 23, 0.86);
  --panel-line: rgba(255, 255, 255, 0.09);
  --shadow-card: 0 10px 22px rgba(0, 0, 0, 0.5);
  --radius: 18px;

  --card-w: clamp(58px, 9vw, 96px);
  --card-ratio: 362 / 242;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
:root { color-scheme: dark; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1300px 900px at 50% -10%, #17251f 0%, transparent 60%),
    linear-gradient(165deg, var(--bg-1), var(--bg-2));
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100dvh; }
.screen { min-height: 100dvh; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.muted { color: var(--ink-dim); font-size: 0.92rem; }

i[class^="ri-"], i[class*=" ri-"] { line-height: 1; }

/* ---------------- Botões ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  padding: 0.6rem 1.05rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn.primary {
  background: linear-gradient(180deg, #ffdf74, var(--gold-2));
  border-color: #c98f16;
  color: #3a2a05;
  box-shadow: 0 8px 22px rgba(242, 179, 46, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 10px 26px rgba(242, 179, 46, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.55); }

.btn.big { font-size: 1.06rem; padding: 0.95rem 1.4rem; border-radius: 14px; width: 100%; }
.btn.big i { font-size: 1.25rem; }
.btn.ghost { background: transparent; }
.btn.icon { padding: 0.6rem; font-size: 1.1rem; border-radius: 12px; }
.btn.small { padding: 0.3rem 0.55rem; font-size: 0.85rem; border-radius: 9px; }
.btn.danger { border-color: rgba(239, 83, 80, 0.5); color: #ffb4b2; }

.pills { display: flex; gap: 0.5rem; }
.pill {
  flex: 1;
  padding: 0.6rem 0;
  border-radius: 11px;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim);
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.16s ease;
}
.pill:hover { color: var(--ink); }
.pill.selected {
  background: linear-gradient(180deg, #35a86b, #1d7a4d);
  border-color: #4fd98f;
  color: #fff;
  box-shadow: 0 5px 16px rgba(56, 204, 120, 0.32);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid var(--panel-line);
  padding: 0.34rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.badge.dir { font-size: 1rem; }
.badge.dir i { transition: transform 0.6s cubic-bezier(0.3, 0.7, 0.3, 1.2); display: inline-block; }
.badge.dir.spin i { transform: rotate(360deg) scale(1.15); }

/* ---------------- Avatares ---------------- */
.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  color: #fff;
  background: linear-gradient(180deg, #2c3b33, #182219);
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45), inset 0 2px 3px rgba(255, 255, 255, 0.14);
  flex: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.avatar i { font-size: 1.4rem; }
/* foto de perfil: preenche o círculo do avatar em qualquer tela */
.avatar { overflow: hidden; }
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.avatar.frame-gold, .sb-avatar.frame-gold { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 210, 75, 0.28), 0 0 18px rgba(255, 210, 75, 0.22); }
.avatar.frame-purple, .sb-avatar.frame-purple { border-color: #c6a1ff; box-shadow: 0 0 0 2px rgba(198, 161, 255, 0.24), 0 0 18px rgba(198, 161, 255, 0.18); }
.av-red    { background: linear-gradient(160deg, #ff8a80, #c62828); }
.av-yellow { background: linear-gradient(160deg, #ffe082, #e65100); }
.av-green  { background: linear-gradient(160deg, #81f0ae, #1b7a45); }
.av-blue   { background: linear-gradient(160deg, #90caf9, #1565c0); }
.av-purple { background: linear-gradient(160deg, #ce93d8, #6a1b9a); }
.av-orange { background: linear-gradient(160deg, #ffcc80, #d84315); }

.avatar.me {
  font-family: var(--font-display);
  font-size: 1.15rem;
  background: linear-gradient(160deg, #2c3b33, #121a14);
}

/* ---------------- LOBBY ---------------- */
#lobby { align-items: center; padding: clamp(1.4rem, 4vh, 3rem) 1rem 1rem; position: relative; }

.lobby-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.float-card {
  position: absolute;
  width: 120px;
  height: 180px;
  border-radius: 14px;
  opacity: 0.07;
  transform: rotate(-18deg);
  animation: floaty 9s ease-in-out infinite;
}
.fc-1 { background: linear-gradient(160deg, #ef5350, #8e1e1c); top: 8%; left: 6%; }
.fc-2 { background: linear-gradient(160deg, #ffd24b, #b8860b); bottom: 12%; right: 8%; transform: rotate(22deg); animation-delay: -3s; }
.fc-3 { background: linear-gradient(160deg, #5596ec, #1a4c8f); top: 55%; left: 12%; transform: rotate(8deg); animation-delay: -6s; }
@keyframes floaty {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -22px; }
}

.lobby-hero { text-align: center; margin-bottom: clamp(1rem, 3vh, 2rem); position: relative; z-index: 1; }
.logo-fan { display: flex; justify-content: center; height: 128px; margin-bottom: -14px; }
.logo-fan img {
  width: 88px;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s cubic-bezier(0.3, 0.7, 0.3, 1.3);
}
.logo-fan:hover img { transform: translateY(-10px) rotate(0deg) !important; }
.logo-title {
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 10vw, 5.6rem);
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #ffe9a3 15%, #f2b32e 55%, #cf8510);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 12px 26px rgba(242, 179, 46, 0.28));
  line-height: 1;
}
.tagline { color: var(--ink-dim); font-weight: 600; margin-top: 0.5rem; }

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 430px) minmax(0, 430px);
  gap: 1.3rem;
  width: min(100%, 900px);
  align-items: start;
  position: relative;
  z-index: 1;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}
.panel h2 {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.panel h2 i { color: var(--gold); font-size: 1.15rem; }
.panel h2 .btn { margin-left: auto; }

.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; font-weight: 800; font-size: 0.88rem; }
.field > span { color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.74rem; }

/* Campo com ícone: ícone em slot flex separado — nunca sobrepõe o texto,
   mesmo com zoom de fonte/accessibilidade no celular. */
.input-ico {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--panel-line);
  border-radius: 11px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-ico:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 210, 75, 0.16); }
.input-ico i {
  flex: 0 0 auto;
  margin: 0 0.65rem 0 0.9rem;
  color: var(--ink-dim);
  font-size: 1.05rem;
  pointer-events: none;
}
.input-ico input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0.68rem 0.85rem 0.68rem 0;
  width: 100%;
}

input[type="text"],
input[type="password"] {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--panel-line);
  color: var(--ink);
  border-radius: 11px;
  padding: 0.68rem 0.85rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]::placeholder,
input[type="password"]::placeholder { color: #6d8177; font-weight: 600; }
input[type="text"]:focus,
input[type="password"]:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 210, 75, 0.16); }

.opp-names { display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 1.2rem; }
.opp-name-row { display: flex; align-items: center; gap: 0.7rem; }
.opp-name-row .avatar { width: 40px; height: 40px; }
.opp-name-row .avatar i { font-size: 1.15rem; }
.opp-name-row input { flex: 1; }

.rules { margin-top: 1.15rem; border-top: 1px dashed var(--panel-line); padding-top: 0.9rem; }
.rules summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}
.rules summary::-webkit-details-marker { display: none; }
.rules summary:hover { color: var(--ink); }
.rules summary i { font-size: 1.05rem; }
.rules-body { margin-top: 0.7rem; color: var(--ink-dim); font-size: 0.9rem; line-height: 1.6; }
.rules-body ul { padding-left: 1.15rem; display: flex; flex-direction: column; gap: 0.4rem; }
.rules-body b { color: var(--ink); }

.saved-list { display: flex; flex-direction: column; gap: 0.65rem; max-height: 400px; overflow: auto; padding-right: 0.25rem; }
.save-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--panel-line);
  border-radius: 13px;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.save-row:hover { border-color: rgba(255, 210, 75, 0.35); background: rgba(255, 255, 255, 0.07); }
.save-row .save-info { flex: 1; min-width: 0; }
.save-row .save-title { font-weight: 800; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-row .save-sub { color: var(--ink-dim); font-size: 0.78rem; margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.4rem; row-gap: 2px; }
.save-row .sub-item { display: inline-flex; align-items: center; gap: 0.28rem; min-width: 0; }
.save-row .sub-item i { font-size: 0.85rem; flex: none; }
.save-row .sub-item .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-row .sub-item .winner { color: var(--gold); font-weight: 800; }
.save-row .sub-item .live { color: var(--green); font-weight: 800; }

/* ---------------- MESA ---------------- */
#game {
  background:
    radial-gradient(65% 52% at 50% 36%, var(--felt-1) 0%, var(--felt-2) 58%, var(--felt-3) 100%);
  position: relative;
  overflow: hidden;
}
#game::before { /* anel da mesa */
  content: "";
  position: absolute;
  left: 50%; top: 38%;
  width: min(150vw, 1250px);
  height: min(62vh, 560px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.35), 0 0 70px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
#game::after { /* vinheta */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(130% 95% at 50% 42%, transparent 52%, rgba(0, 0, 0, 0.55) 100%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 4px);
}

.game-top {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}
.game-info { display: flex; gap: 0.6rem; }
.top-actions { display: flex; gap: 0.5rem; }

/* --- Oponentes --- */
.opponents {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: clamp(0.8rem, 4vw, 2.6rem);
  padding: 0.4rem 1rem 0.2rem;
  flex-wrap: wrap;
}
.opp {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: rgba(4, 12, 8, 0.55);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.42rem 1.05rem 0.42rem 0.48rem;
  backdrop-filter: blur(4px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.opp.active {
  border-color: rgba(255, 210, 75, 0.85);
  box-shadow: 0 0 0 4px rgba(255, 210, 75, 0.14), 0 10px 26px rgba(0, 0, 0, 0.5);
  transform: translateY(2px);
}
.opp .opp-info { display: flex; flex-direction: column; line-height: 1.2; }
.opp .opp-name {
  font-weight: 800;
  font-size: 0.92rem;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.opp .opp-name .turn-dot { display: none; color: var(--gold); font-size: 0.8rem; }
.opp.active .opp-name .turn-dot { display: inline-flex; animation: turnPulse 1.4s ease infinite; }
.opp .opp-cards { display: flex; align-items: center; gap: 0.4rem; margin-top: 1px; }

.mini-fan { display: inline-flex; }
.mini-fan i {
  width: 17px;
  height: 25px;
  border-radius: 3px;
  background: #d5383f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 242 362'%3E%3Crect width='242' height='362' rx='26' fill='%23d5383f'/%3E%3Cellipse cx='121' cy='181' rx='160' ry='88' transform='rotate(-32 121 181)' fill='%23b02a32'/%3E%3C/svg%3E") center/cover;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  margin-left: -9px;
}
.mini-fan i:first-child { margin-left: 0; }
.opp-count-chip {
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.05rem 0.48rem;
}

.uno-badge {
  display: none;
  align-items: center;
  gap: 0.22rem;
  background: linear-gradient(180deg, #ff7a68, #e02f2f);
  color: #fff;
  font-weight: 900;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  padding: 0.16rem 0.5rem 0.16rem 0.4rem;
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(255, 90, 70, 0.75);
  animation: unoPulse 0.9s ease infinite;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.uno-badge i { font-size: 0.72rem; }
.opp.is-uno .uno-badge, .me-id.is-uno .uno-badge { display: inline-flex; }

@keyframes unoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.shake { animation: shake 0.45s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* --- Centro --- */
.table-center {
  position: relative;
  z-index: 4;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 5vw, 4.5rem);
  padding: 0.6rem 1rem;
  min-height: 200px;
}
.pile-box { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.pile-label {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.pile { position: relative; width: calc(var(--card-w) * 1.06); height: calc(var(--card-w) * 1.06 * var(--card-ratio)); }

.deck-stack { position: absolute; inset: 0; }
.deck-stack i {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: #1a2233 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 242 362'%3E%3Crect x='6' y='6' width='230' height='350' rx='24' fill='%23151b31' stroke='%230b0f1f' stroke-width='8'/%3E%3Cellipse cx='121' cy='181' rx='164' ry='92' transform='rotate(-32 121 181)' fill='%23e0403f'/%3E%3Cellipse cx='121' cy='181' rx='164' ry='92' transform='rotate(-32 121 181)' fill='none' stroke='%23f7d24b' stroke-width='10'/%3E%3Ctext x='121' y='207' transform='rotate(-32 121 181)' font-family='Arial Black, Arial, sans-serif' font-size='74' font-weight='900' fill='%23f7d24b' text-anchor='middle'%3EUNO%3C/text%3E%3C/svg%3E") center/cover;
  box-shadow: var(--shadow-card);
}
.deck-stack i:nth-child(1) { transform: translate(-6px, 6px) rotate(-4deg); }
.deck-stack i:nth-child(2) { transform: translate(6px, 5px) rotate(3deg); }
.deck-stack i:nth-child(3) { transform: rotate(-1deg); }

.deck-count {
  position: absolute;
  right: -12px;
  top: -12px;
  background: linear-gradient(180deg, #3a3a44, #17171d);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-weight: 900;
  font-size: 0.8rem;
  min-width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
}

.pile.deck { cursor: pointer; transition: transform 0.16s ease, filter 0.16s ease; border-radius: 12px; }
.pile.deck.can-draw { filter: drop-shadow(0 0 16px rgba(255, 210, 75, 0.55)); }
.pile.deck.can-draw:hover { transform: translateY(-5px) scale(1.04); }
.pile.deck.disabled { filter: saturate(0.5) brightness(0.7); cursor: not-allowed; }

.discard-top,
.discard-under {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.table-mid { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; min-width: 160px; text-align: center; }

.turn-label {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.8vw, 1.7rem);
  letter-spacing: 0.02em;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  transition: color 0.25s ease;
}
.turn-label.mine { color: var(--gold); animation: turnPulse 1.7s ease infinite; }
.turn-label.theirs { color: #f2fbf6; }
@keyframes turnPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid var(--panel-line);
  padding: 0.36rem 0.85rem 0.36rem 0.52rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.color-chip .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #666;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.35), 0 0 12px currentColor;
}
.color-chip.pop { animation: chipPop 0.5s ease; }
@keyframes chipPop { 30% { transform: scale(1.2); } }

.c-red .dot { background: radial-gradient(circle at 32% 30%, #ff9d94, #d63c3c); color: #ef5350; }
.c-yellow .dot { background: radial-gradient(circle at 32% 30%, #ffefa6, #eab61f); color: #ffce3a; }
.c-green .dot { background: radial-gradient(circle at 32% 30%, #97eab9, #2c9c5c); color: #43c47c; }
.c-blue .dot { background: radial-gradient(circle at 32% 30%, #aed4ff, #2f74cf); color: #5596ec; }
.c-special .dot { background: conic-gradient(#ef5350, #ffce3a, #43c47c, #5596ec, #ef5350); color: #fff; }

/* --- Jogador --- */
.me-area { position: relative; z-index: 7; padding: 0.2rem 0.7rem 1rem; }
.me-row { display: flex; align-items: flex-end; gap: 1rem; max-width: 1120px; margin: 0 auto; }

.me-id {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(4, 12, 8, 0.55);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  margin-bottom: 14px;
  backdrop-filter: blur(4px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  flex: none;
}
.me-id.active { border-color: rgba(255, 210, 75, 0.85); box-shadow: 0 0 0 4px rgba(255, 210, 75, 0.13); }
.me-id .avatar { width: 46px; height: 46px; }
.me-txt { display: flex; flex-direction: column; line-height: 1.25; }
.me-txt strong { font-size: 0.95rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-txt > span { font-size: 0.74rem; color: var(--ink-dim); font-weight: 700; }

.hand-zone { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.hand-hint {
  height: 1.4em;
  font-size: 0.86rem;
  color: var(--gold);
  font-weight: 800;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.hand-hint i { font-size: 0.95rem; }

.hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 1.3rem 0.5rem 0.5rem;
  min-height: calc(var(--card-w) * var(--card-ratio) + 42px);
  width: 100%;
}
.card-wrap {
  width: var(--card-w);
  flex: none;
  position: relative;
  transition: transform 0.18s ease, filter 0.2s ease;
  transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px));
  z-index: var(--z, 1);
}
.card-wrap img { width: 100%; display: block; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); border-radius: 9px; }

.card-wrap.playable { cursor: pointer; }
.card-wrap.playable:hover { transform: rotate(0deg) translateY(calc(var(--lift, 0px) - 28px)) scale(1.08); z-index: 99; }
.card-wrap.playable::before {
  content: "";
  position: absolute;
  inset: 4% -20%;
  border-radius: 12px;
  background: radial-gradient(closest-side, rgba(255, 226, 110, 0.55), transparent 78%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.card-wrap.playable:hover::before { opacity: 1; }
.card-wrap.dim { filter: brightness(0.48) saturate(0.65); }
.card-wrap.dealt { animation: dealtIn 0.38s cubic-bezier(0.2, 0.8, 0.3, 1.1) backwards; }
@keyframes dealtIn { from { opacity: 0; transform: translateY(46px) scale(0.75); } }

/* ---------------- Camada de voo ---------------- */
.fly-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.fly-card {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55));
}
.fly-card .flip-inner { position: relative; width: 100%; transform-style: preserve-3d; transition: transform 0.32s ease; }
.fly-card .flip-inner img {
  position: absolute;
  inset: 0;
  width: 100%;
  display: block;
  border-radius: 9px;
  backface-visibility: hidden;
}
.fly-card .flip-inner .face { transform: rotateY(180deg); }

.float-text {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 900;
  font-size: 1.05rem;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
  animation: floatUp 1.15s ease forwards;
  white-space: nowrap;
  transform: translate(-50%, 0);
}
@keyframes floatUp {
  from { opacity: 1; translate: 0 0; }
  to { opacity: 0; translate: 0 -50px; }
}

/* ---------------- Splash UNO ---------------- */
.uno-splash {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 70;
  opacity: 0;
}
.uno-splash span {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 18vw, 10rem);
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow:
    0 0 34px rgba(255, 90, 70, 0.95),
    0 9px 0 #c22c2c,
    0 22px 46px rgba(0, 0, 0, 0.65);
  transform: rotate(-4deg);
}
.uno-splash.show { animation: unoSplash 1.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards; }
@keyframes unoSplash {
  0% { opacity: 0; transform: scale(0.35) rotate(-16deg); }
  22% { opacity: 1; transform: scale(1.14) rotate(3deg); }
  34% { transform: scale(1) rotate(0deg); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.08); }
}

/* ---------------- Flash de penalidade ---------------- */
.flash-red {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 65;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(220, 40, 40, 0.42));
  opacity: 0;
}
.flash-red.show { animation: flashK 0.6s ease; }
@keyframes flashK { 15% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------- Toasts ---------------- */
.toasts {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 80;
  pointer-events: none;
  width: min(94vw, 500px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(10, 17, 14, 0.95);
  border: 1px solid var(--panel-line);
  border-left: 4px solid var(--gold);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.62rem 1.05rem;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  animation: toastIn 0.25s ease;
  max-width: 100%;
}
.toast i { font-size: 1.05rem; color: var(--gold); }
.toast.err { border-left-color: var(--red); } .toast.err i { color: var(--red); }
.toast.good { border-left-color: var(--green); } .toast.good i { color: var(--green); }
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------------- Histórico ---------------- */
.log-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(370px, 94vw);
  background: rgba(8, 14, 11, 0.97);
  border-left: 1px solid var(--panel-line);
  z-index: 75;
  transform: translateX(105%);
  transition: transform 0.3s cubic-bezier(0.3, 0.7, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -22px 0 60px rgba(0, 0, 0, 0.55);
}
.log-panel.open { transform: translateX(0); }
.log-panel h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1.05rem;
  border-bottom: 1px solid var(--panel-line);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  gap: 0.5rem;
}
.log-panel h3 i { color: var(--gold); }
.log-list { flex: 1; overflow: auto; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.45rem; }
.log-entry {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 11px;
  padding: 0.5rem 0.65rem;
  font-size: 0.86rem;
  font-weight: 600;
  animation: toastIn 0.2s ease;
}
.log-entry img.card-thumb { width: 27px; flex: none; }
.log-entry .log-ico { width: 26px; text-align: center; flex: none; font-size: 1.05rem; color: var(--ink-dim); }
.log-entry b { color: var(--gold); font-weight: 900; }
.log-entry .qty { color: var(--ink-dim); }

/* ---------------- Modais ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 6, 0.74);
  backdrop-filter: blur(5px);
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  background: linear-gradient(180deg, #18241e, #0d1511);
  border: 1px solid var(--panel-line);
  border-radius: 22px;
  padding: 1.7rem 1.8rem;
  width: min(94vw, 440px);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.65);
  text-align: center;
  animation: modalIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  max-height: 88dvh;
  overflow: auto;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(16px); } }

.modal h3 { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.02em; margin-bottom: 0.45rem; }
.modal .modal-sub { color: var(--ink-dim); font-size: 0.92rem; margin-bottom: 1.15rem; font-weight: 600; }

.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.color-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  border: none;
  border-radius: 16px;
  padding: 1.35rem 0 1.1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.97);
  cursor: pointer;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  transition: transform 0.13s ease, filter 0.13s ease;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.22), 0 8px 20px rgba(0, 0, 0, 0.4);
}
.color-btn i { font-size: 1.5rem; }
.color-btn:hover { transform: translateY(-4px) scale(1.03); filter: brightness(1.12); }
.color-btn.red { background: linear-gradient(180deg, #f3705f, #d43a2c); }
.color-btn.yellow { background: linear-gradient(180deg, #ffd94f, #e9ab16); color: #4d3a00; text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4); }
.color-btn.green { background: linear-gradient(180deg, #4ecb85, #249457); }
.color-btn.blue { background: linear-gradient(180deg, #5fa2ef, #2d6fce); }

.modal-actions { display: flex; gap: 0.7rem; margin-top: 1.25rem; }
.modal-actions .btn { flex: 1; }

/* Vitória */
.win-trophy {
  font-size: 3.6rem;
  line-height: 1;
  color: var(--gold);
  animation: trophyBounce 1.3s ease infinite;
  filter: drop-shadow(0 10px 24px rgba(255, 210, 75, 0.5));
}
@keyframes trophyBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.win-name { font-family: var(--font-display); font-size: 1.65rem; color: var(--gold); margin: 0.5rem 0 0.25rem; letter-spacing: 0.01em; }
.win-points { font-size: 1.05rem; font-weight: 800; margin-bottom: 1.1rem; color: var(--ink); }
.score-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin-bottom: 0.4rem; }
.score-table th, .score-table td { padding: 0.5rem 0.4rem; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.score-table th { color: var(--ink-dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; }
.score-table td:first-child, .score-table th:first-child { text-align: left; }
.score-table .winner-row { color: var(--gold); font-weight: 900; }

/* Confete */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -22px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(105dvh) rotate(720deg); opacity: 0.9; }
}

/* ---------------- Responsivo ---------------- */
@media (max-width: 900px) {
  .lobby-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --card-w: clamp(46px, 12.5vw, 66px); }
  .logo-fan img { width: 64px; }
  .logo-fan { height: 96px; }
  .opp { padding: 0.32rem 0.75rem 0.32rem 0.36rem; gap: 0.5rem; }
  .avatar { width: 44px; height: 44px; }
  .avatar i { font-size: 1.2rem; }
  .me-id { padding: 0.36rem 0.6rem 0.36rem 0.36rem; margin-bottom: 8px; }
  .me-id .avatar { width: 40px; height: 40px; font-size: 0.95rem; }
  .me-txt strong { max-width: 76px; }
  .table-mid { min-width: 112px; }
  .hand { padding-top: 1rem; }
  .badge { font-size: 0.72rem; padding: 0.28rem 0.6rem; }
}
@media (max-height: 660px) and (orientation: landscape) {
  .opponents { padding-top: 0; }
  .table-center { min-height: 150px; }
  .hand { min-height: 0; }
}

/* ============================================================
   ADIÇÕES: campeonato (placar, abas, janela de UNO, estatísticas)
   ============================================================ */

/* ---------------- Abas do painel lateral ---------------- */
.side-panel { padding: 0; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--panel-line); }
.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.95rem 0.5rem;
  background: transparent;
  border: none;
  color: var(--ink-dim);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease, box-shadow 0.15s ease;
}
.tab i { font-size: 1rem; }
.tab:hover { color: var(--ink); }
.tab.selected {
  color: var(--gold);
  box-shadow: inset 0 -3px 0 var(--gold);
  background: rgba(255, 210, 75, 0.05);
}
.tab-body { padding: 1rem 1.1rem 1.2rem; }
.tab-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7rem; min-height: 30px; }

/* ---------------- Placar do campeonato (topo) ---------------- */
.connection-status { display: inline-flex; align-items: center; gap: 0.3rem; max-width: 14rem; padding: 0.25rem 0.55rem; border-radius: 999px; font-size: 0.65rem; font-weight: 800; color: var(--green); background: rgba(0, 0, 0, 0.24); border: 1px solid rgba(67, 196, 124, 0.24); opacity: 0.9; }
.connection-status.reconnecting { color: #ffd58a; border-color: rgba(255, 213, 138, 0.3); }
.connection-status i { font-size: 0.85rem; }
.scorebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  max-width: 70vw;
}
.sb-round {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--ink-dim);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-line);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.sb-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: 0.24rem 0.7rem 0.24rem 0.3rem;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.sb-chip .sb-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  color: #fff;
  flex: none;
}
.sb-chip .sb-avatar i { font-size: 0.78rem; }
.sb-chip .sb-name { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
.sb-chip .sb-pts { color: var(--gold); font-weight: 900; }
.sb-chip.leader { border-color: rgba(255, 210, 75, 0.65); box-shadow: 0 0 12px rgba(255, 210, 75, 0.18); }
.sb-chip.leader .sb-pts::after { content: " ★"; }
.sb-team-chip { min-width: 9rem; display: grid; grid-template-columns: 1.2rem minmax(0, 1fr) auto; border-radius: 14px; }
.sb-team-mark { color: var(--gold); }
.sb-team-chip .sb-name { grid-column: 2; }
.sb-team-chip .sb-members { grid-column: 2; color: var(--ink-dim); font-size: 0.58rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-team-chip .sb-pts { grid-column: 3; grid-row: 1 / span 2; }
.sb-target { color: var(--ink-dim); font-size: 0.72rem; font-weight: 800; margin-left: 0.15rem; }

/* ---------------- Janela do grito de UNO ---------------- */
.uno-window {
  position: fixed;
  inset: 0;
  z-index: 68;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 7, 0.45);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease;
}
.uno-window-card {
  position: relative;
  background: linear-gradient(180deg, #1c2a23, #0d1611);
  border: 1px solid rgba(255, 210, 75, 0.35);
  border-radius: 22px;
  padding: 1.6rem 2rem 1.8rem;
  text-align: center;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  min-width: min(88vw, 330px);
}
.uw-count {
  position: absolute;
  top: -16px;
  right: -10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff7a68, #e02f2f);
  border: 3px solid #fff;
  color: #fff;
  font-weight: 900;
  font-size: 1.05rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  animation: unoPulse 1s ease infinite;
}
.uw-title { font-weight: 900; font-size: 1rem; margin-bottom: 1.1rem; color: var(--ink); }
.uw-title b { color: var(--gold); }

.btn-uno {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(180deg, #ff7a68, #d32222);
  border: none;
  border-radius: 18px;
  padding: 0.9rem 2.2rem;
  cursor: pointer;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
  box-shadow: 0 10px 28px rgba(224, 47, 47, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.12s ease, filter 0.12s ease;
  animation: unoPulse 0.9s ease infinite;
}
.btn-uno:hover { transform: scale(1.05); filter: brightness(1.08); }
.btn-uno:active { transform: scale(0.97); }
.btn-uno.catch {
  font-size: 1.25rem;
  background: linear-gradient(180deg, #ffd94f, #e9a01b);
  color: #3d2a00;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 28px rgba(233, 160, 27, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.5);
}
.btn-uno.catch i { font-size: 1.4rem; }

/* ---------------- Estatísticas ---------------- */
.stats-box { max-height: 400px; overflow: auto; padding-right: 0.25rem; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.stats-table th {
  color: var(--ink-dim);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid var(--panel-line);
  text-align: center;
  white-space: nowrap;
}
.stats-table th:first-child { text-align: left; }
.stats-table td { padding: 0.5rem 0.35rem; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-weight: 700; }
.stats-table td:first-child { text-align: left; font-weight: 800; display: flex; align-items: center; gap: 0.45rem; max-width: 120px; }
.stats-table td:first-child .sb-avatar { width: 22px; height: 22px; font-size: 0.72rem; display: grid; place-items: center; border-radius: 50%; color: #fff; flex: none; }
.stats-table .me-row-stats { color: var(--gold); }
.stats-table td .zero { color: #5c6f66; }

/* ---------------- Resumo de rodada / campeão ---------------- */
.round-points { font-family: var(--font-display); font-size: 1.15rem; color: var(--gold); margin: 0.3rem 0 1.1rem; }
.progress-rows { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 0.5rem; }
.progress-row { display: flex; flex-direction: column; gap: 0.22rem; text-align: left; }
.progress-row .pr-top { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 800; }
.progress-row .pr-top .pr-pts { color: var(--gold); }
.progress-row.leader .pr-top .pr-name::after { content: " ★"; color: var(--gold); }
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f2b32e, #ffd24b);
  box-shadow: 0 0 10px rgba(255, 210, 75, 0.5);
  transition: width 0.9s cubic-bezier(0.25, 0.7, 0.3, 1);
  width: 0;
}
.pr-goal { font-size: 0.7rem; color: var(--ink-dim); font-weight: 800; text-align: right; }

@media (max-width: 640px) {
  .scorebar { max-width: 62vw; gap: 0.3rem; }
  .sb-chip .sb-name { max-width: 52px; }
  .sb-round { display: none; }
  .btn-uno { font-size: 1.4rem; padding: 0.8rem 1.6rem; }
}

/* ============================================================
   ADIÇÕES: login, barra do usuário e créditos
   ============================================================ */

/* ---------------- Tela de login ---------------- */
#auth { align-items: center; padding: clamp(1rem, 4vh, 2.5rem) 1rem; }
.auth-wrap { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; width: min(100%, 430px); position: relative; z-index: 1; }
.auth-panel { width: 100%; padding: 0; overflow: hidden; }
.auth-form { display: flex; flex-direction: column; }
.auth-form .btn { margin-top: 0.3rem; }

/* ---------------- Barra do usuário (lobby) ---------------- */
.user-bar {
  position: relative;
  z-index: 2;
  width: min(100%, 900px);
  margin: 0 auto;
  padding: 0.9rem 1rem 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: 0.32rem 0.95rem 0.32rem 0.36rem;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
.user-chip .sb-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #2c3b33, #121a14);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.85rem;
  border: 1.5px solid rgba(255, 210, 75, 0.4);
}
.user-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- Créditos ---------------- */
.credits {
  margin-top: 1.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  z-index: 1;
}
.credits-by { font-size: 0.9rem; color: var(--ink-dim); font-weight: 700; }
.credits-by b { color: var(--gold); font-weight: 900; letter-spacing: 0.02em; }
.credits-insta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #ff8fb3;
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 143, 179, 0.35);
  background: rgba(255, 143, 179, 0.08);
  transition: all 0.15s ease;
}
.credits-insta:hover { background: rgba(255, 143, 179, 0.16); transform: translateY(-1px); }
.credits-insta i { font-size: 1.1rem; }
.credits-disc { font-size: 0.72rem; color: #6d8177; max-width: 420px; }

@media (max-width: 640px) {
  .user-bar { padding-top: 0.6rem; }
  .user-name { max-width: 110px; }
}

/* ============================================================
   POLIMENTO MULTIPLATAFORMA (Android/iOS e PC)
   ============================================================ */

/* Toque: sem atraso de duplo-toque, sem destaque azul, sem seleção acidental */
button, .btn, .pill, .tab, .color-btn, .card-wrap, .pile, .opp, .save-row, .log-entry {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#game, .game-top, .opponents, .table-center, .me-area { -webkit-user-select: none; user-select: none; }
img { -webkit-user-drag: none; }

/* Ícones nunca separam o texto para a linha de baixo */
.pile-label, .hand-hint, .tab, .opp-name, .sb-chip, .badge, .user-chip, .credits-insta, .uw-title { white-space: nowrap; }
.hand-hint { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Foco visível para teclado/acessibilidade (PC) */
.btn:focus-visible, .pill:focus-visible, .tab:focus-visible, .color-btn:focus-visible,
.btn-uno:focus-visible, input:focus-visible, .card-wrap.playable:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Áreas seguras (notch/barra do Android) */
.game-top { padding-top: calc(0.85rem + env(safe-area-inset-top, 0px)); }
.me-area { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
#lobby, #auth { padding-left: max(1rem, env(safe-area-inset-left, 0px)); padding-right: max(1rem, env(safe-area-inset-right, 0px)); }
.log-panel { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ---------------- Mobile (Android/iPhone, retrato) ---------------- */
@media (max-width: 640px) {
  .btn.small { min-width: 36px; min-height: 36px; }
  .btn.icon { min-width: 42px; min-height: 42px; }

  .auth-wrap { width: 100%; }
  .auth-panel { border-radius: var(--radius); }
  .tab-body { padding: 0.9rem 0.95rem 1rem; }

  .modal { padding: 1.25rem 1rem; border-radius: 18px; }
  .color-btn { padding: 1.05rem 0 0.9rem; }
  .modal-actions { flex-direction: column; }

  .uno-window-card { padding: 1.25rem 1.1rem 1.4rem; min-width: min(92vw, 300px); }
  .btn-uno { font-size: 1.35rem; padding: 0.85rem 1.7rem; }

  .opp { border-radius: 999px; }
  .opp .opp-name { max-width: 96px; }

  .hand { padding-top: 0.9rem; }
  .me-txt strong { max-width: 70px; }

  .log-panel { width: 100vw; border-left: none; }
  .log-entry { font-size: 0.82rem; }

  .save-row { padding: 0.6rem 0.65rem; }
  .save-row .btn.primary.small { min-width: 40px; }

  .credits-insta { font-size: 0.88rem; }
}

/* Celular em paisagem (altura curta) */
@media (max-height: 620px) and (orientation: landscape) {
  .opponents { padding-top: 0; gap: 0.5rem; }
  .avatar { width: 38px; height: 38px; font-size: 1.05rem; }
  .avatar i { font-size: 1rem; }
  .opp { padding: 0.22rem 0.7rem 0.22rem 0.28rem; gap: 0.45rem; }
  .opp .avatar { width: 34px; height: 34px; }
  .table-center { min-height: 118px; padding: 0.3rem 0.6rem; gap: clamp(0.7rem, 4vw, 2rem); }
  .pile-label { display: none; }
  .me-id { padding: 0.3rem 0.55rem 0.3rem 0.3rem; margin-bottom: 6px; gap: 0.45rem; }
  .me-id .avatar { width: 34px; height: 34px; font-size: 0.85rem; }
  .me-txt span { display: none; }
  .hand { min-height: 0; padding-top: 0.7rem; }
  .hand-hint { display: none; }
  .turn-label { font-size: 1rem; }
  .game-top { padding-top: 0.4rem; padding-bottom: 0.2rem; }
  .me-area { padding-bottom: 0.55rem; }
}

/* Tablets */
@media (min-width: 641px) and (max-width: 1024px) {
  :root { --card-w: clamp(64px, 10vw, 88px); }
  .lobby-grid { grid-template-columns: 1fr 1fr; }
}

/* PC grande */
@media (min-width: 1500px) {
  :root { --card-w: 102px; }
  .me-row { max-width: 1240px; }
}

/* ===================== ABA PERFIL ===================== */
.profile-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 1rem;
}
.profile-top { display: flex; align-items: center; gap: 0.85rem; }
.avatar-big {
  flex: 0 0 auto;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: #171126;
  background: linear-gradient(135deg, var(--gold), #ff7a59);
}
.profile-id { display: flex; flex-direction: column; min-width: 0; }
.pf-name {
  font-size: 1.12rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-user { font-size: 0.85rem; line-height: 1.3; }
.pf-since { font-size: 0.78rem; line-height: 1.3; }
.pf-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.pf-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  padding: 0.55rem 0.3rem;
  text-align: center;
}
.pf-chip b { font-size: 1.05rem; color: var(--gold); }
.pf-chip span { font-size: 0.68rem; color: var(--ink-dim); line-height: 1.2; }
.pf-chip i { font-size: 0.95rem; color: var(--ink-dim); }
.pf-form { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.9rem; }
.pf-form-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink-dim);
}
.pf-form-title i { font-size: 1rem; }

@media (max-width: 640px) {
  .pf-chips { gap: 0.4rem; }
  .pf-chip { padding: 0.45rem 0.2rem; }
}

/* ===================== PÁGINAS PERFIL / RANKS ===================== */
.perfil-wrap { width: min(560px, 94vw); margin: 0 auto; padding: 1.2rem 0 2rem; display: flex; flex-direction: column; gap: 1rem; }
.perfil-wrap.wide { width: min(760px, 94vw); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.page-title { font-family: var(--font-logo); font-size: clamp(1.2rem, 4vw, 1.6rem); color: var(--ink); display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.page-title i { color: var(--gold); }
.head-spacer { width: 2.2rem; }
.perfil-panel { display: flex; flex-direction: column; gap: 1rem; }
.avatar-wrap { position: relative; flex: 0 0 auto; }
.avatar-big img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar-edit {
  position: absolute; right: -4px; bottom: -4px;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  border: 2px solid #171126; background: var(--gold); color: #171126;
  display: grid; place-items: center; cursor: pointer; font-size: 1rem;
  transition: transform 0.15s ease;
}
.avatar-edit:hover { transform: scale(1.12); }
.sb-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.user-chip { text-decoration: none; }
.chip-go { color: var(--ink-dim); margin-left: 2px; }

.side-links { display: flex; gap: 0.5rem; }
.side-links.center { justify-content: center; }
.side-link {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.6rem 0.5rem; border-radius: 11px;
  background: rgba(0, 0, 0, 0.26); border: 1px solid var(--panel-line);
  color: var(--ink); font-weight: 800; font-size: 0.9rem; text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.side-link i { color: var(--gold); font-size: 1.05rem; }
.side-link:hover { border-color: var(--gold); background: rgba(255, 210, 75, 0.07); }

/* ranques */
.ranks-table { display: flex; flex-direction: column; }
.stats-row.head { color: var(--ink-dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.ranks-table .stats-row { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) repeat(5, minmax(2.2rem, 1fr)); align-items: center; gap: 0.3rem; padding: 0.55rem 0.4rem; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.ranks-table .stats-row > span { text-align: center; font-weight: 700; font-size: 0.92rem; }
.ranks-table .cell-name { justify-content: flex-start; text-align: left; }
.ranks-table .gold { color: var(--gold); }
.ranks-table .stats-row.me { background: rgba(255, 210, 75, 0.08); border-radius: 10px; }
.rank-pos { display: grid; place-items: center; }
.medal { font-size: 1.15rem; color: var(--ink-dim); }
.medal.m1 { color: #ffd24b; }
.medal.m2 { color: #c9d6e8; }
.medal.m3 { color: #e0905a; }
.pos { color: var(--ink-dim); font-size: 0.85rem; }
.wr { display: block; font-size: 0.68rem; color: var(--ink-dim); font-weight: 700; }

/* ===================== LOBBY: MODO / SALA ===================== */
.pill i { font-size: 0.95rem; margin-right: 2px; }
.hint { display: block; margin-top: 0.45rem; font-size: 0.8rem; color: var(--ink-dim); font-weight: 600; }
.join-box { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px dashed var(--panel-line); display: flex; flex-direction: column; gap: 0.55rem; }
.join-title { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 800; color: var(--ink-dim); }
.join-title i { color: var(--gold); }
.join-row { display: flex; gap: 0.5rem; }
.join-row input {
  flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.18em; text-align: center;
  background: rgba(0, 0, 0, 0.32); border: 1px solid var(--panel-line); color: var(--ink);
  border-radius: 11px; padding: 0.68rem 0.85rem; font-family: var(--font-body); font-size: 1rem; font-weight: 800; outline: none;
}
.join-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 210, 75, 0.16); }

/* ===================== SALA DE ESPERA ===================== */
#waitingRoom { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
#waitingRoom.hidden { display: none; }
.wait-card {
  width: min(430px, 94vw); background: rgba(20, 26, 46, 0.92); border: 1px solid var(--panel-line);
  border-radius: 18px; padding: 1.4rem 1.2rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.wait-card h2 { font-family: var(--font-logo); font-size: 1.3rem; display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.wait-card h2 i { color: var(--gold); }
.wait-sub { color: var(--ink-dim); font-size: 0.86rem; margin: 0; }
.wait-code {
  font-family: var(--font-logo); font-size: clamp(2rem, 9vw, 2.6rem); letter-spacing: 0.35em; text-indent: 0.35em;
  color: var(--gold); background: rgba(0, 0, 0, 0.4); border: 1px dashed rgba(255, 210, 75, 0.45);
  border-radius: 14px; padding: 0.55rem 0.8rem; width: 100%; cursor: pointer; user-select: all;
}
.wait-count { font-weight: 800; margin: 0.2rem 0 0; }
.wait-players { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center; }
.wait-player {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.7rem;
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--panel-line); border-radius: 999px;
  font-weight: 700; font-size: 0.86rem;
}
.wait-player i { color: var(--green); }
.wait-player.me { border-color: rgba(255, 210, 75, 0.5); }
.wait-player.empty { color: var(--ink-dim); }
.wait-player.empty i { color: var(--ink-dim); animation: spin 1.6s linear infinite; }
.wait-note { font-size: 0.78rem; margin: 0.2rem 0 0; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .ranks-table .stats-row { grid-template-columns: 2rem minmax(0, 1fr) repeat(5, minmax(1.7rem, 1fr)); font-size: 0.82rem; gap: 0.2rem; }
  .ranks-table .stats-row > span { font-size: 0.8rem; }
  .page-head .btn span { display: none; }
}

/* ===================== ESQUECI A SENSA ===================== */
.link-like {
  background: none; border: none; color: var(--ink-dim); font-family: var(--font-body);
  font-weight: 700; font-size: 0.85rem; cursor: pointer; padding: 0.4rem 0 0;
  display: inline-flex; align-items: center; gap: 0.4rem; justify-content: center; width: 100%;
}
.link-like:hover { color: var(--gold); }
.forgot-note {
  display: flex; align-items: flex-start; gap: 0.45rem; font-size: 0.82rem; color: var(--ink-dim);
  background: rgba(0, 0, 0, 0.26); border: 1px solid var(--panel-line); border-radius: 10px; padding: 0.6rem 0.7rem;
  font-weight: 600; margin: 0;
}
.forgot-note i { color: var(--gold); font-size: 1rem; flex: 0 0 auto; margin-top: 1px; }

/* ===================== CHAT DA PARTIDA ===================== */
.chat-panel { border-left-color: rgba(255, 210, 75, 0.4); }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.4rem; }
.chat-msg {
  background: rgba(0, 0, 0, 0.3); border-radius: 10px; padding: 0.4rem 0.6rem;
  font-size: 0.84rem; font-weight: 600; display: flex; flex-direction: column;
}
.chat-msg b { font-size: 0.7rem; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.03em; }
.chat-msg.mine { background: rgba(255, 210, 75, 0.12); border: 1px solid rgba(255, 210, 75, 0.25); }
.chat-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; padding-top: 0.5rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.chat-preset {
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--panel-line); color: var(--ink);
  border-radius: 9px; padding: 0.45rem 0.3rem; font-family: var(--font-body); font-weight: 700;
  font-size: 0.78rem; cursor: pointer; transition: border-color 0.15s ease;
}
.chat-preset:hover:not(:disabled) { border-color: var(--gold); }
.chat-preset:disabled { opacity: 0.45; cursor: wait; }

/* humano x bot na mesa */
.opp .avatar.human i { color: #ffd24b; }

/* avatar nas linhas do ranking */
.row-avatar { width: 1.5rem; height: 1.5rem; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }

/* ===================== CARTAS 3D (objeto com PNG de face/máscara) ===================== */
/* Cada carta é um objeto: wrapper com perspectiva + rotação interna (preserve-3d),
   face = PNG da carta, verso = arte do baralho, brilho recortado pela máscara do PNG. */
.card3d { position: relative; width: 100%; perspective: 700px; }
.c3d-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg));
  transition: transform 0.34s cubic-bezier(0.3, 0.7, 0.25, 1.05);
  will-change: transform;
}
.card3d .c3d-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; width: 100%; display: block; }
.card3d .c3d-back {
  position: absolute; inset: 0;
  transform: rotateY(180deg);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.card3d .c3d-back img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; display: block; }
.card3d.flipped .c3d-inner { transform: rotateY(180deg); }

/* brilho de "jogável" recortado pela SILHUETA da própria carta (PNG como máscara) */
.c3d-glow {
  position: absolute; inset: -1%; z-index: 2;
  pointer-events: none; opacity: 0;
  -webkit-mask-image: var(--card-png);
  mask-image: var(--card-png);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  background: linear-gradient(205deg, rgba(255, 232, 130, 0.95), rgba(255, 255, 255, 0.12) 55%, rgba(255, 210, 75, 0.55));
  transform: translateZ(3px);
  transition: opacity 0.18s ease;
}
.card-wrap.playable .c3d-glow { opacity: 0.14; }
.card-wrap.playable:hover .c3d-glow { opacity: 0.9; }
.card-wrap.playable:active .c3d-inner { transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)) scale(0.96); }

/* mão: distribuição com flip (verso -> face) */
.card-wrap.dealt .c3d-inner { animation: none; }

/* compra: a carta nova chega virada e revela */
.card-wrap.reveal .c3d-inner { animation: c3dReveal 0.5s cubic-bezier(0.25, 0.7, 0.3, 1.1); }
@keyframes c3dReveal {
  0% { transform: rotateY(180deg) scale(0.82); }
  100% { transform: rotateY(0deg) scale(1); }
}

/* carta do descarte aterrissando com flip */
.discard-top.card3d .c3d-inner { animation: c3dLand 0.42s cubic-bezier(0.25, 0.8, 0.35, 1.18); }
.discard-top.card3d .c3d-face { width: 100%; height: 100%; object-fit: contain; }
@keyframes c3dLand {
  0% { transform: rotateY(-95deg) scale(0.92); opacity: 0.35; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

/* voo com "distorção" 3D (wobble) por cima da animação de flip */
.fly-card .wob { perspective: 700px; animation: c3dWobble 0.55s ease both; }
@keyframes c3dWobble {
  0% { transform: rotateY(0deg) rotateZ(0deg); }
  35% { transform: rotateY(26deg) rotateZ(-7deg); }
  70% { transform: rotateY(-13deg) rotateZ(5deg); }
  100% { transform: rotateY(0deg) rotateZ(0deg); }
}

/* reduced motion: desliga os extras */
@media (prefers-reduced-motion: reduce) {
  .fly-card .wob, .card-wrap.reveal .c3d-inner, .discard-top.card3d .c3d-inner { animation: none; }
  .c3d-inner { transition: none; }
}

/* ===================== AMIGOS ===================== */
.friend-add { display: flex; flex-direction: column; gap: 0.55rem; padding-bottom: 0.8rem; border-bottom: 1px dashed var(--panel-line); }
.link-mini {
  background: none; border: none; color: var(--gold); font-family: var(--font-body); font-weight: 700;
  font-size: 0.78rem; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 0.25rem;
}
.link-mini:hover { text-decoration: underline; }
.friend-sec { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.8rem; }
.friend-row {
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(0, 0, 0, 0.26); border: 1px solid var(--panel-line);
  border-radius: 12px; padding: 0.5rem 0.6rem;
}
.friend-av {
  position: relative; width: 2.1rem; height: 2.1rem; border-radius: 50%; overflow: hidden;
  background: linear-gradient(160deg, #2c3b33, #182219); display: grid; place-items: center;
  color: var(--ink-dim); font-size: 1.1rem; flex: none;
}
.friend-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.friend-av.on::after {
  content: ""; position: absolute; right: 0; bottom: 0;
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: #43c47c; border: 2px solid #10151f;
}
.friend-name { flex: 1; min-width: 0; font-weight: 800; font-size: 0.9rem; display: flex; flex-direction: column; overflow: hidden; }
.friend-name .online-txt { font-size: 0.68rem; color: var(--green); font-weight: 700; }
.friend-name .online-txt.req { color: var(--gold); }
.friend-name .online-txt.pend { color: var(--ink-dim); }
.friend-acts { display: flex; gap: 0.3rem; }
.friend-bio {
  margin: 0.8rem 0 0; font-size: 0.9rem; color: var(--ink);
  background: rgba(0, 0, 0, 0.26); border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0; padding: 0.6rem 0.8rem; font-style: italic;
}

/* ID de amigo + bio no perfil */
.fid-box { display: flex; flex-direction: column; gap: 0.5rem; background: rgba(0, 0, 0, 0.26); border: 1px solid var(--panel-line); border-radius: 14px; padding: 0.9rem 1rem; }
.fid-row { display: flex; align-items: center; gap: 0.6rem; }
.fid-code {
  flex: 1; text-align: center; font-family: var(--font-logo); letter-spacing: 0.22em; text-indent: 0.22em;
  font-size: 1.25rem; color: var(--gold); background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(255, 210, 75, 0.45); border-radius: 10px; padding: 0.45rem 0.6rem;
}
textarea#bioText {
  width: 100%; resize: vertical; min-height: 4.4rem;
  background: rgba(0, 0, 0, 0.32); border: 1px solid var(--panel-line); color: var(--ink);
  border-radius: 11px; padding: 0.68rem 0.85rem; font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 600; outline: none;
}
textarea#bioText:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 210, 75, 0.16); }

/* ===================== AMIGOS AO VIVO / CONVITES ===================== */
.tab { position: relative; }
.tab-badge {
  position: absolute; top: -0.35rem; right: -0.3rem;
  min-width: 1.15rem; height: 1.15rem; padding: 0 0.28rem;
  border-radius: 999px; background: #e0403f; color: #fff;
  font-size: 0.68rem; font-weight: 900; line-height: 1.15rem;
  box-shadow: 0 0 0 2px var(--panel-bg, #141a2e);
  pointer-events: none;
}
.friend-row.invite { border-color: rgba(255, 210, 75, 0.4); }
#btnChat:disabled { opacity: 0.38; filter: grayscale(1); cursor: not-allowed; }
#invitePills { display: flex; gap: 0.45rem; flex-wrap: wrap; }

/* ===================== VERIFICAÇÃO / LGPD ===================== */
.verify-badge {
  display: inline-block; margin-left: 0.3rem; padding: 0.1rem 0.55rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 900; letter-spacing: 0.02em; vertical-align: middle;
}
.verify-badge.ok { background: rgba(67, 196, 124, 0.18); color: var(--green); border: 1px solid rgba(67, 196, 124, 0.5); }
.verify-badge.pend { background: rgba(255, 210, 75, 0.14); color: var(--gold); border: 1px solid rgba(255, 210, 75, 0.45); }
.pf-btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.lgpd-zone { border: 1px dashed rgba(224, 64, 63, 0.35); }
.btn.danger { background: rgba(224, 64, 63, 0.14); border-color: rgba(224, 64, 63, 0.5); color: #ff8f8e; }
.btn.danger:hover { background: rgba(224, 64, 63, 0.28); }
a.link-like { text-align: center; }


/* ===================== MELHORIAS DE USABILIDADE ===================== */
.turn-direction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 2rem;
  padding: 0.34rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.turn-direction .direction-arrow {
  display: inline-block;
  color: var(--gold);
  font-size: 1.15rem;
  line-height: 1;
}
.turn-direction.counterclockwise .direction-arrow { color: #8fd6ff; }
.turn-direction.clockwise { border-color: rgba(255, 210, 75, 0.28); }
.turn-direction.counterclockwise { border-color: rgba(143, 214, 255, 0.28); }

/* A mão pode deslizar horizontalmente em telas estreitas, sem esmagar os alvos de toque. */
.hand { scrollbar-width: thin; scrollbar-color: rgba(255, 210, 75, 0.55) transparent; }
.hand::-webkit-scrollbar { height: 6px; }
.hand::-webkit-scrollbar-thumb { background: rgba(255, 210, 75, 0.48); border-radius: 999px; }
.card-wrap.playable:active { transform: rotate(0deg) translateY(calc(var(--lift, 0px) - 16px)) scale(1.04); }
.card-wrap:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 10px; }

/* ===================== MENU DA CONTA ===================== */
.account-menu { position: relative; z-index: 10; }
.account-trigger { cursor: pointer; border: 1px solid var(--panel-line); }
.account-trigger .account-chevron { transition: transform 0.2s ease; color: var(--ink-dim); }
.account-menu.open .account-chevron { transform: rotate(180deg); }
.account-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(290px, calc(100vw - 2rem));
  padding: 0.75rem;
  background: rgba(11, 20, 15, 0.98);
  border: 1px solid rgba(255, 210, 75, 0.25);
  border-radius: 16px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.account-menu.open .account-panel { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.account-summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.35rem 0.75rem;
  border-bottom: 1px solid var(--panel-line);
}
.account-summary .account-avatar { width: 42px; height: 42px; font-size: 1rem; }
.account-summary-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.account-summary-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary-text span { color: var(--ink-dim); font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coins-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  padding: 0.28rem 0.5rem;
  border: 1px solid rgba(255, 210, 75, 0.28);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}
.coins-pill i { font-size: 0.95rem; }
.account-links { display: grid; gap: 0.3rem; padding-top: 0.65rem; }
.account-link, .account-buy {
  display: flex;
  align-items: center;
  gap: 0.58rem;
  width: 100%;
  padding: 0.62rem 0.68rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 800 0.88rem var(--font-body);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.account-link:hover, .account-buy:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); border-color: var(--panel-line); }
.account-link i, .account-buy i { width: 1.15rem; color: var(--gold); text-align: center; font-size: 1.05rem; }
.account-buy { color: var(--ink-dim); cursor: not-allowed; }
.account-buy i { color: var(--green); }
.account-buy small { margin-left: auto; color: var(--gold); font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.06em; }
.account-logout { margin-top: 0.35rem; border-top: 1px solid var(--panel-line); padding-top: 0.65rem; }
.account-logout i { color: var(--red); }

/* ===================== RANKING PESSOAL ===================== */
.rank-highlight {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 210, 75, 0.3);
  border-radius: 13px;
  background: linear-gradient(115deg, rgba(255, 210, 75, 0.14), rgba(255, 255, 255, 0.045));
}
.rank-highlight .rank-highlight-icon { color: var(--gold); font-size: 1.5rem; }
.rank-highlight .rank-highlight-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.rank-highlight .rank-highlight-copy span { color: var(--ink-dim); font-size: 0.74rem; font-weight: 800; }
.rank-highlight .rank-highlight-copy strong { font-size: 1.05rem; }
.rank-highlight .rank-highlight-pos { margin-left: auto; color: var(--gold); font: 1.45rem var(--font-display); }

@media (max-width: 640px) {
  :root { --card-w: clamp(68px, 19vw, 84px); }
  .table-center { gap: 0.65rem; padding-left: 0.5rem; padding-right: 0.5rem; }
  .table-mid { min-width: 124px; gap: 0.48rem; }
  .turn-direction { padding: 0.28rem 0.5rem; font-size: 0.65rem; }
  .turn-direction .direction-arrow { font-size: 1rem; }
  .me-row { flex-direction: column; align-items: stretch; gap: 0.15rem; }
  .me-id { align-self: center; margin-bottom: 0; }
  .hand-zone { width: 100%; align-items: stretch; }
  .hand {
    justify-content: flex-start;
    gap: 4px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 1.1rem max(0.85rem, env(safe-area-inset-left, 0px)) 0.8rem max(0.85rem, env(safe-area-inset-right, 0px));
    scroll-snap-type: x proximity;
    scroll-padding-inline: 0.85rem;
  }
  .card-wrap { margin-left: 0 !important; scroll-snap-align: center; }
  .card-wrap.playable:hover { transform: rotate(0deg) translateY(calc(var(--lift, 0px) - 12px)) scale(1.04); }
  .hand-hint { justify-content: center; }
  .account-panel { right: -0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .account-panel, .account-trigger .account-chevron { transition: none; }
}

.account-trigger { appearance: none; color: var(--ink); font-family: var(--font-body); }
.account-trigger.compact { gap: 0.35rem; padding: 0.28rem 0.5rem 0.28rem 0.3rem; }
.account-trigger.compact .sb-avatar { width: 30px; height: 30px; }
@media (max-width: 640px) {
  .account-trigger.compact .user-name { display: none; }
  .account-trigger.compact { padding: 0.3rem; }
  .top-actions { gap: 0.28rem; }
}

.profile-account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; margin: 0.9rem 0 1.1rem; }
.wallet-card, .profile-rank-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--panel-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  text-decoration: none;
}
.wallet-card-icon, .profile-rank-link > i:first-child { color: var(--gold); font-size: 1.4rem; flex: none; }
.wallet-card > div:last-child, .profile-rank-link > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.wallet-card span, .profile-rank-link small { color: var(--ink-dim); font-size: 0.68rem; font-weight: 800; }
.wallet-card strong { color: var(--gold); font-size: 0.95rem; }
.wallet-card small { color: #6d8177; font-size: 0.63rem; margin-top: 0.18rem; }
.profile-rank-link { transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease; }
.profile-rank-link:hover { border-color: rgba(255, 210, 75, 0.35); background: rgba(255, 255, 255, 0.075); transform: translateY(-1px); }
.profile-rank-link > span { flex: 1; }
.profile-rank-link > span b { font-size: 0.87rem; }
.profile-rank-link > i:last-child { color: var(--ink-dim); font-size: 1.1rem; }
@media (max-width: 640px) {
  .profile-account-grid { grid-template-columns: 1fr; }
}

.game-top { gap: 0.55rem; }
.game-top > .scorebar { flex: 1 1 auto; min-width: 0; }
@media (max-width: 640px) {
  .game-top { padding-left: 0.55rem; padding-right: 0.55rem; gap: 0.3rem; }
  .scorebar { max-width: none; gap: 0.22rem; }
  .sb-chip { padding-left: 0.22rem; padding-right: 0.42rem; gap: 0.24rem; }
  .sb-chip .sb-name { max-width: 58px; }
  .sb-target { display: none; }
}

/* ===================== REDESIGN DO PERFIL ===================== */
.perfil-panel { gap: 0.75rem; }
.profile-top { padding: 0.2rem 0.15rem 0.35rem; }
.profile-id { gap: 0.12rem; }
.profile-rank-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.3rem;
  margin-top: 0.28rem;
  padding: 0.24rem 0.52rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: var(--ink-dim);
  font-size: 0.7rem;
  font-weight: 900;
}
.profile-rank-badge i { color: var(--gold); }
.profile-rank-badge.is-ranked { color: var(--gold); border-color: rgba(255, 210, 75, 0.34); background: rgba(255, 210, 75, 0.08); }
.profile-section-title {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}
.profile-section-title i { color: var(--gold); font-size: 1.05rem; }
.profile-section-title.standalone { margin-top: 0.1rem; padding: 0.15rem 0.1rem 0; color: var(--ink-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.profile-section {
  margin-top: 0.35rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.14);
}
.profile-section .pf-form { margin-top: 0.85rem; }
.profile-section .pf-form:first-of-type { margin-top: 0.7rem; }
.profile-section .lgpd-zone { margin-top: 0.85rem; padding: 0.78rem; }
.profile-account-grid { margin-top: 0.2rem; }
.rank-highlight { min-height: 3.4rem; }
@media (max-width: 640px) {
  .perfil-wrap { width: min(100% - 1rem, 560px); padding-top: 0.7rem; }
  .perfil-panel { padding: 0.78rem; border-radius: 18px; }
  .profile-top { align-items: flex-start; gap: 0.7rem; }
  .avatar-big { width: 3.8rem; height: 3.8rem; }
  .pf-chips { grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }
  .pf-chip { min-height: 4.2rem; justify-content: center; }
  .profile-section { padding: 0.72rem; }
  .profile-section .pf-btn-row { flex-direction: column; }
  .profile-section .pf-btn-row .btn { width: 100%; }
  .profile-rank-badge { font-size: 0.66rem; }
}

/* O alerta LGPD continua destacado, mas sem a borda pontilhada dominante no celular. */
.lgpd-zone { border-style: solid; border-color: rgba(224, 64, 63, 0.22); background: rgba(224, 64, 63, 0.035); }
.lgpd-zone .hint { line-height: 1.45; }

.demo-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.3rem;
  padding: 0.12rem 0.34rem;
  border: 1px solid rgba(143, 214, 255, 0.38);
  border-radius: 999px;
  color: #9bdcff;
  background: rgba(143, 214, 255, 0.1);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  vertical-align: middle;
}
.ranks-table .demo-badge { display: inline-flex; font-size: 0.52rem; }

/* ===================== PÁGINAS SEPARADAS ===================== */
.page-screen { min-height: 100dvh; }
.page-shell { position: relative; z-index: 1; width: min(980px, calc(100% - 2rem)); margin: 0 auto; padding: 0.65rem 0 2rem; }
.page-user-bar { width: 100%; padding: 0.15rem 0 0.45rem; }
.page-head-card { padding: 0.65rem 0; }
.page-head-card .page-title { justify-content: center; }
.page-nav { width: min(760px, 100%); margin: 0 auto 1.05rem; }
.lobby-nav { display: flex; align-items: center; justify-content: center; gap: 0.45rem; }
.lobby-nav-link {
  position: relative;
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.42rem;
  min-height: 2.65rem; padding: 0.55rem 0.7rem; color: var(--ink-dim); text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; background: rgba(0, 0, 0, 0.2);
  font-size: 0.82rem; font-weight: 900; transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.lobby-nav-link i { color: var(--gold); font-size: 1rem; }
.nav-badge { position: absolute; top: -0.34rem; right: -0.22rem; display: grid; place-items: center; min-width: 1.05rem; height: 1.05rem; padding: 0 0.2rem; border: 2px solid var(--bg); border-radius: 999px; color: #171b2a; background: var(--gold); font-size: 0.58rem; font-weight: 900; line-height: 1; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); }
.nav-badge.hidden { display: none; }
.lobby-nav-link:hover, .lobby-nav-link.active { color: var(--ink); border-color: rgba(255, 210, 75, 0.46); background: rgba(255, 210, 75, 0.1); }
.page-content { display: grid; gap: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.section-kicker { display: inline-flex; align-items: center; gap: 0.32rem; color: var(--gold); font-size: 0.68rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; }
.section-kicker i { font-size: 0.9rem; }
.panel-head h2, .friends-hero h2, .stats-hero h2 { margin: 0.2rem 0 0; font-size: 1.18rem; }
.friends-page-content { width: min(700px, 100%); margin: 0 auto; }
.friends-hero, .stats-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; }
.friends-hero p, .stats-hero p { margin: 0.35rem 0 0; color: var(--ink-dim); font-size: 0.86rem; font-weight: 600; }
.friends-hero-icon { color: var(--gold); font-size: 3.2rem; opacity: 0.75; }
.friends-panel { padding: 1.1rem 1.2rem; }
.friend-add-page { padding: 0.85rem 0 0; border: 0; }
.friend-page-list { margin-top: 0.2rem; }
.friend-page-list .friend-sec { margin-top: 1.15rem; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 2.1rem 1rem; text-align: center; color: var(--ink-dim); }
.empty-state i { color: var(--gold); font-size: 2rem; }
.empty-state strong { color: var(--ink); font-size: 1rem; }
.empty-state span { font-size: 0.82rem; }
.stats-page-shell { width: min(980px, calc(100% - 2rem)); }
.stats-page-content { width: min(900px, 100%); margin: 0 auto; }
.stats-hero-number { color: var(--gold); font: 2.1rem var(--font-display); white-space: nowrap; }
.ranking-panel { padding: 1.15rem; }
.personal-rank { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem; margin-bottom: 1.15rem; border: 1px solid rgba(255, 210, 75, 0.38); border-radius: 15px; background: linear-gradient(110deg, rgba(255, 210, 75, 0.14), rgba(255, 255, 255, 0.04)); }
.personal-rank.empty { color: var(--ink-dim); }
.personal-rank-icon { color: var(--gold); font-size: 1.9rem; }
.personal-rank-avatar { flex: none; }
.personal-rank-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.personal-rank-copy > span { color: var(--ink-dim); font-size: 0.72rem; font-weight: 900; }
.personal-rank-copy > strong { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.personal-rank-copy > small { color: var(--ink-dim); font-size: 0.75rem; margin-top: 0.2rem; }
.personal-rank-position { display: flex; align-items: baseline; gap: 0.12rem; margin-left: auto; color: var(--gold); font: 2rem var(--font-display); }
.personal-rank-position span { font-size: 1rem; }
.ranking-head { display: flex; align-items: end; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.65rem; padding: 0 0.15rem; }
.ranking-head h2 { margin: 0.18rem 0 0; font-size: 1.08rem; }
.ranking-updated { font-size: 0.7rem; white-space: nowrap; }
.ranking-list { display: grid; gap: 0.5rem; }
.ranking-card { display: grid; grid-template-columns: 2.4rem 3.1rem minmax(10rem, 1fr) minmax(26rem, 1.9fr); align-items: center; gap: 0.65rem; padding: 0.7rem 0.75rem; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 13px; background: rgba(0, 0, 0, 0.2); }
.ranking-card.is-me { border-color: rgba(255, 210, 75, 0.42); background: rgba(255, 210, 75, 0.08); }
.ranking-place { display: grid; place-items: center; color: var(--ink-dim); }
.rank-medal { font-size: 1.28rem; }
.rank-medal.position-1 { color: #ffd24b; } .rank-medal.position-2 { color: #c9d6e8; } .rank-medal.position-3 { color: #e0905a; }
.rank-number { font-size: 0.9rem; font-weight: 900; }
.rank-avatar { width: 2.8rem; height: 2.8rem; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: #162018; background: linear-gradient(145deg, #ffd24b, #ff8459); font-size: 0.82rem; font-weight: 900; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1); }
.rank-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rank-avatar.av-blue { color: #fff; background: linear-gradient(145deg, #67b4ff, #4868d9); }
.rank-avatar.av-purple { color: #fff; background: linear-gradient(145deg, #cc7bff, #7950c9); }
.rank-avatar.av-green { color: #fff; background: linear-gradient(145deg, #6bd89d, #32976c); }
.rank-avatar.av-orange { color: #fff; background: linear-gradient(145deg, #ffb26b, #db6d39); }
.rank-avatar.av-pink { color: #fff; background: linear-gradient(145deg, #ff8fb3, #c64f8a); }
.rank-avatar.av-bot { color: var(--ink-dim); background: linear-gradient(145deg, #33443a, #18241d); font-size: 1.15rem; }
.ranking-player { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ranking-player strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-player > span { color: var(--ink-dim); font-size: 0.72rem; font-weight: 800; }
.ranking-metrics { display: grid; grid-template-columns: repeat(5, minmax(3.2rem, 1fr)); gap: 0.35rem; }
.ranking-metrics div { display: flex; flex-direction: column; align-items: center; gap: 0.08rem; }
.ranking-metrics strong { font-size: 0.93rem; }
.ranking-metrics small { color: var(--ink-dim); font-size: 0.62rem; font-weight: 800; text-transform: uppercase; }
.ranking-metrics .metric-wins strong { color: var(--gold); }

@media (max-width: 760px) {
  .page-shell, .stats-page-shell { width: min(100% - 1rem, 700px); padding-top: 0.45rem; }
  .lobby-nav-link { min-height: 2.5rem; padding-left: 0.4rem; padding-right: 0.4rem; font-size: 0.76rem; }
  .friends-hero, .stats-hero { padding: 0.95rem; }
  .friends-hero-icon { font-size: 2.5rem; }
  .ranking-panel { padding: 0.75rem; }
  .ranking-card { grid-template-columns: 2rem 2.75rem minmax(0, 1fr); gap: 0.5rem; padding: 0.7rem 0.55rem; }
  .ranking-metrics { grid-column: 3; grid-template-columns: repeat(5, minmax(2.7rem, 1fr)); width: 100%; padding-top: 0.35rem; border-top: 1px solid rgba(255, 255, 255, 0.07); }
  .ranking-player strong { font-size: 0.9rem; }
  .ranking-head { align-items: start; flex-direction: column; gap: 0.25rem; }
}
@media (max-width: 480px) {
  .page-head-card .page-title { font-size: 1.15rem; }
  .lobby-nav { gap: 0.25rem; }
  .lobby-nav-link { gap: 0.25rem; font-size: 0.68rem; }
  .lobby-nav-link i { font-size: 0.9rem; }
  .friends-hero p, .stats-hero p { font-size: 0.78rem; }
  .friends-hero-icon { display: none; }
  .join-row { flex-wrap: wrap; }
  .join-row input { min-width: 0; }
  .friend-add-page .join-row .btn { flex: 1; }
  .personal-rank { align-items: flex-start; }
  .personal-rank-copy > strong { font-size: 0.9rem; }
  .personal-rank-position { font-size: 1.55rem; }
  .rank-avatar { width: 2.55rem; height: 2.55rem; }
  .ranking-metrics { grid-template-columns: repeat(5, minmax(2.25rem, 1fr)); gap: 0.15rem; }
  .ranking-metrics strong { font-size: 0.82rem; }
  .ranking-metrics small { font-size: 0.52rem; }
}

/* ===================== RESPONSIVIDADE FLUIDA V4 ===================== */
html, body { max-width: 100%; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
img, svg, video, canvas { max-width: 100%; }
#app, .screen, .page-shell, .perfil-wrap, .lobby-grid, .panel { min-width: 0; }
.user-bar { width: min(calc(100% - 1rem), 900px); padding-left: 0; padding-right: 0; }
.lobby-grid { width: min(calc(100% - 1rem), 900px); }
.panel { overflow: hidden; }
.ranking-card, .personal-rank, .friends-hero, .stats-hero { min-width: 0; }
.stats-hero { flex-wrap: wrap; }
.stats-hero > div:first-child, .friends-hero > div:first-child { min-width: 0; }
.stats-hero-number { margin-left: auto; }

/* Rodapé: autoria e aviso com hierarquia clara, sem parecer um botão gigante. */
.credits {
  width: min(100%, 700px);
  margin: clamp(1rem, 4vw, 1.6rem) auto 0;
  padding: 0.95rem clamp(0.75rem, 3vw, 1.2rem);
  gap: 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(18, 31, 28, 0.88), rgba(8, 18, 16, 0.74));
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.2);
}
.credits-brand { display: inline-flex; align-items: center; gap: 0.65rem; text-align: left; }
.credits-mark { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 0.75rem; color: #152016; background: linear-gradient(145deg, var(--gold), #f2834c); box-shadow: 0 5px 15px rgba(255, 210, 75, 0.18); }
.credits-mark i { font-size: 1.15rem; }
.credits-brand > div { display: flex; flex-direction: column; gap: 0.03rem; }
.credits-label { color: var(--ink-dim); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.credits-by { display: block; color: var(--ink); font-size: 0.98rem; line-height: 1.2; font-weight: 900; letter-spacing: 0.01em; }
.credits-insta { max-width: 100%; display: inline-flex; align-items: center; gap: 0.42rem; padding: 0.45rem 0.85rem; border: 1px solid rgba(255, 143, 179, 0.36); border-radius: 999px; color: #ff9bbb; background: rgba(255, 143, 179, 0.075); font-size: 0.82rem; font-weight: 900; text-decoration: none; transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease; }
.credits-insta:hover { border-color: rgba(255, 143, 179, 0.75); background: rgba(255, 143, 179, 0.14); transform: translateY(-1px); }
.credits-insta i { flex: none; font-size: 1.1rem; }
.credits-insta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credits-insta small { padding-left: 0.45rem; border-left: 1px solid rgba(255, 143, 179, 0.25); color: rgba(255, 193, 211, 0.72); font-size: 0.64rem; font-weight: 800; white-space: nowrap; }
.credits-disc { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.25rem 0.42rem; width: 100%; max-width: 620px; margin: 0.1rem 0 0; color: #81938b; font-size: 0.68rem; line-height: 1.35; }
.credits-disc i { color: #9aaa9f; font-size: 0.85rem; }
.credits-dot { color: rgba(255, 210, 75, 0.7); }

@media (max-width: 760px) {
  .lobby-grid { grid-template-columns: minmax(0, 1fr); gap: 0.85rem; }
  .setup-panel, .saves-panel { width: 100%; }
  .stats-hero, .friends-hero { align-items: flex-start; }
  .stats-hero-number { margin-left: 0; }
}
@media (max-width: 540px) {
  .page-shell, .stats-page-shell, .perfil-wrap { width: calc(100% - 0.75rem); }
  .user-bar { width: calc(100% - 0.75rem); }
  .lobby-hero { padding-inline: 0.25rem; }
  .logo-fan { height: clamp(88px, 25vw, 128px); }
  .logo-fan img { width: clamp(58px, 18vw, 88px); }
  .logo-title { font-size: clamp(3rem, 16vw, 4.8rem); }
  .tagline { padding-inline: 0.5rem; font-size: clamp(0.78rem, 3.2vw, 0.95rem); line-height: 1.35; }
  .lobby-nav { width: 100%; }
  .lobby-nav-link { min-width: 0; padding-inline: 0.35rem; }
  .lobby-nav-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .panel { border-radius: 17px; }
  .setup-panel, .saves-panel, .friends-panel, .ranking-panel { padding: clamp(0.72rem, 3vw, 1.1rem); }
  .stats-hero, .friends-hero { padding: 0.85rem; }
  .stats-hero-number { align-self: flex-end; font-size: clamp(1.4rem, 7vw, 2rem); }
  .ranking-card { grid-template-columns: 1.7rem 2.55rem minmax(0, 1fr); gap: 0.42rem; padding: 0.62rem 0.45rem; }
  .ranking-metrics { grid-column: 3; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.1rem; }
  .ranking-metrics small { white-space: normal; text-align: center; line-height: 1.05; }
  .personal-rank { grid-template-columns: 2.6rem minmax(0, 1fr) auto; gap: 0.55rem; padding: 0.68rem; }
  .personal-rank-copy { min-width: 0; }
  .personal-rank-copy > strong { white-space: normal; overflow-wrap: anywhere; }
  .personal-rank-position { font-size: 1.45rem; }
  .credits { margin-top: 1rem; padding: 0.8rem 0.6rem; border-radius: 15px; }
  .credits-insta { max-width: 100%; }
  .credits-insta small { display: none; }
  .credits-disc { font-size: 0.62rem; }
}
@media (max-width: 370px) {
  .page-head-card { gap: 0.25rem; }
  .page-head-card .page-title { font-size: 1.05rem; }
  .lobby-nav { gap: 0.18rem; }
  .lobby-nav-link { font-size: 0.64rem; }
  .lobby-nav-link i { font-size: 0.82rem; }
  .personal-rank { grid-template-columns: 2.35rem minmax(0, 1fr) auto; }
  .personal-rank-copy > span, .personal-rank-copy > small { font-size: 0.64rem; }
  .personal-rank-position { font-size: 1.25rem; }
  .credits-brand { gap: 0.5rem; }
  .credits-mark { width: 2rem; height: 2rem; }
  .credits-by { font-size: 0.9rem; }
  .credits-insta { width: 100%; justify-content: center; padding-inline: 0.55rem; }
}

/* ===================== GUIA DE SALA COM AMIGOS ===================== */
.join-hint { display: block; margin-top: -0.28rem; color: var(--ink-dim); font-size: 0.74rem; font-weight: 600; line-height: 1.35; }
.field-note { display: block; margin-top: 0.28rem; color: var(--ink-dim); font-size: 0.7rem; line-height: 1.35; font-weight: 700; }
.duo-teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin: 0.75rem 0; }
.duo-teams > div { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.6rem 0.7rem; border: 1px solid rgba(255, 210, 75, 0.24); border-radius: 11px; background: rgba(255, 210, 75, 0.07); }
.duo-teams b { color: var(--gold); font-size: 0.72rem; }
.duo-teams span { color: var(--ink-dim); font-size: 0.76rem; overflow-wrap: anywhere; }
.friends-guide { margin-top: 0.7rem; padding: 0.75rem; border: 1px solid rgba(255, 210, 75, 0.2); border-radius: 13px; background: rgba(255, 210, 75, 0.055); }
.friends-guide-title { display: flex; align-items: center; gap: 0.35rem; color: var(--gold); font-size: 0.76rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.07em; }
.friends-guide-title i { font-size: 0.95rem; }
.friends-guide ol { display: grid; gap: 0.48rem; margin: 0.62rem 0 0; padding: 0; list-style: none; counter-reset: guide; }
.friends-guide li { display: grid; grid-template-columns: 1.45rem minmax(0, 1fr); align-items: center; gap: 0.48rem; color: var(--ink-dim); font-size: 0.75rem; font-weight: 700; line-height: 1.25; }
.friends-guide li b { display: grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; color: #172018; background: var(--gold); font-size: 0.72rem; }
.field .friends-guide.hidden { display: none; }

/* ECONOMIA DE BATALHA */
.stake-pills { flex-wrap: wrap; }
.stake-pills .pill { min-width: 5.25rem; }
.pill small { display: block; margin-top: 0.12rem; font: 800 0.68rem/1 var(--font-body); opacity: 0.78; }
.pill:disabled { opacity: 0.38; cursor: not-allowed; filter: grayscale(0.55); }
.battle-economy { margin: 0.9rem 0; padding: 0.72rem 0.82rem; border: 1px solid rgba(255, 210, 75, 0.28); border-radius: 13px; background: linear-gradient(135deg, rgba(255, 210, 75, 0.1), rgba(25, 125, 78, 0.08)); }
.battle-economy-title { display: flex; align-items: center; gap: 0.4rem; color: var(--gold); font: 900 0.76rem/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.05em; }
.battle-economy-title i { font-size: 1rem; }
.battle-economy-copy { display: block; margin-top: 0.35rem; color: var(--ink-dim); font-size: 0.78rem; font-weight: 700; line-height: 1.35; }
.sb-economy { display: inline-flex; align-items: center; gap: 0.28rem; color: var(--gold); font-size: 0.72rem; font-weight: 900; white-space: nowrap; }
.economy-result { margin: 0.85rem 0 0; padding: 0.72rem 0.82rem; border-radius: 12px; border: 1px solid rgba(255, 210, 75, 0.28); background: rgba(255, 210, 75, 0.08); color: var(--ink-dim); font-size: 0.82rem; font-weight: 700; line-height: 1.4; }
.economy-result b { color: var(--gold); }
@media (max-width: 540px) {
  .stake-pills .pill { min-width: calc(50% - 0.25rem); }
  .sb-economy { width: 100%; justify-content: center; }
}

/* GUIA DE MOEDAS E CHAT GLOBAL */
.economy-guide { margin: 0.95rem 0 1.15rem; padding: 0.9rem 0.95rem; border: 1px solid rgba(255, 210, 75, 0.25); border-radius: 14px; background: linear-gradient(135deg, rgba(255, 210, 75, 0.11), rgba(25, 125, 78, 0.09)); }
.economy-guide-title { display: flex; align-items: center; gap: 0.45rem; color: var(--gold); font: 900 0.78rem/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.04em; }
.economy-guide-title i { font-size: 1.05rem; }
.economy-guide-title b { margin-left: auto; color: var(--ink); font: 900 0.72rem/1 var(--font-body); text-transform: none; letter-spacing: 0; white-space: nowrap; }
.economy-guide p { margin: 0.42rem 0 0.62rem; color: var(--ink-dim); font-size: 0.78rem; line-height: 1.38; font-weight: 700; }
.economy-guide-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.35rem; }
.economy-guide-grid span { display: flex; flex-direction: column; gap: 0.12rem; padding: 0.42rem 0.3rem; border-radius: 9px; text-align: center; background: rgba(0, 0, 0, 0.18); }
.economy-guide-grid b { color: var(--ink-dim); font-size: 0.68rem; }
.economy-guide-grid strong { color: var(--gold); font-size: 0.88rem; }
.economy-guide small { display: block; margin-top: 0.62rem; color: var(--ink-dim); font-size: 0.68rem; line-height: 1.35; font-weight: 700; }
.global-chat-panel { grid-column: 1 / -1; padding-bottom: 1rem; }
.global-chat-head { align-items: flex-start; }
.global-chat-head h2 { margin-bottom: 0.22rem; }
.panel-subtitle { margin: 0; color: var(--ink-dim); font-size: 0.78rem; font-weight: 700; }
.chat-live { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.34rem 0.52rem; border: 1px solid rgba(97, 219, 142, 0.3); border-radius: 999px; color: var(--green); font-size: 0.7rem; font-weight: 900; white-space: nowrap; }
.chat-live i { font-size: 0.65rem; }
.global-chat-list { display: flex; flex-direction: column; gap: 0.48rem; min-height: 5.2rem; max-height: 16rem; overflow-y: auto; padding: 0.2rem 0.25rem 0.2rem 0; }
.global-chat-message { display: flex; align-items: flex-start; gap: 0.55rem; max-width: min(88%, 44rem); padding: 0.52rem 0.68rem; border: 1px solid var(--panel-line); border-radius: 11px 11px 11px 4px; background: rgba(255, 255, 255, 0.045); }
.global-chat-message.mine { align-self: flex-end; border-color: rgba(255, 210, 75, 0.28); border-radius: 11px 11px 4px 11px; background: rgba(255, 210, 75, 0.08); }
.global-chat-avatar { display: grid; place-items: center; flex: 0 0 2.05rem; width: 2.05rem; height: 2.05rem; overflow: hidden; border: 1px solid rgba(255, 210, 75, 0.36); border-radius: 50%; color: #172018; background: linear-gradient(135deg, var(--gold), #8fe3a6); font: 900 0.68rem/1 var(--font-body); }
.global-chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.global-chat-bubble { min-width: 0; flex: 1; }
.global-chat-message.mine .global-chat-avatar { order: 2; }
.chat-message-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; opacity: 0; transition: opacity 0.15s ease; }
.global-chat-message:hover .chat-message-actions, .global-chat-message:focus-within .chat-message-actions { opacity: 1; }
.chat-message-actions button { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.18rem 0.35rem; border: 0; color: var(--ink-dim); background: transparent; font: 700 0.62rem var(--font-body); cursor: pointer; }
.chat-message-actions button:hover { color: var(--gold); }
.global-chat-message-meta { display: flex; align-items: baseline; gap: 0.45rem; }
.global-chat-message-meta b { color: var(--ink); font-size: 0.75rem; }
.global-chat-message-meta time { color: var(--ink-dim); font-size: 0.65rem; font-weight: 700; }
.global-chat-message p { margin: 0.18rem 0 0; color: var(--ink-dim); font-size: 0.82rem; line-height: 1.35; overflow-wrap: anywhere; }
.chat-empty { display: flex; align-items: center; gap: 0.4rem; min-height: 4.5rem; justify-content: center; text-align: center; }
.global-chat-form { display: flex; gap: 0.55rem; margin-top: 0.7rem; }
.global-chat-form input { flex: 1; min-width: 0; }
.global-chat-form .btn { flex: 0 0 auto; }
.global-chat-hint { display: block; margin-top: 0.42rem; }
@media (max-width: 540px) {
  .economy-guide-title { align-items: flex-start; flex-wrap: wrap; }
  .economy-guide-title b { margin-left: 0; width: 100%; }
  .economy-guide-grid { gap: 0.25rem; }
  .economy-guide-grid b { font-size: 0.62rem; }
  .global-chat-form { flex-direction: column; }
  .global-chat-form .btn { width: 100%; }
  .global-chat-message { max-width: 94%; }
}

@media (max-width: 540px) {
  .join-hint { font-size: 0.7rem; }
  .friends-guide { padding: 0.65rem; }
  .friends-guide li { font-size: 0.7rem; }
  .duo-teams { grid-template-columns: 1fr; }
}

/* PÁGINA DE PROGRESSÃO */
.progression-page-content { width: min(920px, 100%); margin: 0 auto; }
.season-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(120deg, rgba(25, 125, 78, 0.16), rgba(255, 210, 75, 0.1)); }
.season-hero h2 { margin: 0.2rem 0 0.3rem; font-size: 1.25rem; }
.season-hero p { margin: 0; color: var(--ink-dim); font-size: 0.82rem; font-weight: 700; }
.progress-level { display: grid; min-width: 6rem; padding: 0.65rem 0.8rem; text-align: center; border: 1px solid rgba(255, 210, 75, 0.32); border-radius: 14px; background: rgba(255, 210, 75, 0.08); }
.progress-level span, .progress-level small { color: var(--ink-dim); font-size: 0.66rem; font-weight: 800; }
.progress-level strong { color: var(--gold); font: 1.7rem var(--font-display); }
.progress-level small b { color: var(--ink); }
.progression-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 1rem; }
.achievements-panel, .seasonal-panel, .cosmetics-panel { padding: 1.05rem; }
.achievement-list, .season-list, .cosmetic-list { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.achievement-card { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; padding: 0.58rem; border: 1px solid var(--panel-line); border-radius: 11px; background: rgba(255, 255, 255, 0.035); }
.achievement-card.locked { opacity: 0.65; }
.achievement-icon { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 11px; color: var(--gold); background: rgba(255, 210, 75, 0.13); font-size: 1.05rem; }
.achievement-card strong, .cosmetic-card strong { color: var(--ink); font-size: 0.78rem; }
.achievement-card p, .cosmetic-card p { margin: 0.16rem 0 0; color: var(--ink-dim); font-size: 0.68rem; line-height: 1.3; font-weight: 700; }
.achievement-card small { display: block; margin-top: 0.18rem; color: var(--green); font-size: 0.62rem; font-weight: 800; }
.achievement-card.locked small { color: var(--ink-dim); }
.achievement-state { color: var(--green); font-size: 1rem; }
.achievement-card.locked .achievement-state { color: var(--ink-dim); }
.season-row { display: grid; grid-template-columns: 1.7rem 1.75rem minmax(0, 1fr) auto; align-items: center; gap: 0.45rem; padding: 0.5rem 0.4rem; border-bottom: 1px solid rgba(255, 255, 255, 0.06); color: var(--ink-dim); font-size: 0.7rem; }
.season-row.me { border-radius: 9px; background: rgba(255, 210, 75, 0.1); }
.season-row > b { color: var(--gold); }
.season-avatar { display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: 50%; color: #172018; background: linear-gradient(135deg, var(--gold), #8fe3a6); font-size: 0.66rem; font-weight: 900; }
.season-row strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.season-row > span:last-child { font-weight: 900; white-space: nowrap; }
.cosmetic-card { display: grid; grid-template-columns: 2.3rem minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; padding: 0.6rem; border: 1px solid var(--panel-line); border-radius: 11px; background: rgba(255, 255, 255, 0.035); }
.cosmetic-card.locked { opacity: 0.6; }
.cosmetic-preview { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 2px solid var(--ink-dim); border-radius: 50%; color: var(--ink-dim); font-size: 1rem; }
.cosmetic-preview.frame-gold { border-color: var(--gold); color: var(--gold); }
.cosmetic-preview.frame-purple { border-color: #c6a1ff; color: #c6a1ff; }
.cosmetic-preview.title { border-radius: 8px; }
@media (max-width: 760px) { .progression-grid { grid-template-columns: 1fr; } }
@media (max-width: 540px) { .season-hero { align-items: flex-start; flex-direction: column; } .progress-level { width: 100%; } .achievement-card, .cosmetic-card { grid-template-columns: 2rem minmax(0, 1fr); } .achievement-icon, .cosmetic-preview { width: 1.9rem; height: 1.9rem; } .achievement-state, .cosmetic-card .btn { grid-column: 2; justify-self: start; } }

/* PÁGINA DE HISTÓRICO */
.history-page-content { width: min(900px, 100%); margin: 0 auto; }
.history-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(120deg, rgba(255, 210, 75, 0.13), rgba(0, 0, 0, 0.12)); }
.history-hero h2 { margin: 0.2rem 0 0.3rem; font-size: 1.25rem; }
.history-hero p { margin: 0; color: var(--ink-dim); font-size: 0.84rem; font-weight: 700; }
.history-wallet { display: grid; grid-template-columns: auto auto; align-items: center; gap: 0.15rem 0.5rem; padding: 0.7rem 0.85rem; border: 1px solid rgba(255, 210, 75, 0.32); border-radius: 13px; background: rgba(255, 210, 75, 0.08); white-space: nowrap; }
.history-wallet span { grid-column: 1 / -1; color: var(--ink-dim); font-size: 0.68rem; font-weight: 800; }
.history-wallet strong { color: var(--gold); font-size: 1.15rem; }
.history-wallet i { color: var(--gold); font-size: 1.15rem; }
.history-panel { padding: 1.1rem; }
.history-list { display: grid; gap: 0.58rem; margin-top: 0.8rem; }
.history-card { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr) auto; align-items: center; gap: 0.7rem; padding: 0.75rem; border: 1px solid var(--panel-line); border-radius: 13px; background: rgba(255, 255, 255, 0.035); }
.history-result { display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; padding: 0.35rem 0.4rem; border-radius: 999px; font-size: 0.68rem; font-weight: 900; }
.history-result.good { color: var(--green); background: rgba(97, 219, 142, 0.12); }
.history-result.bad { color: #ff9191; background: rgba(255, 100, 100, 0.1); }
.history-main { min-width: 0; }
.history-main strong { display: block; overflow: hidden; color: var(--ink); font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.history-main strong span { color: var(--ink-dim); font-weight: 700; }
.history-main small { display: block; margin-top: 0.2rem; color: var(--ink-dim); font-size: 0.68rem; font-weight: 700; }
.history-coins { display: grid; grid-template-columns: auto auto; align-items: center; gap: 0.25rem; font-size: 0.72rem; white-space: nowrap; }
.history-coins i { font-size: 0.92rem; }
.history-coins b { font-size: 0.72rem; }
.history-coins small { grid-column: 1 / -1; color: var(--ink-dim); font-size: 0.63rem; text-align: right; }
.history-coins.positive { color: var(--green); }
.history-coins.negative { color: #ff9191; }
.history-coins.positive small, .history-coins.negative small { color: var(--ink-dim); }
.transaction-list { display: grid; gap: 0.4rem; margin-top: 0.75rem; }
.transaction-row { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; align-items: center; gap: 0.55rem; padding: 0.55rem 0.65rem; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.transaction-row > i { color: var(--gold); font-size: 1.05rem; }
.transaction-row span { min-width: 0; }
.transaction-row b, .transaction-row small { display: block; }
.transaction-row b { color: var(--ink); font-size: 0.75rem; }
.transaction-row small { margin-top: 0.12rem; color: var(--ink-dim); font-size: 0.64rem; }
.transaction-row strong { font-size: 0.78rem; }
.transaction-row .positive { color: var(--green); }
.transaction-row .negative { color: #ff9191; }
@media (max-width: 540px) {
  .history-hero { align-items: flex-start; flex-direction: column; }
  .history-wallet { width: 100%; }
  .history-card { grid-template-columns: 1fr auto; gap: 0.45rem; }
  .history-result { justify-self: start; }
  .history-main { grid-column: 1 / -1; grid-row: 2; }
  .history-coins { grid-column: 2; grid-row: 1; }
}

/* PÁGINA PRÓPRIA DO CHAT */
.chat-page-content { width: min(820px, 100%); margin: 0 auto; }
.chat-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(120deg, rgba(25, 125, 78, 0.16), rgba(0, 0, 0, 0.12)); }
.chat-hero h2 { margin: 0.2rem 0 0.3rem; font-size: 1.25rem; }
.chat-hero p { margin: 0; color: var(--ink-dim); font-size: 0.84rem; font-weight: 700; }
.chat-hero-icon { flex: none; color: var(--gold); font-size: 3.6rem; filter: drop-shadow(0 8px 16px rgba(255, 210, 75, 0.2)); }
.global-chat-page-panel { padding-bottom: 1.1rem; }
.chat-page-list { min-height: 20rem; max-height: min(58vh, 38rem); }
.chat-rules { color: var(--ink-dim); }
.chat-rules h2 { margin: 0.3rem 0; font-size: 1rem; color: var(--ink); }
.chat-rules p { margin: 0; font-size: 0.8rem; line-height: 1.45; font-weight: 700; }
@media (max-width: 540px) {
  .chat-hero { align-items: flex-start; }
  .chat-hero-icon { font-size: 2.5rem; }
  .chat-page-list { min-height: 15rem; }
}

/* Respiro entre a navegação e o conteúdo principal do lobby. */
.lobby-nav { margin-bottom: clamp(1.05rem, 4vw, 1.6rem); }
@media (max-width: 540px) {
  .lobby-nav { margin-bottom: 1.15rem; }
}

/* ---------------- Painel administrativo ---------------- */
.admin-shell { width: min(100%, 1120px); }
.admin-page-content { display: grid; gap: 1rem; }
.admin-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.admin-kpi { display: grid; grid-template-columns: 2rem 1fr; align-items: center; gap: 0.1rem 0.7rem; padding: 0.9rem 1rem; border: 1px solid var(--panel-line); border-radius: 14px; background: rgba(255, 255, 255, 0.045); }
.admin-kpi i { grid-row: 1 / span 2; font-size: 1.5rem; color: var(--gold); }
.admin-kpi span { color: var(--ink-dim); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-kpi b { font-size: 1.35rem; }
.admin-panel { padding: 1.1rem 1.2rem; }
.admin-panel .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.8rem; }
.admin-panel h2 { margin: 0.18rem 0 0; }
.admin-report-list, .audit-list { display: grid; gap: 0.55rem; }
.admin-report { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.6rem 0.8rem; padding: 0.75rem 0.85rem; border: 1px solid var(--panel-line); border-radius: 12px; background: rgba(0, 0, 0, 0.16); }
.admin-report strong, .admin-report small { display: block; }
.admin-report small { margin-top: 0.2rem; color: var(--ink-dim); font-size: 0.72rem; }
.report-status { padding: 0.25rem 0.5rem; border-radius: 999px; font-size: 0.68rem; font-weight: 900; text-transform: uppercase; }
.report-status.open { color: #ffd58a; background: rgba(255, 180, 80, 0.14); }
.report-status.reviewed { color: var(--green); background: rgba(67, 196, 124, 0.13); }
.report-status.dismissed { color: var(--ink-dim); background: rgba(255, 255, 255, 0.08); }
.admin-report-actions { grid-column: 1 / -1; display: flex; gap: 0.5rem; justify-content: flex-end; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.admin-table th, .admin-table td { padding: 0.65rem 0.5rem; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.07); white-space: nowrap; }
.admin-table th { color: var(--ink-dim); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-user { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; }
.admin-avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; overflow: hidden; border-radius: 50%; background: linear-gradient(160deg, #ce93d8, #6a1b9a); font-weight: 900; }
.admin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.audit-row { display: grid; grid-template-columns: 1.2rem minmax(0, 1fr) auto; align-items: center; gap: 0.45rem; padding: 0.55rem 0.2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 0.75rem; }
.audit-row > i { color: var(--gold); }
.audit-row small { color: var(--ink-dim); font-size: 0.65rem; }
@media (max-width: 640px) {
  .admin-kpis { grid-template-columns: 1fr; }
  .admin-report { grid-template-columns: 1fr; }
  .admin-report-actions { justify-content: stretch; }
  .admin-report-actions .btn { flex: 1; }
  .audit-row { grid-template-columns: 1.2rem minmax(0, 1fr); }
  .audit-row small { grid-column: 2; }
}

@media (hover: none), (max-width: 640px) {
  .chat-message-actions { opacity: 1 !important; pointer-events: auto !important; }
}

/* ===================== POLIMENTO VISUAL: FUNDO E ADMIN ===================== */
body {
  background:
    radial-gradient(900px 520px at 50% -18%, rgba(255, 210, 75, 0.13), transparent 62%),
    radial-gradient(760px 520px at 0% 100%, rgba(74, 125, 255, 0.12), transparent 68%),
    radial-gradient(620px 460px at 100% 78%, rgba(224, 64, 63, 0.11), transparent 68%),
    linear-gradient(145deg, #080d18 0%, #11162a 48%, #0b1717 100%);
}

.lobby-bg {
  isolation: isolate;
  background:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.7;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 90%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 90%);
}
.lobby-bg::before,
.lobby-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(4px);
}
.lobby-bg::before {
  width: min(52vw, 620px);
  height: min(52vw, 620px);
  top: -28%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 210, 75, 0.12), rgba(255, 210, 75, 0.025) 42%, transparent 70%);
}
.lobby-bg::after {
  width: min(72vw, 780px);
  height: min(72vw, 780px);
  right: -28%;
  bottom: -42%;
  background: radial-gradient(circle, rgba(68, 184, 255, 0.12), transparent 68%);
}
.float-card {
  width: clamp(76px, 10vw, 138px);
  height: clamp(112px, 15vw, 198px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  opacity: 0.18;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.018), 0 22px 65px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(2px);
}
.float-card::after {
  content: "";
  position: absolute;
  inset: 24% 13%;
  border: 1px solid currentColor;
  border-radius: 48% 54% 46% 52%;
  opacity: 0.42;
  transform: rotate(-28deg);
}
.fc-1 { color: rgba(239, 83, 80, 0.72); background: linear-gradient(145deg, rgba(239, 83, 80, 0.16), rgba(239, 83, 80, 0.025)); }
.fc-2 { color: rgba(255, 210, 75, 0.72); background: linear-gradient(145deg, rgba(255, 210, 75, 0.16), rgba(255, 210, 75, 0.025)); }
.fc-3 { color: rgba(85, 150, 236, 0.72); background: linear-gradient(145deg, rgba(85, 150, 236, 0.16), rgba(85, 150, 236, 0.025)); }

#auth, #lobby, #perfil, .page-screen { position: relative; overflow: hidden; }
.auth-wrap, .perfil-wrap, .page-shell { position: relative; z-index: 1; }
.auth-panel, .perfil-panel, .page-panel, .panel { border-color: rgba(255, 255, 255, 0.12); box-shadow: 0 26px 80px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.025); }

/* ADM: desktop arejado, mobile sem overflow horizontal ou ações espremidas. */
.admin-shell { width: min(1180px, calc(100% - 2rem)); padding-bottom: 2.2rem; }
.admin-page-content { width: 100%; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.admin-kpis { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-page-content > .admin-panel:nth-of-type(2) { grid-column: 1 / span 7; }
.admin-page-content > .admin-panel:nth-of-type(3) { grid-column: 8 / -1; }
.admin-page-content > .admin-panel:nth-of-type(4) { grid-column: 1 / -1; }
.admin-panel { min-width: 0; overflow: hidden; }
.admin-panel .panel-head { min-width: 0; flex-wrap: wrap; }
.admin-panel .panel-head > div { min-width: 0; }
.admin-panel h2 { overflow-wrap: anywhere; }
.admin-report { min-width: 0; grid-template-columns: minmax(0, 1fr) auto; }
.admin-report > div:first-child { min-width: 0; }
.admin-report-message { margin: 0.45rem 0 0; color: var(--ink-dim); font-size: 0.8rem; line-height: 1.4; overflow-wrap: anywhere; }
.admin-report-actions { flex-wrap: wrap; }
.admin-report-actions .btn { min-height: 2.25rem; }
.admin-table { min-width: 540px; }
.audit-row span { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .admin-page-content { grid-template-columns: 1fr; }
  .admin-page-content > .admin-panel:nth-of-type(2),
  .admin-page-content > .admin-panel:nth-of-type(3),
  .admin-page-content > .admin-panel:nth-of-type(4) { grid-column: 1; }
}
@media (max-width: 640px) {
  .lobby-bg { background-size: 30px 30px; opacity: 0.52; }
  .fc-1 { top: 10%; left: -7%; }
  .fc-2 { right: -8%; bottom: 7%; }
  .fc-3 { left: 4%; top: 57%; opacity: 0.1; }
  .auth-wrap { width: min(100% - 1.1rem, 430px); }
  .auth-panel { padding: 1rem; border-radius: 20px; }
  .perfil-wrap { width: min(100% - 1rem, 600px); }
  .page-shell.admin-shell { width: min(100% - 1rem, 1180px); padding-top: 0.35rem; }
  .admin-shell .page-head-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.45rem; }
  .admin-shell .page-head-card .page-title { min-width: 0; font-size: clamp(0.92rem, 4.8vw, 1.2rem); text-align: center; line-height: 1.1; }
  .admin-shell .page-head-card .btn { padding-inline: 0.5rem; }
  .admin-panel { padding: 0.85rem; border-radius: 16px; }
  .admin-panel .panel-head { align-items: flex-start; margin-bottom: 0.65rem; }
  .admin-panel h2 { font-size: 0.88rem; margin-bottom: 0; }
  .admin-report { grid-template-columns: 1fr; gap: 0.55rem; padding: 0.72rem; }
  .admin-report > .report-status { justify-self: start; }
  .admin-report-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
  .admin-report-actions .btn { width: 100%; min-width: 0; padding-inline: 0.35rem; font-size: 0.72rem; white-space: normal; }
  .admin-kpi { padding: 0.75rem 0.85rem; }
  .audit-row { grid-template-columns: 1.1rem minmax(0, 1fr); align-items: start; }
  .audit-row small { grid-column: 2; }
}

/* Fundo refinado: os cartões ficam apenas como textura, sem competir com o conteúdo. */
.float-card {
  opacity: 0.055;
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.008));
  filter: blur(0.2px);
}
.float-card::after { opacity: 0.2; }
.fc-1, .fc-2, .fc-3 { color: rgba(255, 255, 255, 0.75); }

/* ===================== PAINEL 3D DE CARTAS NO FUNDO ===================== */
.uno-bg-panel {
  position: absolute;
  top: 47%;
  left: 50%;
  width: min(980px, 86vw);
  height: min(590px, 66vh);
  overflow: hidden;
  transform: translate(-50%, -50%) perspective(1100px) rotateX(5deg) rotateZ(-1deg);
  transform-style: preserve-3d;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.012) 42%, rgba(0, 0, 0, 0.16)),
    linear-gradient(155deg, rgba(18, 36, 56, 0.46), rgba(10, 18, 32, 0.24));
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 0 70px rgba(255, 255, 255, 0.025);
  opacity: 0.92;
}
.uno-bg-panel::before,
.uno-bg-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.uno-bg-panel::before {
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 35%, rgba(255, 255, 255, 0.07) 45%, transparent 57%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 22px);
  mix-blend-mode: screen;
  opacity: 0.35;
  animation: uno-panel-shimmer 16s ease-in-out infinite;
}
.uno-bg-panel::after {
  inset: 9%;
  border: 1px solid rgba(255, 210, 75, 0.12);
  border-radius: 25px;
  box-shadow: inset 0 0 42px rgba(255, 210, 75, 0.035);
}
.uno-bg-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52%;
  height: 64%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 210, 75, 0.18), rgba(73, 164, 255, 0.06) 42%, transparent 72%);
  filter: blur(12px);
  animation: uno-glow-breathe 7s ease-in-out infinite;
}
.uno-bg-cards {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.uno-bg-card {
  position: absolute;
  width: clamp(72px, 9.7vw, 132px);
  aspect-ratio: 242 / 362;
  object-fit: cover;
  border-radius: clamp(8px, 1vw, 14px);
  opacity: 0.42;
  filter: saturate(0.88) contrast(0.94) drop-shadow(0 18px 16px rgba(0, 0, 0, 0.34));
  transform-style: preserve-3d;
  will-change: transform;
  animation: uno-card-drift 12s ease-in-out infinite;
}
.uno-bg-card-1 { top: 17%; left: 18%; transform: rotateY(18deg) rotateZ(-23deg) translateZ(48px); animation-delay: -1.2s; }
.uno-bg-card-2 { top: 10%; left: 38%; transform: rotateY(-14deg) rotateZ(-8deg) translateZ(88px); animation-delay: -5.3s; }
.uno-bg-card-3 { top: 17%; right: 19%; transform: rotateY(-20deg) rotateZ(22deg) translateZ(42px); animation-delay: -8.7s; }
.uno-bg-card-4 { bottom: 11%; left: 26%; transform: rotateY(16deg) rotateZ(17deg) translateZ(62px); animation-delay: -3.1s; }
.uno-bg-card-5 { top: 29%; left: 43%; opacity: 0.62; transform: rotateY(0deg) rotateZ(-2deg) translateZ(125px); animation-delay: -6.6s; }
.uno-bg-card-6 { bottom: 10%; right: 25%; transform: rotateY(-17deg) rotateZ(-15deg) translateZ(60px); animation-delay: -9.4s; }
.uno-bg-card-7 { top: 40%; right: 11%; transform: rotateY(-23deg) rotateZ(11deg) translateZ(34px); animation-delay: -2.4s; }
@keyframes uno-card-drift {
  0%, 100% { margin-top: 0; filter: saturate(0.88) contrast(0.94) drop-shadow(0 18px 16px rgba(0, 0, 0, 0.34)); }
  50% { margin-top: -12px; filter: saturate(1) contrast(0.98) drop-shadow(0 28px 22px rgba(0, 0, 0, 0.4)); }
}
@keyframes uno-panel-shimmer {
  0%, 100% { transform: translateX(-12%); opacity: 0.22; }
  50% { transform: translateX(12%); opacity: 0.42; }
}
@keyframes uno-glow-breathe {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.94); }
  50% { opacity: 0.92; transform: translate(-50%, -50%) scale(1.07); }
}
.float-card { display: none; }
@media (max-width: 640px) {
  .uno-bg-panel {
    top: 42%;
    width: 126vw;
    height: 54vh;
    border-radius: 24px;
    transform: translate(-50%, -50%) perspective(900px) rotateX(4deg) rotateZ(-1deg);
    opacity: 0.82;
  }
  .uno-bg-panel::after { inset: 7%; border-radius: 17px; }
  .uno-bg-card { width: clamp(55px, 16vw, 84px); opacity: 0.35; }
  .uno-bg-card-1 { top: 12%; left: 13%; }
  .uno-bg-card-2 { top: 7%; left: 35%; }
  .uno-bg-card-3 { top: 13%; right: 12%; }
  .uno-bg-card-4 { bottom: 8%; left: 17%; }
  .uno-bg-card-5 { top: 28%; left: 43%; opacity: 0.5; }
  .uno-bg-card-6 { bottom: 7%; right: 17%; }
  .uno-bg-card-7 { top: 39%; right: 5%; }
}
@media (prefers-reduced-motion: reduce) {
  .uno-bg-panel::before, .uno-bg-glow, .uno-bg-card { animation: none; }
}

/* ===================== ADM MOBILE: SEM CORTE LATERAL ===================== */
.admin-kpis,
.admin-kpi,
.admin-kpi span,
.admin-kpi b,
.admin-table-wrap,
.admin-table,
.admin-table tbody,
.admin-table tr,
.admin-table td { min-width: 0; }
.admin-kpis { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.admin-kpi span, .admin-kpi b { overflow-wrap: anywhere; white-space: normal; }
.admin-panel, .admin-panel * { max-width: 100%; }

@media (max-width: 720px) {
  .admin-shell { width: calc(100% - 1rem); overflow-x: clip; }
  .admin-page-content { width: 100%; overflow-x: clip; }
  .admin-kpis { grid-template-columns: minmax(0, 1fr); gap: 0.55rem; }
  .admin-kpi { grid-template-columns: 2.1rem minmax(0, 1fr); }
  .admin-table-wrap { overflow: visible; }
  .admin-table { display: block; width: 100%; min-width: 0; }
  .admin-table thead { display: none; }
  .admin-table tbody { display: grid; gap: 0.5rem; }
  .admin-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 0.26rem 0.65rem; padding: 0.72rem 0.65rem; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; background: rgba(0, 0, 0, 0.12); }
  .admin-table td { display: block; width: auto; min-width: 0; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .admin-table td:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .admin-table td:nth-child(2) { grid-column: 2; grid-row: 1; align-self: end; text-align: right; color: var(--ink-dim); font-size: 0.7rem; }
  .admin-table td:nth-child(3) { grid-column: 2; grid-row: 2; align-self: start; text-align: right; color: var(--gold); font-weight: 900; font-size: 0.75rem; }
  .admin-table td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; padding-top: 0.38rem; border-top: 1px solid rgba(255, 255, 255, 0.06); color: var(--ink-dim); font-size: 0.65rem; }
  .admin-user { max-width: 100%; }
  .admin-user > span:last-child { min-width: 0; overflow-wrap: anywhere; }
  .admin-panel .panel-head { gap: 0.5rem; }
}

/* ===================== COSMÉTICOS DE EVENTO ===================== */
.avatar.frame-fire-event, .sb-avatar.frame-fire-event, .avatar-big.frame-fire-event {
  border-color: #ff8b3d;
  box-shadow: 0 0 0 2px rgba(255, 139, 61, 0.58), 0 0 0 5px rgba(224, 64, 63, 0.24), 0 0 22px rgba(255, 108, 44, 0.38);
}
.avatar.frame-neon-event, .sb-avatar.frame-neon-event, .avatar-big.frame-neon-event {
  border-color: #79eaff;
  box-shadow: 0 0 0 2px rgba(121, 234, 255, 0.62), 0 0 0 5px rgba(168, 97, 255, 0.28), 0 0 22px rgba(72, 189, 255, 0.42);
}
.avatar.frame-duo-event, .sb-avatar.frame-duo-event, .avatar-big.frame-duo-event {
  border-color: #70e4ae;
  box-shadow: 0 0 0 2px rgba(112, 228, 174, 0.62), 0 0 0 5px rgba(57, 191, 187, 0.25), 0 0 22px rgba(47, 203, 133, 0.34);
}
.avatar.frame-wild-event, .sb-avatar.frame-wild-event, .avatar-big.frame-wild-event {
  border-color: #ffe277;
  box-shadow: 0 0 0 2px rgba(255, 226, 119, 0.62), 0 0 0 5px rgba(255, 91, 106, 0.24), 0 0 22px rgba(116, 175, 255, 0.38);
}
.cosmetic-preview.avatar { overflow: hidden; padding: 0; background: rgba(255, 255, 255, 0.06); }
.cosmetic-preview.avatar img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 50%; }
.cosmetic-preview.frame-fire-event { border-color: #ff8b3d; color: #ffb35e; box-shadow: 0 0 0 2px rgba(255, 139, 61, 0.3), 0 0 12px rgba(255, 108, 44, 0.32); }
.cosmetic-preview.frame-neon-event { border-color: #79eaff; color: #c6a1ff; box-shadow: 0 0 0 2px rgba(121, 234, 255, 0.25), 0 0 12px rgba(72, 189, 255, 0.3); }
.cosmetic-preview.frame-duo-event { border-color: #70e4ae; color: #9ff5d0; box-shadow: 0 0 0 2px rgba(112, 228, 174, 0.25), 0 0 12px rgba(47, 203, 133, 0.26); }
.cosmetic-preview.frame-wild-event { border-color: #ffe277; color: #ffe277; box-shadow: 0 0 0 2px rgba(255, 226, 119, 0.25), 0 0 12px rgba(116, 175, 255, 0.3); }

/* ===================== SELETOR DE AVATAR E MOLDURA NO PERFIL ===================== */
.profile-customizer {
  margin: .8rem 0 1.1rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(30,39,53,.8), rgba(16,23,33,.72));
}
.customizer-preview-row {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .85rem;
  margin-bottom: .95rem;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
}
.customizer-preview-row .avatar-big { flex: 0 0 72px; width: 72px; height: 72px; }
.customizer-preview-row strong { display: block; font-size: 1rem; }
.customizer-preview-row .hint { margin: .24rem 0 0; line-height: 1.4; }
.customizer-group + .customizer-group { margin-top: 1rem; }
.customizer-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .5rem;
  color: var(--muted);
  font-size: .77rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.customizer-label > i { color: var(--gold); font-size: 1rem; }
.customizer-label > span { flex: 1; }
.btn.tiny { min-height: 28px; padding: .28rem .55rem; font-size: .68rem; }
.profile-cosmetic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.cosmetic-choice {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .58rem;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 13px;
  color: var(--text);
  background: rgba(255,255,255,.035);
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.cosmetic-choice.unlocked { cursor: pointer; }
.cosmetic-choice.unlocked:hover, .cosmetic-choice.unlocked:focus-visible { border-color: rgba(255,210,75,.62); background: rgba(255,210,75,.08); transform: translateY(-1px); outline: none; }
.cosmetic-choice.selected { border-color: var(--gold); background: rgba(255,210,75,.12); box-shadow: 0 0 0 2px rgba(255,210,75,.12); }
.cosmetic-choice.locked { opacity: .46; cursor: not-allowed; }
.profile-cosmetic-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(7,11,18,.7);
  overflow: hidden;
}
.profile-cosmetic-thumb.avatar { padding: 0; }
.profile-cosmetic-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-cosmetic-thumb.frame-fire-event { border-color: #ff8b3d; box-shadow: 0 0 0 2px rgba(255,108,44,.22), 0 0 12px rgba(255,108,44,.24); }
.profile-cosmetic-thumb.frame-neon-event { border-color: #79eaff; box-shadow: 0 0 0 2px rgba(121,234,255,.22), 0 0 12px rgba(72,189,255,.26); }
.profile-cosmetic-thumb.frame-duo-event { border-color: #70e4ae; box-shadow: 0 0 0 2px rgba(112,228,174,.22), 0 0 12px rgba(47,203,133,.24); }
.profile-cosmetic-thumb.frame-wild-event { border-color: #ffe277; box-shadow: 0 0 0 2px rgba(255,226,119,.22), 0 0 12px rgba(116,175,255,.25); }
.cosmetic-choice-copy { min-width: 0; flex: 1; }
.cosmetic-choice-copy strong, .cosmetic-choice-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cosmetic-choice-copy strong { font-size: .78rem; }
.cosmetic-choice-copy small { margin-top: .13rem; color: var(--muted); font-size: .66rem; font-weight: 800; }
.cosmetic-choice-state { flex: none; color: var(--gold); font-size: 1rem; }
@media (max-width: 520px) {
  .profile-customizer { padding: .75rem; }
  .customizer-preview-row { align-items: flex-start; }
  .customizer-preview-row .avatar-big { flex-basis: 60px; width: 60px; height: 60px; }
  .profile-cosmetic-grid { grid-template-columns: 1fr; }
  .customizer-label { align-items: flex-start; flex-wrap: wrap; }
  .customizer-label > span { min-width: 140px; }
  .customizer-label .btn { margin-left: 1.45rem; }
}

/* Ajuste final do seletor de cosméticos no celular: galeria compacta, sem lista infinita */
@media (max-width: 520px) {
  .profile-customizer { margin-top: .55rem; padding: .65rem; border-radius: 15px; }
  .customizer-preview-row { padding: .65rem; gap: .65rem; margin-bottom: .72rem; }
  .customizer-preview-row .avatar-big { flex-basis: 54px; width: 54px; height: 54px; }
  .customizer-preview-row .hint { font-size: .68rem; line-height: 1.25; }
  .customizer-label { margin-bottom: .4rem; font-size: .68rem; }
  .customizer-label .btn { margin-left: auto; }
  .profile-cosmetic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .42rem; }
  .cosmetic-choice { min-height: 108px; display: flex; flex-direction: column; justify-content: center; gap: .32rem; padding: .58rem .35rem .5rem; position: relative; text-align: center; }
  .cosmetic-choice-copy { width: 100%; flex: none; }
  .cosmetic-choice-copy strong, .cosmetic-choice-copy small { white-space: normal; text-align: center; line-height: 1.12; }
  .cosmetic-choice-copy strong { font-size: .68rem; }
  .cosmetic-choice-copy small { margin-top: .2rem; font-size: .57rem; }
  .cosmetic-choice-state { position: absolute; right: .42rem; top: .42rem; font-size: .86rem; }
  .profile-cosmetic-thumb { width: 46px; height: 46px; flex: 0 0 46px; }
}

/* Moldura de evento como camada visual real sobre a foto/inicial */
.avatar.has-avatar-frame, .sb-avatar.has-avatar-frame, .avatar-big.has-avatar-frame, .friend-av.has-avatar-frame { position: relative; overflow: visible; isolation: isolate; }
.avatar.has-avatar-frame > img:not(.avatar-frame-overlay), .sb-avatar.has-avatar-frame > img:not(.avatar-frame-overlay), .avatar-big.has-avatar-frame > img:not(.avatar-frame-overlay), .friend-av.has-avatar-frame > img:not(.avatar-frame-overlay) { position: relative; z-index: 1; }
.avatar-frame-overlay {
  position: absolute !important;
  z-index: 4 !important;
  inset: -13% !important;
  width: 126% !important;
  height: 126% !important;
  max-width: none !important;
  max-height: none !important;
  display: block !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  pointer-events: none;
}
.profile-cosmetic-thumb.frame-preview { position: relative; overflow: visible; border: 0; background: transparent; }
.profile-cosmetic-thumb.frame-preview .frame-preview-avatar { position: absolute; z-index: 1; inset: 15%; width: 70%; height: 70%; border-radius: 50%; object-fit: cover; }
.profile-cosmetic-thumb.frame-preview .frame-preview-art { position: absolute; z-index: 2; inset: -14%; width: 128%; height: 128%; object-fit: contain; pointer-events: none; }
.profile-cosmetic-thumb.frame-gold, .profile-cosmetic-thumb.frame-purple { border: 0; box-shadow: none; }
@media (max-width: 520px) {
  .avatar-frame-overlay { inset: -15% !important; width: 130% !important; height: 130% !important; }
}

/* Molduras base também precisam atingir o avatar grande do perfil e dos modais */
.avatar-big.frame-gold { border: 2px solid var(--gold); box-shadow: 0 0 0 2px rgba(255,210,75,.28), 0 0 18px rgba(255,210,75,.22); }
.avatar-big.frame-purple { border: 2px solid #c6a1ff; box-shadow: 0 0 0 2px rgba(198,161,255,.24), 0 0 18px rgba(198,161,255,.18); }

/* Preview real das molduras: avatar demonstrativo no centro + arte transparente ao redor */
.cosmetic-card:has(.cosmetic-frame-preview) { grid-template-columns: 4rem minmax(0, 1fr) auto; }
.cosmetic-preview.frame:has(.cosmetic-frame-preview) {
  width: 3.7rem;
  height: 3.7rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  color: inherit;
}
.cosmetic-frame-preview {
  position: relative;
  display: block;
  width: 3.7rem;
  height: 3.7rem;
  overflow: visible;
}
.cosmetic-preview-avatar {
  position: absolute;
  z-index: 1;
  inset: 15%;
  width: 70%;
  height: 70%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  background: #111827;
}
.cosmetic-frame-art {
  position: absolute;
  z-index: 2;
  inset: -13%;
  width: 126%;
  height: 126%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}
@media (max-width: 540px) {
  .cosmetic-card:has(.cosmetic-frame-preview) { grid-template-columns: 3.65rem minmax(0, 1fr); }
  .cosmetic-preview.frame:has(.cosmetic-frame-preview), .cosmetic-frame-preview { width: 3.35rem; height: 3.35rem; }
  .cosmetic-preview-avatar { inset: 15%; width: 70%; height: 70%; }
  .cosmetic-frame-art { inset: -13%; width: 126%; height: 126%; }
}

/* Ajuste fino: a moldura acompanha o avatar, sem ficar torta ou grande demais */
.avatar-frame-overlay { inset: -5% !important; width: 110% !important; height: 110% !important; }
.profile-cosmetic-thumb.frame-preview .frame-preview-art { inset: -6%; width: 112%; height: 112%; }
.cosmetic-frame-art { inset: -6%; width: 112%; height: 112%; }
@media (max-width: 520px) {
  .avatar-frame-overlay { inset: -5% !important; width: 110% !important; height: 110% !important; }
  .profile-cosmetic-thumb.frame-preview .frame-preview-art, .cosmetic-frame-art { inset: -6%; width: 112%; height: 112%; }
}

/* Centralização definitiva: inset + width causava deslocamento horizontal no Chrome mobile */
.avatar-frame-overlay,
.profile-cosmetic-thumb.frame-preview .frame-preview-art,
.cosmetic-frame-art {
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
}
.avatar-frame-overlay { inset: auto !important; width: 110% !important; height: 110% !important; }
.profile-cosmetic-thumb.frame-preview .frame-preview-art,
.cosmetic-frame-art { inset: auto !important; width: 112% !important; height: 112% !important; }

/* Última regra do cascade: não usar inset depois de centralizar */
.avatar-frame-overlay,
.profile-cosmetic-thumb.frame-preview .frame-preview-art,
.cosmetic-frame-art {
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
}
