/* --- custom fonts --- */

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');

@font-face {
  src: url(/fonts/Spirit.woff2);
  font-family: 'spirits';
  font-display: swap;
}

/* --- body --- */

body {
  -ms-overflow-style: none;
  scrollbar-width: none;
  background-image: url(/media/backgrounds/pinkcheck.png);
  background-size: 40px;
  font-family: 'nunito', sans-serif;
  font-weight: 500;
  color: #616161;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  overflow: hidden;
  box-sizing: border-box;
}

body::-webkit-scrollbar {
  display: none;
}

/* --- selection & cursor --- */

::selection {
  background-color: #fef4fa;
  color: #8d7c76;
}

::-moz-selection {
  background-color: #fef4fa;
  color: #8d7c76;
}

body,
a,
button {
  cursor: url(/media/cursor/melody.webp), progress;
}

*,
*::before,
*::after {
  cursor: url(/media/cursor/melody.webp), auto !important;
}

/* --- main containers --- */

.calendar-card,
.annotation-section {
  position: relative;
  background: white;
  width: 100%;
  max-width: 650px;
  min-height: 450px;
  border-radius: 20px;
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.08),
    0 5px 15px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

/* --- calendar header & titles --- */

.calendar-header {
  background-color: #ffeff7;
  padding: 35px 0;
  text-align: center;
  border-bottom: 0px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow:
    inset 4px 4px 0px rgba(255, 255, 255, 0.8),
    inset -4px -4px 4px rgba(215, 127, 171, 0.15);
  position: relative;
  overflow: hidden;
}

.month-title {
  font-family: 'spirits', cursive;
  color: #88685d;
  text-transform: lowercase;
  margin: 0;
  font-size: 4rem;
  text-shadow: 2px 2px 0px #ffffff, -1px -1px 0px #6d534a;
  letter-spacing: 1px;
}

.entries-title {
  font-family: 'spirits', cursive;
  color: #88685d;
  text-transform: lowercase;
  margin: 0;
  font-size: 4rem;
  letter-spacing: 1px;
}

/* --- calendar grid & day squares --- */

.weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
  padding: 10px 50px;
  background-color: #fff;
}

.weekday {
  text-align: center;
  font-size: 0.85rem;
  color: #adb5bd;
  text-transform: lowercase;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  padding: 20px 50px 40px 50px;
}

.day-square {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  position: relative;
}

.day-square:hover {
  background-color: #ffeff7;
  border-color: #ffb3d9;
  color: #88685d;
  transform: scale(1.05);
}

.day-square.has-content {
  background-color: #ffeff7;
  font-weight: 800;
  color: #88685d;
  border-color: #ffb3d9;
}

.empty-slot {
  visibility: hidden;
}

.day-square.today-active {
  background-color: #ffeff7;
  border-color: #ffb3d9;
  color: #88685d;
}

/* --- event bubbles & hearts --- */

.event-bubble {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #f6dae8;
  color: #616161;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 100;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.event-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #f6dae8 transparent transparent transparent;
}

.day-square:hover .event-bubble {
  visibility: visible;
  opacity: 1;
  bottom: 130%;
  font-weight: 500 !important;
}

.event-heart {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 15px;
  height: auto;
  pointer-events: none;
  z-index: 5;
  transition: all 0.2s ease;
}

.day-square.has-content .event-heart,
.day-square:hover .event-heart {
  content: url("https://kkul.neocities.org/media/graphics/white-heart.png");
}

/* --- annotation section & diary --- */

.annotation-section {
  position: relative;
  overflow: visible;
  display: none;
  padding: 40px 50px;
  padding-right: 90px;
  box-sizing: border-box;
}

.back-btn {
  font-size: 0.8rem;
  color: #f4abcb;
  cursor: pointer;
  margin-bottom: 20px;
  text-transform: lowercase;
  font-weight: 700;
}

