/* Splash: lobby, loading, errors, game over headline */

.splash {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-3) var(--space-3);
  text-align: center;
}

.splash--picker {
  padding-bottom: 0;
}

.splash-icon {
  display: grid;
  place-items: center;
  width: 5rem;
  height: 5rem;
  border: 2px solid var(--gold-500);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(247, 230, 176, 0.25), rgba(201, 160, 67, 0.08) 70%);
  box-shadow: 0 0 34px rgba(227, 189, 90, 0.22), inset 0 0 18px rgba(227, 189, 90, 0.15);
  color: var(--gold-300);
}

.splash-icon .icon {
  width: 2.4rem;
  height: 2.4rem;
}

.splash-icon.is-spinning .icon {
  animation: spin 2.4s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.splash-title {
  color: var(--gold-200);
  font-size: var(--text-xl);
  letter-spacing: 0.06em;
  text-wrap: balance;
}

.splash-text {
  max-width: 28rem;
  color: var(--text-muted);
}

.splash--error .splash-icon {
  border-color: var(--ember-400);
  background: radial-gradient(circle at 35% 30%, rgba(240, 144, 122, 0.22), rgba(200, 67, 45, 0.08) 70%);
  box-shadow: 0 0 34px rgba(200, 67, 45, 0.22);
  color: var(--ember-300);
}

.splash--victory.is-defeat .splash-icon {
  border-color: var(--ember-400);
  color: var(--ember-300);
}

.roster {
  display: grid;
  gap: var(--space-2);
  width: min(100%, 22rem);
  margin-top: var(--space-2);
}

.roster-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  font-weight: 600;
}

.roster-item .icon {
  color: var(--gold-400);
}

/* Hero selection */

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.hero-tile {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  min-height: 11rem;
  padding: var(--space-4) var(--space-3);
  border: 2px solid var(--gold-600);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--night-700), var(--night-850));
  box-shadow: var(--shadow-card);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s var(--ease-out), border-color 0.2s, box-shadow 0.2s;
}

.hero-tile:hover,
.hero-tile:focus-visible {
  border-color: var(--gold-300);
  box-shadow: var(--glow-gold);
}

.hero-tile:active {
  transform: scale(0.97);
}

.hero-tile-icon {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-600));
  color: var(--ink);
}

.hero-tile-icon .icon {
  width: 1.8rem;
  height: 1.8rem;
}

.hero-tile-name {
  color: var(--gold-200);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
}

.hero-tile-class {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.hero-tile-card {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-1);
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* Combat */

.alert {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-3) var(--space-5);
  border: 1px solid var(--ember-500);
  border-radius: var(--radius-lg);
  background: radial-gradient(120% 90% at 50% 0%, rgba(200, 67, 45, 0.28), rgba(15, 22, 48, 0.4) 70%);
  box-shadow: 0 0 40px rgba(200, 67, 45, 0.18) inset;
  text-align: center;
}

.alert-icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--ember-400), var(--ember-600));
  box-shadow: 0 0 26px rgba(200, 67, 45, 0.55);
  color: #fff;
}

.alert-icon .icon {
  width: 2rem;
  height: 2rem;
}

.alert-title {
  color: var(--ember-300);
  font-size: var(--text-xl);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.alert-sub {
  color: var(--text-muted);
}

.alert--ambush {
  border-color: var(--violet-600);
  background: radial-gradient(120% 90% at 50% 0%, rgba(95, 71, 179, 0.32), rgba(15, 22, 48, 0.4) 70%);
  box-shadow: 0 0 40px rgba(95, 71, 179, 0.2) inset;
}

.alert--ambush .alert-icon {
  background: linear-gradient(180deg, var(--violet-400), var(--violet-600));
  box-shadow: 0 0 26px rgba(95, 71, 179, 0.6);
}

.alert--ambush .alert-title {
  color: var(--violet-400);
}

.alert--group {
  border-color: var(--crimson-500);
  background: radial-gradient(120% 90% at 50% 0%, rgba(163, 29, 58, 0.4), rgba(15, 10, 20, 0.6) 70%);
  box-shadow: 0 0 46px rgba(163, 29, 58, 0.3) inset;
}

.alert--group .alert-icon {
  background: linear-gradient(180deg, #d1344f, #6d0f25);
  box-shadow: 0 0 30px rgba(163, 29, 58, 0.7);
}

.alert-card {
  display: grid;
  justify-items: center;
  padding: var(--space-2) 0;
}

.defense-section .pick-grid {
  padding-top: var(--space-3);
}

/* Pending decisions */

.pending-header {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2) var(--space-2);
  text-align: center;
}

.pending-icon {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border: 2px solid var(--gold-500);
  border-radius: 50%;
  background: rgba(227, 189, 90, 0.1);
  color: var(--gold-300);
}

.pending-icon .icon {
  width: 1.6rem;
  height: 1.6rem;
}

.pending-title {
  color: var(--gold-200);
  font-size: var(--text-xl);
  text-wrap: balance;
}

.pending-sub {
  max-width: 30rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-wrap: balance;
}

.type-grid,
.target-grid {
  display: grid;
  gap: var(--space-3);
}

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

.type-btn,
.player-target-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 4rem;
  padding: var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(165deg, var(--night-700), var(--night-850));
  box-shadow: var(--shadow-card);
  color: var(--gold-200);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 0.12s var(--ease-out), border-color 0.2s, box-shadow 0.2s;
}

.type-btn:hover,
.player-target-btn:hover {
  border-color: var(--gold-300);
  box-shadow: var(--glow-gold);
}

.type-btn:active,
.player-target-btn:active {
  transform: scale(0.97);
}

.type-btn-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--gold-400);
}

.target-grid .player-target-btn {
  width: 100%;
}

/* Game over */

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) 0 0;
}

.podium-place {
  display: grid;
  flex: 1;
  justify-items: center;
  max-width: 9.5rem;
  gap: 0.15rem;
  text-align: center;
}

.podium-crown {
  min-height: 1.6rem;
  color: var(--gold-300);
}

.podium-crown .icon {
  width: 1.6rem;
  height: 1.6rem;
}

.podium-name {
  max-width: 100%;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-score {
  color: var(--gold-200);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.podium-label {
  color: var(--text-faint);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
}

.podium-block {
  display: grid;
  width: 100%;
  place-items: start center;
  padding-top: var(--space-2);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: linear-gradient(180deg, var(--night-600), var(--night-800));
  color: var(--gold-300);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
}

.podium-place--1 .podium-block {
  height: 6.5rem;
  background: linear-gradient(180deg, var(--gold-400), var(--gold-700));
  color: var(--ink);
}

.podium-place--2 .podium-block {
  height: 4.8rem;
  background: linear-gradient(180deg, #c9d2e8, #5d6b92);
  color: var(--ink);
}

.podium-place--3 .podium-block {
  height: 3.6rem;
  background: linear-gradient(180deg, #d79a63, #7b4a24);
  color: var(--ink);
}

.podium-place.is-winner .podium-name {
  color: var(--gold-200);
}

.vp-list {
  display: grid;
  gap: 0.3rem;
  padding-top: var(--space-2);
}

.vp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 3ch;
  align-items: center;
  gap: var(--space-3);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  font-size: var(--text-sm);
}

.vp-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vp-calc {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.vp-total {
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.vp-row.is-negative .vp-total {
  color: var(--violet-400);
}

/* Large phones and tablets */

@media (min-width: 40rem) {
  :root {
    --card-w: 10.5rem;
    --page-pad: 1.25rem;
  }

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