:root {
  --red: #e10600;
  --red-50: #fff0f0;
  --red-100: #ffe0e0;
  --green: #0b7a33;
  --green-50: #e4f6eb;
  --bg: #ffffff;
  --text: #121212;
  --muted: #6b7280;
  --border: #e6e6e6;
  --radius: 12px;
  --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: var(--bg);
  font-family: 'Poppins', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex-grow: 1;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.section {
  padding: 30px 0;
}

.section-title {
  margin: 0 0 20px;
  font-size: 28px;
  letter-spacing: 0.2px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.stack {
  display: grid;
  gap: 12px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card[href]:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-pad {
  padding: 18px;
}

.event-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card--link {
  cursor: pointer;
}

.event-card--link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.event-card--static {
  cursor: default;
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  border: 1.5px solid var(--red);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  box-shadow: 0 6px 16px rgba(225, 6, 0, 0.25);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(225, 6, 0, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--red);
  box-shadow: none;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: 70px;
  height: 70px;
}

/* Burger */
.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-toggle .burger,
.nav-toggle .burger::before,
.nav-toggle .burger::after {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: #333;
  border-radius: 2px;
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle .burger::before {
  position: absolute;
  transform: translateY(-6px);
}

.nav-toggle .burger::after {
  position: absolute;
  transform: translateY(6px);
}

/* Animate to "X" when open */
header.menu-open .nav-toggle .burger {
  transform: rotate(45deg);
}

header.menu-open .nav-toggle .burger::before {
  transform: rotate(90deg);
}

header.menu-open .nav-toggle .burger::after {
  opacity: 0;
}

/* Nav links */
nav.nav-links {
  display: flex;
  gap: 6px;
}

nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--red);
  font-weight: 700;
}

nav a:hover {
  background: var(--red-50);
}

nav a[aria-current='page'] {
  color: var(--red);
  background: var(--red-100);
}

/* Mobile nav */
@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex;
  }

  nav.nav-links {
    position: absolute;
    top: 66px;
    right: 0;
    left: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px;
    display: none;
    gap: 8px;
  }

  header.menu-open nav.nav-links {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Hero */
.hero {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--border);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
}

.hero-overlay {
  position: relative;
  z-index: 1;
  color: #fff;
  text-align: center;
  width: min(900px, 92%);
}

.hero-glass {
  display: inline-block;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(1px);
  padding: 16px 18px;
  border-radius: 14px;
}

.hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(26px, 4vw, 44px);
}

.hero p {
  margin: 0 0 14px;
  color: #eaeaea;
}

/* Value cards */
.value-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.value-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.value-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff5f5;
  color: var(--red);
  font-size: 26px;
  border: 1px solid #ffd6d6;
}

/* Events */
.event-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.event-card .card-pad {
  display: grid;
  gap: 6px;
}

.event-date {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff5f5;
  color: var(--red);
  border: 1px solid #ffd6d6;
  font-size: 12px;
  font-weight: 700;
}

/* Event image fullscreen modal */
.event-image-modal-card {
  position: relative;
  background: transparent;
  padding: 0;
  max-width: 90vw;
  max-height: 90vh;
  min-width: auto;
  box-shadow: none;
}

.event-image-modal-card img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.event-image-modal-card .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  z-index: 10;
}

/* Teams */
.team-card img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
}

.team-card .card-pad {
  display: grid;
  gap: 6px;
}

/* Team hero */
.team-banner {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

#team-name {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: auto;
  margin: 0;
  padding: 0;
  background: transparent;

  font-size: 32px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -1px;
  line-height: 1.1;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
  #team-name {
    font-size: 24px;
    padding: 0;
    bottom: 10px;
    left: 10px;
  }
}

.team-banner img {
  width: 100%;
  height: auto;
  display: block;
}

.team-split-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  align-items: start;
}

.team-sidebar-col {
  padding-top: 62px;
  /* Align with player cards (skipping title) */
}

@media (max-width: 900px) {
  .team-split-layout {
    grid-template-columns: 1fr;
  }

  .team-main-col {
    order: 2;
  }

  .team-sidebar-col {
    order: 1;
    padding-top: 0;
  }
}

.info-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.info-box h4 {
  margin: 0 0 12px;
  font-size: 18px;
  display: flex;
  align-items: center;
}

/* Games */
/* Scrollable games box */
.games-box {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  overflow: hidden;
}

.games-scroll {
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
  scrollbar-gutter: stable;
}

@media (max-width: 720px) {
  .games-scroll {
    max-height: 370px;
  }
}

/* Game row with right-aligned score */
.game {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 720px) {
  .game {
    grid-template-columns: 80px 1fr auto;
    align-items: start;
  }
}

.game+.game {
  margin-top: 10px;
}

.game .meta {
  color: var(--muted);
  font-size: 14px;
}

/* Result card hover */
.result-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.score-badge,
.game-score {
  white-space: nowrap;
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 10px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  background: #f3f4f6;
  color: var(--text);
}

.score-badge.score-win,
.game-score.score-win {
  color: var(--green);
  background: var(--green-50);
  border-color: #9fd7b3;
}

