:root {
  --green-dark: #1a3a2a;
  --green-turf: #3d8a4f;
  --green-turf-light: #4a9e5c;
  --cream: #f5f0e8;
  --cream-dim: #b0a998;
  --red-marker: #dd3333;
  --white-marker: #f0ece4;
  --gold: #c8a84e;
  --gold-bright: #e8c85e;
  --sea-blue: #4a90b8;
  --sea-light: #6ab0d8;
  --tennis-red: #c45a3a;
  --tennis-surface: #3a6a7a;
  --clubhouse-green: #2a5e3a;
  --clubhouse-cream: #e8e0d0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100dvh; overflow: hidden; }

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--green-dark);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100dvh;
}

/* === INSTALL BANNER === */
.install-banner {
  display: none;
  width: 100%;
  padding: 0.4rem 0.8rem;
  background: linear-gradient(135deg, #2a5e3a, #1a4a2a);
  border-bottom: 1px solid rgba(200,168,78,0.3);
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.install-banner.show { display: flex; }

.install-banner p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: clamp(0.7rem, 2.2vw, 0.85rem);
  color: var(--cream);
}

.install-btn {
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  padding: 0.25rem 0.7rem;
  background: var(--gold);
  color: var(--green-dark);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.install-dismiss {
  background: none;
  border: none;
  color: var(--cream-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
  flex-shrink: 0;
}

/* === HEADER === */
.header {
  text-align: center;
  padding: 0.3rem 0.5rem 0.1rem;
  flex-shrink: 0;
}

.header-logo {
  height: clamp(28px, 8vw, 44px);
  width: auto;
  margin-bottom: 0.1rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.header h1 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 3.8vw, 1.5rem);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  line-height: 1.1;
}

.header .subtitle {
  font-family: 'Oswald', sans-serif;
  font-weight: 400;
  font-size: clamp(0.6rem, 2.2vw, 0.8rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cream-dim);
  margin-top: 0.1rem;
}

/* === SCENE === */
.scene {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.05rem 0.2rem;
  min-height: 0;
}

.scene-frame {
  width: min(98vw, 500px);
  display: flex;
  flex-direction: column;
  padding: 0 5px;
}

/* Sea */
.sea-bar {
  height: 1.2rem;
  background: linear-gradient(180deg, var(--sea-light), var(--sea-blue));
  border-radius: 3px 3px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.sea-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg, transparent 0px, transparent 20px,
    rgba(255,255,255,0.1) 20px, rgba(255,255,255,0.1) 22px
  );
  animation: wave 4s linear infinite;
}

@keyframes wave {
  0% { transform: translateX(0); }
  100% { transform: translateX(22px); }
}

.sea-bar span {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.45rem, 1.4vw, 0.6rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.85);
  position: relative;
  z-index: 1;
}

.promenade-bar {
  height: 0.65rem;
  background: #777;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.promenade-bar span {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.35rem, 1.2vw, 0.45rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.7);
}

.green-row {
  display: flex;
  min-height: 0;
}

/* Tennis courts */
.tennis-courts {
  width: 2.4rem;
  flex-shrink: 0;
  background: var(--tennis-red);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 6px 6px 0;
}

.tennis-court {
  flex: 1;
  background: var(--tennis-surface);
  border-radius: 0 1px 1px 0;
}

/* The green */
.green-surface {
  flex: 1 1 auto;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1.5px,
      transparent 1.5px, transparent 14px
    ),
    linear-gradient(160deg, var(--green-turf), #2e7a44, var(--green-turf-light));
  position: relative;
  border: 2px solid rgba(255,255,255,0.25);
  overflow: visible;
}

.green-surface::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1.5px solid rgba(255,255,255,0.12);
  pointer-events: none;
  z-index: 1;
}

.right-side {
  width: 0.8rem;
  flex-shrink: 0;
  background: #5a5a4a;
}

