/* ==========================================================================
   Componentes reutilizáveis
   ========================================================================== */

/* ---------- Botões ---------- */
.btn {
  --h: 40px;
  height: var(--h); padding: 0 16px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: var(--fs-md); font-weight: 600; white-space: nowrap; line-height: 1;
  background: var(--surface); color: var(--text);
  transition: background var(--t), color var(--t), transform var(--t-fast), box-shadow var(--t), opacity var(--t);
  user-select: none;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); box-shadow: 0 6px 20px -8px var(--brand-glow); }
.btn-primary:active { background: var(--brand-press); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-outline { background: transparent; border: 1px solid var(--surface-3); }
.btn-outline:hover { border-color: var(--muted-2); background: transparent; }
.btn-outline-light { background: transparent; border: 1px solid rgba(255,255,255,0.85); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,0.08); }
.btn-danger { background: var(--loss); color: #fff; }
.btn-danger:hover { background: #ff7482; }
.btn-dark { background: var(--bg-elev); }
.btn-sm { --h: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { --h: 48px; padding: 0 22px; font-size: 15px; }
.btn-xl { --h: 52px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading > :not(.spinner) { opacity: 0.4; }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: inline-grid; place-items: center; background: var(--surface); color: var(--text);
  transition: background var(--t), color var(--t); position: relative; flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.is-active { color: var(--brand); background: var(--brand-soft); }
.icon-btn.ghost { background: transparent; color: var(--muted); }
.icon-btn.ghost:hover { color: var(--text); background: var(--surface); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn .dot-badge {
  position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--loss); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg);
}

.link { color: var(--brand); font-weight: 500; }
.link:hover { text-decoration: underline; }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite; display: inline-block;
}

/* ---------- Formulários ---------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 14px; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; gap: 8px; }
.field-label .req { color: var(--loss); }
.field-hint { font-size: 12px; color: var(--muted-2); }
.field-error { font-size: 12px; color: var(--loss); min-height: 0; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-sm);
  background: var(--bg); border: 1px solid var(--surface-3); color: var(--text);
  font-size: var(--fs-md); transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--loss); box-shadow: 0 0 0 3px rgba(255, 90, 106, 0.12); }
.input[readonly] { background: var(--bg-elev); color: var(--muted); }
.input.has-icon { padding-left: 40px; }
.input.has-action { padding-right: 44px; }
.input-icon { position: absolute; left: 12px; color: var(--muted-2); pointer-events: none; }
.input-action { position: absolute; right: 6px; }
.input-suffix { position: absolute; right: 10px; display: flex; gap: 4px; }
.textarea { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%2399a8b1'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select option { background: var(--bg-elev); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row .field + .field { margin-top: 0; }
@media (max-width: 479px) { .form-row { grid-template-columns: 1fr; } }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); cursor: pointer; line-height: 1.45; }
.check input { appearance: none; flex-shrink: 0; width: 18px; height: 18px; margin: 1px 0 0; border-radius: 5px; border: 1.5px solid var(--muted-3); background: var(--bg); cursor: pointer; display: grid; place-items: center; transition: background var(--t), border-color var(--t); }
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after { content: ''; width: 5px; height: 9px; border: solid var(--brand-ink); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check a { color: var(--text); text-decoration: underline; }

.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background var(--t); }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform var(--t) var(--ease); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row h4 { font-size: 14.5px; font-weight: 500; }
.setting-row p { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; }

.password-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.password-meter i { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background var(--t); }
.password-meter[data-score="1"] i:nth-child(-n+1) { background: var(--loss); }
.password-meter[data-score="2"] i:nth-child(-n+2) { background: var(--warn); }
.password-meter[data-score="3"] i:nth-child(-n+3) { background: #9be15d; }
.password-meter[data-score="4"] i { background: var(--brand); }

/* ---------- Segmentado / Tabs / Chips ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  height: 40px; padding: 0 16px; border-radius: var(--r-sm); font-size: var(--fs-md);
  border: 1px solid var(--surface); color: var(--muted); background: transparent;
  display: inline-flex; align-items: center; gap: 8px; transition: all var(--t);
}
.tab:hover { color: var(--text); border-color: var(--surface-3); }
.tab.is-active { color: var(--brand); background: var(--brand-soft); border-color: var(--surface); }
.tab .count { font-size: 11px; background: var(--surface); color: var(--muted); padding: 1px 7px; border-radius: 99px; }

.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg); border-radius: var(--r-md); border: 1px solid var(--surface); }
.segmented button { height: 34px; padding: 0 14px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; color: var(--muted); transition: all var(--t); flex: 1; white-space: nowrap; }
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented.full { display: flex; width: 100%; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 99px; background: var(--surface); color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13.5px; font-weight: 500;
  transition: all var(--t); border: 1px solid transparent;
}
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip.is-active { color: var(--brand-ink); background: var(--brand); }
.chip .ic { flex-shrink: 0; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; line-height: 1; }
.badge-new { background: #3bd65b; color: #04210b; font-size: 9px; height: 16px; padding: 0 5px; border-radius: 3px; }
.badge-exclusive { background: #29d07a; color: #04210b; }
.badge-hot { background: #ff6b3d; color: #fff; }
.badge-live { background: var(--brand); color: var(--brand-ink); text-transform: none; font-weight: 600; font-size: 11px; border-radius: 5px; }
.badge-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: livePing 1.6s infinite; }
.badge-soft { background: var(--surface); color: var(--muted); }
.badge-success { background: rgba(94, 228, 60, 0.12); color: var(--win); }
.badge-danger { background: rgba(255, 90, 106, 0.12); color: var(--loss); }
.badge-warn { background: rgba(244, 183, 49, 0.14); color: var(--warn); }
.badge-info { background: rgba(63, 182, 255, 0.12); color: var(--info); }

/* ---------- Seções ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; margin-bottom: 20px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 600; line-height: 24.8px; color: var(--text-soft); }
.section-title a { display: inline-flex; align-items: center; gap: 8px; transition: color var(--t); }
.section-title a:hover { color: var(--brand); }
.section-title .ic { color: currentColor; flex-shrink: 0; width: 24px; height: 24px; }
.section-actions .btn { --h: 40px; padding: 0 16px; min-width: 99px; border-radius: 6px; background: var(--surface); font-weight: 500; font-size: 14px; }
.section-actions .btn:hover { background: var(--surface-2); }
.section-title small { font-size: 13px; color: var(--muted-2); font-weight: 400; }
.section-actions { display: flex; align-items: center; gap: 8px; }
@media (max-width: 767px) {
  .section-title { font-size: 18px; line-height: 24px; }
  .section-head { min-height: 32px; margin-bottom: 16px; }
  .section-actions .btn { --h: 32px; min-width: 0; padding: 0 12px; font-size: 14px; }
}

/* ---------- Scroller horizontal com setas ---------- */
.scroller { position: relative; }
.scroller-track {
  display: grid; grid-auto-flow: column; gap: var(--card-gap);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; padding: 26px 0 4px; margin-top: -26px;
}
.scroller-track::-webkit-scrollbar { display: none; }
.scroller-track > * { scroll-snap-align: start; }
.scroller-track.cols-7 { grid-auto-columns: calc((100% - 6 * var(--card-gap)) / 7); }
.scroller-track.cols-7 { padding: 8px 0 0; margin-top: -8px; }
.scroller-track.cols-3 { grid-auto-columns: calc((100% - 2 * var(--card-gap)) / 3); }
.scroller-track.cols-2 { grid-auto-columns: calc((100% - 1 * var(--card-gap)) / 2); }
.scroller-track.cols-wins { grid-auto-columns: 96px; gap: 10px; }
.scroller-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted-2);
  transition: color var(--t);
}
.scroller-arrow:hover { color: #fff; }
.scroller-arrow[disabled] { color: var(--surface); cursor: default; }
.scroller-arrow.prev { left: -36px; }
.scroller-arrow.next { right: -36px; }
@media (max-width: 1400px) { .scroller-arrow { display: none; } }
@media (max-width: 1279px) { .scroller-track.cols-7 { grid-auto-columns: calc((100% - 5 * var(--card-gap)) / 6); } }
@media (max-width: 1023px) {
  :root { --card-gap: 10px; }
  .scroller-track.cols-7 { grid-auto-columns: calc((100% - 4 * var(--card-gap)) / 5); }
  .scroller-track.cols-3 { grid-auto-columns: 42%; }
}
@media (max-width: 767px) {
  :root { --card-gap: 6px; }
  .scroller-track.cols-7 { grid-auto-columns: calc((100% - 2 * var(--card-gap)) / 3); }
  .scroller-track.cols-3 { grid-auto-columns: 78%; }
  .scroller-track.cols-2 { grid-auto-columns: 88%; }
  .provider-card { height: 61.23px; }
}

/* ---------- Card de jogo ---------- */
.game-card { position: relative; display: block; border-radius: var(--r-md); isolation: isolate; }
.game-card-media {
  position: relative; aspect-ratio: 167 / 222; border-radius: 12px;
  transition: transform 300ms ease-out;
}
.game-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: lighten; }
@media (hover: none) { .game-card:hover .game-card-media { transform: none; } }
.game-card-media img.is-loaded { animation: cardReveal 400ms var(--ease); }
.game-card:hover .game-card-media { transform: translateY(-8px); }
.game-card-overlay {
  position: absolute; inset: 3% 2.5%; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, rgba(1,12,16,0.25), rgba(1,12,16,0.82));
  opacity: 0; transition: opacity var(--t); padding: 10px; text-align: center;
}
.game-card:hover .game-card-overlay, .game-card:focus-visible .game-card-overlay { opacity: 1; }
.game-card-play { width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; transform: scale(0.8); transition: transform var(--t) var(--ease); box-shadow: 0 0 30px -4px var(--brand-glow); }
.game-card:hover .game-card-play { transform: scale(1); }
.game-card-name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.game-card-prov { font-size: 11px; color: var(--muted); }
.game-card-tags { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; z-index: 2; }
.game-card-fav {
  position: absolute; top: 6px; right: 6px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(1,12,16,0.55); color: #fff; opacity: 0;
  transition: opacity var(--t), color var(--t), transform var(--t-fast); backdrop-filter: blur(4px);
}
.game-card:hover .game-card-fav, .game-card-fav.is-on { opacity: 1; }
.game-card-fav.is-on { color: var(--gold); }
.game-card-fav.is-on .ic { fill: currentColor; }
.game-card-fav:active { transform: scale(0.9); }
.game-card-foot { padding: 8px 2px 0; }
.game-card-foot .n { font-size: 13px; font-weight: 500; }
.game-card-foot .p { font-size: 11.5px; color: var(--muted-2); }

