/* =====================================
   LAYOUT SANITY FIX
   removes weird stretching, fixes gaps
===================================== */

/* right column: normal compact stacked boxes */
body.home-page .retro-right {
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
  row-gap: 7px !important;
}

body.home-page .retro-right .retro-box {
  margin: 0 !important;
}

/* force World Cup -> time -> calendar to stack with same normal gap */
body.home-page .world-cup-panel,
body.home-page .world-cup-panel-fixed {
  margin-bottom: 0 !important;
}

body.home-page .clock-panel,
body.home-page .time-panel,
body.home-page .time-panel-fixed {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  min-height: unset !important;
  height: auto !important;
  padding-bottom: 6px !important;
}

/* un-weird the time box */
body.home-page .clock-panel [class*="time"],
body.home-page .clock-panel [class*="clock"],
body.home-page .time-panel [class*="time"],
body.home-page .time-panel [class*="clock"],
body.home-page .time-panel-fixed [class*="time"],
body.home-page .time-panel-fixed [class*="clock"] {
  min-height: unset !important;
  height: auto !important;
  margin: 4px 7px 0 7px !important;
  padding: 7px 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

/* trip rows: centered, no overlap, no huge height */
body.home-page .trip-panel .trip-list {
  padding: 5px 7px !important;
  gap: 5px !important;
}

body.home-page .trip-panel .trip-row {
  display: grid !important;
  grid-template-columns: 31px minmax(0, 1fr) 43px !important;
  align-items: center !important;
  column-gap: 7px !important;
  min-height: 41px !important;
  height: 41px !important;
  padding: 3px 7px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body.home-page .trip-panel .trip-icon {
  width: 31px !important;
  height: 31px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.home-page .trip-panel .trip-icon img {
  max-width: 28px !important;
  max-height: 28px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

body.home-page .trip-label-final {
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
  height: 100% !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  line-height: 1.05 !important;
  color: #5f688e !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.home-page .trip-count-final {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: end !important;
  align-self: center !important;
  width: 41px !important;
  height: 17px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: rgba(255,255,255,.92) !important;
  border: 1px solid #a994c8 !important;
  border-radius: 2px !important;
  color: #735f96 !important;
  font-family: monospace !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

/* hide all older trip pieces */
body.home-page .trip-panel .trip-info,
body.home-page .trip-panel .trip-pill-final,
body.home-page .trip-panel .trip-dday-mini,
body.home-page .trip-panel .trip-label-clean,
body.home-page .trip-panel .trip-count-clean,
body.home-page .trip-panel .trip-label-superlock,
body.home-page .trip-panel .trip-count-superlock {
  display: none !important;
}

/* center bottom: remove the big top padding under ふええええ */
body.home-page .bottom-photos-panel-fixed,
body.home-page .retro-center .retro-box:has(.retro-title) {
  margin-bottom: 0 !important;
}

body.home-page .bottom-photos-panel-fixed .retro-title {
  margin-bottom: 0 !important;
  padding-bottom: 3px !important;
}

body.home-page .bottom-photos-panel-fixed > div:not(.retro-title),
body.home-page .bottom-photos-panel-fixed .photo-grid,
body.home-page .bottom-photos-panel-fixed .photo-row,
body.home-page .bottom-photos-panel-fixed .center-photo-grid {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* more general fallback for the ふええええ panel */
body.home-page .retro-center .retro-box .retro-title {
  margin-bottom: 0 !important;
}

/* Stardew: make title/body visually consistent */
body.home-page .stardew-panel-fixed {
  background:
    url("/images/patterns/green-gingham.jpg")
    center/90px auto repeat !important;
  padding-bottom: 8px !important;
}

body.home-page .stardew-panel-fixed .retro-title {
  background:
    rgba(218, 255, 184, 0.9) !important;
  color: #5d7d52 !important;
  border-bottom: 1px solid #9bc77e !important;
}

body.home-page .stardew-panel-fixed img[src*="junimo"] {
  margin-top: 4px !important;
}

/* top-right counter: exactly one row */
body.home-page .dating-badge {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
}

body.home-page .dating-badge .counter-sanity-since {
  color: #8f5f86 !important;
  font-family: monospace !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

body.home-page .dating-badge .counter-sanity-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
}

body.home-page .dating-badge .shuma-day-heart {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 22px !important;
  color: white !important;
  background: #e8a2ca !important;
  border: 1px solid #c67eaa !important;
  border-radius: 50% 50% 45% 45% !important;
  font-family: monospace !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

body.home-page .dating-badge .shuma-day-heart::before {
  content: "♥" !important;
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #e8a2ca !important;
  font-size: 28px !important;
  z-index: 0 !important;
}

body.home-page .dating-badge .shuma-day-heart > span {
  position: relative !important;
  z-index: 1 !important;
}

body.home-page .dating-badge .counter-sanity-word {
  color: #557d9a !important;
  font-family: monospace !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}

/* bottom-right photo stays natural, not weird stretched */
body.home-page .boba-final-clean img,
body.home-page .hard-boba-panel img,
body.home-page .boba-right-panel img,
body.home-page .locked-boba-photo {
  height: 210px !important;
  object-fit: cover !important;
  object-position: center !important;
}