.back-btn:hover {
  font-style: italic;
}

.placeholder {
  color: #adb5bd;
}

.scroll-container {
  height: 380px;
  overflow-y: auto;
  padding-right: 10px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
  display: none;
}

.log-template p {
  margin: 12px 0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  border-bottom: 1px dashed #ffe2f0;
  padding-bottom: 8px;
  line-height: 1.2;
  white-space: pre-wrap;
}

.log-template p::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  margin-bottom: 2px;
  background-image: url("https://kkul.neocities.org/media/graphics/heart.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.diary-section {
  margin-top: 20px;
}

.diary-title {
  font-size: 0.85rem;
  color: #f4abcb;
  margin-bottom: 5px;
}

.diary-entry {
  font-size: 13px;
  line-height: 1.5;
  min-height: 100px;
  outline: none;
}

/* --- decorative images --- */

#random-image-container {
  position: static;
}

.image-main,
.image-logs,
.image-wrapper {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  display: flex;
  justify-content: center;
}

.image-main {
  height: 370px;
  right: -150px;
  bottom: 0px;
}

.image-logs {
  height: var(--img-h, 370px);
  right: var(--img-r, -150px);
  bottom: var(--img-b, 0px);
}

.image-wrapper {
  height: var(--img-h, 300px);
  right: var(--img-r, -120px);
  bottom: var(--img-b, 0px);
}

.image-main::after,
.image-logs::after,
.image-wrapper::after {
  content: "";
  position: absolute;
  left: var(--sl, 45px);
  bottom: var(--sb, -3px);
  width: var(--sw, 40%);
  height: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  filter: blur(8px);
  z-index: 1;
}

.corner-image,
.image-logs img {
  height: 100%;
  width: auto;
  position: relative;
  z-index: 2;
}