/* grade de jogos */
.game-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 20px var(--card-gap); }
@media (max-width: 1279px) { .game-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .game-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 767px) { .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; } }

/* ---------- Skeleton ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--surface); border-radius: var(--r-md); }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent); animation: skeletonSweep 1.3s infinite; }

/* ---------- Provedor ---------- */
.provider-card {
  height: 80px; border-radius: 8px; background: var(--bg-elev);
  display: grid; place-items: center; padding: 0; color: var(--muted-2); overflow: hidden;
  transition: background var(--t), color var(--t);
}
.provider-card:hover { color: #fff; }
.provider-card svg { width: 100%; height: var(--lh, 24px); }
.provider-card .prov-wordmark { font-weight: 700; font-size: 15px; letter-spacing: 0.3px; }
.prov-own { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
@media (min-width: 1024px) { .provider-card svg { height: var(--lg, 28px); } }

/* ---------- Tabela ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; font-size: 14px; }
.table th { text-align: left; font-weight: 400; color: var(--muted-2); font-size: 14px; padding: 12px; white-space: nowrap; }
.table td { padding: 0 12px; height: 48px; white-space: nowrap; }
.table tbody tr:nth-child(odd) td { background: var(--bg-elev); }
.table tbody tr td:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.table tbody tr td:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.table .num { text-align: right; }
@media (max-width: 599px) { .table.wrap-sm th, .table.wrap-sm td { white-space: normal; padding-left: 8px; padding-right: 8px; } .table.wrap-sm th { line-height: 1.3; } }
.table-plain tbody tr td { background: transparent !important; border-bottom: 1px solid var(--line); border-radius: 0 !important; }

/* ---------- Painel / cartões genéricos ---------- */
.panel { background: var(--bg-elev); border-radius: var(--r-lg); padding: 20px; }
.panel-lg { padding: 28px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { font-size: 17px; }
.card-soft { background: var(--surface); border-radius: var(--r-md); padding: 16px; }
.stat { background: var(--bg-elev); border-radius: var(--r-md); padding: 16px 18px; }
.stat .k { font-size: 12.5px; color: var(--muted-2); }
.stat .v { font-size: 20px; font-weight: 600; margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 767px) { .stats { grid-template-columns: 1fr 1fr; } .panel { padding: 16px; } .panel-lg { padding: 20px; } }

.divider { height: 1px; background: var(--line); margin: 18px 0; }
.or-divider { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 12px; margin: 18px 0; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--surface-3); }

.progress { height: 8px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-press), var(--brand)); transition: width 700ms var(--ease); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  font-size: 13px; font-weight: 700; color: #fff; background: hsl(var(--hue, 150) 55% 32%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08);
}
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }

