.schedule {
  /* removed fixed 100vh so it grows with vertical stacking */
  min-height: 100vh;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  /* add padding to prevent cutting off on small screens */
  padding: 0 0 190px;
}

.schedule-title {
  font-family: "Quicksand", sans-serif;
  font-size: 3rem;
  color: rgba(42, 27, 6, 0.768);
  margin: 0;
}

.towel-grid {
  width: min(94vw);
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 28px;
  align-items: center;
  justify-items: center;
}

.towel-shadow {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 3 / 5;
  overflow: visible;
  transition: filter 0.25s ease;
  filter: none;
}

.towel-shadow:hover {
  filter: drop-shadow(-6px 6px 20px rgba(0, 0, 0, 0.12));
}

.towel {
  width: 100%;
  height: 90%;
  max-width: 520px;
  aspect-ratio: 3 / 5;
  position: relative;
  overflow: visible;
  background: rgba(255, 0, 0, 0.2);
}

.towel--blue {
  background: url("../assets/schedule/Blue_Towel.svg") center / contain
    no-repeat;
  mask-image: url("../assets/schedule/Blue_Towel.svg");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  filter: drop-shadow(-5px 7px 4px rgba(0, 0, 0, 0.2));
}

.towel--red {
  background: url("../assets/schedule/Red_Towel.svg") center / contain no-repeat;
  mask-image: url("../assets/schedule/Red_Towel.svg");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  filter: drop-shadow(-5px 7px 4px rgba(0, 0, 0, 0.2));
}

.towel-header,
.towel-footer,
.towel-window {
  position: absolute;
  left: 0;
  right: 0;
}

.towel-header {
  top: 0;
  height: 15%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Quicksand", sans-serif;
  padding-top: clamp(1.5vw, 7vw, 20px);
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 700;
  color: #0b0b0b;
  pointer-events: none;
}

.towel-footer {
  bottom: 0;
  height: 15%;
  pointer-events: none;
}

.towel-window {
  top: 17%;
  bottom: 15%;
  overflow: hidden;
}

/* stripes go edge-to-edge */
.stripe-layer {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  pointer-events: auto;
}

.towel-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Quicksand", sans-serif;
  font-size: larger;
  color: #0b0b0b;
}

/* row stripes that scroll with rows */
.towel-table tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.92);
}

.towel-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0);
}

.time {
  display: inline-block;
  width: 92px;
  opacity: 0.9;
}

.row-text {
  padding: 1vw 5vw;
}

.stripe-layer::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* mobile view */
@media (max-width: 768px) {
    .schedule {
        height: auto;
        min-height: 100vh;
        padding: 24px 0;
    }

    .schedule-title {
        font-size: clamp(2rem, 7vw, 3rem);
    }

    .towel-grid {
        /* force single column stacking on mobile */
        grid-template-columns: 1fr;
        width: 94vw;
        gap: 22px;
    }

    .towel {
        max-width: 92vw;
    }

    .stripe-layer {
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain; /* Prevent scroll chaining to parent */
        touch-action: pan-y;
    }

    .stripe-layer * {
        touch-action: none;
    }

    /* iOS fix i have no idea why it works it just does okay */
    .towel-window,
    .stripe-layer {
        transform: translateZ(0);
    }

    /* Arrow button container in footer */
    .towel-footer {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        pointer-events: auto;
        padding-bottom: 8px; /* Move buttons up from edge */
    }

    .scroll-arrow {
        background: rgba(255, 255, 255, 0.8);
        border: 2px solid rgba(0, 0, 0, 0.3);
        border-radius: 50%;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 16px;
        font-weight: bold;
        color: #0b0b0b;
        transition: all 0.2s;
        pointer-events: auto;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .scroll-arrow:active {
        transform: scale(0.9);
        background: rgba(255, 255, 255, 0.95);
    }

    .scroll-arrow.disabled {
        opacity: 0.3;
        pointer-events: none;
    }
}

/* Hide arrow buttons on desktop */
@media (min-width: 769px) {
    .scroll-arrow {
        display: none;
    }
}