:root {
  --court-width: 650px;
  --court-height: 900px;
  --wall-height: 200px;
  --court-scale: 1;
  --rx: 55deg;
  --rz: -35deg;
}
body { background-color: #F7F1E5; color: #004225; overflow-x: hidden; }
@media (pointer: fine) { body.custom-cursor, body.custom-cursor a, body.custom-cursor button { cursor: none; } }

/* Custom cursor */
.cursor-dot, .cursor-outline {
  position: fixed; top: 0; left: 0; transform: translate(-50%, -50%);
  border-radius: 50%; z-index: 9999; pointer-events: none;
}
.cursor-dot, .cursor-outline { opacity: 0; } body.cursor-ready .cursor-dot, body.cursor-ready .cursor-outline { opacity: 1; }
.cursor-dot { width: 8px; height: 8px; background-color: #D96C06; }
.cursor-outline {
  width: 40px; height: 40px; border: 1px solid rgba(0, 66, 37, 0.5);
  display: flex; align-items: center; justify-content: center;
  transition: width 0.2s, height 0.2s, background-color 0.2s;
  font: 600 9px/1 Montserrat, sans-serif; letter-spacing: 0.15em; color: #D96C06;
}
.cursor-outline span { opacity: 0; transition: opacity 0.2s; }
body.hovering .cursor-outline { width: 80px; height: 80px; background-color: rgba(217, 108, 6, 0.1); border-color: #D96C06; }
body.hovering .cursor-outline span { opacity: 1; }
@media (pointer: coarse) { .cursor-dot, .cursor-outline { display: none !important; } }

/* 3D court */
.scene-container { perspective: 2500px; overflow: hidden; }
.court-assembly {
  transform-style: preserve-3d; width: var(--court-width); height: var(--court-height);
  position: absolute; top: 55%; left: 58%;
  transform: translate(-50%, -50%) scale(var(--court-scale)) rotateX(var(--rx)) rotateZ(var(--rz));
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}
@media (max-width: 767px) { :root { --court-scale: 0.5; } .court-assembly { top: 62%; left: 62%; } }
@media (min-width: 768px) and (max-width: 1199px) { :root { --court-scale: 0.75; } }
.hotspot { position: absolute; width: 40px; height: 40px; transform-style: preserve-3d; z-index: 50; }
.hotspot-inner {
  width: 100%; height: 100%; background: rgba(247, 241, 229, 0.9); border: 1px solid #004225;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; box-shadow: 0 10px 20px rgba(0,0,0,0.1); animation: pulse-border 2s infinite;
}
.hotspot-label {
  position: absolute; left: 50px; top: 50%; transform: translateY(-50%);
  background: #004225; color: #F7F1E5; padding: 8px 16px; white-space: nowrap;
  font-family: 'Montserrat'; font-size: 12px; opacity: 0; pointer-events: none;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1); transform-origin: left center; scale: 0.8; letter-spacing: 0.05em;
}
.hotspot:hover .hotspot-inner { background: #D96C06; border-color: #D96C06; transform: scale(1.2); color: white; }
.hotspot:hover .hotspot-label { opacity: 1; scale: 1; left: 60px; }
@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(0, 66, 37, 0.2); }
  70% { box-shadow: 0 0 0 10px rgba(0, 66, 37, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 66, 37, 0); }
}
.court-floor {
  position: absolute; width: 100%; height: 100%; background: #004225; border: 8px solid #F7F1E5;
  box-shadow: 30px 30px 60px rgba(0,0,0,0.2), inset 0 0 100px rgba(0,0,0,0.3); transform-style: preserve-3d;
}
.court-floor::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 40px 40px;
}
.court-line { position: absolute; background: rgba(247, 241, 229, 0.55); }
.net {
  position: absolute; width: 106%; height: 50px; left: -3%; top: 50%;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.2) 0, rgba(255,255,255,0.2) 1px, transparent 0, transparent 4px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.2) 0, rgba(255,255,255,0.2) 1px, transparent 0, transparent 4px);
  border-top: 3px solid white; transform: rotateX(-90deg) translateY(-25px); transform-origin: bottom;
}
.glass-wall {
  position: absolute; background: linear-gradient(180deg, rgba(200, 255, 220, 0.1) 0%, rgba(200, 255, 220, 0.02) 100%);
  border: 1px solid rgba(255,255,255,0.15); transform-origin: bottom;
}
.wall-back { width: 100%; height: var(--wall-height); bottom: 0; left: 0; transform: rotateX(-90deg); }
.wall-left { width: var(--court-height); height: var(--wall-height); top: 0; left: 0; transform: rotateY(90deg) rotateZ(-90deg); transform-origin: 0 0; }
.wall-right { width: var(--court-height); height: var(--wall-height); top: 0; right: 0; transform: rotateY(-90deg) rotateZ(90deg); transform-origin: 100% 0; }
.ball { animation: ball-bounce 1.6s ease-in-out infinite; }
@keyframes ball-bounce { 0%, 100% { transform: translateZ(20px); } 50% { transform: translateZ(90px); } }

