* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
}

:root {
  --arena-bg-image: none;
  --arena-slot-image: none;

  --bg1: #060812;
  --bg2: #0f1830;
  --bg3: #15112c;
  --panel: rgba(10, 16, 33, 0.78);
  --panel-strong: rgba(10, 16, 33, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);
  --gold: #ffd36a;
  --gold-2: #f0b646;
  --muted: #aeb8ca;
  --text: #f4f6fb;
  --danger: #ff5f83;
  --blue: #46d8ff;
  --green: #6fffb1;
  --purple: #9c7cff;
  --shadow: 0 24px 80px rgba(0,0,0,0.42);
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(156, 124, 255, 0.26), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(70, 216, 255, 0.20), transparent 24%),
    radial-gradient(circle at 80% 85%, rgba(255, 211, 106, 0.16), transparent 22%),
    linear-gradient(rgba(4, 7, 18, 0.78), rgba(4, 7, 18, 0.86)),
    url('https://i.imgur.com/x6tFNu4.png') center center / cover no-repeat fixed,
    linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3));
  background-attachment: fixed;
}

a {
  color: var(--gold);
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  font-weight: bold;
  cursor: pointer;
  color: #111722;
  background: linear-gradient(180deg, #ffe08a, #cd9c35);
  box-shadow: 0 10px 20px rgba(0,0,0,0.22);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 14px 28px rgba(0,0,0,0.28);
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

input, select {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  outline: none;
}

input::placeholder {
  color: #97a5c0;
}

.flash {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1000;
  display: grid;
  gap: 8px;
}

.flash div {
  background: rgba(0,0,0,0.78);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  color: #fff;
}

.glass-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)), var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.compact {
  padding: 12px 14px !important;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.panel-head h2 {
  color: var(--gold);
  font-size: 22px;
}

.panel-head span {
  font-size: 12px;
  color: var(--muted);
}

.brand-mark {
  display: inline-flex;
  gap: 12px;
  align-items: center;
}

.brand-mark img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,0.35));
}

.brand-mark strong {
  display: block;
  color: #fff;
  font-size: 20px;
}

.brand-mark span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.brand-mark.large img {
  width: 76px;
  height: 76px;
}

.gold-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  min-height: 44px;
  padding: 10px 16px;
  font-weight: bold;
  transition: transform .18s ease, filter .18s ease, background .18s ease;
}

.gold-btn {
  background: linear-gradient(180deg, #ffe08a, #cd9c35);
  color: #111722;
  box-shadow: 0 10px 22px rgba(205, 156, 53, 0.28);
}

.gold-btn.big,
.ghost-btn.big {
  min-height: 48px;
  padding: 12px 20px;
}

.ghost-btn {
  color: #fff;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
}

.gold-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.small-btn {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}

.full {
  width: 100%;
}

/* HOME */
.landing-page {
  min-height: 100vh;
  padding: 24px;
}

.landing-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.landing-nav {
  display: flex;
  gap: 10px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.88fr;
  gap: 22px;
  align-items: stretch;
}

.hero-copy,
.ranking-panel {
  padding: 28px;
}

.eyebrow {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: var(--gold);
  margin-bottom: 18px;
  font-size: 13px;
}

.hero-copy h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  margin-bottom: 16px;
}

.hero-copy p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
  max-width: 700px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.feature-badges,
.feature-stack {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.feature-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  color: #fff;
  font-size: 13px;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.info-card {
  padding: 22px;
}

.info-card h3 {
  color: var(--gold);
  margin-bottom: 10px;
}

.info-card p {
  color: var(--muted);
  line-height: 1.6;
}

.ranking-list {
  display: grid;
  gap: 10px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
}

.ranking-row.top-1 {
  border-color: rgba(255,211,106,0.55);
  box-shadow: 0 0 0 1px rgba(255,211,106,0.16) inset;
}

.ranking-row.top-2 {
  border-color: rgba(188, 212, 230, 0.45);
}

.ranking-row.top-3 {
  border-color: rgba(255, 170, 110, 0.42);
}

.rank-pos {
  font-size: 22px;
  font-weight: bold;
  color: var(--gold);
  text-align: center;
}

.rank-player {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rank-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  font-size: 20px;
}

.rank-player strong {
  display: block;
}

.rank-player small,
.rank-stats small {
  color: var(--muted);
  font-size: 12px;
}

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

.rank-stats strong {
  display: block;
  color: var(--gold);
}

.empty-state {
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  text-align: center;
}

.empty-state.small {
  padding: 12px;
  font-size: 13px;
}

/* AUTH */
.auth-shell {
  min-height: 100vh;
  padding: 22px;
  display: grid;
  grid-template-columns: 1.1fr 0.95fr;
  gap: 22px;
  align-items: center;
}

.auth-brand,
.auth-card {
  padding: 28px;
}

.auth-brand h1 {
  font-size: clamp(34px, 4vw, 48px);
  margin-top: 18px;
  margin-bottom: 12px;
}

.auth-brand p {
  color: var(--muted);
  line-height: 1.7;
  max-width: 620px;
}

.auth-card.premium {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)), var(--panel-strong);
  border: 1px solid var(--line-strong);
}

.auth-card-header h2 {
  color: var(--gold);
  font-size: 28px;
  margin-bottom: 6px;
}

.auth-card-header p {
  color: var(--muted);
  margin-bottom: 20px;
}

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

.auth-form label {
  font-size: 14px;
  color: #dbe6fa;
}

.auth-links {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
}

.auth-links.secondary {
  margin-top: 8px;
}

.mini-ranking {
  margin-top: 24px;
  display: grid;
  gap: 8px;
}

.mini-rank-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
}

.mini-rank-pos {
  color: var(--gold);
  font-weight: bold;
}

.mini-rank-name {
  color: #fff;
}

.mini-rank-points {
  color: var(--muted);
  font-size: 13px;
}

/* LOBBY */
.lobby-shell {
  min-height: 100vh;
  padding: 18px;
}

.lobby-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.player-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.player-summary-main {
  display: flex;
  gap: 12px;
  align-items: center;
}

.avatar-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  font-size: 24px;
}

.player-summary small {
  color: var(--muted);
}

.player-summary-stats {
  text-align: right;
}

.player-summary-stats span {
  display: block;
  color: var(--gold);
  font-weight: bold;
}

.lobby-nav {
  display: flex;
  gap: 10px;
  justify-content: end;
}

.lobby-main-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 18px;
}

.lobby-panel {
  padding: 22px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.action-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,0.04);
  display: grid;
  gap: 10px;
}

.action-card h3 {
  color: var(--gold);
}

.action-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.action-card-create {
  background: linear-gradient(180deg, rgba(255,211,106,0.09), rgba(255,255,255,0.03));
}


.training-wrap {
  margin-top: 18px;
}

.training-head {
  margin-bottom: 12px;
}

.challengers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.challenger-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  display: grid;
  gap: 0;
}

.challenger-frame {
  aspect-ratio: 1 / 1;
  background: rgba(0,0,0,0.35);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.challenger-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.challenger-body {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.challenger-body strong {
  color: #fff;
  font-size: 16px;
}

.challenger-title {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challenger-level {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 211, 106, 0.12);
  color: var(--gold);
  font-weight: 700;
  font-size: 12px;
}

.challenger-body p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  min-height: 38px;
}
.room-list-wrap {
  margin-top: 18px;
}

.room-list-wrap h3 {
  margin-bottom: 10px;
  color: #fff;
}

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

.room-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
}

.room-row strong {
  display: block;
}

.room-row small {
  color: var(--muted);
}

/* DECK / GAME OLD STRUCTURE */
.topbar,
.game-topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
}

.topbar h1,
.game-topbar h1 {
  color: var(--gold);
}

.topbar p,
.game-topbar p {
  color: var(--muted);
  margin-top: 4px;
}

.topbar nav,
.game-topbar nav {
  display: flex;
  gap: 14px;
}

.deck-page,
.game-page {
  min-height: 100vh;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  padding: 16px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.25);
}

.panel h2 {
  color: var(--gold);
  margin-bottom: 12px;
}

.deck-layout {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  max-height: calc(100vh - 160px);
  overflow: auto;
}

.library-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.library-card .card-icon {
  font-size: 36px;
}

.library-card strong {
  color: #fff;
}

.library-card span,
.library-card small,
.library-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.deck-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  margin: 12px 0;
}

.deck-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
}

.game-layout {
  height: calc(100vh - 72px);
  padding: 10px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 10px;
  overflow: hidden;
}

.game-side {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  overflow: hidden;
}

.game-side button {
  width: 100%;
  margin-bottom: 8px;
}

.battle-board {
  position: relative;
  border: 1px solid rgba(255, 211, 106, 0.24);
  border-radius: 26px;
  padding: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 8, 18, 0.10), rgba(5, 8, 18, 0.40)),
    var(--arena-bg-image) center/cover no-repeat;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.30),
    inset 0 0 0 1px rgba(255,255,255,0.05);
  backdrop-filter: blur(2px);
}