.score-badge.score-loss,
.game-score.score-loss {
  color: var(--red);
  background: var(--red-50);
  border-color: #ffd6d6;
}

.game strong {
  color: #222;
}

.game .meta {
  color: var(--muted);
  font-size: 14px;
}

/* Players */
.player-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  padding: 0;
  cursor: pointer;
  display: grid;
  grid-template-rows: 1fr auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.player-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.player-card .player-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.player-card img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 27%;
}

.player-card .player-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.player-card .player-placeholder svg {
  width: 40%;
  height: 40%;
  color: #c5c9ce;
}

.player-card .card-pad {
  display: grid;
  gap: 4px;
  background: #fff;
}

.player-card small {
  color: var(--muted);
}

/* Player size-based image positioning for head alignment */
/* S (Small < 175cm): show more from bottom to push head down */
/* M (Medium 175-189cm or unknown): default positioning */
/* L (Large >= 190cm): show more from top to push head up */
.player-card img.player-size-s {
  object-position: center 45%;
}

.player-card img.player-size-m {
  object-position: center 27%;
}

.player-card img.player-size-l {
  object-position: center 10%;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.hero h1,
.hero p,
.section-title {
  animation: fadeIn 0.6s ease-out backwards;
}

.hero p {
  animation-delay: 0.1s;
}

.btn-row {
  animation: fadeIn 0.6s ease-out 0.2s backwards;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  max-width: 90vw;
  min-width: 400px;
  width: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-body {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 24px 0 24px;
}

.modal-body .modal-image-wrapper {
  position: relative;
  max-width: 100%;
  height: 550px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modal-body img {
  max-width: 100%;
  height: 550px;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #f8f8f8;
}

.modal-body .modal-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modal-body .modal-placeholder svg {
  width: 25%;
  height: 25%;
  color: #c5c9ce;
}

.modal-content {
  padding: 24px;
  flex-shrink: 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-header>div {
  flex-grow: 1;
}

.modal-header .badge {
  display: inline-block;
  background: #e10600;
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 8px;
}

.modal-close {
  border: none;
  background: #f5f5f5;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-close:hover {
  background: #e10600;
  color: #fff;
  transform: rotate(90deg);
}

.modal-close svg {
  width: 20px;
  height: 20px;
  display: block;
}

.kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px 16px;
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.6;
}

.kv b {
  color: #333;
  font-weight: 600;
}

/* Timeline */
.timeline {
  position: relative;
  margin: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-left: 56px;
  margin-bottom: 18px;
}

.timeline-dot {
  position: absolute;
  left: -36px;
  top: 10px;
  width: 16px;
  height: 16px;
  background: var(--red);
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
}

.timeline-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.timeline-card img {
  width: 100%;
  height: auto;
  display: block;
}

.timeline-card .card-pad {
  padding: 14px;
}

/* Board */
.board-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.board-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.board-card img {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  object-position: center 27%;
}

/* Board member size-based image positioning (same as player cards) */
.board-card img.board-size-s {
  object-position: center 45%;
}

.board-card img.board-size-m {
  object-position: center 27%;
}

.board-card img.board-size-l {
  object-position: center 10%;
}

.board-email {
  display: block;
  margin-top: 6px;
  color: var(--red);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.board-email:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 26px 0 14px;
}

.footer-section h4 {
  margin: 0 0 8px;
}

.footer-section .stack a {
  color: var(--red);
  font-weight: 600;
}

.footer-bottom {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  color: #555;
  font-size: 14px;
}

/* A11y helper */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  white-space: nowrap;
  border: 0;
}

/* Contact page */
.contact-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.map-wrap iframe {
  width: 100%;
  height: 320px;
  border: 0;
  display: block;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

/* Responsive */
@media (max-width: 960px) {
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }

  .team-info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {

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

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

  .hero {
    aspect-ratio: 4 / 3;
  }

  .modal {
    padding: 16px;
  }

  .modal-card {
    max-width: 100%;
    min-width: 0;
    max-height: 95vh;
  }

  .modal-body {
    padding: 20px 20px 0 20px;
  }

  .modal-body .modal-image-wrapper {
    height: 450px;
  }

  .modal-body img {
    height: 450px;
  }

  .modal-content {
    padding: 20px;
  }

  .kv {
    grid-template-columns: 100px 1fr;
    gap: 6px 12px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .modal {
    padding: 12px;
  }

  .modal-card {
    border-radius: 12px;
    min-width: 0;
  }

  .modal-body {
    padding: 16px 16px 0 16px;
  }

  .modal-body .modal-image-wrapper {
    height: 400px;
  }

  .modal-body img {
    height: 400px;
  }

  .modal-content {
    padding: 16px;
  }

  .modal-header {
    gap: 12px;
    margin-bottom: 12px;
  }

  .kv {
    grid-template-columns: 90px 1fr;
    gap: 6px 10px;
    font-size: 13px;
  }
}

/* Training section styling */
.training-item {
  padding: 8px 0;
}

.training-time {
  font-weight: 600;
  color: var(--text);
}

.training-location {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.training-divider {
  height: 1px;
  border: none;
  background: var(--border);
  margin: 8px 0;
}