html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  overflow-y: visible;
  background: #fefeef;
  font-family: Arial, sans-serif;
}

body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ————— CARNIVAL CAROUSEL ————— */
#tentCarousel,
#carouselWrapper {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #fefeef;
}

.carousel-item {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

#carouselWrapper {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.28s cubic-bezier(.2,.9,.2,1);
  will-change: transform;
}

/* ————— TENT ELEMENTS ————— */
.container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: inline-block;
  cursor: pointer;
}

.img-gold-tent,
.img-tent {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 11;
}

.button {
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translate(-50%,0);
  background: gold;
  color: black;
  font-size: 22px;
  z-index: 12;
  text-align: center;
  padding: 3px 6px;
  border: 1px solid black;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
}

.cost,
.rules,
.ttcomplete {
  position: absolute;
  background: gold;
  color: black;
  font-size: 22px;
  text-align: center;
  padding: 3px 6px;
  border: 2px solid black;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  z-index: 21;
  pointer-events: auto;
}

.cost    { right: 4%; top: 32%; }
.rules   { left: 2%; top: 32%; }
.ttcomplete { left: 2%; bottom: 2%; }

.closed {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%,0) rotate(-40deg);
  background: gold;
  color: black;
  font-size: 28px;
  z-index: 22;
  text-align: center;
  padding: 3px 6px;
  border: 2px solid black;
  border-radius: 1px;
  white-space: nowrap;
}

.other-image {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%,0);
  width: 250px;
  border-radius: 10px;
  z-index: 1;
}

.user-text,
.other-text {
  position: absolute;
  left: 50%;
  transform: translate(-50%,0);
  color: black;
  font-size: 20px;
  z-index: 1;
}

.user-text  { top: 60%; }
.other-text { bottom: 3%; }

.heart-tooltip {
  position: absolute;
  top: 26%;
  left: 50%;
  transform: translate(-50%,0);
  z-index: 16;
}

.heart-overlay {
  width: 65px;
  height: auto;
  display: block;
}

.tooltiptext {
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s;
  background: gold;
  color: #000;
  border: 2px solid black;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 99;
  font-size: 18px;
  text-align: center;
}

.heart-tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* ————— CLOCK ————— */
.clock-container {
  position: fixed;
  top: -2px;
  left: 49.5%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
}

.digital-clock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  color: black;
  font-size: 18px;
  font-weight: bold;
  white-space: nowrap;
  z-index: 1001;
}

/* ————— RANKINGS MODAL ————— */
.rankings-modal {
  background: #fefeef;
  padding: 10px;
  text-align: center;
  perspective: 1000px;
}

.rankings-modal h2 {
  color: black;
  text-shadow: 2px 2px 0 gold;
  margin-bottom: 10px;
}

.rankings-modal table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.rankings-modal th,
.rankings-modal td {
  border: 1px solid #111;
  padding: 10px;
  text-align: center;
  background: #fefeef;
}

.rankings-modal th {
  background: gold;
  color: black;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,.15);
  position: sticky;
  top: 0;
  z-index: 2;
}

.rankings-btn {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  background: #007BFF;
  color: white;
  border: 2px solid black;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
  z-index: 12;
}

.rankings-btn:hover {
  background: #0056b3;
}

/* ————— NEXT CLASS VIEW ————— */
.next-class-compact {
  padding: 8px 12px;
  background: #f9f9f9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.next-class-compact h2 {
  margin: 32px 0 10px;
  font-size: 24px;
  color: #333;
  text-align: center;
  width: 100%;
  max-width: 380px;
}

.next-class-card-compact {
  position: relative;
  background: #ddd9c6;
  border: 4px solid gold;
  border-radius: 12px;
  padding: 10px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  overflow: hidden;
}

.next-class-date-compact {
  position: relative;
  z-index: 1;
  font-size: 19px;
  font-weight: bold;
  color: #000;
  text-align: center;
  margin-bottom: 6px;
  padding: 4px 0;
  background: #fffbe6;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.next-class-date-compact .prefix {
  font-weight: 900;
}

.next-class-date-compact .family-emoji {
  font-size: 24px;
  line-height: 1;
}

.tent-row-compact {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fefeef;
  border-radius: 10px;
  padding: 6px 10px;
  margin-bottom: 6px;
  min-height: 68px;
}

.tent-row-compact:last-child {
  margin-bottom: 0;
}

.tent-row-compact img {
  height: 100%;
  width: auto;
  max-width: 120px;
  max-height: 60px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

.tent-row-compact .name {
  font-weight: bold;
  font-size: 19px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1a1a1a;
}

.tent-row-compact .time {
  color: #000;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

/* Upcoming classes */
#upcomingClasses {
  width: 100%;
  max-width: 380px !important;
  margin-top: 20px;
}

#upcomingClasses table {
  width: 100% !important;
  font-size: 14px;
  border-collapse: collapse;
  background: #fff;
}

#upcomingClasses th,
#upcomingClasses td {
  padding: 7px 5px;
  text-align: center;
  border: 1px solid #666;
}