.battle-board::before {
  content: attr(data-arena-name);
  position: absolute;
  top: 12px;
  right: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(5, 8, 18, 0.62);
  border: 1px solid rgba(255, 211, 106, 0.30);
  color: #ffe9ab;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 2;
}

.battle-board::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255,255,255,0.06), transparent 58%);
}

.battle-zone {
  position: relative;
  min-height: 210px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(7, 10, 22, 0.55), rgba(7, 10, 22, 0.34));
  backdrop-filter: blur(3px);
  z-index: 1;
}

.battle-zone h2,
.hand-zone h2 {
  color: var(--gold);
  font-size: 16px;
  margin-bottom: 8px;
}

.battle-zone h2 span {
  color: var(--muted);
  font-size: 12px;
}

.field {
  height: calc(100% - 28px);
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.slot {
  position: relative;
  min-height: 166px;
  border: none;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--arena-slot-image) center/100% 100% no-repeat;
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
  padding: 8px;
}

.slot::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  background: radial-gradient(circle at center, rgba(255,255,255,0.05), transparent 68%);
  pointer-events: none;
}

.slot:empty::after {
  content: "";
}

.slot .game-card {
  position: relative;
  z-index: 1;
}

.hand-zone {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,0.28);
  padding: 10px;
  overflow: hidden;
}

.hand {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.game-card {
  width: 112px;
  min-width: 112px;
  height: 145px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  background: linear-gradient(160deg, #273246, #111723);
  padding: 6px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform .14s ease, box-shadow .14s ease;
}

.game-card:hover {
  transform: translateY(-2px);
}

.game-card .top {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #fff;
}

.game-card .icon {
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 26px;
}

.game-card .name {
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  min-height: 28px;
}

.game-card .skill {
  font-size: 8px;
  text-align: center;
  color: #dbe7ff;
  line-height: 1.15;
}

.game-card .stats {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(0,0,0,0.48);
  font-size: 9px;
  text-align: center;
}

.game-card .stats div {
  padding: 4px 2px;
}

.fogo { border-color: #ff7043; }
.agua { border-color: #46d8ff; }
.terra { border-color: #76c56f; }
.vento { border-color: #66ffe3; }
.luz { border-color: #ffd36a; }
.sombra { border-color: #9c7cff; }
.arcano { border-color: #db75ff; }

#directAttackBtn {
  background: linear-gradient(180deg, #9ef7ff, #3498c9);
}

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

@media (max-width: 1100px) {
  .hero-grid,
  .auth-shell,
  .lobby-main-grid {
    grid-template-columns: 1fr;
  }

  .landing-topbar,
  .lobby-topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .lobby-nav,
  .landing-nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  .deck-layout,
  .game-layout,
  .info-cards,
  .action-grid,
  .admin-grid,
  .form-grid-2,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }

  .game-layout {
    height: auto;
    overflow: auto;
  }

  .battle-board {
    height: 760px;
  }

  .player-summary {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .landing-page,
  .auth-shell,
  .lobby-shell {
    padding: 14px;
  }

  .hero-copy,
  .ranking-panel,
  .auth-brand,
  .auth-card,
  .lobby-panel {
    padding: 20px;
  }

  .ranking-row {
    grid-template-columns: 44px 1fr;
  }

  .rank-stats {
    grid-column: 2;
    text-align: left;
  }

  .hero-actions,
  .feature-badges,
  .feature-stack {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Correção visual: fundo místico nas telas iniciais */
.landing-page,
.auth-shell,
.lobby-shell {
  position: relative;
  isolation: isolate;
}

.landing-page::before,
.auth-shell::before,
.lobby-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(5, 8, 20, 0.68), rgba(5, 8, 20, 0.82)),
    url('https://i.imgur.com/x6tFNu4.png') center center / cover no-repeat;
  z-index: -2;
}

.landing-page::after,
.auth-shell::after,
.lobby-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 211, 106, 0.16), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(70, 216, 255, 0.15), transparent 26%),
    radial-gradient(circle at 55% 80%, rgba(156, 124, 255, 0.20), transparent 32%);
  pointer-events: none;
  z-index: -1;
}

/* Aumenta contraste dos cards sobre o fundo */
.glass-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025)),
    rgba(8, 12, 28, 0.84);
  backdrop-filter: blur(14px);
}

/* Caso a logo externa falhe, mantém layout estável */
.brand-mark img {
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 4px;
}


/* ==========================
   ANIMAÇÕES DE ATAQUE
========================== */

.attack-fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.attack-beam {
  position: fixed;
  left: 0;
  top: 0;
  height: 4px;
  border-radius: 999px;
  transform-origin: left center;
  background: linear-gradient(90deg, transparent, rgba(70,216,255,0.98), rgba(255,211,106,0.95), transparent);
  box-shadow:
    0 0 14px rgba(70,216,255,0.9),
    0 0 28px rgba(255,211,106,0.45);
  animation: attackBeamPulse 620ms ease-out forwards;
}

.attack-beam.direct {
  height: 5px;
  background: linear-gradient(90deg, transparent, rgba(255,211,106,1), rgba(255,95,131,0.95), transparent);
  box-shadow:
    0 0 16px rgba(255,211,106,0.95),
    0 0 32px rgba(255,95,131,0.50);
}

.attack-orb {
  position: fixed;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--gold), transparent 72%);
  box-shadow:
    0 0 18px rgba(255,255,255,0.9),
    0 0 38px rgba(255,211,106,0.65);
  animation: attackOrbExplosion 650ms ease-out forwards;
}

.card-attack-cast {
  animation: cardAttackCast 720ms ease-out;
  z-index: 60;
}

.card-impact-hit {
  animation: cardImpactHit 720ms ease-out;
}

.life-impact-hit {
  animation: lifeImpactHit 720ms ease-out;
}

@keyframes cardAttackCast {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  30% {
    transform: translateY(-8px) scale(1.08);
    filter: brightness(1.65);
    box-shadow: 0 0 24px rgba(255,211,106,0.60);
  }
  62% {
    transform: translateY(4px) scale(1.03);
    filter: brightness(1.3);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes cardImpactHit {
  0% {
    transform: translateX(0);
    filter: brightness(1);
  }
  15% {
    transform: translateX(-7px) rotate(-2deg);
    filter: brightness(1.9);
    box-shadow: 0 0 22px rgba(255,95,131,0.75);
  }
  35% {
    transform: translateX(7px) rotate(2deg);
  }
  55% {
    transform: translateX(-4px) rotate(-1deg);
  }
  75% {
    transform: translateX(3px);
  }
  100% {
    transform: translateX(0);
    filter: brightness(1);
  }
}

@keyframes lifeImpactHit {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  22% {
    transform: scale(1.08);
    filter: brightness(1.8);
    color: var(--danger);
    text-shadow: 0 0 18px rgba(255,95,131,0.8);
  }
  55% {
    transform: scale(0.98);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes attackBeamPulse {
  0% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    filter: brightness(2);
  }
  22% {
    opacity: 1;
    clip-path: inset(0 35% 0 0);
  }
  70% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
  100% {
    opacity: 0;
    clip-path: inset(0 0 0 100%);
    filter: brightness(1);
  }
}

@keyframes attackOrbExplosion {
  0% {
    transform: scale(0.35);
    opacity: 0;
  }
  30% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}


/* ==========================
   MODO TELESPECTADOR
========================== */

.room-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.spectator-layout {
  height: calc(100vh - 72px);
  padding: 10px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 10px;
  overflow: hidden;
}

.spectator-page .game-side {
  grid-template-rows: auto auto 1fr;
}

.spectator-note {
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.spectator-board {
  grid-template-rows: 1fr 1fr 94px;
}

.spectator-footer {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,0.28);
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  overflow: hidden;
}

.spectator-card {
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  padding: 10px 12px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.spectator-card strong {
  color: var(--gold);
}

.spectator-card span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .spectator-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: auto;
  }

  .spectator-board {
    height: 760px;
  }

  .spectator-footer {
    grid-template-columns: 1fr;
  }

  .room-actions {
    justify-content: flex-start;
  }
}


/* ==========================
   TIMER DE TURNO E RESULTADO
========================== */

.turn-timer-box {
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.055);
  display: grid;
  gap: 4px;
  text-align: center;
  transition: .2s ease;
}

.turn-timer-box span {
  color: var(--muted);
  font-size: 12px;
}

.turn-timer-box strong {
  color: var(--green);
  font-size: 38px;
  line-height: 1;
  text-shadow: 0 0 18px rgba(111,255,177,0.28);
}

.turn-timer-box.timer-warning strong {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255,211,106,0.45);
}

.turn-timer-box.timer-danger {
  border-color: rgba(255,95,131,0.42);
  box-shadow: 0 0 24px rgba(255,95,131,0.18);
  animation: timerDangerPulse .8s infinite ease-in-out;
}

.turn-timer-box.timer-danger strong {
  color: var(--danger);
  text-shadow: 0 0 20px rgba(255,95,131,0.60);
}

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

.result-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at center, rgba(255,211,106,0.10), transparent 34%),
    rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
  z-index: 1400;
}

.result-modal.active {
  display: flex;
  animation: resultFadeIn .25s ease-out;
}

