#blazor-error-ui {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
}

#blazor-error-ui.show {
    display: flex;
    color: white;
}

#blazor-error-ui a {
    color: white;
    text-decoration: underline;
    cursor: pointer;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: auto;
    position: absolute;
    top: 10px;
    right: 10px;
}
body {
  overscroll-behavior: none;
}
img {
  /* Prevent haptic touch previews */
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
* {
-webkit-tap-highlight-color: transparent;
}

:root {
  --app-bg-top: #f7fbff;
  --app-bg-bottom: #ecf2f8;
  --app-surface: #ffffff;
  --app-border: #d7e0eb;
  --app-text: #1c2a39;
  --app-muted: #5f7185;
  --app-shadow: 0 8px 24px rgba(15, 29, 45, 0.08);
  --app-shadow-soft: 0 2px 10px rgba(15, 29, 45, 0.07);
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--app-text);
  background: linear-gradient(180deg, var(--app-bg-top) 0%, var(--app-bg-bottom) 100%);
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
  width: min(960px, 100%);
  margin: 0 auto;
  padding-bottom: 1.25rem;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(110deg, #1c2a39 0%, #243447 52%, #1a2635 100%);
  backdrop-filter: saturate(120%) blur(4px);
}

.app-topbar .container {
  min-height: 4rem;
}

.brand-pill {
  color: #f6fbff;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.desktop-nav {
  display: none;
  gap: 1.25rem;
}

.mobile-menu {
  position: relative;
}

.mobile-menu-toggle {
  width: 2.6rem;
  height: 2.4rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(232, 244, 255, 0.6);
  background: rgba(21, 73, 109, 0.28);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.24rem;
  list-style: none;
  cursor: pointer;
}

.mobile-menu-toggle::-webkit-details-marker {
  display: none;
}

.menu-line {
  width: 1.12rem;
  height: 2px;
  border-radius: 1px;
  background: #f5fbff;
}

.mobile-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 11rem;
  display: grid;
  gap: 0.18rem;
  padding: 0.45rem;
  border: 1px solid var(--app-border);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 30px rgba(16, 28, 44, 0.14);
  z-index: 60;
}

.mobile-menu:not([open]) .mobile-menu-panel {
  display: none;
}

.mobile-menu-link {
  color: var(--app-text);
  text-decoration: none;
  font-weight: 600;
  border-radius: 0.65rem;
  padding: 0.56rem 0.64rem;
}

.mobile-menu-link.active {
  background: rgba(44, 146, 212, 0.15);
  color: #1d5f8b;
}

.desktop-link {
  color: rgba(245, 251, 255, 0.82);
  text-decoration: none;
  font-weight: 600;
  padding: 0.25rem 0;
}

.desktop-link.active {
  color: #ffffff;
}

.card {
  border: 1px solid var(--app-border);
  border-radius: 1.1rem;
  box-shadow: var(--app-shadow);
}

.card-body {
  padding: 1.15rem;
}

.form-control,
.btn {
  min-height: 2.85rem;
  border-radius: 0.8rem;
}

.form-control-lg,
.btn-lg {
  min-height: 3.15rem;
}

.app-score-input {
  font-size: 1.18rem;
  font-weight: 700;
}

.match-screen {
  border-radius: 1.25rem;
}

.match-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: var(--app-muted);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.team-block {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66) 0%, rgba(245, 249, 255, 0.9) 100%);
  border: 1px solid rgba(212, 223, 236, 0.86);
  border-radius: 1rem;
  padding: 0.95rem 0.85rem;
}

.vs-pill {
  margin-inline: auto;
  width: fit-content;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(44, 146, 212, 0.35);
  color: #1d6a9d;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.match-actions {
  margin-top: 0.5rem;
}

.app-empty-state {
  text-align: center;
  color: var(--app-muted);
  padding: 2rem 1rem;
}

.player-list {
  border-radius: 0.95rem;
  overflow: hidden;
}

.player-list .player-row {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border-color: var(--app-border);
  color: var(--app-text);
}

.player-list .player-row + .player-row {
  border-top: 1px solid var(--app-border);
}

