:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #f3f7f5;
  background: #101416;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #101416;
}

a {
  color: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0.7rem 1rem;
  background: #f5c542;
  color: #15120a;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: #263238;
  color: #f3f7f5;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: #172023;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
  font-size: 1.1rem;
  font-weight: 900;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar form {
  margin: 0;
}

.topbar button {
  padding: 0.5rem 0.75rem;
}

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

.hero {
  min-height: calc(100vh - 128px);
  display: grid;
  align-items: center;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.5rem);
  line-height: 0.98;
}

.hero p {
  max-width: 680px;
  color: #c8d3cd;
  font-size: 1.15rem;
}

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

.panel,
.form-panel,
.messages {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #172023;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.panel,
.form-panel {
  padding: 1.25rem;
}

.form-panel {
  max-width: 520px;
}

.form-panel input,
.form-panel select,
.chat-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 0.75rem;
  background: #101416;
  color: #f3f7f5;
}

.form-panel input[type="color"] {
  min-height: 52px;
  padding: 0.35rem;
  cursor: pointer;
}

.color-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}

.color-preview div {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0.75rem;
  border-radius: 6px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
}

.color-preview small {
  grid-column: 2;
  color: #a9b8b0;
}

.swatch {
  width: 34px;
  height: 34px;
  display: inline-block;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: #1565c0;
}

.mini-kit {
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
  justify-items: center;
  background:
    linear-gradient(135deg, var(--primary-preview, #1565c0) 0 50%, var(--secondary-preview, #f5f5f5) 50% 100%);
  color: #101416;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.messages {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
}

.messages p {
  margin: 0;
}

.muted,
.eyebrow {
  color: #a9b8b0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1rem;
}

.club-card {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 55%, #172023), #172023 58%),
    #172023;
}

.club-card h1 {
  margin: 0;
  font-size: 2.4rem;
}

.stats,
.facility-list,
.tier-list {
  display: grid;
  gap: 0.65rem;
}

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

.stats span,
.facility-list li,
.tier-list li,
.role-row {
  border-radius: 6px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
}

.stats strong,
.facility-list strong {
  display: block;
}

.facility-list,
.tier-list {
  padding: 0;
  list-style: none;
}

.chat-panel {
  grid-column: 1 / -1;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
}

.chat-feed {
  margin-top: 1rem;
}

.role-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1rem;
  align-items: center;
  margin-top: 0.75rem;
}

.checks {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .topbar,
  .topbar nav,
  .dashboard-grid,
  .stats,
  .role-row,
  .chat-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
  }
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 1rem;
}

.main-board,
.board-grid {
  display: grid;
  gap: 1rem;
}

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

.club-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.club-crest,
.club-crest-image {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
}

.club-crest {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--primary, #1565c0);
  box-shadow: inset 0 0 0 5px var(--secondary, #f5f5f5), 0 12px 28px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.club-crest span {
  width: 30px;
  height: 30px;
  display: block;
  background: var(--secondary, #f5f5f5);
}

.club-crest-shield {
  border-radius: 14px 14px 26px 26px;
  clip-path: polygon(50% 0, 92% 12%, 86% 72%, 50% 100%, 14% 72%, 8% 12%);
}

.club-crest-round {
  border-radius: 50%;
}

.club-crest-round span {
  border-radius: 50%;
}

.club-crest-diamond {
  transform: rotate(45deg) scale(0.82);
  border-radius: 8px;
}

.club-crest-diamond span {
  transform: rotate(-45deg);
}

.club-crest-stripes {
  background:
    repeating-linear-gradient(90deg, var(--primary, #1565c0) 0 14px, var(--secondary, #f5f5f5) 14px 28px);
}

.club-crest-stripes span {
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(16, 20, 22, 0.72);
}

.club-crest-image {
  display: block;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.crest-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.85rem;
  margin: 1rem 0;
  border-radius: 6px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
}

.crest-preview .club-crest {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
}

.game-layout .chat-panel {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto auto;
  gap: 1rem;
  grid-column: auto;
}

.chat-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.chat-title h2 {
  margin: 0;
}

#chatPulse {
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: rgba(245, 197, 66, 0.16);
  color: #f5c542;
  font-size: 0.8rem;
  font-weight: 800;
}

.game-layout .chat-feed {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  overflow: auto;
  margin-top: 0;
  padding-right: 0.25rem;
}

.chat-message {
  position: relative;
  border-radius: 6px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
}

.chat-message strong {
  display: block;
  color: #f5c542;
}

.chat-name-link {
  display: block;
  font-weight: 900;
  text-decoration: none;
}

.chat-name-link:hover {
  text-decoration: underline;
}

.chat-profile-link {
  display: inline-flex;
  flex: 0 0 auto;
  text-decoration: none;
}

.chat-message p {
  margin: 0.35rem 0 0;
  color: #d7dfdb;
}

.chat-message-meta {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.35rem;
  color: #a9b8b0;
  font-size: 0.72rem;
  font-weight: 800;
}

@media (max-width: 920px) {
  .game-layout,
  .board-grid {
    grid-template-columns: 1fr;
  }

  .game-layout .chat-panel {
    position: static;
    max-height: none;
  }
}

.chat-form textarea,
.ip-ban-form input,
.moderation-row input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 0.75rem;
  background: #101416;
  color: #f3f7f5;
}

.chat-form textarea {
  min-height: 78px;
  resize: vertical;
}

.chat-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: fit-content;
  max-width: 100%;
  border-radius: 6px;
  cursor: context-menu;
  outline: none;
}

.chat-identity:focus-visible {
  box-shadow: 0 0 0 2px rgba(245, 197, 66, 0.72);
}

.chat-identity .club-crest,
.chat-identity .club-crest-image {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}

.chat-identity .club-crest span {
  width: 16px;
  height: 16px;
}

.chat-title-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.chat-gif {
  width: 100%;
  max-height: 220px;
  display: block;
  border-radius: 6px;
  object-fit: cover;
}

.moderation-list {
  display: grid;
  gap: 0.75rem;
}

.moderation-row,
.ip-ban-form,
.challenge-form,
.challenge-row {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 320px) auto auto;
  gap: 0.75rem;
  align-items: center;
  border-radius: 6px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
}