.result-box {
  width: min(480px, 100%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 28px;
  padding: 34px 28px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
    rgba(8, 12, 28, 0.96);
  box-shadow:
    0 30px 90px rgba(0,0,0,0.58),
    0 0 40px rgba(255,211,106,0.18);
  animation: resultPop .36s ease-out;
}

.result-icon {
  width: 86px;
  height: 86px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16);
  background: radial-gradient(circle, rgba(255,211,106,0.32), rgba(156,124,255,0.12));
  font-size: 44px;
  box-shadow: 0 0 30px rgba(255,211,106,0.20);
}

.result-box h2 {
  color: var(--gold);
  font-size: 38px;
  margin-bottom: 10px;
}

.result-box p {
  color: #dce6f7;
  line-height: 1.55;
  margin-bottom: 22px;
}

@keyframes resultFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes resultPop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* ==========================
   EDITOR DE DECK MELHORADO
========================== */

.deck-card-detail {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.deck-card-main {
  display: grid;
  gap: 6px;
}

.deck-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.deck-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.11);
  font-size: 20px;
}

.deck-card-title strong {
  display: block;
  color: #fff;
  font-size: 13px;
}

.deck-card-title small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.deck-card-main p {
  color: #cbd8ee;
  font-size: 12px;
  line-height: 1.35;
}

/* Cartas de feitiço */
.game-card.spell-card {
  border-style: dashed;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,211,106,0.18), transparent 45%),
    linear-gradient(160deg, #312445, #111723);
}

.game-card.spell-card::before {
  content: "FEITIÇO";
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,211,106,0.88);
  color: #1a1202;
  font-size: 8px;
  font-weight: 900;
  z-index: 5;
}


/* ==========================
   DISPLAY DE VIDA / MANA
========================== */

.battle-zone h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.battle-zone h2 > span {
  flex: 1;
  min-width: 360px;
}

.vitals-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.vital-pill {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.07);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.vital-icon {
  font-size: 13px;
}

.vital-text {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.vital-pill strong {
  font-size: 16px;
  color: #fff;
  line-height: 1;
}

.life-pill {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.20), transparent 24%),
    linear-gradient(180deg, rgba(255,95,131,0.28), rgba(95,20,45,0.60));
  border-color: rgba(255,95,131,0.35);
  box-shadow: 0 0 14px rgba(255,95,131,0.16), inset 0 1px 0 rgba(255,255,255,0.08);
}

.life-pill strong {
  color: #ffe8ee;
  text-shadow: 0 0 10px rgba(255,95,131,0.45);
  font-size: 18px;
}

.mana-pill {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.20), transparent 24%),
    linear-gradient(180deg, rgba(70,216,255,0.28), rgba(15,65,100,0.62));
  border-color: rgba(70,216,255,0.35);
  box-shadow: 0 0 14px rgba(70,216,255,0.16), inset 0 1px 0 rgba(255,255,255,0.08);
}

.mana-pill strong {
  color: #e5fbff;
  text-shadow: 0 0 10px rgba(70,216,255,0.45);
  font-size: 18px;
}

.deck-pill,
.hand-pill {
  background: rgba(0,0,0,0.26);
}

.draw-pill {
  font-size: 11px;
  font-weight: bold;
}

.draw-pill.ready {
  color: #08160f;
  background: linear-gradient(180deg, rgba(111,255,177,0.95), rgba(55,180,110,0.86));
}

.draw-pill.used {
  color: #fff;
  background: rgba(255,255,255,0.10);
}

.vital-waiting {
  color: var(--muted);
  font-size: 13px;
}

/* ==========================
   EFEITO DE ATAQUE DIRETO NA VIDA
========================== */

.life-impact-hit {
  animation: lifeImpactHitEnhanced 800ms ease-out;
}

.direct-life-hit-screen {
  animation: screenDirectHit 620ms ease-out;
}

@keyframes lifeImpactHitEnhanced {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  18% {
    transform: scale(1.18) rotate(-1deg);
    filter: brightness(2.2);
    box-shadow:
      0 0 0 4px rgba(255,95,131,0.16),
      0 0 26px rgba(255,95,131,0.72),
      0 0 46px rgba(255,211,106,0.28);
  }
  38% {
    transform: scale(.96) rotate(1deg);
  }
  58% {
    transform: scale(1.09);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes screenDirectHit {
  0%, 100% {
    filter: none;
  }
  18% {
    filter: brightness(1.22) saturate(1.35);
  }
  35% {
    filter: brightness(.92) saturate(1.15);
  }
  55% {
    filter: brightness(1.12);
  }
}

/* ==========================
   BOTÃO DESISTIR
========================== */

.surrender-btn {
  color: #fff;
  background: linear-gradient(180deg, #ff6b86, #9c2442);
  border: 1px solid rgba(255,255,255,0.10);
}

.surrender-btn:hover {
  box-shadow: 0 14px 28px rgba(255,95,131,0.22);
}

@media (max-width: 900px) {
  .battle-zone h2 > span {
    min-width: 100%;
  }

  .vitals-bar {
    justify-content: flex-start;
  }

  .vital-pill {
    min-height: 32px;
  }

  .vital-text {
    display: none;
  }
}


/* Carta com arte personalizada */
.game-card .icon.card-art-slot {
  height: 42px;
  display: grid;
  place-items: center;
  margin-top: 2px;
  margin-bottom: 2px;
}

.card-art-image {
  width: 100%;
  max-width: 64px;
  height: 42px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 6px 12px rgba(0,0,0,0.28);
  background: rgba(0,0,0,0.18);
}

.library-card .card-icon.card-icon-image {
  width: 100%;
  height: 82px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
}

.library-card .card-icon.card-icon-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.deck-card-icon-image {
  width: 34px;
  height: 34px;
  overflow: hidden;
  padding: 0;
}

.deck-card-icon-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
}


.deck-top-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-shell {
  min-height: 100vh;
  padding: 24px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.admin-panel {
  padding: 24px;
}

.admin-card-form {
  display: grid;
  gap: 14px;
}

.admin-card-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--gold);
}

.admin-card-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  outline: none;
  resize: vertical;
}

.form-grid-2,
.form-grid-4 {
  display: grid;
  gap: 12px;
}

.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-card-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.admin-card-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
}

.admin-card-thumb {
  width: 82px;
  height: 110px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 30px;
}

.admin-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.admin-card-body {
  display: grid;
  gap: 4px;
}

.admin-card-body strong {
  color: #fff;
}

.admin-card-body small,
.admin-card-body p {
  color: var(--muted);
  line-height: 1.45;
}

.game-card.full-art-card {
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, #111723, #111723);
}

.full-art-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.full-art-frame {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), inset 0 -36px 50px rgba(0,0,0,0.28);
}

.full-art-status {
  position: absolute;
  top: 6px;
  left: 6px;
  right: auto;
  bottom: auto;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
  z-index: 6;
}

.art-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(4px);
}

.art-stat.hp {
  background: rgba(125, 18, 38, 0.82);
}


/* ==========================
   MODAL DE CARTA AMPLIADA
========================== */

.card-zoom-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1600;
}

.card-zoom-modal.active {
  display: flex;
}

.card-zoom-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255,211,106,0.12), transparent 34%),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.card-zoom-content {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    rgba(8, 12, 28, 0.96);
  box-shadow:
    0 30px 90px rgba(0,0,0,0.58),
    0 0 44px rgba(255,211,106,0.15);
  padding: 18px;
  animation: cardZoomPop .22s ease-out;
}

.card-zoom-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: linear-gradient(180deg, #ff6b86, #9c2442);
  z-index: 5;
  font-size: 24px;
  line-height: 1;
}

.zoom-full-card {
  width: min(330px, 78vw);
  height: min(460px, 72vh);
  margin: 0 auto;
  border-radius: 22px;
  overflow: hidden;
  border: 2px solid rgba(255,211,106,0.45);
  box-shadow:
    0 18px 50px rgba(0,0,0,0.50),
    0 0 26px rgba(255,211,106,0.20);
  background: #111;
}

.zoom-full-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.zoom-card-info {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.zoom-card-info h2 {
  color: var(--gold);
  text-align: center;
  font-size: 24px;
}

.zoom-card-info p {
  color: #dce6f7;
  line-height: 1.55;
  text-align: center;
}

.zoom-card-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.zoom-card-tags span {
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 12px;
}

.zoom-normal-card {
  min-height: 480px;
  border-radius: 22px;
  border: 2px solid rgba(255,255,255,0.18);
  padding: 20px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,0.14), transparent 34%),
    linear-gradient(160deg, #273246, #111723);
  display: grid;
  gap: 16px;
  align-content: start;
}

.zoom-normal-top {
  display: flex;
  justify-content: space-between;
  color: #fff;
}

.zoom-normal-top strong {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffe08a, #cd9c35);
  color: #111722;
  font-size: 22px;
}

.zoom-normal-icon {
  height: 150px;
  display: grid;
  place-items: center;
  font-size: 88px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}

.zoom-normal-card h2 {
  color: var(--gold);
  text-align: center;
}