.clubhouse-bar {
  height: 1.5rem;
  background: linear-gradient(0deg, #2a4a32, var(--clubhouse-green));
  border-radius: 0 0 3px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.clubhouse-bar::before {
  content: '';
  position: absolute;
  top: 2px; left: 15%; right: 15%; bottom: 2px;
  background: var(--clubhouse-cream);
  border-radius: 2px;
  opacity: 0.85;
}

.clubhouse-bar::after {
  content: '';
  position: absolute;
  top: 2px; left: 15%; right: 15%; bottom: 2px;
  background: repeating-linear-gradient(
    90deg, transparent 0px, transparent 28px,
    var(--clubhouse-green) 28px, var(--clubhouse-green) 30px
  );
  opacity: 0.5;
  border-radius: 2px;
}

.clubhouse-bar span {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.45rem, 1.4vw, 0.6rem);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green-dark);
  position: relative;
  z-index: 2;
  font-weight: 700;
}

/* === MARKERS === */
.markers-edge {
  position: absolute;
  z-index: 5;
  display: flex;
  pointer-events: none;
  transition: opacity 0.5s;
  opacity: 0;
}

.markers-edge.active { opacity: 1; }

.markers-edge.left-edge {
  left: -1px; top: 8px; bottom: 8px;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  width: 0;
}

.markers-edge.right-edge {
  right: -1px; top: 8px; bottom: 8px;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  width: 0;
}

.markers-edge.top-edge {
  top: -1px; left: 8px; right: 8px;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
  height: 0;
}

.markers-edge.bottom-edge {
  bottom: -1px; left: 8px; right: 8px;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
  height: 0;
}

.marker-dot {
  width: clamp(16px, 5vw, 24px);
  height: clamp(16px, 5vw, 24px);
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.marker-dot.red {
  background: var(--red-marker);
  box-shadow: 0 0 8px rgba(221,51,51,0.5);
}

.marker-dot.white {
  background: var(--white-marker);
  box-shadow: 0 0 8px rgba(255,255,255,0.35);
}

.marker-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(18px, 5.5vw, 28px);
  height: clamp(16px, 4.5vw, 24px);
  padding: 0 3px;
  background: white;
  border: 1.5px solid rgba(0,0,0,0.3);
  border-radius: 3px;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.55rem, 2vw, 0.8rem);
  font-weight: 700;
  color: #222;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Rink lines */
.rink-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
  z-index: 1;
}

.rink-lines.active { opacity: 1; }

.rink-line {
  position: absolute;
  background: rgba(255,255,255,0.1);
}

.rink-line.horizontal { height: 1px; left: 6px; right: 6px; }
.rink-line.vertical { width: 1px; top: 6px; bottom: 6px; }

/* === ARROWS === */
.arrows-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.arrow-group {
  display: flex;
  gap: clamp(0.8rem, 4vw, 1.8rem);
  opacity: 0;
  transition: opacity 0.6s;
}

.arrow-group.active { opacity: 1; }
.arrow-group.across { flex-direction: row; }
.arrow-group.updown { flex-direction: row; }

.arrow {
  fill: none;
  stroke: var(--cream);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.arrow.across-arrow {
  width: clamp(50px, 16vw, 80px);
  height: clamp(28px, 8vw, 44px);
  animation: pulse-h 2s ease-in-out infinite;
}

.arrow.updown-arrow {
  width: clamp(28px, 8vw, 44px);
  height: clamp(50px, 16vw, 80px);
  animation: pulse-v 2s ease-in-out infinite;
}

@keyframes pulse-h {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes pulse-v {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-3px); opacity: 1; }
}

/* Labels */
.green-label-marker {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 40%;
  z-index: 4;
  pointer-events: none;
}

.currently-label {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.55rem, 2vw, 0.7rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.1rem;
}

.green-label-marker > .marker-text {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.1rem, 5vw, 1.7rem);
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
  background: rgba(0,0,0,0.3);
  padding: 0.1rem 0.7rem;
  border-radius: 3px;
}

