/* =====================
   Base
===================== */

:root {
  --smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  color: white;
}

/* Prevent browser forced dark mode */
html {
  color-scheme: dark;
}

body {
  background-color: #000;
}


main,
footer {
  position: relative;
  z-index: 1;
}

footer {
  text-align: center;
  font-size: 12px;
  opacity: 0.6;
  padding: 20px;
}

/* =====================
   Navbar
===================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand {
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  color: white;
}

.nav-right {
  display: flex;
  gap: 28px;
}

.nav-link {
  position: relative;
  text-decoration: none;
  color: rgba(255,255,255,0.75);
  transition: color .25s var(--smooth), transform .25s var(--smooth);
  display: inline-block;
}

.nav-link:hover {
  color: white;
  transform: translateY(-2px);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 2px;
  background: currentColor;
  transition: width .25s var(--smooth);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* =====================
   Backgrounds
===================== */

.gradient-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(
    120deg,
    rgba(255,0,0,0.3),
    rgba(0,0,0,0),
    rgba(255,0,0,0.3)
  );
  background-size: 200% 200%;
  animation: gradientMove 22s ease-in-out infinite;
}

@keyframes gradientMove {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.r-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.06),
    rgba(255,255,255,0.06) 1px,
    transparent 1px,
    transparent 48px
  );
}

body.fun .gradient-bg {
  display: none;
}

body.fun .r-bg {
  background-color: #3b1b5a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Ctext x='20' y='80' font-size='64' fill='rgba(255,255,255,0.08)' transform='rotate(-25 60 60)'%3ER%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
  animation: bgScroll 180s ease-in-out infinite;
}

@keyframes bgScroll {
  0%,100% { background-position: 0 0; }
  50% { background-position: 120px 120px; }
}

/* =====================
   Animations
===================== */

.fade-in {
  opacity: 0;
  animation: fadeIn .8s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stagger-container > * {
  opacity: 0;
  animation: fadeIn .7s ease forwards;
}

.stagger-container > *:nth-child(1) { animation-delay: .1s }
.stagger-container > *:nth-child(2) { animation-delay: .2s }
.stagger-container > *:nth-child(3) { animation-delay: .3s }
.stagger-container > *:nth-child(4) { animation-delay: .4s }

/* =====================
   Home
===================== */

.hero {
  padding: 120px 10vw 80px;
  max-width: 900px;
}

/* =====================
   Buttons
===================== */

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg,#ff2a2a,#c40000);
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: transform .2s var(--smooth), box-shadow .2s var(--smooth);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(255,0,0,.35);
}

/* =====================
   Fun Page
===================== */

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 280px));
  gap: 32px;
  justify-content: center;
  padding: 80px 24px;
}

a.game-tile,
.game-tile {
  height: 140px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  font-weight: 600;
  font-size: 1.2rem;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  color: #e6d36a;
  text-decoration: none;
  transition: transform .45s var(--smooth), box-shadow .45s var(--smooth);
}

a.game-tile:hover {
  transform: scale(1.02);
  box-shadow:
    0 0 18px rgba(255,235,0,.25),
    0 0 48px rgba(255,235,0,.08);
}

/* =====================
   Swim
===================== */

.event-list {
  width: 100%;
  border-collapse: collapse;
}

.event-list tr {
  cursor: pointer;
  transition: background-color .25s ease;
}

.event-list tr:hover {
  background: rgba(0,150,255,.12);
}

.event-list td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* Event list links */