.zoom-normal-card p {
  color: #dce6f7;
  line-height: 1.55;
  text-align: center;
}

.zoom-normal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.zoom-normal-stats span {
  padding: 10px;
  border-radius: 14px;
  text-align: center;
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--muted);
}

.zoom-normal-stats strong {
  color: #fff;
}

@keyframes cardZoomPop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* ==========================
   HOVER ZOOM DAS CARTAS
========================== */

.card-hover-preview {
  position: fixed;
  left: 0;
  top: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 14px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
    rgba(8, 12, 28, 0.96);
  box-shadow:
    0 26px 90px rgba(0,0,0,0.58),
    0 0 42px rgba(255,211,106,0.12);
  backdrop-filter: blur(10px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(.96);
  transition: opacity .12s ease, transform .12s ease;
  z-index: 1550;
}

.card-hover-preview.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.card-hover-preview .zoom-full-card {
  width: 100%;
  height: min(430px, 58vh);
}

@media (max-width: 900px) {
  .card-hover-preview {
    display: none !important;
  }
}

/* ==========================
   ÁUDIO DO DUELO
========================== */

.sound-toggle-btn {
  color: #fff;
  background: linear-gradient(180deg, #667cff, #293a9d);
  border: 1px solid rgba(255,255,255,0.12);
}

.sound-toggle-btn.sound-on {
  color: #08160f;
  background: linear-gradient(180deg, rgba(111,255,177,0.96), rgba(55,180,110,0.88));
}

.sound-toggle-btn:hover {
  box-shadow: 0 14px 28px rgba(70,216,255,0.18);
}


/* ==========================
   BOTÃO DE SOM NO TOPO
========================== */

.game-nav-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.sound-top-btn {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
  border-radius: 999px;
}

/* ==========================
   DESTAQUE DE DANO EM CARTAS
========================== */

.game-card {
  position: relative;
}

.card-damage-highlight {
  animation: cardDamagePulse 820ms ease-out;
}

.hp-damage-highlight {
  animation: hpDamagePulse 820ms ease-out;
}

.damage-number-pop {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 80;
  min-width: 42px;
  padding: 4px 10px;
  border-radius: 999px;
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(180deg, rgba(255,75,95,0.98), rgba(130,14,30,0.92));
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow:
    0 0 20px rgba(255,75,95,0.70),
    0 0 36px rgba(255,211,106,0.28);
  pointer-events: none;
  animation: damageNumberPop 900ms ease-out forwards;
}

@keyframes cardDamagePulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  16% {
    transform: scale(1.08) rotate(-1.5deg);
    filter: brightness(2.1) saturate(1.25);
    box-shadow:
      0 0 0 4px rgba(255,75,95,0.18),
      0 0 30px rgba(255,75,95,0.72);
  }
  34% {
    transform: scale(.96) rotate(1.5deg);
  }
  54% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes hpDamagePulse {
  0% {
    transform: scale(1);
    color: #fff;
  }
  22% {
    transform: scale(1.32);
    color: #fff;
    background: rgba(255,75,95,0.92);
    box-shadow: 0 0 18px rgba(255,75,95,0.8);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes damageNumberPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(.55);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.18);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -150%) scale(.92);
  }
}

@media (max-width: 900px) {
  .game-nav-actions {
    align-items: flex-start;
  }
}

@media (max-width: 1180px) {
  .challengers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .challengers-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================
   RECOMPENSA VISUAL DE TREINO
========================== */

.training-result-note {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.reward-confetti {
  position: fixed;
  top: -40px;
  z-index: 2000;
  font-size: 22px;
  pointer-events: none;
  animation: rewardConfettiFall 2.1s ease-in forwards;
  filter: drop-shadow(0 0 10px rgba(255,211,106,0.38));
}

.reward-confetti.legendary {
  font-size: 28px;
}

.reward-confetti.epic {
  font-size: 24px;
}

@keyframes rewardConfettiFall {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0) rotate(0deg) scale(.7);
  }
  14% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--fall-x), calc(100vh + 80px), 0) rotate(480deg) scale(1.05);
  }
}


/* ==========================
   AJUSTES DE ARENA E TIMER
========================== */

.action-panel {
  display: grid;
  gap: 8px;
}

.controls-timer {
  margin: 4px 0 10px;
  padding: 10px;
}

.controls-timer strong {
  font-size: 44px;
}

.game-layout {
  grid-template-columns: 260px minmax(0, 1fr);
}

.battle-board {
  min-width: 0;
  overflow: hidden;
}

.battle-zone,
.hand-zone {
  min-width: 0;
  overflow: hidden;
}

.field {
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  align-items: stretch;
}

.slot {
  min-width: 0;
  overflow: visible;
}

.game-card {
  width: 100%;
  max-width: 126px;
  min-width: 0;
  justify-self: center;
}

.hand .game-card {
  width: 112px;
  min-width: 112px;
}

.attack-ghost-card {
  animation: ghostAttackTrace 820ms ease-out forwards;
  opacity: .96;
  box-shadow: 0 0 26px rgba(255,211,106,.45);
}

@keyframes ghostAttackTrace {
  0% {
    transform: scale(1);
    opacity: .96;
  }
  40% {
    transform: translateY(-12px) scale(1.08);
    opacity: .92;
    filter: brightness(1.6);
  }
  100% {
    transform: translateY(6px) scale(.9);
    opacity: 0;
    filter: brightness(.8);
  }
}

/* ==========================
   TORNEIOS
========================== */

.tournament-shell .lobby-topbar {
  margin-bottom: 20px;
}

.tournament-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 18px;
  align-items: start;
}

.tournament-list,
.my-tournament-list,
.match-list,
.registered-list {
  display: grid;
  gap: 10px;
}

.tournament-card,
.match-row,
.my-tournament-row,
.registered-player {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
}

.tournament-card {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 14px;
  padding: 14px;
  align-items: center;
}

.tournament-card h3 {
  color: var(--gold);
  margin-bottom: 6px;
}

.tournament-card p,
.match-row small,
.my-tournament-row small,
.muted-text {
  color: var(--muted);
  line-height: 1.5;
}

.tournament-badge,
.tournament-detail-badge,
.earned-badge {
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: radial-gradient(circle, rgba(255,211,106,.24), rgba(255,255,255,.04));
  border: 1px solid rgba(255,211,106,.25);
  box-shadow: 0 0 24px rgba(255,211,106,.12);
}

.tournament-badge {
  width: 64px;
  height: 64px;
  font-size: 34px;
}

.tournament-detail-badge {
  width: 64px;
  height: 64px;
  font-size: 36px;
}

.earned-badge {
  width: 48px;
  height: 48px;
  font-size: 28px;
}

.tournament-actions,
.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tournament-status {
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.12);
}

.status-open {
  color: #0d2417;
  background: linear-gradient(180deg, #8affbe, #43be77);
}

.status-started {
  color: #071828;
  background: linear-gradient(180deg, #8bdfff, #3498c9);
}

.status-finished {
  color: #1d1402;
  background: linear-gradient(180deg, #ffe08a, #cd9c35);
}

.profile-tournament-summary {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.summary-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255,255,255,.04);
  text-align: center;
}

.summary-box strong {
  display: block;
  color: var(--gold);
  font-size: 42px;
}

.summary-box span {
  color: var(--muted);
}

.badge-wall {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.my-tournament-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  padding: 12px;
  align-items: center;
}

.my-tournament-row span {
  font-size: 28px;
}

.match-row,
.registered-player {
  padding: 12px;
}

.match-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.registered-player {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
}

.registered-player span {
  font-size: 24px;
}

.section-subtitle {
  color: var(--gold);
  margin: 20px 0 10px;
}

@media (max-width: 1100px) {
  .tournament-grid {
    grid-template-columns: 1fr;
  }

  .tournament-card {
    grid-template-columns: 64px 1fr;
  }

  .tournament-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .field {
    grid-template-columns: repeat(5, minmax(72px, 1fr));
  }

  .game-card {
    max-width: 104px;
  }

  .match-row {
    display: grid;
  }
}


/* ==========================
   MARCADOR SUPERIOR E DESTRUIÇÃO DE CARTA
========================== */
.full-art-status {
  top: 6px;
  bottom: auto;
  justify-content: flex-end;
}

.full-art-status .art-stat.hp {
  background: rgba(115, 22, 46, 0.92);
  box-shadow: 0 0 14px rgba(255, 95, 131, 0.35);
}

.attack-source-label {
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  z-index: 95;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  color: #1d1402;
  background: linear-gradient(180deg, #ffe08a, #cd9c35);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 0 18px rgba(255,211,106,.42);
  pointer-events: none;
  animation: attackLabelPop 1.1s ease-out forwards;
}

.attacker-ghost-card {
  outline: 3px solid rgba(255, 211, 106, .65);
}

.destroyed-ghost-card {
  outline: 3px solid rgba(255, 95, 131, .65);
}

.card-destroyed-animation {
  animation: cardDestroyedBreak 1.05s ease-out forwards !important;
  z-index: 85;
}

.destroy-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

.destroy-burst span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  margin-top: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, #ff5f83 55%, transparent 75%);
  box-shadow: 0 0 18px rgba(255,95,131,.82);
  animation: destroyParticle 850ms ease-out forwards;
}

.destroy-burst span:nth-child(1) { --dx: -52px; --dy: -46px; }
.destroy-burst span:nth-child(2) { --dx: 48px; --dy: -42px; }
.destroy-burst span:nth-child(3) { --dx: -58px; --dy: 36px; }
.destroy-burst span:nth-child(4) { --dx: 56px; --dy: 40px; }
.destroy-burst span:nth-child(5) { --dx: 0px; --dy: -64px; }
.destroy-burst span:nth-child(6) { --dx: 0px; --dy: 62px; }

@keyframes cardDestroyedBreak {
  0% { transform: scale(1) rotate(0deg); opacity: 1; filter: brightness(1); }
  18% { transform: scale(1.14) rotate(-2deg); opacity: 1; filter: brightness(2.25) saturate(1.4); box-shadow: 0 0 34px rgba(255,95,131,.85); }
  42% { transform: scale(.96) rotate(2deg); opacity: .95; filter: brightness(1.5); }
  70% { transform: scale(1.08) rotate(-1deg); opacity: .82; filter: brightness(1.25); }
  100% { transform: scale(.72) rotate(7deg); opacity: 0; filter: brightness(.55) blur(1px); }
}

@keyframes destroyParticle {
  0% { transform: translate(0,0) scale(.6); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.2); opacity: 0; }
}

@keyframes attackLabelPop {
  0% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.9); }
  18% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(.96); }
}