.empty { text-align: center; padding: 56px 16px; display: grid; justify-items: center; gap: 8px; }
.empty .empty-ic { width: 64px; height: 64px; border-radius: 18px; background: var(--surface); display: grid; place-items: center; color: var(--muted); margin-bottom: 8px; }
.empty h3 { font-size: 18px; }
.empty p { color: var(--muted); font-size: 14px; max-width: 380px; }

.kbd { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--surface); color: var(--muted); border: 1px solid var(--surface-3); }

.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }

.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); font-size: 13px; line-height: 1.5; background: var(--surface); color: var(--muted); }
.alert .ic { flex-shrink: 0; margin-top: 1px; }
.alert-warn { background: rgba(244, 183, 49, 0.1); color: #f6d27d; }
.alert-info { background: rgba(63, 182, 255, 0.08); color: #a9dcff; }
.alert-success { background: rgba(94, 228, 60, 0.08); color: #b4f59f; }
.alert-danger { background: rgba(255, 90, 106, 0.1); color: #ffb3bb; }

/* ---------- Acordeão ---------- */
.accordion { background: var(--bg-elev); border-radius: var(--r-md); }
.accordion + .accordion { margin-top: 8px; }
.accordion-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; font-size: 18px; font-weight: 500; text-align: left; }
.accordion-head .ic { transition: transform var(--t) var(--ease); color: var(--text); flex-shrink: 0; }
.accordion.is-open .accordion-head .ic { transform: rotate(180deg); }
.accordion-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-slow) var(--ease); }
.accordion.is-open .accordion-body { grid-template-rows: 1fr; }
.accordion-body > div { overflow: hidden; }
.accordion-content { padding: 0 20px 24px; }
.accordion.sm .accordion-head { font-size: 15px; padding: 16px 18px; }
.accordion.sm .accordion-content { padding: 0 18px 18px; color: var(--muted); font-size: 14px; }

/* ---------- Prosa (textos longos) ---------- */
.prose { color: var(--muted); font-size: 14.5px; line-height: 1.75; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); margin: 1.6em 0 0.6em; }
.prose h1 { font-size: 24px; margin-top: 0; }
.prose h2 { font-size: 20px; }
.prose h3 { font-size: 17px; }
.prose p + p { margin-top: 1em; }
.prose ul { list-style: disc; padding-left: 1.3em; margin: 0.8em 0; display: grid; gap: 4px; }
.prose ol { list-style: decimal; padding-left: 1.3em; margin: 0.8em 0; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--brand); }
.prose a:hover { text-decoration: underline; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 500; background: rgba(12, 29, 37, 0.8);
  display: grid; place-items: center; padding: 8px; overflow-y: auto;
  animation: fadeOpacity 160ms var(--ease);
}
.modal {
  width: 100%; max-height: calc(100dvh - 16px); overflow-y: auto; position: relative;
  background: var(--bg-elev); border-radius: 12px;
  box-shadow: var(--shadow-lg); animation: fadeScale 220ms var(--ease);
}
.modal-sm { max-width: 420px; }
.modal-md { max-width: 520px; }
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 980px; }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 16px 24px; background: var(--bg-elev); border-bottom: 1px solid var(--line); }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-bare .modal-body { padding: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.modal-backdrop.is-leaving { animation: fadeOpacity 180ms reverse forwards; }
.modal-backdrop.is-leaving .modal { animation: fadeScaleOut 180ms var(--ease) forwards; }
@media (max-width: 767px) {
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 94dvh; border-radius: 16px 16px 0 0; animation: sheetUp 280ms var(--ease); max-width: none; }
  .modal-body { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .modal-head { padding-left: 16px; }
}

/* ---------- Toast ---------- */
.toast-root { position: fixed; top: 16px; right: 16px; z-index: 900; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.toast {
  position: relative; overflow: hidden; display: flex; gap: 12px; align-items: flex-start; padding: 14px 40px 14px 14px;
  background: var(--surface); border: 1px solid var(--surface-3); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  animation: toastIn 320ms var(--ease);
}
.toast.is-leaving { animation: toastOut 220ms var(--ease) forwards; }
.toast-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-3); }
.toast-success .toast-icon { background: var(--brand-soft); color: var(--brand); }
.toast-error .toast-icon { background: rgba(255,90,106,0.14); color: var(--loss); }
.toast-warn .toast-icon { background: rgba(244,183,49,0.14); color: var(--warn); }
.toast-info .toast-icon { background: rgba(63,182,255,0.12); color: var(--info); }
.toast-body strong { display: block; font-size: 14px; }
.toast-body p { font-size: 13px; color: var(--muted); line-height: 1.45; }
.toast-close { position: absolute; top: 10px; right: 10px; color: var(--muted-2); }
.toast-close:hover { color: var(--text); }
.toast-life { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--brand); transform-origin: left; animation: toastLife linear forwards; opacity: 0.6; }
@media (max-width: 1023px) { .toast-root { top: calc(var(--header-h) + 8px); left: 16px; right: 16px; width: auto; } }