.moderation-row.compact {
  grid-template-columns: 1fr auto;
}

.challenge-form {
  grid-template-columns: 1fr auto;
  margin-bottom: 1rem;
}

.challenge-form select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 0.75rem;
  background: #101416;
  color: #f3f7f5;
}

.challenge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.challenge-row {
  grid-template-columns: 1fr auto auto auto;
  margin-top: 0.65rem;
}

.challenge-row.compact {
  grid-template-columns: 1fr auto;
}

.status-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 900;
}

.status-badge.danger {
  background: rgba(229, 57, 53, 0.18);
  color: #ff8a80;
}

.secondary-action {
  background: #263238;
  color: #f3f7f5;
}

.danger-action {
  background: #e53935;
  color: #fff;
}

.game-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #172023;
}

.game-nav a {
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
  font-weight: 800;
}

.game-nav .supporter-link {
  color: #f5c542;
}

.profile-record,
.upgrade-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.profile-record {
  grid-template-columns: repeat(4, 1fr);
}

.profile-stats {
  margin-top: 1rem;
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.profile-record span,
.upgrade-row,
.standing-row,
.result-row {
  border-radius: 6px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
}

.profile-record strong {
  display: block;
  font-size: 1.7rem;
}

.upgrade-row,
.standing-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.65rem;
}

.result-row small {
  color: #a9b8b0;
  font-weight: 800;
}

.standings {
  display: grid;
  gap: 0.55rem;
}

.chat-toggle {
  justify-self: stretch;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  padding: 0.65rem 0.7rem;
  background: #263238;
  color: #f3f7f5;
  white-space: nowrap;
}

.chat-panel.is-collapsed {
  grid-template-rows: auto auto;
}

.chat-panel.is-collapsed #chatFeed,
.chat-panel.is-collapsed .chat-form {
  display: none;
}

.chat-context-menu {
  position: absolute;
  z-index: 40;
  top: 3.35rem;
  left: 0.75rem;
  min-width: 168px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 0.35rem;
  background: #101416;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

.chat-context-menu[hidden] {
  display: none;
}

.chat-context-menu a,
.chat-context-menu button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 4px;
  padding: 0.55rem 0.65rem;
  background: transparent;
  color: #a9d6ff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.chat-context-menu a:hover,
.chat-context-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.danger-text {
  color: #ff8a80;
}

.supporter-page {
  text-align: center;
}

.supporter-page h1 {
  max-width: 820px;
  margin: 0 auto 1rem;
  font-size: clamp(2rem, 5vw, 4rem);
}

.supporter-page p {
  max-width: 980px;
  margin-inline: auto;
  color: #d7dfdb;
}

.perk-list {
  max-width: 760px;
  display: grid;
  gap: 0.65rem;
  margin: 1rem auto;
  padding: 0;
  list-style: none;
  text-align: left;
}

.perk-list li {
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  background: rgba(245, 197, 66, 0.1);
}

.perk-list li::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  display: inline-block;
  margin-right: 0.65rem;
  background: #f5c542;
  transform: rotate(45deg);
}

.coming-soon {
  max-width: 420px;
  display: grid;
  gap: 0.25rem;
  margin: 1.5rem auto 0;
  border: 1px solid rgba(245, 197, 66, 0.45);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(245, 197, 66, 0.1);
}

.coming-soon strong {
  color: #f5c542;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .moderation-row,
  .ip-ban-form,
  .challenge-form,
  .challenge-grid,
  .challenge-row,
  .profile-detail-grid,
  .profile-record,
  .upgrade-row,
  .standing-row {
    grid-template-columns: 1fr;
  }
}
