:root {
  color-scheme: dark;
  --bg: #060816;
  --bg-2: #140821;
  --panel: rgba(8, 11, 24, 0.82);
  --panel-2: rgba(14, 18, 37, 0.9);
  --line: rgba(110, 248, 255, 0.2);
  --line-strong: rgba(110, 248, 255, 0.52);
  --text: #f5f7ff;
  --muted: #95a0c3;
  --cyan: #6ef8ff;
  --magenta: #ff4db8;
  --lime: #b9ff67;
  --gold: #ffd447;
  --danger: #ff5a7d;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.48);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(110, 248, 255, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 77, 184, 0.14), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 92%);
}

.app-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 28px;
}

.chrome-bar,
.hero-panel,
.match-card,
.selected-card,
.stats-panel,
.result-panel,
.fighter-card,
.bracket-match,
.account-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 19, 40, 0.92), rgba(8, 10, 24, 0.84));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.chrome-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 22px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.chrome-title,
.section-heading h2,
.hero-panel h1,
.match-card h3,
.stats-panel h3 {
  margin: 0;
}

.chrome-title {
  font-size: 1.25rem;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.account-chip strong {
  color: var(--text);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: screenIn 220ms ease both;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-panel {
  border-radius: 30px;
  padding: 32px;
}

.hero-panel h1 {
  max-width: 10ch;
  font-size: clamp(3rem, 9vw, 5.4rem);
  line-height: 0.92;
}

.hero-copy {
  max-width: 62ch;
  font-size: 1.04rem;
  color: var(--muted);
}

.hero-actions,
.match-actions,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-actions {
  justify-content: flex-start;
  margin-top: 22px;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}

.primary-button {
  color: #071017;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.account-card {
  border-radius: 18px;
  padding: 16px;
}

.account-card strong,
.stat-card strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 8px;
}

.section-heading {
  margin-bottom: 20px;
}

.fighter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.fighter-card {
  border-radius: 24px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.fighter-card::after,
.selected-card::after,
.fighter-mini::after {
  content: "";
  position: absolute;
  inset: auto auto -40px -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 66%);
}

.fighter-card h3,
.fighter-mini h4 {
  margin: 8px 0 6px;
}

.fighter-tag {
  color: var(--muted);
  margin: 0 0 12px;
}

.avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar::before,
.avatar::after {
  content: "";
  position: absolute;
  inset: auto;
}

.avatar::before {
  width: 60%;
  height: 60%;
  left: 20%;
  top: 18%;
  border-radius: 50% 50% 42% 42%;
  background: rgba(9, 12, 26, 0.8);
  box-shadow:
    0 0 0 10px rgba(255, 255, 255, 0.04),
    0 0 42px rgba(255, 255, 255, 0.16);
}

.avatar::after {
  width: 74%;
  height: 30%;
  left: 13%;
  bottom: 8%;
  border-radius: 44% 44% 18% 18%;
  background: rgba(9, 12, 26, 0.8);
}

.avatar-face {
  position: absolute;
  inset: 0;
}

.avatar-face .visor,
.avatar-face .crest,
.avatar-face .scar,
.avatar-face .core {
  position: absolute;
  display: block;
}

.avatar-face .visor {
  width: 46%;
  height: 12%;
  left: 27%;
  top: 34%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.94), transparent);
  box-shadow: 0 0 26px currentColor;
}

.avatar-face .crest {
  width: 12%;
  height: 28%;
  left: 44%;
  top: 10%;
  background: currentColor;
  clip-path: polygon(50% 0%, 100% 70%, 50% 100%, 0% 70%);
  box-shadow: 0 0 24px currentColor;
}

.avatar-face .scar {
  width: 8%;
  height: 30%;
  left: 62%;
  top: 26%;
  transform: rotate(24deg);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.avatar-face .core {
  width: 16%;
  height: 16%;
  left: 42%;
  bottom: 18%;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 24px currentColor;
}

.fighter-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.fighter-card button {
  width: 100%;
  margin-top: 14px;
}

.fighter-stats {
  display: flex;
  gap: 6px;
  margin: 10px 0 0;
  flex-wrap: wrap;
}

.fighter-stats span {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.fighter-stats .stat-atk { color: var(--danger); border-color: rgba(255, 90, 125, 0.3); }
.fighter-stats .stat-def { color: var(--cyan);   border-color: rgba(110, 248, 255, 0.3); }
.fighter-stats .stat-spd { color: var(--lime);   border-color: rgba(185, 255, 103, 0.3); }

.fighter-card {
  animation: cardIn 300ms ease both;
}
.fighter-card:nth-child(1) { animation-delay: 0ms; }
.fighter-card:nth-child(2) { animation-delay: 55ms; }
.fighter-card:nth-child(3) { animation-delay: 110ms; }
.fighter-card:nth-child(4) { animation-delay: 165ms; }
.fighter-card:nth-child(5) { animation-delay: 220ms; }
.fighter-card:nth-child(6) { animation-delay: 275ms; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.status-chip {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.04);
}

.tournament-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
}

.match-panel {
  display: grid;
  gap: 18px;
}

.match-card,
.selected-card,
.stats-panel,
.result-panel {
  border-radius: 24px;
  padding: 20px;
}

.commentary {
  min-height: 78px;
  color: var(--muted);
}

.versus-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin: 18px 0;
}