/* ---------- Popover / menu do usuário ---------- */
.popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 240px;
  background: var(--bg-elev); border: 1px solid var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 8px; animation: popIn 160ms var(--ease);
}
.popover-anchor { position: relative; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; color: var(--muted); text-align: left; }
.menu-item:hover { background: var(--surface); color: var(--text); }
.menu-item .ic { color: var(--muted-2); }
.menu-item:hover .ic { color: var(--text); }
.menu-item.danger:hover { color: var(--loss); }
.menu-item.danger:hover .ic { color: var(--loss); }

/* Saldo no header */
.balance-pill { display: flex; align-items: stretch; height: 40px; border-radius: var(--r-sm); background: var(--bg-elev); border: 1px solid var(--surface); }
/* sem overflow:hidden (cortava o menu de moedas no desktop): os cantos vão nos filhos */
.balance-pill > .popover-anchor { display: flex; }
.balance-pill > .popover-anchor > .balance-btn { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.balance-pill > .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0 !important; }
.balance-btn { display: flex; align-items: center; gap: 8px; padding: 0 12px; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.balance-btn:hover { background: var(--surface); }
.balance-btn .ic.caret { color: var(--muted); }
.balance-pill .btn { border-radius: 0; height: auto; }
.balance-amount.flash-up { animation: flashUp 700ms var(--ease); }
.balance-amount.flash-down { animation: flashDown 700ms var(--ease); }
.coin-ic { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 8px; font-weight: 800; color: #fff; flex-shrink: 0; letter-spacing: -0.3px; }
.coin-ic.lg { width: 28px; height: 28px; font-size: 10px; }
.currency-menu { width: 300px; max-height: 420px; overflow-y: auto; }
.currency-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; }
.currency-row:hover, .currency-row.is-active { background: var(--surface); }
.currency-row .amt { font-variant-numeric: tabular-nums; font-weight: 500; }
@media (max-width: 479px) { .balance-btn { padding: 0 8px; font-size: 13px; } .balance-pill .btn { padding: 0 10px; } .balance-pill .btn span { display: none; } }

/* Lista de notificações */
.notif-list { width: 360px; max-height: 460px; overflow-y: auto; }
.notif { display: flex; gap: 12px; padding: 12px; border-radius: var(--r-sm); }
.notif:hover { background: var(--surface); }
.notif-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; color: var(--brand); flex-shrink: 0; }
.notif h5 { font-size: 13.5px; font-weight: 600; }
.notif p { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.notif time { font-size: 11px; color: var(--muted-2); }
.notif.unread h5::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: 6px; vertical-align: middle; }
@media (max-width: 479px) { .notif-list, .currency-menu { width: calc(100vw - 24px); } .popover { position: fixed; top: calc(var(--header-h) + 4px); left: 12px; right: 12px; } }