/* ==========================
   HP NO CANTO SUPERIOR ESQUERDO
========================== */

.full-art-status {
  top: 6px !important;
  left: 6px !important;
  right: auto !important;
  bottom: auto !important;
  justify-content: flex-start !important;
}

.art-stat.hp {
  min-width: 46px;
  padding: 3px 7px;
  font-size: 9px;
  border-radius: 999px;
}


/* ==========================
   STATUS HP E ATK NA CARTA
========================== */

.full-art-status {
  position: absolute;
  top: 6px !important;
  left: 6px !important;
  right: auto !important;
  bottom: auto !important;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  justify-content: flex-start !important;
  pointer-events: none;
  z-index: 8;
}

.art-stat {
  min-width: 48px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
  box-shadow: 0 0 14px rgba(0,0,0,0.35);
}

.art-stat.hp {
  background: rgba(125, 18, 38, 0.84);
}

.art-stat.atk {
  background: rgba(24, 71, 132, 0.86);
}


/* ==========================
   MENSAGEM DE TURNO
========================== */

.turn-toast {
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translate(-50%, -20px) scale(.96);
  z-index: 1700;
  min-width: min(440px, calc(100vw - 36px));
  padding: 18px 28px;
  border-radius: 24px;
  text-align: center;
  color: #fff;
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.18);
  background:
    radial-gradient(circle at center, rgba(255,211,106,0.18), transparent 56%),
    linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03)),
    rgba(8, 12, 28, 0.92);
  box-shadow:
    0 28px 90px rgba(0,0,0,0.52),
    0 0 46px rgba(255,211,106,0.18);
  backdrop-filter: blur(10px);
}

.turn-toast.active {
  animation: turnToastShow 2s ease-out forwards;
}

.turn-toast.your-turn {
  color: #fff7d2;
  text-shadow:
    0 0 12px rgba(255,211,106,0.80),
    0 0 28px rgba(255,211,106,0.32);
}

.turn-toast.enemy-turn {
  color: #dff5ff;
  text-shadow:
    0 0 12px rgba(70,216,255,0.80),
    0 0 28px rgba(70,216,255,0.32);
}

@keyframes turnToastShow {
  0% {
    opacity: 0;
    transform: translate(-50%, -28px) scale(.92);
    filter: blur(3px);
  }
  16% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    filter: blur(0);
  }
  78% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -12px) scale(.98);
  }
}