.fighter-mini {
  position: relative;
  border-radius: 18px;
  min-height: 140px;
  padding: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fighter-mini .avatar {
  margin-bottom: 10px;
  border-radius: 16px;
}

.fighter-mini h4,
.fighter-mini p {
  position: relative;
  z-index: 1;
}

.fighter-mini p {
  margin: 0;
  color: var(--muted);
}

.versus-mark {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--magenta);
  letter-spacing: 0.14em;
}

.progress-shell {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--magenta), var(--cyan), var(--lime));
  transition: width 120ms linear;
}

.progress-bar.running {
  animation: barPulse 700ms ease infinite;
}

@keyframes barPulse {
  0%, 100% { filter: brightness(1); }
  50%       { filter: brightness(1.4) saturate(1.5); }
}

.odds-display {
  margin: 4px 0 10px;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  min-height: 1.5em;
}

.odds-favour  { color: var(--lime); }
.odds-against { color: var(--danger); }

@keyframes flashWin {
  0%   { background: rgba(185, 255, 103, 0.35); box-shadow: 0 0 28px rgba(185, 255, 103, 0.5); }
  100% { background: rgba(255, 255, 255, 0.04); box-shadow: none; }
}

@keyframes flashLoss {
  0%   { background: rgba(255, 90, 125, 0.35); box-shadow: 0 0 28px rgba(255, 90, 125, 0.5); }
  100% { background: rgba(255, 255, 255, 0.04); box-shadow: none; }
}

.flash-win  { animation: flashWin  1.6s ease forwards; }
.flash-loss { animation: flashLoss 1.6s ease forwards; }

@keyframes championPulse {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 0 0 3px rgba(255, 212, 71, 0.6), 0 0 80px rgba(255, 212, 71, 0.35); }
}

.app-shell.champion {
  animation: championPulse 800ms ease 3;
  border-radius: 26px;
}

.streak-badge {
  display: inline-block;
  margin: 8px 0;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 212, 71, 0.1);
  border: 1px solid rgba(255, 212, 71, 0.3);
  color: var(--gold);
}

.selected-card h3 {
  margin: 6px 0 12px;
}

.bracket-board {
  padding: 20px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(8, 11, 24, 0.9), rgba(7, 10, 19, 0.88)),
    radial-gradient(circle at top right, rgba(255, 77, 184, 0.08), transparent 28%);
  overflow-x: auto;
}

.bracket-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 22px;
  min-width: 720px;
}

.round-column h3 {
  margin: 0 0 16px;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.92rem;
}

.round-stack {
  display: grid;
  gap: 18px;
}

.bracket-match {
  border-radius: 18px;
  padding: 14px;
}

.bracket-match.active {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px rgba(110, 248, 255, 0.3), 0 0 24px rgba(110, 248, 255, 0.12);
}

.bracket-match.player-focus {
  border-color: rgba(255, 212, 71, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 212, 71, 0.25), 0 0 24px rgba(255, 212, 71, 0.16);
}

.match-slot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.match-slot:last-child {
  border-bottom: 0;
}

.match-slot.winner {
  color: var(--text);
}

.match-slot.player {
  color: var(--gold);
}

.slot-badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.06);
}

.stats-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.result-panel h3 {
  margin-top: 0;
  font-size: 1.8rem;
}

.result-panel p,
.usage-panel p {
  color: var(--muted);
}

.stat-card {
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.usage-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.usage-row:last-child {
  border-bottom: 0;
}

.placement {
  display: inline-flex;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 212, 71, 0.12);
  border: 1px solid rgba(255, 212, 71, 0.26);
  color: var(--gold);
}

@media (max-width: 980px) {
  .tournament-layout,
  .stats-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .chrome-bar,
  .hero-actions,
  .section-heading,
  .match-actions {
    flex-wrap: wrap;
  }

  .hero-panel {
    padding: 22px;
  }

  .hero-panel h1 {
    font-size: clamp(2.4rem, 12vw, 4rem);
  }

  .fighter-grid {
    grid-template-columns: 1fr;
  }
}