.marker-word-red { color: #ff5555 !important; text-shadow: 0 1px 8px rgba(255,50,50,0.6); }
.marker-word-white { color: #ffffff !important; text-shadow: 0 0 8px rgba(255,255,255,0.5); }
.marker-word-number { color: var(--gold-bright) !important; }

.green-label-direction {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 40%;
  z-index: 4;
  pointer-events: none;
}

.green-label-direction span {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.3rem, 5.5vw, 2rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
  background: rgba(0,0,0,0.4);
  padding: 0.15rem 0.8rem;
  border-radius: 3px;
}

.before-play-banner {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 65%;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}

.before-play-banner.active { opacity: 1; }

.before-play-banner span {
  font-family: 'Source Sans 3', sans-serif;
  font-size: clamp(0.7rem, 2.5vw, 0.95rem);
  font-weight: 600;
  color: var(--gold-bright);
  background: rgba(0,0,0,0.55);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  letter-spacing: 0.03em;
}

/* === FOOTER === */
.info-footer {
  flex-shrink: 0;
  width: min(98vw, 500px);
  padding: 0.2rem 0.3rem 0.25rem;
  text-align: center;
}

.countdown-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255,255,255,0.06);
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.08);
}

.countdown-label {
  font-size: clamp(0.6rem, 2vw, 0.75rem);
  color: var(--cream-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.countdown-time {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1rem, 3.5vw, 1.4rem);
  font-weight: 700;
  color: var(--gold-bright);
}

.datetime-row {
  margin-top: 0.1rem;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.75rem, 2.3vw, 0.95rem);
  color: var(--cream-dim);
}

.datetime-row .day-name { color: var(--gold); font-weight: 600; }

.by-order {
  margin-top: 0.05rem;
  font-size: 0.4rem;
  color: rgba(255,255,255,0.18);
}

/* Guidelines link */
.guidelines-link {
  margin-top: 0.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: clamp(0.65rem, 2vw, 0.8rem);
  color: var(--cream-dim);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  background: none;
  border: none;
  padding: 0.2rem 0.4rem;
}

.guidelines-link:hover,
.guidelines-link:active { opacity: 1; }

.guidelines-link .info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--cream-dim);
  font-size: 0.6rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  line-height: 1;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #2a2a2a;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 1.2rem 1rem;
  max-width: 380px;
  width: 100%;
  max-height: 80dvh;
  overflow-y: auto;
  color: var(--cream);
  position: relative;
}

.modal-content h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-align: center;
  margin-bottom: 0.5rem;
}

.modal-content p {
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  color: var(--cream-dim);
  text-align: center;
}

.modal-content .rule-section {
  margin: 0.6rem 0;
  padding: 0.5rem 0.6rem;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  border-left: 3px solid var(--gold);
}

.modal-content .rule-section h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cream);
  margin-bottom: 0.3rem;
}

.modal-content .rule-section p {
  text-align: left;
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.modal-content .committee {
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  margin-top: 0.8rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.modal-close {
  display: block;
  margin: 0.8rem auto 0;
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  padding: 0.35rem 1.5rem;
  background: var(--gold);
  color: var(--green-dark);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* === DEBUG === */
.debug-bar {
  flex-shrink: 0;
  width: 100%;
  background: #222;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 0.3rem 0.6rem;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.debug-bar.visible { display: flex; }

.debug-bar label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.65rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.debug-bar select {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.8rem;
  padding: 0.2rem 0.3rem;
  background: #444;
  color: #fff;
  border: 1px solid #666;
  border-radius: 3px;
  -webkit-appearance: auto;
}

.debug-bar button {
  font-family: 'Oswald', sans-serif;
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  background: var(--gold);
  color: var(--green-dark);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 600;
}

/* Staggered arrow pulses (was inline style attributes) */
.arrow-group .arrow:nth-child(2) { animation-delay: 0.3s; }
.arrow-group .arrow:nth-child(3) { animation-delay: 0.6s; }