/* ==========================
   FEITIÇOS ATIVOS NO CAMPO
========================== */
.active-spells-zone { display:none; min-height:78px; margin-top:8px; padding:8px; border:1px solid rgba(255,211,106,0.16); border-radius:16px; background:radial-gradient(circle at 20% 50%, rgba(255,211,106,0.10), transparent 42%),rgba(0,0,0,0.22); gap:8px; align-items:center; overflow:hidden; }
.active-spells-zone.visible { display:flex; }
.active-spell-card { width:58px; height:76px; border-radius:10px; position:relative; overflow:hidden; display:grid; place-items:center; background:linear-gradient(160deg, rgba(49,36,69,.95), rgba(17,23,35,.95)); border:1px solid rgba(255,211,106,0.35); box-shadow:0 0 18px rgba(255,211,106,0.18), inset 0 0 18px rgba(255,255,255,0.05); }
.active-spell-card img { width:100%; height:100%; object-fit:cover; }
.active-spell-card span { position:absolute; left:4px; right:4px; bottom:4px; padding:3px 4px; border-radius:7px; font-size:7px; line-height:1.05; font-weight:800; text-align:center; color:#fff; background:rgba(0,0,0,0.68); }
.active-spell-icon { font-size:26px; }
.spell-activated-glow { animation:spellActivatedGlow 1.35s ease-in-out infinite alternate; }
.spell-cast-pulse { animation:spellCastPulse 1.15s ease-out; }
@keyframes spellActivatedGlow { from { filter:brightness(1); box-shadow:0 0 12px rgba(255,211,106,0.18); } to { filter:brightness(1.32); box-shadow:0 0 20px rgba(255,211,106,0.48),0 0 38px rgba(156,124,255,0.24); } }
@keyframes spellCastPulse { 0% { transform:scale(.92); filter:brightness(1); } 35% { transform:scale(1.18); filter:brightness(1.9); box-shadow:0 0 0 5px rgba(255,211,106,0.14),0 0 36px rgba(255,211,106,0.65),0 0 60px rgba(156,124,255,0.34); } 100% { transform:scale(1); filter:brightness(1); } }
.deck-hover-preview { z-index:1800; }


/* ==========================
   EFEITOS VISUAIS DE HABILIDADES
========================== */
.effect-buff-pulse {
  animation: effectBuffPulse 1.1s ease-out;
}

.effect-debuff-pulse {
  animation: effectDebuffPulse 1.1s ease-out;
}

.effect-heal-pulse {
  animation: effectHealPulse 1.1s ease-out;
}

@keyframes effectBuffPulse {
  0% { transform: scale(1); filter: brightness(1); }
  30% { transform: scale(1.10); filter: brightness(1.9); box-shadow: 0 0 0 4px rgba(111,255,177,.20), 0 0 36px rgba(111,255,177,.70); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes effectDebuffPulse {
  0% { transform: scale(1); filter: brightness(1); }
  28% { transform: scale(1.08) rotate(-1deg); filter: brightness(1.85) saturate(1.3); box-shadow: 0 0 0 4px rgba(255,95,131,.20), 0 0 36px rgba(255,95,131,.70); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes effectHealPulse {
  0% { transform: scale(1); filter: brightness(1); }
  30% { transform: scale(1.10); filter: brightness(1.9); box-shadow: 0 0 0 4px rgba(70,216,255,.20), 0 0 36px rgba(70,216,255,.70); }
  100% { transform: scale(1); filter: brightness(1); }
}

.deck-hover-preview {
  z-index: 2500 !important;
  pointer-events: none;
}


/* ==========================
   CORREÇÃO FEITIÇOS VISÍVEIS ATÉ O FIM DO TURNO
========================== */

.active-spells-zone.visible {
  display: flex !important;
  margin-top: 8px;
}

.active-spell-card {
  position: relative;
  isolation: isolate;
}

.active-spell-card::after {
  content: "ATIVO";
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 900;
  color: #1d1402;
  background: linear-gradient(180deg, #ffe08a, #cd9c35);
  box-shadow: 0 0 12px rgba(255,211,106,.38);
  z-index: 3;
}


/* ==========================
   FEITIÇO VISÍVEL PARA OS DOIS JOGADORES
========================== */

.active-spells-zone {
  display: none;
  min-height: 86px;
  margin-top: 8px;
  padding: 8px;
  gap: 8px;
  align-items: center;
  border-radius: 16px;
  border: 1px solid rgba(255,211,106,0.18);
  background:
    radial-gradient(circle at 20% 50%, rgba(255,211,106,0.12), transparent 44%),
    rgba(0,0,0,0.24);
}

.active-spells-zone.visible {
  display: flex !important;
}

.active-spell-card {
  position: relative;
  width: 62px;
  height: 82px;
  border-radius: 11px;
  overflow: hidden;
  background: rgba(8, 12, 28, 0.88);
  border: 1px solid rgba(255,211,106,0.38);
  box-shadow:
    0 0 18px rgba(255,211,106,0.22),
    inset 0 0 18px rgba(255,255,255,0.05);
  isolation: isolate;
}

.active-spell-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.active-spell-card span {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  padding: 3px 4px;
  border-radius: 7px;
  color: #fff;
  background: rgba(0,0,0,0.68);
  font-size: 7px;
  line-height: 1.05;
  font-weight: 900;
  text-align: center;
}

.active-spell-card::after {
  content: "ATIVO";
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 900;
  color: #1d1402;
  background: linear-gradient(180deg, #ffe08a, #cd9c35);
  box-shadow: 0 0 12px rgba(255,211,106,.38);
  z-index: 3;
}

.spell-activated-glow {
  animation: spellActivatedGlow 1.35s ease-in-out infinite alternate;
}

@keyframes spellActivatedGlow {
  from {
    filter: brightness(1);
    box-shadow: 0 0 12px rgba(255,211,106,0.18);
  }
  to {
    filter: brightness(1.32);
    box-shadow:
      0 0 20px rgba(255,211,106,0.48),
      0 0 38px rgba(156,124,255,0.24);
  }
}


/* ==========================
   FEITIÇO COMO CARTA NO CAMPO
========================== */

.game-card.active-field-spell-card {
  border-color: rgba(255, 211, 106, 0.72);
  box-shadow:
    0 0 0 2px rgba(255, 211, 106, 0.16),
    0 0 26px rgba(255, 211, 106, 0.45),
    0 0 46px rgba(156, 124, 255, 0.18);
}

.game-card.active-field-spell-card::after {
  content: "FEITIÇO";
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .05em;
  color: #1d1402;
  background: linear-gradient(180deg, #ffe08a, #cd9c35);
  box-shadow: 0 0 14px rgba(255, 211, 106, .42);
  z-index: 10;
}

.game-card.active-field-spell-card .full-art-frame {
  box-shadow:
    inset 0 0 0 2px rgba(255,211,106,.35),
    inset 0 -36px 50px rgba(0,0,0,0.28),
    0 0 28px rgba(255,211,106,.32);
}

.spell-activated-glow {
  animation: fieldSpellGlow 1.25s ease-in-out infinite alternate;
}

@keyframes fieldSpellGlow {
  from {
    filter: brightness(1);
  }
  to {
    filter: brightness(1.28) saturate(1.15);
  }
}


/* ==========================
   LOBBY OTIMIZADO + MATCHMAKING
========================== */

.matchmaking-panel {
  margin: 18px 0;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(255,211,106,0.22);
  background:
    radial-gradient(circle at 12% 24%, rgba(255,211,106,0.16), transparent 36%),
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
    rgba(8,12,28,0.72);
}

.matchmaking-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #1d1402;
  background: linear-gradient(180deg, #ffe08a, #cd9c35);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.matchmaking-copy h2 {
  color: var(--gold);
  font-size: clamp(24px, 3vw, 38px);
  margin-bottom: 4px;
}

.matchmaking-copy p,
.matchmaking-copy small {
  color: var(--muted);
  line-height: 1.45;
}

.matchmaking-main-btn {
  min-height: 52px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.matchmaking-actions {
  display: grid;
  gap: 10px;
}

.queue-status {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: center;
  color: #fff7d2;
  background: rgba(0,0,0,0.28);
  box-shadow: inset 0 0 14px rgba(255,211,106,0.05);
}

.queue-status.idle {
  color: var(--muted);
}

.enhanced-room-list {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,211,106,0.20);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025)),
    rgba(8,12,28,0.62);
}

.enhanced-room-list h3 {
  color: var(--gold);
  font-size: 24px;
  margin-bottom: 12px;
}

.room-row {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 14px;
  background:
    radial-gradient(circle at 0% 50%, rgba(70,216,255,0.08), transparent 32%),
    rgba(255,255,255,0.045);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.room-row:hover {
  transform: translateY(-2px);
  border-color: rgba(255,211,106,0.34);
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
}

.room-row strong {
  color: #fff;
  font-size: 16px;
}

.room-mode-badge,
.room-state-badge {
  display: inline-flex;
  margin-right: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.room-mode-badge {
  color: #1d1402;
  background: linear-gradient(180deg, #ffe08a, #cd9c35);
}

.room-state-badge {
  color: #dff5ff;
  border: 1px solid rgba(70,216,255,0.22);
  background: rgba(70,216,255,0.10);
}

.bot-offer-modal {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(8px);
}

.bot-offer-modal.active {
  display: flex;
}

.bot-offer-card {
  width: min(520px, calc(100vw - 32px));
  border-radius: 26px;
  padding: 24px;
  border: 1px solid rgba(255,211,106,0.24);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,211,106,0.18), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035)),
    rgba(8,12,28,0.96);
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  text-align: center;
}

.bot-offer-card h2 {
  color: var(--gold);
  font-size: 28px;
  margin-bottom: 8px;
}

.bot-offer-card p {
  color: #dce6f7;
  line-height: 1.5;
  margin-bottom: 18px;
}

.bot-offer-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .matchmaking-panel {
    grid-template-columns: 1fr;
  }
}


/* ==========================
   AJUSTES BUSCA RÁPIDA E SALAS
========================== */

.matchmaking-panel {
  order: 2;
}

.enhanced-room-list {
  order: 3;
}

.room-list#roomList {
  min-height: 90px;
}

.room-row small {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 4px;
}

.room-state-badge {
  text-transform: capitalize;
}


/* ==========================
   RANKING TOP 6 + CHAT DO LOBBY
========================== */





.lobby-chat-panel {
  margin-top: 16px;
  padding: 16px;
}

.lobby-chat-panel .panel-head h2 {
  color: var(--gold);
}

.lobby-chat-messages {
  height: 280px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(circle at 12% 10%, rgba(70,216,255,0.06), transparent 36%),
    rgba(0,0,0,0.24);
}

.chat-empty {
  color: var(--muted);
  text-align: center;
  padding: 28px 10px;
}

.lobby-chat-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: start;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,211,106,0.14);
  border: 1px solid rgba(255,211,106,0.22);
  box-shadow: 0 0 14px rgba(255,211,106,0.10);
}

.chat-bubble {
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.chat-meta strong {
  color: #fff;
  font-size: 12px;
}

.chat-meta span {
  color: var(--muted);
  font-size: 11px;
}

.chat-bubble p {
  color: #dce6f7;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.lobby-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.lobby-chat-form input {
  width: 100%;
  min-height: 38px;
}

@media (max-width: 900px) {
  .lobby-chat-messages {
    height: 230px;
  }
}


/* ==========================
   CORREÇÃO TOP 6 SEM CORTE
========================== */

.ranking-list {
  max-height: none !important;
  overflow: visible !important;
  display: grid;
  gap: 8px;
}

.ranking-list .rank-row {
  min-height: 54px;
  padding: 9px 10px;
}

.ranking-list .rank-row:nth-child(n+7) {
  display: none !important;
}

.lobby-chat-panel {
  margin-top: 18px;
}

.lobby-chat-messages {
  height: 260px;
}


/* ==========================
   COMUNIDADES
========================== */

.lobby-chat-panel {
  display: none !important;
}

.lobby-communities-panel {
  margin-top: 16px;
  padding: 16px;
}

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

.lobby-community-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 9px;
  background: rgba(255,255,255,0.045);
  transition: transform .15s ease, border-color .15s ease;
}

.lobby-community-row:hover {
  transform: translateY(-2px);
  border-color: rgba(255,211,106,0.30);
}

.lobby-community-row img,
.community-fallback-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: rgba(255,211,106,0.14);
  border: 1px solid rgba(255,211,106,0.22);
}

.lobby-community-row strong {
  color: #fff;
}

.lobby-community-row small {
  color: var(--muted);
}

.community-create-shortcut {
  margin-top: 12px;
}

.community-shell {
  display: grid;
  gap: 18px;
}

.community-list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.community-card {
  overflow: hidden;
}

.community-card-image {
  display: block;
  height: 180px;
  overflow: hidden;
  background: rgba(0,0,0,.25);
}

.community-card-image img,
.community-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-fallback-big {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: grid;
  place-items: center;
  font-size: 64px;
  background:
    radial-gradient(circle, rgba(255,211,106,.20), transparent 48%),
    rgba(0,0,0,.25);
}

.community-card-body {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.community-card-body h2,
.community-hero-info h1 {
  color: var(--gold);
}

.community-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.community-tags span,
.community-pending,
.community-approved {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,.12);
  color: #fff7d2;
  background: rgba(255,211,106,.10);
}

.community-approved {
  color: #d9ffe9;
  background: rgba(111,255,177,.12);
}

.community-pending {
  color: #fff7d2;
}

.community-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 18px;
}

.community-hero-image {
  height: 220px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,211,106,.24);
}

.community-hero-info {
  display: grid;
  align-content: center;
  gap: 10px;
}

.community-socials,
.community-actions,
.member-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.community-members-panel {
  padding: 18px;
}

.community-member-list {
  display: grid;
  gap: 10px;
}

.community-member-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.04);
}

.community-member-row.pending-member {
  border-color: rgba(255,211,106,.22);
  background: rgba(255,211,106,.055);
}

.member-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,211,106,.14);
}

.community-member-row strong {
  color: #fff;
}

.community-member-row small,
.community-card-body p {
  color: var(--muted);
}

.member-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.member-stats span {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255,255,255,.06);
  color: #dce6f7;
}