/* Breadcrumb */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted-2); flex-wrap: wrap; }
.crumbs a:hover { color: var(--text); }
.crumbs .ic { opacity: 0.6; }

/* Tooltip simples */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--surface-3); color: var(--text); font-size: 12px; padding: 5px 8px; border-radius: 6px; white-space: nowrap; z-index: 20; pointer-events: none;
}

/* Paginação / carregar mais */
.load-more { display: grid; justify-items: center; gap: 12px; margin-top: 32px; }
.load-more .progress { width: 220px; height: 4px; }
.load-more small { color: var(--muted-2); font-size: 13px; }

/* Cookie banner */
.cookie-bar {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 400; max-width: 560px; margin-left: auto;
  background: var(--surface); border: 1px solid var(--surface-3); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-lg);
  display: flex; gap: 16px; align-items: center; animation: sheetUp 360ms var(--ease);
}
.cookie-bar p { font-size: 13px; color: var(--muted); }
.cookie-bar a { color: var(--text); text-decoration: underline; }
@media (max-width: 1023px) { .cookie-bar { bottom: calc(var(--mobile-nav-h) + 12px); flex-direction: column; align-items: stretch; } }

/* QR */
.qr-box { background: #fff; padding: 10px; border-radius: var(--r-md); width: 168px; height: 168px; display: grid; place-items: center; flex-shrink: 0; }
.qr-box img, .qr-box svg { width: 100%; height: 100%; image-rendering: pixelated; }

/* ------------------------------------------------------------------ Carteira (modal) */
.wallet { display: flex; flex-direction: column; gap: 16px; }
.wallet-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; margin: -4px 0 0; background: var(--bg); border: 1px solid var(--surface); border-radius: var(--r-md); }
.wallet-tab { min-width: 0; height: 36px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: background var(--t), color var(--t); }
.wallet-tab:hover { color: var(--text); }
.wallet-tab.is-active { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-sm); }
.wallet-bal { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); font-size: 13px; }
.wallet-bal strong { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wallet-sec { display: flex; flex-direction: column; gap: 14px; }
.wallet-sec .field + .field { margin-top: 0; }
.coin-select { display: flex; flex-wrap: wrap; gap: 6px; }
.coin-opt { height: 34px; padding: 0 10px 0 6px; display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-full); background: var(--bg); border: 1px solid var(--surface); font-size: 12.5px; font-weight: 600; color: var(--muted); transition: border-color var(--t), color var(--t), background var(--t); }
.coin-opt:hover { color: var(--text); border-color: var(--line-strong); }
.coin-opt.is-active { color: var(--text); border-color: var(--brand); background: var(--brand-soft); }
.net-seg { flex-wrap: wrap; }
.deposit-box { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--surface); }
.deposit-box .copy-field .input { min-width: 0; flex: 1; }
.deposit-box .field-label { margin-bottom: 6px; }
.deposit-notes { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; padding-left: 16px; list-style: disc; font-size: 12.5px; line-height: 18px; color: var(--muted-2); }
.deposit-notes strong { color: var(--text-soft); font-weight: 600; }
.demo-box { padding: 14px; border-radius: var(--r-md); border: 1px dashed var(--line-strong); background: rgba(16, 171, 225, 0.04); }
.demo-box .input { flex: 1; min-width: 0; }
.wd-summary { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); font-size: 13px; }
.wd-summary > div { display: flex; justify-content: space-between; gap: 12px; }
.wd-summary strong { font-variant-numeric: tabular-nums; }
.pay-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pay-method { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--surface); text-align: left; transition: border-color var(--t), background var(--t); }
.pay-method strong { font-size: 13.5px; font-weight: 600; color: var(--text); }
.pay-method span { font-size: 11.5px; color: var(--muted-2); }
.pay-method:hover { border-color: var(--line-strong); }
.pay-method.is-active { border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 559px) {
  .deposit-box { flex-direction: column; align-items: center; }
  .deposit-box > .grow { width: 100%; }
  .pay-methods { grid-template-columns: 1fr; }
  .wallet-tab { padding: 0 6px; font-size: 12px; }
}

.qr-missing { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; color: #3b5563; font-size: 11.5px; line-height: 1.35; padding: 8px; }

/* nome do jogo original sobre a capa ilustrada (a arte não tem texto) */
.game-card-title { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 34% 8px 9%; background: linear-gradient(180deg, transparent, rgba(4, 10, 12, .82)); color: #fff; font-weight: 800; font-size: clamp(12px, 1.05vw, 16px); line-height: 1.1; letter-spacing: .05em; text-transform: uppercase; text-align: center; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); pointer-events: none; border-radius: 0 0 inherit inherit; overflow-wrap: anywhere; }