.player-list .player-name {
  color: var(--app-text);
}

.podium-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.podium-card {
  border: 1px solid var(--app-border);
  border-radius: 0.9rem;
  padding: 0.65rem 0.55rem;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  text-align: center;
  box-shadow: var(--app-shadow-soft);
}

.podium-card.rank-1 {
  border-color: #7ac9f6;
  background: linear-gradient(180deg, #ecf7ff 0%, #dff1ff 100%);
}

.podium-rank {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #3f6b8c;
}

.podium-name {
  margin-top: 0.2rem;
  font-weight: 700;
  color: var(--app-text);
  font-size: 0.88rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-value {
  margin-top: 0.22rem;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  color: #18669a;
}

.podium-label {
  margin-top: 0.12rem;
  font-size: 0.66rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.leader-list {
  display: grid;
  gap: 0.6rem;
}

.leader-row {
  border: 1px solid var(--app-border);
  border-radius: 0.95rem;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: var(--app-shadow-soft);
  animation: app-rise 260ms ease-out both;
}

.leader-row summary {
  list-style: none;
}

.leader-row summary::-webkit-details-marker {
  display: none;
}

.leader-row-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  cursor: pointer;
  padding: 0.75rem 0.8rem;
}

.leader-rank {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid var(--app-border);
  font-size: 0.72rem;
  font-weight: 700;
  color: #40617d;
  background: #ffffff;
}

.leader-main {
  min-width: 0;
}

.leader-name {
  font-weight: 700;
  color: var(--app-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-sub {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.leader-score-block {
  text-align: right;
}

.leader-score {
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1;
  color: #1f6d9f;
}

.leader-score-label {
  margin-top: 0.15rem;
  font-size: 0.66rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.leader-meta {
  padding: 0 0.8rem 0.75rem;
}

.leader-row:not([open]) .leader-meta {
  display: none;
}

.about-page {
  width: min(760px, 100%);
  margin: 0 auto;
}

.about-hero {
  border-color: #b8d4ea;
  background: linear-gradient(160deg, #f2f9ff 0%, #e8f4ff 100%);
}

.about-list {
  margin: 0;
  padding-left: 1.05rem;
  color: var(--app-text);
}

.about-list li {
  margin-bottom: 0.45rem;
}

.about-list li:last-child {
  margin-bottom: 0;
}

.about-highlight {
  border: 1px solid #bcd8ec;
  background: linear-gradient(180deg, #f8fcff 0%, #eef7ff 100%);
  border-radius: 0.9rem;
  padding: 0.8rem 0.9rem;
  color: #23445f;
}

.about-highlight-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2f668f;
}

.about-actions {
  display: grid;
  gap: 0.6rem;
}

.about-actions .btn {
  width: 100%;
}

.rules-page {
  width: min(760px, 100%);
  margin: 0 auto;
}

.rules-hero {
  border-color: #b8d4ea;
  background: linear-gradient(160deg, #f4faff 0%, #ebf5ff 100%);
}

.rules-section-label {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  color: #476b88;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rules-placeholder-list {
  margin: 0;
  padding-left: 1.05rem;
  color: var(--app-text);
}

.rules-placeholder-list li {
  margin-bottom: 0.45rem;
}

.rules-placeholder-list li:last-child {
  margin-bottom: 0;
}

.rules-note {
  border: 1px dashed #b8cfe1;
  border-radius: 0.9rem;
  padding: 0.8rem 0.9rem;
  background: linear-gradient(180deg, #fcfeff 0%, #f4f9fd 100%);
  color: #42647f;
}

.rules-actions {
  display: grid;
  gap: 0.6rem;
}

.rules-actions .btn {
  width: 100%;
}

@media (min-width: 768px) {
  .about-actions {
    grid-template-columns: 1fr 1fr;
  }

  .rules-actions {
    grid-template-columns: 1fr 1fr;
  }
}

.app-rise-in {
  animation: app-rise 260ms ease-out both;
}

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

@media (min-width: 768px) {
  .desktop-nav {
    display: inline-flex;
  }

  .mobile-menu {
    display: none;
  }

  .app-content {
    padding-bottom: 2rem;
  }
}