.danger-btn {
  color: #ffd8df;
  border-color: rgba(255,91,116,.30);
}

.my-community-callout {
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

.my-community-callout strong {
  color: var(--gold);
}

@media (max-width: 1100px) {
  .community-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .community-list-grid {
    grid-template-columns: 1fr;
  }

  .community-member-row {
    grid-template-columns: 44px 1fr;
  }

  .member-stats,
  .member-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}


/* ==========================
   ARENA VISUAL RANDOMIZADA
========================== */
.game-page {
  position: relative;
}

.game-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top, rgba(255,255,255,0.10), transparent 30%), linear-gradient(180deg, rgba(7,10,22,0.25), rgba(7,10,22,0.55));
  z-index: 0;
}

.game-layout, .spectator-layout {
  position: relative;
  z-index: 1;
}

.battle-zone.enemy {
  margin-top: 28px;
}

.battle-zone.player {
  margin-top: 10px;
}

.battle-zone h2 {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.game-card {
  box-shadow: 0 10px 22px rgba(0,0,0,0.30);
}

.game-card:hover {
  transform: translateY(-6px) scale(1.03);
}

.spectator-board .slot {
  min-height: 160px;
}



/* ==========================
   CORREÇÃO ARENA LIMPA E MÃO VISÍVEL
========================== */

.game-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.game-layout,
.spectator-layout {
  grid-template-columns: 230px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: stretch;
  height: calc(100vh - 88px);
  max-height: calc(100vh - 88px);
}

.game-side {
  max-height: calc(100vh - 92px);
  overflow-y: auto;
}

.battle-board {
  position: relative;
  display: grid;
  grid-template-rows: minmax(168px, 1fr) minmax(168px, 1fr) minmax(150px, auto);
  gap: 8px;
  padding: 10px !important;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: none !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(5, 8, 18, 0.18), rgba(5, 8, 18, 0.34)),
    var(--arena-bg-image) center/cover no-repeat !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.battle-board::before {
  top: 8px !important;
  right: 10px !important;
  padding: 4px 9px !important;
  font-size: 10px !important;
  opacity: .78;
}

.battle-board::after {
  display: none !important;
}

.battle-zone {
  min-height: 0 !important;
  padding: 8px !important;
  border: none !important;
  border-radius: 14px !important;
  background: rgba(5, 8, 18, 0.24) !important;
  backdrop-filter: none !important;
}

.battle-zone.enemy,
.battle-zone.player {
  margin-top: 0 !important;
}

.battle-zone h2 {
  margin: 0 0 5px !important;
  font-size: 14px !important;
  line-height: 1.1;
}

.field {
  height: calc(100% - 22px) !important;
  display: grid;
  grid-template-columns: repeat(5, minmax(88px, 1fr)) !important;
  gap: 6px !important;
  min-height: 132px;
}

.slot {
  min-height: 128px !important;
  padding: 4px !important;
  border-radius: 12px !important;
  background: transparent !important;
  box-shadow: none !important;
}

.slot::before {
  inset: 0 !important;
  border-radius: 12px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(0,0,0,0.08)),
    var(--arena-slot-image) center/100% 100% no-repeat !important;
  opacity: .74;
}

.slot:has(.game-card)::before {
  opacity: .35;
}

.slot .game-card {
  max-width: 108px !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 138px !important;
}

.hand-zone {
  min-height: 148px !important;
  max-height: 174px !important;
  padding: 8px !important;
  border: none !important;
  border-radius: 14px !important;
  background: rgba(5, 8, 18, 0.62) !important;
  overflow: hidden !important;
}

.hand-zone h2 {
  margin: 0 0 6px !important;
  font-size: 14px !important;
}

.hand {
  min-height: 116px;
  max-height: 132px;
  display: flex;
  gap: 8px;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 2px 6px 8px;
  scroll-behavior: smooth;
}

.hand .game-card {
  width: 92px !important;
  min-width: 92px !important;
  height: 120px !important;
  transform-origin: bottom center;
}

.hand .game-card:hover {
  transform: translateY(-8px) scale(1.08) !important;
  z-index: 20;
}

.full-art-status {
  gap: 3px !important;
}

.art-stat {
  min-width: 42px !important;
  padding: 2px 6px !important;
  font-size: 8px !important;
}

.game-card .skill {
  font-size: 8px !important;
  line-height: 1.1 !important;
}

.game-card .name {
  font-size: 10px !important;
}

.game-card .stats {
  font-size: 8px !important;
}

.active-spells-zone {
  min-height: 44px !important;
  padding: 4px !important;
  margin-top: 3px !important;
  background: rgba(0,0,0,0.18) !important;
}

.active-spell-card {
  width: 42px !important;
  height: 56px !important;
}

.spectator-board {
  grid-template-rows: minmax(210px, 1fr) minmax(210px, 1fr) auto !important;
}

.spectator-board .slot {
  min-height: 150px !important;
}

@media (max-width: 1180px) {
  .game-layout,
  .spectator-layout {
    grid-template-columns: 200px minmax(0, 1fr) !important;
  }

  .field {
    grid-template-columns: repeat(5, minmax(72px, 1fr)) !important;
  }

  .slot .game-card {
    max-width: 96px !important;
    height: 126px !important;
  }

  .hand .game-card {
    width: 84px !important;
    min-width: 84px !important;
    height: 112px !important;
  }
}

@media (max-width: 880px) {
  .game-layout,
  .spectator-layout {
    height: auto;
    max-height: none;
    grid-template-columns: 1fr !important;
  }

  .game-side {
    max-height: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .battle-board {
    height: auto;
    min-height: 680px;
  }

  .hand-zone {
    max-height: 190px !important;
  }
}

@media (max-width: 620px) {
  .game-side {
    grid-template-columns: 1fr;
  }

  .field {
    grid-template-columns: repeat(5, minmax(54px, 1fr)) !important;
    gap: 4px !important;
  }

  .slot {
    min-height: 104px !important;
  }

  .slot .game-card {
    height: 108px !important;
  }
}



/* ==========================
   ARENA FINAL — FUNDO, OVERLAYS, 100% CHROME E MÃO SEM CORTE
========================== */

:root {
  --arena-bg-image: none;
  --arena-slot-image: none;
}

.game-page,
.spectator-page {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(5,8,18,.34), rgba(5,8,18,.58)),
    var(--arena-bg-image) center center / cover no-repeat fixed !important;
}

.game-page::before,
.spectator-page::before {
  content: "";
  position: fixed !important;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(165,111,255,.18), transparent 22%),
    radial-gradient(circle at 50% 56%, rgba(255,255,255,.06), transparent 16%),
    linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.16));
  z-index: 1 !important;
}

.game-topbar,
.game-layout,
.spectator-layout {
  position: relative;
  z-index: 2 !important;
}

.result-modal,
.card-zoom-modal,
.turn-toast,
.attack-fx-layer,
.card-hover-preview {
  position: fixed !important;
}

.result-modal {
  z-index: 5000 !important;
}

.card-zoom-modal {
  z-index: 4900 !important;
}

.turn-toast {
  z-index: 4800 !important;
}

.attack-fx-layer {
  z-index: 4700 !important;
  inset: 0 !important;
  pointer-events: none !important;
}

.card-hover-preview {
  z-index: 4600 !important;
}

.game-topbar {
  padding: 10px 16px 4px !important;
  background: transparent !important;
}

.game-topbar h1 {
  font-size: clamp(24px, 2.4vw, 31px) !important;
  color: var(--gold);
  text-shadow: 0 3px 14px rgba(0,0,0,.55);
}

.game-topbar p {
  font-size: 12px !important;
  color: rgba(233,240,255,.72);
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}

.game-layout,
.spectator-layout {
  height: calc(100vh - 64px) !important;
  max-height: calc(100vh - 64px) !important;
  padding: 0 10px 10px !important;
  grid-template-columns: 182px minmax(0, 1fr) !important;
  gap: 10px !important;
  background: transparent !important;
}

.game-side {
  display: flex !important;
  flex-direction: column;
  gap: 8px !important;
  max-height: calc(100vh - 76px) !important;
  overflow-y: auto;
}

