* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  font-family: 'MAKEN', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #f2f7ff;
  background-color: #030712;
}

@font-face {
  font-family: 'MAKEN';
  src: url('../assets/MAKEN-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #0a1b3d, #020409 65%);
  color: inherit;
}

html,
body {
  height: 100%;
}

p{
  font-family:system-ui;
}

.bg-image {
  min-height: 100vh;
  background: url('/assets/Background.png') center/cover fixed;
}

.page-hero {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
  padding: 1rem 0 0;
  margin-bottom: clamp(0.5rem, 2vh, 1.5rem);
}

.page-hero img {
  width: min(95vw, 1200px);
  max-height: 35vh;
  height: auto;
  object-fit: contain;
}

#splash {
  position: fixed;
  inset: 0;
  background: #01030b;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: opacity 0.6s ease;
}

#splash {
  flex-direction: column;
  gap: 1rem;
}

#splash .splash-hero {
  width: 100%;
  height: auto;
}

#splash .splash-logo {
  width: 75%;
  height: auto;
  max-width: 400px;
}

#splash.fade-out {
  opacity: 0;
  pointer-events: none;
}

.app-shell {
  width: min(960px, 90vw);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-shell.card-stack {
  margin-top: 40vh;
  min-height: 100vh;
}

.app-shell.card-stack > * {
  width: 100%;
}

.page {
  width: min(960px, 90vw);
  margin: 0 auto;
  padding: 2rem 0 0;
}

.page-inner {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
}

.page-image {
  display: block;
  width: 100%;
  height: auto;
}

.landing main {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

.hero {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: relative;
  margin: clamp(0.5rem, 3vh, 1.5rem) auto 3rem;
  background: rgba(5, 12, 30, 0.92);
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  width: min(560px, 94vw);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: center;
  z-index: 2;
}

.info-card {
  width: min(960px, 90vw);
  margin: 2rem auto;
  background: rgba(5, 12, 30, 0.75);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.info-card h2 {
  margin-bottom: 0.75rem;
}

.info-card section p {
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

h1,
h2 {
  font-weight: 400;
}

.card {
  background: rgba(9, 20, 45, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.tournament-finished-card {
  position: relative;
  top: 20%;
}

.entry-header {
  text-align: center;
  z-index: 2;
}

.entry-grid {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.entry-card {
  display: block;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1rem;
  background: rgba(3, 9, 22, 0.85);
  color: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  flex: 1 1 45%;
  min-width: 140px;
  max-width: 260px;
}

  
.entry-card:nth-child(2) {
  background: linear-gradient(140deg, rgba(84, 131, 255, 0.2), rgba(17, 224, 255, 0.15));
}

.card-icon {
  font-size: 2.2rem;
}

.entry-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.35);
}

.info-copy {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-copy h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.info-copy p {
  line-height: 1.4;
  font-size: clamp(0.95rem, 3.4vw, 1.05rem);
}

.entry-logo {
  text-align: center;
}

.entry-logo img {
  max-width: 200px;
  width: 30vw;
  height: auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.host-room-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.host-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ball-grid {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.ball-item {
  width: 120px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.ball-item.offline {
  opacity: 0.5;
}

.ball-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 40%, #222 41%, #222 60%, #fff 61%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #101010;
  position: relative;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.ball-icon span {
  font-size: 1.2rem;
}

.ball-icon::after,
.ball-icon::before {
  content: '';
  position: absolute;
  width: 90%;
  height: 2px;
  background: rgba(0, 0, 0, 0.1);
  left: 5%;
}

.ball-icon::before {
  top: 25%;
}

.ball-icon::after {
  bottom: 25%;
}

.matches-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.join-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.join-hero span {
  font-size: 2.5rem;
}

.center-card {
  margin: 22vh auto 0;
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
}

.center-card .join-hero {
  justify-content: center;
}

.match-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 13, 30, 0.8);
}

.match-alert {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 126, 61, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

label span {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.65);
}

input {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(2, 9, 22, 0.7);
  color: #f2f7ff;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
}

button {
  border: none;
  background: linear-gradient(120deg, #ff7e3d, #ff396f);
  color: #fff;
  border-radius: 12px;
  padding: 0.85rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

button.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

button.small {
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
}

#returnHome,
#returnHomeJoin {
  width: auto;
  align-self: flex-end;
  padding: 0.25rem 0.75rem;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-row {
  display: flex;
  gap: 1rem;
}

.status {
  min-height: 1.2rem;
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
}

.status.error {
  color: #ff5f7a;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(8, 17, 35, 0.9);
}

.room-code-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  text-align: center;
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: rgba(255, 255, 255, 0.6);
  align-items: center;
}

.player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.player-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.player-list li span {
  font-weight: 500;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

.badge {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.bracket-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bracket-round h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.bracket-match {
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(3, 9, 22, 0.7);
}

.bracket-match p {
  font-size: 0.95rem;
}

.hidden {
  display: none;
}

.question-card {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
}

.subtext {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.pitch {
  background: linear-gradient(180deg, rgba(1, 10, 25, 0.8), rgba(0, 0, 0, 0.6));
  border-radius: 24px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.result-card {
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.result-card h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

#hostLobby {
  margin-top: 22vh;
}


@media (max-width: 768px) {
  .app-shell {
    width: 100%;
    padding: 1.5rem 1rem 3rem;
  }

  .app-shell.card-stack {
    margin-top: 12vh;
  }

  .hero-overlay {
    width: 90vw;
    padding: 1.25rem;
    margin: 2rem auto 3rem;
    transform: none;
  }

  .entry-grid {
    flex-direction: row;
  }

  .lobby-header,
  .players-card,
  .bracket-card,
  #matchCta,
  .info-card {
    width: 100%;
  }

  #hostLobby {
    margin-top: 12vh;
  }

  .match-footer {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hero-overlay {
    transform: none;
    margin: 1.5rem auto 2.5rem;
    padding: 1rem;
  }

  .entry-card,
  .info-card {
    padding: 1rem;
  }
}