/* Reveal text */
.char { display: inline-block; opacity: 0; transform: translateY(100%); transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease; }

/* Marquee */
.marquee-container { display: flex; overflow: hidden; user-select: none; gap: 2rem; }
.marquee-content { flex-shrink: 0; display: flex; justify-content: space-around; min-width: 100%; gap: 2rem; animation: scroll 24s linear infinite; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(calc(-100% - 2rem)); } }

/* Image mask reveal */
.mask-reveal { clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); transition: clip-path 1.2s cubic-bezier(0.7, 0, 0.2, 1); }
.mask-reveal.active { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }

.vertical-tab { writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg); }

/* Sticky horizontal scroll */
.horizontal-section { position: relative; height: 400vh; }
.horizontal-wrapper { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; align-items: center; }
.cards-track { display: flex; gap: 4vw; padding-left: 6vw; will-change: transform; }
@media (min-width: 768px) { .cards-track { padding-left: 10vw; } }

.nav-link::after { content: ''; position: absolute; width: 0; height: 1px; bottom: -2px; left: 0; background-color: #D96C06; transition: width 0.3s ease; }
.nav-link:hover::after { width: 100%; }

/* Standings */
.row-enter { animation: row-in 0.6s cubic-bezier(0.19, 1, 0.22, 1) both; }
@keyframes row-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.live-dot { animation: live 1.4s ease-in-out infinite; }
@keyframes live { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.tabular { font-variant-numeric: tabular-nums; }

input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #F7F1E5; }
::-webkit-scrollbar-thumb { background: #004225; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Hall of fame medals */
.medal {
  width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font: 600 22px/1 Montserrat, sans-serif; box-shadow: inset 0 -4px 8px rgba(0,0,0,0.25), inset 0 3px 6px rgba(255,255,255,0.45), 0 10px 24px rgba(0,0,0,0.15);
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}
.group:hover .medal { transform: rotate(-12deg) scale(1.08); }
.medal span { text-shadow: 0 1px 0 rgba(255,255,255,0.35); }
.medal-gold { background: radial-gradient(circle at 30% 30%, #FFF1B8, #E5B53A 45%, #A87B12); color: #5C4200; }
.medal-silver { background: radial-gradient(circle at 30% 30%, #FFFFFF, #C9CDD2 45%, #7F858C); color: #3A3F45; }
.medal-bronze { background: radial-gradient(circle at 30% 30%, #FFD2A8, #C27A3E 45%, #7A4416); color: #3F1F05; }
.medal-black { background: radial-gradient(circle at 30% 30%, #5A5A5A, #1F1F1F 50%, #000); color: #F7F1E5; box-shadow: inset 0 -4px 8px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.15), 0 0 0 1px rgba(247,241,229,0.2); }
.medal-black span { text-shadow: none; }

/* Last-edition crowns */
.crown-gold { color: #D4A20F; fill: rgba(212, 162, 15, 0.25); }
.crown-silver { color: #9AA0A6; fill: rgba(154, 160, 166, 0.25); }
.crown-bronze { color: #B8732F; fill: rgba(184, 115, 47, 0.25); }
.crown-black { color: #1a1a1a; fill: #1a1a1a; filter: drop-shadow(0 0 1px rgba(247, 241, 229, 0.9)); }