.game-side .panel,
.action-panel {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.game-side h2 {
  font-size: 16px !important;
  color: var(--gold);
  margin-bottom: 8px !important;
  text-shadow: 0 3px 10px rgba(0,0,0,.55);
}

.turn-timer-box.controls-timer {
  margin-bottom: 8px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  text-align: center;
}

.turn-timer-box.controls-timer span {
  color: rgba(233,240,255,.78);
}

.turn-timer-box.controls-timer strong {
  font-size: 40px !important;
  color: #00efb0 !important;
  text-shadow: 0 0 18px rgba(0,239,176,.36);
}

.game-side button {
  margin-bottom: 8px !important;
  min-height: 42px !important;
  font-size: 14px !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
}

#drawBtn { background: linear-gradient(180deg, #c8a86e, #8f713f) !important; color: #1f1405 !important; }
#directAttackBtn { background: linear-gradient(180deg, #1fbddd, #057ba5) !important; }
#endTurnBtn { background: linear-gradient(180deg, #ffd96e, #e4ac2d) !important; color: #2a1b03 !important; }
#surrenderBtn { background: linear-gradient(180deg, #ff768f, #df2c55) !important; }

#gameLog,
#turnInfo,
#spectatorLog,
#spectatorTurnInfo,
.spectator-note {
  background: transparent !important;
  color: #f2f5fb !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  text-shadow: 0 2px 9px rgba(0,0,0,.55);
  padding: 0 !important;
  border: none !important;
}

.battle-board,
.spectator-board {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: minmax(208px, 1fr) minmax(208px, 1fr) 160px !important;
  gap: 0 !important;
  height: 100%;
  max-height: 100%;
  overflow: visible !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.battle-board::before {
  content: attr(data-arena-name);
  position: absolute;
  top: 8px !important;
  right: 10px !important;
  padding: 4px 9px !important;
  border-radius: 999px;
  background: rgba(5, 8, 18, 0.54) !important;
  border: 1px solid rgba(255, 211, 106, 0.30);
  color: #ffe9ab;
  font-size: 10px !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 3;
  backdrop-filter: blur(4px);
}

.battle-board::after,
.spectator-board::before,
.spectator-board::after {
  display: none !important;
}

.battle-zone,
.hand-zone,
.spectator-footer,
.spectator-card {
  position: relative;
  z-index: 2;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.battle-zone {
  min-height: 0 !important;
  padding: 2px 8px !important;
}

.battle-zone h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 6px !important;
  color: var(--gold);
  font-size: 16px !important;
  line-height: 1;
  text-shadow: 0 3px 10px rgba(0,0,0,.6);
}

.battle-zone h2 > span {
  margin-left: auto;
}

.vitals-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px !important;
}

.vital-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px !important;
  padding: 6px 11px !important;
  border-radius: 999px;
  background: rgba(6,12,28,.74) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.20);
}

.vital-pill strong { font-size: 13px !important; }
.vital-pill .vital-text { font-size: 10px !important; text-transform: uppercase; letter-spacing: .05em; }
.life-pill { background: linear-gradient(180deg, rgba(159,43,72,.9), rgba(111,22,46,.82)) !important; }
.mana-pill { background: linear-gradient(180deg, rgba(21,122,176,.90), rgba(7,74,108,.84)) !important; }
.deck-pill, .hand-pill { background: rgba(14,20,38,.76) !important; }
.draw-pill.ready { background: linear-gradient(180deg, rgba(100,194,116,.88), rgba(54,133,71,.82)) !important; }
.draw-pill.used { background: linear-gradient(180deg, rgba(154,120,43,.88), rgba(106,75,12,.82)) !important; }
.vital-icon { filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }

.field {
  height: calc(100% - 28px) !important;
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr)) !important;
  align-items: center;
  justify-items: center;
  gap: 8px !important;
}

.slot {
  min-height: 158px !important;
  width: 100%;
  max-width: 118px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.slot::before,
.slot::after {
  display: none !important;
}

.slot .game-card,
.field .game-card {
  width: 104px !important;
  min-width: 104px !important;
  height: 138px !important;
  box-shadow: 0 12px 26px rgba(0,0,0,.30) !important;
}

.hand-zone {
  overflow: visible !important;
  padding: 2px 0 4px !important;
  min-height: 168px !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start !important;
  align-items: center;
}

.hand-zone h2 {
  position: relative !important;
  z-index: 5 !important;
  margin: 0 0 6px !important;
  padding-top: 0 !important;
  width: 100%;
  text-align: center;
  color: var(--gold);
  font-size: 16px !important;
  line-height: 1.1 !important;
  text-shadow: 0 3px 10px rgba(0,0,0,.6);
}

.hand {
  width: 100%;
  min-height: 142px !important;
  max-height: none !important;
  display: flex;
  justify-content: center !important;
  align-items: flex-start !important;
  gap: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  padding: 6px 16px 10px !important;
  margin: 0 auto;
}

.hand:empty::after {
  content: "Nenhuma carta na mão";
  color: rgba(255,255,255,0.56);
  font-size: 13px;
  margin: auto;
}

.hand .game-card {
  position: relative !important;
  top: 0 !important;
  width: 98px !important;
  min-width: 98px !important;
  height: 128px !important;
  margin-top: 2px !important;
  margin-left: -16px !important;
  flex: 0 0 auto;
  transform-origin: bottom center;
  transition: transform .15s ease, margin .15s ease, box-shadow .15s ease !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.28) !important;
}

.hand .game-card:first-child {
  margin-left: 0 !important;
}

.hand .game-card:nth-child(odd) { transform: rotate(-4deg); }
.hand .game-card:nth-child(even) { transform: rotate(4deg); }

.hand .game-card:hover {
  transform: translateY(-10px) scale(1.08) rotate(0deg) !important;
  z-index: 30;
  margin-left: 2px !important;
  margin-right: 2px !important;
}

.game-card .name { font-size: 9px !important; }
.game-card .skill { font-size: 7px !important; }
.game-card .stats { font-size: 7px !important; }
.full-art-status { gap: 3px !important; }
.art-stat { min-width: 40px !important; font-size: 7px !important; padding: 2px 5px !important; }

.active-spells-zone {
  margin-top: 1px !important;
}

.active-spell-card {
  width: 38px !important;
  height: 50px !important;
}

@media (max-width: 1280px) {
  .game-layout,
  .spectator-layout {
    grid-template-columns: 170px minmax(0, 1fr) !important;
  }

  .field {
    grid-template-columns: repeat(5, minmax(88px, 1fr)) !important;
  }

  .slot .game-card,
  .field .game-card {
    width: 94px !important;
    min-width: 94px !important;
    height: 128px !important;
  }

  .hand-zone {
    min-height: 160px !important;
  }

  .hand {
    min-height: 136px !important;
  }

  .hand .game-card {
    width: 92px !important;
    min-width: 92px !important;
    height: 122px !important;
  }
}

@media (max-width: 980px) {
  .game-layout,
  .spectator-layout {
    height: auto !important;
    max-height: none !important;
    grid-template-columns: 1fr !important;
  }

  .game-side {
    max-height: none !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 10px;
  }

  .battle-board,
  .spectator-board {
    grid-template-rows: minmax(200px, auto) minmax(200px, auto) 172px !important;
    min-height: 700px;
  }

  .field {
    grid-template-columns: repeat(5, minmax(76px, 1fr)) !important;
  }

  .slot .game-card,
  .field .game-card {
    width: 88px !important;
    min-width: 88px !important;
    height: 122px !important;
  }

  .hand-zone {
    min-height: 172px !important;
  }

  .hand {
    min-height: 142px !important;
    justify-content: flex-start !important;
  }
}


/* ==========================
   TANQUE + MÃO POR MANA + NOME DA ARENA NO TOPO
========================== */

.tank-guard-card {
  position: relative;
  box-shadow:
    0 0 0 2px rgba(255, 211, 106, 0.88),
    0 0 18px rgba(255, 211, 106, 0.42),
    0 0 32px rgba(99, 224, 255, 0.22) !important;
  animation: tankGuardPulse 1.4s ease-in-out infinite;
}

.tank-guard-card::after {
  content: attr(data-guard-label);
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 8;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #13202f;
  background: linear-gradient(180deg, #ffe59b, #ffbf47);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

@keyframes tankGuardPulse {
  0%, 100% {
    transform: translateY(0);
    filter: brightness(1);
    box-shadow:
      0 0 0 2px rgba(255, 211, 106, 0.82),
      0 0 16px rgba(255, 211, 106, 0.35),
      0 0 28px rgba(99, 224, 255, 0.18) !important;
  }
  50% {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow:
      0 0 0 2px rgba(255, 211, 106, 1),
      0 0 24px rgba(255, 211, 106, 0.55),
      0 0 38px rgba(99, 224, 255, 0.28) !important;
  }
}

.hand .game-card.playable-card {
  filter: brightness(1.1) saturate(1.08);
  opacity: 1;
  box-shadow: 0 12px 26px rgba(255, 211, 106, 0.14);
}

.hand .game-card.unplayable-card {
  filter: brightness(0.62) saturate(0.72);
  opacity: 0.82;
}

.hand .game-card.playable-card:hover {
  filter: brightness(1.16) saturate(1.12);
}

.hand .game-card.unplayable-card:hover {
  filter: brightness(0.82) saturate(0.8);
}

.hand .game-card[data-playable="true"] {
  cursor: pointer;
}

.hand .game-card[data-playable="false"] {
  cursor: not-allowed;
}

.battle-board,
.spectator-board {
  overflow: visible !important;
}

.battle-board::before {
  top: -28px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  padding: 5px 14px !important;
  font-size: 11px !important;
  letter-spacing: 0.08em;
  background: rgba(5, 8, 18, 0.78) !important;
  border: 1px solid rgba(255, 211, 106, 0.42) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.24);
  z-index: 4;
}

@media (max-width: 980px) {
  .battle-board::before {
    top: -24px !important;
    font-size: 10px !important;
    padding: 4px 12px !important;
  }
}