#lace {
  background-image: url(https://file.garden/aS-t0Aj4K3mdDujK/kkul/graphics/lacey.png);
  background-size: auto 100%;
  width: 100%;
  height: 20px;
  filter: drop-shadow(0px 1px #D1B9B3);
  position: fixed;
  top: 0px;
  left: 0px;
  z-index: 9999;
}

#lace-bottom {
  background-image: url(https://file.garden/aS-t0Aj4K3mdDujK/kkul/graphics/lacey.png);
  background-size: auto 100%;
  width: 100%;
  height: 20px;
  filter: drop-shadow(0px 1px #D1B9B3);
  position: fixed;
  bottom: 0px;
  left: 0px;
  transform: rotate(180deg);
  z-index: 9999;
}

/* -----------------------------------------------------------
    desktop styles (blur-in & logic)
----------------------------------------------------------- */

@media only screen and (min-width: 1024px) {

  #potd-window,
  #birthday-countdown,
  #recovery-counter,
  #nav-left,
  #nav-right {
    opacity: 0;
    filter: blur(10px);
    transition: opacity 1.2s ease, filter 1.2s ease;
    pointer-events: none;
  }

  .windows-visible {
    opacity: 1 !important;
    filter: blur(0px) !important;
    pointer-events: auto !important;
  }

  .nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #ffdaed;
    box-shadow:
      inset 2px 2px 0px rgba(255, 255, 255, 0.8),
      inset -2px -2px 2px rgba(215, 127, 171, 0.15),
      0 4px 10px rgba(0, 0, 0, 0.05);
    color: #88685d;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    user-select: none;
    border: none;
    transition: opacity 0.4s ease, transform 0.3s ease, background-color 0.3s ease, visibility 0.4s;
  }

  #nav-left {
    left: 40px;
  }

  #nav-right {
    right: 40px;
  }

  .nav-arrow:hover {
    transform: translateY(-50%) scale(1.2);
  }

  .nav-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  #potd-window {
    top: 220px;
    right: 50px;
  }

  #birthday-countdown {
    top: 180px;
    left: 60px;
  }

  #recovery-counter {
    bottom: 180px;
    left: 60px;
  }

  .win-window {
    position: fixed;
    width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 3000;
    border: 1px solid #ffdaed;
    touch-action: none;
    user-select: none;
  }

  .win-header {
    background: #ffeff7;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ffdaed;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    cursor: move;
    box-shadow:
      inset 2px 2px 0px rgba(255, 255, 255, 0.8),
      inset -2px -2px 2px rgba(215, 127, 171, 0.15);
  }

  .win-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: #88685d;
    text-transform: lowercase;
  }

  .win-controls {
    display: flex;
    gap: 5px;
  }

  .win-btn {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #ffdaed;
    position: relative;
  }

  .win-btn.close {
    background: #f4abcb;
    cursor: pointer;
    transition: 0.2s;
  }

  .win-btn.close:hover {
    background: #88685d;
  }

  .win-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    font-weight: normal;
  }

  #birthday-countdown .win-body,
  #recovery-counter .win-body {
    padding: 40px 10px;
    min-height: 60px;
    justify-content: center;
  }

  .content-center {
    align-items: center;
    text-align: center;
  }

  #potd-img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    background: #fef4fa;
    display: block;
    cursor: zoom-in;
  }

  .countdown-label {
    font-size: 0.7rem;
    color: #616161;
    font-family: 'nunito';
    font-style: italic;
    line-height: 1.3;
    margin-bottom: 5px;
  }

  #potd-caption {
    font-size: 0.7rem;
    color: #616161;
    font-family: 'nunito', sans-serif;
    font-style: normal;
    text-align: left;
    line-height: 1.3;
  }

  #potd-caption b,
  #potd-caption strong {
    font-weight: 800;
    color: #616161;
  }

  .days-number {
    font-family: 'spirits', cursive;
    font-size: 2.2rem;
    color: #f4abcb;
    font-weight: bold;
  }

  .countdown-sticker {
    position: absolute;
    bottom: -15px;
    right: -20px;
    width: 80px;
    pointer-events: none;
    z-index: 3001;
  }

  .melody-sticker {
    position: absolute;
    bottom: -25px;
    right: -40px;
    width: 110px;
    pointer-events: none;
    z-index: 3001;
  }

  .win-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #f6dae8;
    color: #616161;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 4000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    pointer-events: none;
  }

  .win-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #f6dae8 transparent transparent transparent;
  }

  .win-btn:hover .win-tooltip {
    visibility: visible;
    opacity: 1;
    bottom: 130%;
    font-weight: 500 !important;
  }

  #potd-archive-view {
    padding: 10px;
    max-height: 240px;
    overflow-y: auto;
  }

  #potd-archive-view::-webkit-scrollbar {
    width: 4px;
  }

  #potd-archive-view::-webkit-scrollbar-thumb {
    background: #ffdaed;
    border-radius: 10px;
  }

  .archive-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .gallery-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #ffeff7;
    transition: transform 0.2s ease;
  }

  .gallery-thumb:hover {
    transform: scale(1.05);
    border-color: #f4abcb;
  }

  .potd-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
  }

  .potd-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 239, 247, 0.9);
    color: #616161;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    white-space: nowrap;
    z-index: 10;
    border: 1px solid #ffdaed;
    transition: all 0.3s ease;
    pointer-events: none;
  }

  .potd-wrapper:hover .potd-tooltip {
    visibility: visible;
    opacity: 1;
  }

  #potd-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 5000;
    cursor: zoom-out;
    align-items: center;
    justify-content: center;
  }

  #potd-lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #ffdaed;
    animation: zoomIn 0.3s ease;
  }

  .slide-right {
    animation: slideInRight 0.5s ease-out forwards;
  }

  .slide-left {
    animation: slideInLeft 0.5s ease-out forwards;
  }

  .image-slide-up {
    animation: imgSlideUp 0.6s ease-out forwards;
  }
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes imgSlideUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}