.event-link {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.event-link:hover {
  /* Remove underline on hover for spans used as clickable row labels */
  text-decoration: none;
}

/* =====================
   Timeline Container
===================== */

.timeline-wrapper {
  width: min(1000px, 90vw);
  margin: 80px auto 40px;
}

.timeline-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.timeline-header button {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.timeline-header button:hover {
  transform: scale(1.2);
}

.timeline-header span {
  font-size: 1.4rem;
  font-weight: 600;
}

/* =====================
   Timeline Box
===================== */

.timeline-box {
  position: relative;
  height: 160px;
  border-radius: 24px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  padding: 40px;
  overflow: visible;
}

/* Horizontal line */
.timeline-line {
  position: absolute;
  top: 50%;
  left: 40px;
  right: 40px;
  height: 3px;
  background: rgba(255,255,255,0.25);
  transform: translateY(-50%);
}

/* =====================
   Timeline Points
===================== */

.timeline-points {
  position: relative;
  height: 100%;
}

.timeline-point {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-point:hover {
  transform: translate(-50%, -50%) scale(1.5);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* =====================
   Message Box
===================== */

.timeline-message {
  margin-top: 16px;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.85;
  min-height: 1.4em;
  transition: opacity 0.2s ease;
}

/* =====================
   Home page – open sections
===================== */

.home-section {
  margin: 100px auto;
  width: min(900px, 85vw);
  padding: 40px 0;

  border-left: 3px solid transparent;
}

.home-section h2 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.home-section p {
  opacity: 0.8;
  max-width: 600px;
  margin-bottom: 24px;
}

/* Remove card feel */
.home-section {
  background: none;
  border-radius: 0;
  box-shadow: none;
}

/* =====================
   Color-coded buttons
===================== */

.btn-about {
  background: linear-gradient(135deg, #ff2a2a, #c40000);
}

.btn-swim {
  background: linear-gradient(135deg, #00aaff, #0066cc);
}

/* Fun button – YELLOW */

.btn-fun {
  background: linear-gradient(135deg, #ffe94d, #f2c400);
  color: #1a1a1a;
}

.btn-fun:hover {
  box-shadow: 0 12px 30px rgba(255, 233, 77, 0.35);
  filter: brightness(1.05);
}


.btn-about:hover {
  box-shadow: 0 12px 30px rgba(255, 42, 42, 0.35);
}

.btn-swim:hover {
  box-shadow: 0 12px 30px rgba(0, 170, 255, 0.35);
}

/* =====================
   Page Accent System (single source of truth)
===================== */

body.home  { --accent: #ff2a2a; }  /* red */
body.about { --accent: #ff2a2a; }  /* red */
body.swim  { --accent: #00aaff; }  /* blue */
body.fun   { --accent: #fff07a; }  /* LIGHT yellow */

/* =====================
   Brand (R) glow
===================== */

.brand {
  color: rgba(255,255,255,0.7);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

body.home  .brand,
body.about .brand,
body.swim  .brand,
body.fun   .brand {
  color: var(--accent);
  text-shadow:
    0 0 6px rgba(0,0,0,0.35),
    0 0 10px color-mix(in srgb, var(--accent) 40%, transparent);
}

/* =====================
   Navigation glow logic
===================== */

.nav-link {
  color: rgba(255,255,255,0.45);
}

.nav-link::after {
  background: var(--accent);
}

/* Active nav item */
.nav-link.active {
  color: var(--accent);
  text-shadow: 0 0 6px color-mix(in srgb, var(--accent) 40%, transparent);
}

.nav-link.active::after {
  width: 100%;
}

/* Hover remains neutral */
.nav-link:hover {
  color: rgba(255,255,255,0.85);
}

/* =====================
   Home page – section accents
===================== */

.home-section {
  border-left: 3px solid transparent;
  padding-left: 20px;
}

/* About → red */
body.home .home-section.about {
  border-left-color: #ff2a2a;
}

/* Swimming → blue */
body.home .home-section.swim {
  border-left-color: #00aaff;
}

/* Fun → LIGHT yellow */
body.home .home-section.fun {
  border-left-color: rgba(255, 240, 122, 0.8);
}

/* =====================
   Fun button – LIGHT yellow (fixed)
===================== */

.btn-fun {
  background: linear-gradient(135deg, #fff6a5, #ffe066);
  color: #1a1a1a;
}

.btn-fun:hover {
  box-shadow: 0 12px 30px rgba(255, 240, 122, 0.35);
  filter: brightness(1.03);
}

/* =====================
   Timeline Popup
===================== */

.timeline-popup {
  position: absolute;
  bottom: 100%;
  left: 50%;

  transform: translate(-50%, -12px);
  padding: 10px 14px;
  border-radius: 12px;

  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);

  font-size: 0.85rem;
  white-space: nowrap;

  pointer-events: none;
  opacity: 0;

  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.timeline-popup strong {
  display: block;
  font-weight: 600;
}

.timeline-popup span {
  font-size: 0.75rem;
  opacity: 0.7;
}


.timeline-popup strong {
  display: block;
  font-weight: 600;
}

.timeline-popup span {
  opacity: 0.8;
  font-size: 0.75rem;
}

/* =====================
   Timeline CTA – Subtle Version
===================== */

.timeline-cta {
  display: inline-block;
  margin-left: auto;
  margin-top: 18px;

  padding: 8px 18px;
  border-radius: 999px;

  font-size: 0.85rem;
  font-weight: 500;

  color: #9fd4f5;
  text-decoration: none;

  background: rgba(0, 120, 200, 0.12);
  border: 1px solid rgba(0, 120, 200, 0.25);

  box-shadow: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.timeline-cta:hover {
  background: rgba(0, 120, 200, 0.18);
  color: #cfeaff;
}

.timeline-point:hover {
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 40%, transparent);
}

/* =====================
   Swim Timeline (Single Source of Truth)
===================== */

body.swim .timeline-wrapper {
  width: min(1000px, 90vw);
  margin: 80px auto 40px;
}

body.swim .timeline-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

body.swim .timeline-header button {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.4rem;
  cursor: pointer;
}

body.swim .timeline-box {
  position: relative;
  height: 220px;
  padding: 56px 72px;
  border-radius: 32px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  overflow: visible;
}

body.swim .timeline-line {
  position: absolute;
  top: 50%;
  left: 72px;
  right: 72px;
  height: 3px;
  background: rgba(255,255,255,0.25);
  transform: translateY(-50%);
}

body.swim .timeline-points {
  position: relative;
  height: 100%;
}

body.swim .timeline-point {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

body.swim .timeline-point:hover {
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 40%, transparent);
}

/* Popup */

body.swim .timeline-popup {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -12px);
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,0.85);
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 20;
}


/* =====================
   Swim Event Pages
===================== */

body.swim .event-layout {
  width: min(900px, 90vw);
  margin: 80px auto;
  display: grid;
  gap: 40px;
}

body.swim .event-card {
  padding: 32px;
  border-radius: 24px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
}

body.swim .event-card h1 {
  margin-bottom: 12px;
}

body.swim .event-card p {
  opacity: 0.8;
}

body.swim .graph-placeholder {
  height: 260px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

/* Event Dropdown Navigation */
.event-dropdown {
  position: relative;
  margin-bottom: 20px;
}

.event-dropdown select {
  width: 100%;
  max-width: 300px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 170, 255, 0.3);
  border-radius: 8px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.event-dropdown select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 170, 255, 0.5);
}

.event-dropdown select:focus {
  outline: none;
  border-color: #00aaff;
  box-shadow: 0 0 0 2px rgba(0, 170, 255, 0.2);
}

.event-dropdown option {
  background: #1a1a1a;
  color: white;
  padding: 10px;
}

/* Times List Section */
.times-list-section {
  margin-top: 40px;
}

.times-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.times-list-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.edit-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #00aaff, #0066cc);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.edit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 170, 255, 0.3);
}

.times-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.time-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.time-entry .time {
  font-size: 1.1rem;
  font-weight: 600;
  color: #00aaff;
}

.time-entry .date {
  opacity: 0.7;
  font-size: 0.95rem;
}

.no-data {
  text-align: center;
  opacity: 0.5;
  padding: 40px;
}

/* Edit Modal */
.edit-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.edit-modal-content {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(0, 170, 255, 0.3);
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.edit-modal-content h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #00aaff;
}

.edit-modal-content input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-size: 16px;
  margin-bottom: 10px;
}

.error-message {
  color: #ff4444;
  font-size: 0.9rem;
  min-height: 20px;
  margin-bottom: 10px;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn-cancel, .btn-submit, .btn-delete, .btn-add, .btn-back {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn-submit, .btn-add {
  background: linear-gradient(135deg, #00aaff, #0066cc);
  color: white;
}

.btn-delete {
  background: linear-gradient(135deg, #ff2a2a, #c40000);
  color: white;
}

.btn-back {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn-cancel:hover, .btn-submit:hover, .btn-delete:hover, .btn-add:hover, .btn-back:hover {
  transform: translateY(-2px);
}

/* Slide Animations */
.slide-out-left {
  animation: slideOutLeft 0.3s ease forwards;
}

.slide-in-right {
  animation: slideInRight 0.3s ease forwards;
}

@keyframes slideOutLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Editing View */
.edit-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.edit-times-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.edit-time-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.edit-time-entry .time {
  font-size: 1.1rem;
  font-weight: 600;
  color: #00aaff;
  flex: 1;
}

.edit-time-entry .date {
  opacity: 0.7;
  font-size: 0.95rem;
  flex: 1;
}

/* Time Input Popup */
.time-input-popup, .confirm-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  animation: fadeIn 0.3s ease;
}

.time-input-content, .confirm-content {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(0, 170, 255, 0.3);
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
}

.time-input-grid {
  display: grid;
  grid-template-columns: 60px 60px auto 60px auto 60px auto 60px;
  gap: 8px;
  align-items: center;
  margin: 20px 0;
}

.time-input-grid input {
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-size: 18px;
  text-align: center;
}

.time-input-grid .separator {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  color: #00aaff;
}

.date-input {
  margin: 20px 0;
}

.date-input label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.7);
}

.date-input input {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-size: 16px;
}

/* Confirm Popup */
.confirm-content h3 {
  margin-top: 0;
  color: #ff4444;
}

.confirm-content .entry-info {
  margin: 20px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  text-align: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =====================
   Mobile Responsive Styles
   (Desktop layout preserved above)
===================== */

@media screen and (max-width: 768px) {
  
  /* Navbar adjustments */
  .navbar {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  
  .nav-right {
    gap: 16px;
    font-size: 0.9rem;
  }
  
  /* Hero section */
  .hero {
    padding: 60px 5vw 40px;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  /* Home sections */
  .home-section {
    width: 90vw;
    margin: 60px auto;
    padding: 20px 0 20px 16px;
  }
  
  .home-section h2 {
    font-size: 1.5rem;
  }
  
  /* Buttons */
  .btn {
    padding: 10px 20px;
    font-size: 0.95rem;
  }
  
  /* Timeline adjustments */
  .timeline-wrapper {
    width: 95vw;
    margin: 40px auto 20px;
  }
  
  body.swim .timeline-box {
    height: 180px;
    padding: 40px 20px;
  }
  
  body.swim .timeline-line {
    left: 20px;
    right: 20px;
  }
  
  .timeline-header {
    gap: 12px;
    margin-bottom: 16px;
  }
  
  .timeline-header button {
    font-size: 1.2rem;
  }
  
  .timeline-header span {
    font-size: 1.1rem;
  }
  
  .timeline-popup {
    font-size: 0.75rem;
    padding: 8px 10px;
  }
  
  /* Event list table */
  .event-list td {
    padding: 12px 12px;
    font-size: 0.95rem;
  }
  
  .event-list td:nth-child(2),
  .event-list td:nth-child(3) {
    font-size: 0.85rem;
  }
  
  /* Event pages */
  body.swim .event-layout {
    width: 95vw;
    margin: 40px auto;
    gap: 24px;
  }
  
  body.swim .event-card {
    padding: 24px 20px;
  }
  
  body.swim .event-card h1 {
    font-size: 1.5rem;
  }
  
  body.swim .graph-placeholder {
    height: 200px;
  }
  
  /* Event dropdown */
  .event-dropdown select {
    width: 100%;
    max-width: none;
    font-size: 14px;
  }
  
  /* Times list */
  .times-list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .times-list-header h2 {
    font-size: 1.3rem;
  }
  
  .edit-btn {
    width: 100%;
    padding: 12px 20px;
  }
  
  .time-entry {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .time-entry .time {
    font-size: 1.3rem;
  }
  
  /* Edit modal */
  .edit-modal-content {
    width: 95%;
    padding: 24px 20px;
    max-height: 85vh;
  }
  
  .edit-modal-content h2 {
    font-size: 1.3rem;
  }
  
  .edit-times-list {
    max-height: 300px;
  }
  
  .edit-time-entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }
  
  /* Time input popup */
  .time-input-content, .confirm-content {
    width: 95%;
    padding: 24px 16px;
  }
  
  .time-input-grid {
    grid-template-columns: 50px 50px auto 50px auto 50px auto 50px;
    gap: 4px;
  }
  
  .time-input-grid input {
    padding: 10px 4px;
    font-size: 16px;
  }
  
  .time-input-grid .separator {
    font-size: 20px;
  }
  
  /* Modal buttons */
  .modal-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .btn-cancel, .btn-submit, .btn-delete, .btn-add, .btn-back {
    width: 100%;
    padding: 12px 20px;
  }
  
  /* Fun page game grid */
  .game-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 40px 16px;
  }
  
  a.game-tile {
    height: 120px;
  }
  
  /* Timeline CTA */
  .timeline-cta {
    display: block;
    text-align: center;
    margin-top: 16px;
  }
  
  /* Footer */
  footer {
    padding: 16px;
    font-size: 11px;
  }
}

/* Extra small devices */
@media screen and (max-width: 480px) {
  
  .navbar {
    padding: 10px 12px;
  }
  
  .nav-right {
    width: 100%;
    justify-content: space-around;
    margin-top: 8px;
    gap: 8px;
  }
  
  .nav-link {
    font-size: 0.85rem;
  }
  
  .hero h1 {
    font-size: 1.5rem;
  }
  
  .home-section h2 {
    font-size: 1.3rem;
  }
  
  body.swim .timeline-box {
    height: 160px;
    padding: 30px 16px;
  }
  
  .timeline-point {
    width: 12px;
    height: 12px;
  }
  
  .event-list td {
    padding: 10px 8px;
    font-size: 0.9rem;
  }
  
  .time-input-grid {
    grid-template-columns: 45px 45px auto 45px auto 45px auto 45px;
  }
  
  .time-input-grid input {
    padding: 8px 2px;
    font-size: 14px;
  }
}


/* =====================
   Balanced Mobile Styles
   Maintains desktop appearance with subtle mobile optimizations
===================== */

@media screen and (max-width: 768px) {
  
  /* Slightly increase base font for readability */
  html {
    font-size: 16px;
  }
  
  /* Navbar - minimal adjustments */
  .navbar {
    padding: 14px 20px;
  }
  
  .brand {
    font-size: 22px;
  }
  
  .nav-right {
    gap: 20px;
  }
  
  .nav-link {
    font-size: 0.95rem;
    padding: 6px 0;
  }
  
  /* Hero - keep proportions */
  .hero {
    padding: 100px 8vw 60px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  /* Home sections */
  .home-section {
    width: 90vw;
    margin: 80px auto;
    padding: 32px 0 32px 18px;
  }
  
  .home-section h2 {
    font-size: 1.6rem;
  }
  
  .home-section p {
    font-size: 0.95rem;
  }
  
  /* Buttons - just touch-friendly */
  .btn {
    padding: 12px 24px;
    min-height: 44px;
  }
  
  /* Event list - minimal changes */
  .event-list td {
    padding: 16px 14px;
  }
  
  /* Fun page - single column but keep size */
  .game-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 60px 20px;
  }
  
  a.game-tile {
    height: 140px;
  }
  
  /* Timeline - keep desktop look */
  body.swim .timeline-wrapper {
    width: 92vw;
    margin: 60px auto 30px;
  }
  
  body.swim .timeline-box {
    height: 200px;
    padding: 50px 40px;
  }
  
  body.swim .timeline-line {
    left: 40px;
    right: 40px;
  }
  
  .timeline-header button {
    font-size: 1.4rem;
  }
  
  .timeline-header span {
    font-size: 1.4rem;
  }
  
  .timeline-point {
    width: 16px;
    height: 16px;
  }
  
  .timeline-cta {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  /* Event pages - maintain appearance */
  body.swim .event-layout {
    width: 92vw;
    margin: 60px auto;
  }
  
  body.swim .event-card {
    padding: 28px 24px;
  }
  
  body.swim .event-card h1 {
    font-size: 1.6rem;
  }
  
  body.swim .graph-placeholder {
    height: 240px;
  }
  
  /* Edit controls - touch-friendly minimum */
  .edit-btn {
    padding: 12px 20px;
    min-height: 44px;
  }
  
  .time-entry {
    padding: 16px 18px;
  }
  
  /* Modals - fit screen properly */
  .edit-modal-content {
    width: 92%;
    padding: 32px 24px;
    max-height: 85vh;
  }
  
  .edit-modal-content h2 {
    font-size: 1.4rem;
  }
  
  /* Input fields - touch-friendly */
  .edit-modal-content input[type="password"],
  .date-input input {
    padding: 12px 16px;
    min-height: 44px;
  }
  
  .time-input-grid input {
    padding: 10px 6px;
    min-height: 44px;
  }
  
  /* Buttons - touch target minimum */
  .btn-cancel, .btn-submit, .btn-delete, .btn-add, .btn-back {
    padding: 12px 20px;
    min-height: 44px;
  }
  
  .modal-buttons {
    gap: 10px;
  }
}

/* Small phones - minor additional adjustments */
@media screen and (max-width: 480px) {
  
  .nav-right {
    gap: 16px;
  }
  
  body.swim .timeline-box {
    padding: 40px 24px;
  }
  
  body.swim .timeline-line {
    left: 24px;
    right: 24px;
  }
}


/* =====================
   Targeted Mobile Fixes
   Specific adjustments based on feedback
===================== */

@media screen and (max-width: 768px) {
  
  /* NAVBAR FIX - Prevent stacking, smaller text */
  .navbar {
    padding: 12px 16px;
    flex-wrap: nowrap;
  }
  
  .brand {
    font-size: 20px;
  }
  
  .nav-right {
    gap: 14px;
    width: auto;
    margin-top: 0;
  }
  
  .nav-link {
    font-size: 0.85rem;
    padding: 4px 0;
  }
  
  /* SWIM PAGE - Smaller text, shorter rows */
  .event-list td {
    padding: 12px 12px;
    font-size: 0.9rem;
  }
  
  .event-list td:first-child {
    font-size: 0.95rem;
  }
  
  .event-list td:nth-child(2) {
    font-size: 0.85rem;
  }
  
  .event-list td:nth-child(3) {
    font-size: 0.8rem;
  }
  
  /* TIMELINE - Shorter and smaller arrows */
  body.swim .timeline-wrapper {
    width: 94vw;
    margin: 40px auto 24px;
  }
  
  body.swim .timeline-box {
    height: 140px;
    padding: 32px 30px;
  }
  
  body.swim .timeline-line {
    left: 30px;
    right: 30px;
  }
  
  .timeline-header {
    gap: 16px;
    margin-bottom: 16px;
  }
  
  .timeline-header button {
    font-size: 1.12rem;
    padding: 4px 8px;
  }
  
  .timeline-header span {
    font-size: 1.2rem;
  }
  
  .timeline-point {
    width: 14px;
    height: 14px;
  }
  
  .timeline-cta {
    padding: 8px 16px;
    font-size: 0.85rem;
    margin-top: 16px;
  }
  
  /* FUN PAGE - 2 columns like desktop, no side gaps */
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 40px 12px;
    justify-content: stretch;
  }
  
  a.game-tile {
    height: 120px;
    font-size: 1.05rem;
    padding: 16px;
  }
}

/* Small phones - keep 2 columns but adjust */
@media screen and (max-width: 480px) {
  
  .nav-link {
    font-size: 0.8rem;
  }
  
  body.swim .timeline-box {
    height: 120px;
    padding: 28px 20px;
  }
  
  body.swim .timeline-line {
    left: 20px;
    right: 20px;
  }
  
  .timeline-header button {
    font-size: 1rem;
  }
  
  .timeline-header span {
    font-size: 1.1rem;
  }
  
  .game-grid {
    gap: 12px;
    padding: 30px 8px;
  }
  
  a.game-tile {
    height: 100px;
    font-size: 0.95rem;
    padding: 12px;
  }
}


/* =====================
   Event Pages Mobile Optimization
   Keep desktop look, just fit properly
===================== */

@media screen and (max-width: 768px) {
  
  /* Event page layout */
  body.swim .event-layout {
    width: 94vw;
    margin: 40px auto;
    gap: 24px;
  }
  
  /* Event card - keep proportions */
  body.swim .event-card {
    padding: 24px 20px;
  }
  
  body.swim .event-card h1 {
    font-size: 1.5rem;
    margin-bottom: 12px;
  }
  
  body.swim .event-card p {
    font-size: 0.95rem;
    margin: 6px 0;
  }
  
  /* Graph - reasonable size */
  body.swim .graph-placeholder {
    height: 200px;
    font-size: 0.9rem;
  }
  
  /* Event dropdown */
  .event-dropdown select {
    width: 100%;
    max-width: none;
    padding: 12px 16px;
    font-size: 0.95rem;
  }
  
  /* Times list section */
  .times-list-section {
    margin-top: 32px;
  }
  
  .times-list-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
  }
  
  .times-list-header h2 {
    font-size: 1.3rem;
    margin: 0;
  }
  
  /* Edit button - touch friendly */
  .edit-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
    min-height: 44px;
    white-space: nowrap;
  }
  
  /* Time entries - compact but readable */
  .times-list {
    gap: 10px;
  }
  
  .time-entry {
    padding: 14px 16px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .time-entry .time {
    font-size: 1.2rem;
  }
  
  .time-entry .date {
    font-size: 0.85rem;
  }
  
  /* Edit modal */
  .edit-modal-content {
    width: 94%;
    padding: 28px 20px;
    max-height: 88vh;
  }
  
  .edit-modal-content h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
  }
  
  .edit-modal-content input[type="password"] {
    padding: 12px 16px;
    font-size: 0.95rem;
    min-height: 44px;
  }
  
  .error-message {
    font-size: 0.85rem;
  }
  
  /* Edit header */
  .edit-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }
  
  .edit-header h2 {
    font-size: 1.3rem;
    margin: 0;
  }
  
  /* Edit times list */
  .edit-times-list {
    max-height: 320px;
  }
  
  .edit-time-entry {
    padding: 14px 16px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .edit-time-entry .time {
    font-size: 1.1rem;
  }
  
  .edit-time-entry .date {
    font-size: 0.85rem;
  }
  
  /* Time input popup */
  .time-input-content, .confirm-content {
    width: 94%;
    padding: 28px 20px;
  }
  
  .time-input-content h3, .confirm-content h3 {
    font-size: 1.3rem;
    margin-top: 0;
  }
  
  .time-input-grid {
    grid-template-columns: 55px 55px auto 55px auto 55px auto 55px;
    gap: 6px;
    margin: 16px 0;
  }
  
  .time-input-grid input {
    padding: 10px 4px;
    font-size: 1.1rem;
    min-height: 44px;
  }
  
  .time-input-grid .separator {
    font-size: 1.4rem;
  }
  
  /* Date input */
  .date-input {
    margin: 16px 0;
  }
  
  .date-input label {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }
  
  .date-input input {
    padding: 12px 16px;
    font-size: 0.95rem;
    min-height: 44px;
  }
  
  /* Modal buttons */
  .modal-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
  }
  
  .btn-cancel, .btn-submit, .btn-delete, .btn-add, .btn-back {
    flex: 1;
    min-width: calc(50% - 5px);
    padding: 12px 16px;
    font-size: 0.9rem;
    min-height: 44px;
  }
  
  /* Confirm popup */
  .confirm-content .entry-info {
    margin: 16px 0;
    padding: 14px;
    font-size: 0.95rem;
  }
}

/* Small phones - minor adjustments */
@media screen and (max-width: 480px) {
  
  body.swim .event-card h1 {
    font-size: 1.3rem;
  }
  
  body.swim .graph-placeholder {
    height: 180px;
  }
  
  .times-list-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .edit-btn {
    width: 100%;
  }
  
  .time-entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .edit-time-entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .time-input-grid {
    grid-template-columns: 50px 50px auto 50px auto 50px auto 50px;
    gap: 4px;
  }
  
  .time-input-grid input {
    font-size: 1rem;
  }
  
  .modal-buttons {
    flex-direction: column;
  }
  
  .btn-cancel, .btn-submit, .btn-delete, .btn-add, .btn-back {
    width: 100%;
    min-width: 100%;
  }
}

