:root {
  --navy: #0A1018;
  --navy-2: #121A26;
  --navy-3: #1A2433;
  --gold: #C9A45C;
  --gold-soft: #E0C48A;
  --green: #1F8A4C;
  --green-bright: #2EBA68;
  --text: #F2F4F7;
  --muted: #9AA3B2;
  --danger: #D45A5A;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(120% 80% at 50% 0%, #152033 0%, var(--navy) 55%, #060A10 100%);
  color: var(--text);
}

body {
  min-height: 100dvh;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 16px 16px 28px;
}

.screen {
  display: none;
  animation: fadeIn 0.35s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.hero {
  margin-top: 12vh;
  padding: 28px 22px;
  background: linear-gradient(160deg, var(--navy-2), var(--navy-3));
  border: 1px solid rgba(201, 164, 92, 0.35);
  border-radius: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  line-height: 1.1;
}

.tagline {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.bullets {
  text-align: left;
  margin: 0 auto 24px;
  padding: 0 0 0 1.1rem;
  color: var(--text);
  max-width: 280px;
  line-height: 1.55;
  font-size: 0.95rem;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:not(:disabled):active {
  transform: scale(0.97);
}

.btn-gold {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #1A1205;
  width: 100%;
  max-width: 280px;
}

.btn-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(201, 164, 92, 0.5);
  width: 100%;
  max-width: 280px;
}

.hidden {
  display: none !important;
}

.topbar {
  margin-bottom: 14px;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(18, 26, 38, 0.9);
  border: 1px solid rgba(201, 164, 92, 0.25);
  border-radius: var(--radius);
}

.side {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side.cpu {
  text-align: right;
}

.side .label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.side .score {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.vs-pill {
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid rgba(154, 163, 178, 0.35);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

.phase-hint {
  margin: 10px 0 0;
  text-align: center;
  color: var(--green-bright);
  font-weight: 600;
  font-size: 0.95rem;
}

.clash {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin: 16px 0;
  padding: 14px 10px;
  background: rgba(10, 16, 24, 0.65);
  border-radius: var(--radius);
  border: 1px dashed rgba(201, 164, 92, 0.3);
  min-height: 150px;
}

.clash-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.slot-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.slot-card {
  width: 100%;
  max-width: 130px;
  min-height: 96px;
  border-radius: 12px;
  padding: 10px 8px;
  background: var(--navy-3);
  border: 1px solid rgba(201, 164, 92, 0.35);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  line-height: 1.25;
}

.slot-card.empty {
  color: var(--muted);
  font-size: 1.4rem;
  border-style: dashed;
}

.slot-card.attack-glow {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(201, 164, 92, 0.4), 0 8px 24px rgba(201, 164, 92, 0.15);
}

.slot-card.defense-glow {
  border-color: var(--green-bright);
  box-shadow: 0 0 0 1px rgba(46, 186, 104, 0.35), 0 8px 24px rgba(31, 138, 76, 0.2);
}

.slot-card .mini-type {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.slot-power {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold);
  min-height: 1.2em;
}

.clash-mid {
  text-align: center;
  min-width: 72px;
}

.clash-mid .vs {
  display: inline-block;
  font-weight: 800;
  color: var(--muted);
  font-size: 0.9rem;
}

.clash-result {
  margin: 8px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  min-height: 2.4em;
  line-height: 1.3;
}

.clash-result.gol {
  color: var(--green-bright);
}

.clash-result.segura {
  color: var(--gold-soft);
}

.status {
  text-align: center;
  margin: 0 0 14px;
  color: var(--text);
  font-size: 0.95rem;
  min-height: 2.6em;
  line-height: 1.4;
}

.hand-wrap {
  margin-bottom: 16px;
}

.hand-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.hand-head h2 {
  margin: 0;
  font-size: 0.95rem;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.hand {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.card {
  appearance: none;
  background: linear-gradient(165deg, #1C2738, #121A26);
  border: 1px solid rgba(201, 164, 92, 0.28);
  border-radius: 14px;
  padding: 12px 10px 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card:hover:not(:disabled) {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 164, 92, 0.45);
}

.card:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.card .rarity {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 700;
}

.card .name {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
}

.card .role {
  font-size: 0.75rem;
  color: var(--muted);
}

.card .power-row {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.card .power {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--green-bright);
}

.card.jogada .power {
  color: var(--gold);
}

.card .mod {
  font-size: 0.72rem;
  color: var(--gold-soft);
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: sticky;
  bottom: 12px;
}

.end-hero h1 {
  color: var(--gold);
}

@media (max-width: 380px) {
  .hand {
    grid-template-columns: 1fr 1fr;
  }
  .slot-card {
    max-width: 110px;
    font-size: 0.75rem;
  }
}
