/* ---------- telas do app (login, início, sala, convite, extrato) ---------- */
body { overflow: auto; }
body.in-game { overflow: hidden; }

.screen {
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  animation: screen-in .3s ease;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } }

.screen-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.screen-body.narrow { max-width: 420px; width: 100%; margin: 0 auto; }
.screen-body.center { text-align: center; align-items: stretch; justify-content: center; flex: 1; }

.app-header {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 14px 18px; position: sticky; top: 0; z-index: 2;
  background: linear-gradient(180deg, #0b0f0dee, #0b0f0d00);
}
.app-header .title { text-align: center; font-weight: 600; }
.app-header .title strong { color: var(--gold); letter-spacing: .1em; }
.hello { font-size: 1.05rem; }

.icon-btn {
  font: inherit; color: #fff; background: #ffffff12; border: none; cursor: pointer;
  border-radius: 10px; padding: 8px 12px; min-width: 40px;
}
.icon-btn:hover { background: #ffffff22; }

.link-btn {
  font: inherit; background: none; border: none; color: #9fe8c0; cursor: pointer;
  padding: 8px; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn.danger { color: var(--bot); }

.btn-block { width: 100%; display: block; text-align: center; text-decoration: none; }
.btn-whatsapp { background: #25d366; color: #06301a; font-size: 1.05rem; }
.btn-danger { background: var(--bot); color: #2b0000; }
.hint { font-size: .85rem; opacity: .7; line-height: 1.45; margin: 0; }

/* ---------- marca ---------- */
.brand { text-align: center; margin: 28px 0 6px; }
.brand.small { margin: 0; }
.brand-logo { font-size: 3.4rem; animation: float 3s ease-in-out infinite; }
.brand h1 { margin: 6px 0 4px; font-size: 1.9rem; }
.brand h1 span { color: var(--gold); }
.brand p { margin: 0; opacity: .75; }
@keyframes float { 50% { transform: translateY(-6px) rotate(-4deg); } }

/* ---------- formulários ---------- */
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #ffffff0f; border-radius: 12px; padding: 4px; }
.tabs button {
  font: inherit; font-weight: 700; color: #fff; background: none; border: none; cursor: pointer;
  padding: 10px; border-radius: 9px; opacity: .65;
}
.tabs button[aria-selected="true"] { background: #ffffff1c; opacity: 1; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 600; }
.form label small { font-weight: 400; opacity: .6; }
.form input, .code-card input {
  font: inherit; font-size: 1rem; color: #fff;
  background: #ffffff0d; border: 1.5px solid #ffffff26; border-radius: 10px; padding: 12px;
}
.form input:focus, .code-card input:focus { outline: none; border-color: var(--you); background: #ffffff14; }
.form-error { color: var(--bot); min-height: 1.2em; margin: 0; font-size: .9rem; }

/* ---------- início ---------- */
.balance-card {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px;
  padding: 18px; border-radius: 18px;
  background: linear-gradient(135deg, #12633f, #0a3d27);
  box-shadow: inset 0 0 0 1px #ffffff1a, 0 10px 30px #0007;
}
.balance-card .label { grid-column: 1 / -1; opacity: .8; font-size: .85rem; }
.balance-card .value { font-size: 2rem; }

.resume-banner {
  font: inherit; color: var(--ink); cursor: pointer; border: none;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 14px 16px; border-radius: 14px; background: var(--gold);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 6px #f4c54233; } }

.menu-card {
  font: inherit; color: #fff; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: 16px;
  background: #ffffff0b; border: 1px solid #ffffff1f;
  transition: transform .15s, background .2s;
}
.menu-card:hover { transform: translateY(-2px); background: #ffffff12; }
.menu-card.primary { background: linear-gradient(135deg, #2a2210, #1b1608); border-color: #f4c54266; }
.menu-icon { font-size: 1.9rem; }
.menu-text { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.menu-text small { opacity: .7; }
.menu-price { display: flex; flex-direction: column; align-items: flex-end; font-size: .8rem; opacity: .95; }
.menu-price > b { font-size: 1.15rem; color: var(--gold); }
.code-card { cursor: default; }
.code-card:hover { transform: none; }
.code-card input { padding: 8px 10px; text-transform: uppercase; letter-spacing: .15em; width: 100%; }
.code-card .btn { padding: 10px 16px; }

/* ---------- sala esperando ---------- */
.waiting h2 { margin: 18px 0 6px; }
.waiting p { margin: 0 0 12px; opacity: .85; }
.waiting-cards { position: relative; height: 110px; display: flex; justify-content: center; }
.waiting-cards span {
  position: absolute; width: 64px; height: 92px; border-radius: 8px; border: 3px solid #fff;
  background: repeating-linear-gradient(45deg, #8b1e2d 0 6px, #a8293a 6px 12px);
  box-shadow: 0 6px 16px #0008;
  animation: shuffle 2.4s ease-in-out infinite;
}
.waiting-cards span:nth-child(2) { animation-delay: .2s; }
.waiting-cards span:nth-child(3) { animation-delay: .4s; }
@keyframes shuffle {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-46px) rotate(-14deg); }
  75% { transform: translateX(46px) rotate(14deg); }
}

/* ---------- convite ---------- */
.invite-title { font-size: 1.4rem; line-height: 1.35; }
.invite-title span:first-child { color: var(--gold); }
.invite-prize {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 16px; border-radius: 16px; background: #ffffff0b; border: 1px solid #ffffff1f;
}
.invite-prize div { display: flex; flex-direction: column; gap: 4px; }
.invite-prize small { opacity: .7; }
.invite-prize b { font-size: 1.4rem; }
.invite-prize div:last-child b { color: var(--gold); }
.invite-prize .arrow { font-size: 1.4rem; opacity: .5; }

/* ---------- extrato ---------- */
.statement { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.statement li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px; background: #ffffff0b;
}
.statement li div { display: flex; flex-direction: column; gap: 2px; }
.statement small { opacity: .6; font-size: .78rem; }
.statement .pos { color: var(--you); }
.statement .neg { color: var(--bot); }
.statement .empty { justify-content: center; opacity: .6; }

/* ---------- mesa: extras do modo online ---------- */
.topbar { padding-left: 8px; }
.topbar .icon-btn { padding: 6px 10px; }
.actions { gap: 12px; align-items: center; }
.timer {
  font-weight: 800; padding: 8px 12px; border-radius: 999px; background: #ffffff14;
  font-variant-numeric: tabular-nums;
}
.timer.urgent { background: var(--bot); color: #2b0000; animation: pulse 1s infinite; }
.panel .subtitle { opacity: .8; margin: 0 0 8px; }
.app-header.main { display: flex; justify-content: space-between; }
.stake { white-space: nowrap; }
@media (max-width: 520px) {
  .topbar { gap: 6px; padding-right: 8px; }
  .topbar h1 { display: none; }
  .team .label { max-width: 7ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- header: título e avatar do perfil ---------- */
.page-title { margin: 0; font-size: 1.3rem; }
.avatar-btn {
  font: inherit; font-weight: 800; font-size: 1.05rem; color: var(--ink); cursor: pointer;
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid #ffffff40;
  background: linear-gradient(135deg, var(--gold), #e0a800);
  display: grid; place-items: center; flex: none;
  transition: transform .15s, box-shadow .2s;
}
.avatar-btn:hover { transform: scale(1.06); box-shadow: 0 0 0 4px #f4c54233; }
.section-title { margin: 8px 0 0; font-size: 1rem; opacity: .8; }

/* ---------- menu fixo embaixo ---------- */
body.has-nav .screen { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.has-nav .toast { bottom: calc(110px + env(safe-area-inset-bottom)); }

.bottom-nav {
  position: fixed; left: 50%; bottom: 0; z-index: 20; translate: -50% 0;
  width: 100%; max-width: 520px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end;
  padding: 8px 24px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #141a17f2, #0b0f0dfa);
  border-top: 1px solid #ffffff1a; border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px #0008;
  backdrop-filter: blur(8px);
}
.nav-item {
  font: inherit; font-size: .75rem; font-weight: 600; color: #fff; cursor: pointer;
  background: none; border: none; padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  opacity: .6; transition: opacity .2s, color .2s;
}
.nav-item svg { width: 26px; height: 26px; }
.nav-item:hover { opacity: .9; }
.nav-item[aria-current="page"] { opacity: 1; color: var(--you); }

/* botão principal: cartinha em destaque */
.nav-main { opacity: 1; margin-top: -34px; padding: 0 6px 2px; color: #ffffff99; }
.nav-card {
  width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #ffe08a, var(--gold) 45%, #c99400);
  border: 4px solid #0b0f0d;
  box-shadow: 0 6px 18px #f4c54255, 0 0 0 2px #f4c54266;
  transition: transform .2s;
}
.nav-card svg {
  width: 30px; height: 42px; transform: rotate(-10deg);
  filter: drop-shadow(0 2px 3px #0006);
  transition: transform .25s;
}
.nav-main:hover .nav-card { transform: translateY(-2px); }
.nav-main:hover .nav-card svg { transform: rotate(6deg) scale(1.05); }
.nav-main:active .nav-card { transform: scale(.94); }
.nav-main[aria-current="page"] { color: var(--gold); }
.nav-main[aria-current="page"] .nav-card { box-shadow: 0 6px 22px #f4c54288, 0 0 0 3px var(--gold); }

/* ---------- botão depositar ---------- */
.btn-deposit {
  background: linear-gradient(180deg, #ffd65a, #e0a800); color: #4a1500;
  padding: 10px 18px; font-size: 1rem; box-shadow: 0 4px 14px #f4c54244;
}
.btn-deposit:hover { filter: brightness(1.08); }
.balance-card .btn-deposit { align-self: end; }

.deposit-panel .deposit-values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.chip {
  font: inherit; font-weight: 700; color: #fff; cursor: pointer;
  padding: 10px 4px; border-radius: 12px; background: #ffffff0d; border: 2px solid #ffffff25;
}
.chip[aria-pressed="true"] { border-color: var(--gold); background: #f4c5421f; }
.deposit-soon {
  margin: 0; padding: 12px; border-radius: 12px; font-size: .88rem; line-height: 1.45;
  background: #f4c54214; border: 1px dashed #f4c54266;
}

/* ---------- histórico ---------- */
.history-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 14px 8px; border-radius: 16px; text-align: center;
  background: #ffffff0b; border: 1px solid #ffffff1f;
}
.history-summary div { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 0; }
.history-summary b { font-size: 1.2rem; white-space: nowrap; }
.history-summary [data-sum-net] { font-size: 1rem; line-height: 1.45rem; }
.history-summary small { font-size: .72rem; opacity: .65; }
.history-summary .win b { color: var(--you); }
.history-summary .loss b { color: var(--bot); }

.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.history .empty { text-align: center; opacity: .6; padding: 24px 12px; line-height: 1.6; }
.match {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px; background: #ffffff0b;
  border-left: 4px solid #ffffff30;
}
.match.vitoria { border-left-color: var(--you); }
.match.derrota { border-left-color: var(--bot); }
.match .badge {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800;
  background: #ffffff18;
}
.match.vitoria .badge { background: var(--you); color: var(--ink); }
.match.derrota .badge { background: var(--bot); color: #2b0000; }
.match-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.match-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-info small, .match-value small { opacity: .6; font-size: .78rem; }
.match-value { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.match.cancelada { opacity: .7; }
.pos { color: var(--you); }
.neg { color: var(--bot); }

/* ---------- perfil ---------- */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 4px; }
.avatar-lg {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; color: var(--ink);
  background: linear-gradient(135deg, var(--gold), #e0a800);
  border: 3px solid #ffffff40; box-shadow: 0 8px 24px #0007;
}
.profile-name { font-size: 1.25rem; text-align: center; }
.profile-head small { opacity: .6; }
.profile-data {
  margin: 0; border-radius: 16px; overflow: hidden;
  background: #ffffff0b; border: 1px solid #ffffff1f;
}
.profile-data div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid #ffffff12;
}
.profile-data div:last-child { border-bottom: none; }
.profile-data dt { opacity: .65; }
.profile-data dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.header-actions { display: flex; gap: 8px; }
.sound-btn { font-size: 1rem; }

.header-actions { align-items: center; }
