:root {
  --pink: #ed78a7;
  --pink-light: #f8bfd1;
  --green: #0b762e;
  --green-light: #6ea946;
  --paper: #fffefe;
  --bg: #fffafc;
  --grid: #f8ddd8;
  --shadow: #f4b8bd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 16px 16px;
  font-family: "Courier New", monospace;
  color: var(--pink);
}

.top-bar {
  height: 54px;
  background: var(--pink);
  border-bottom: 2px solid var(--pink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  color: #fff8f3;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 1px;
}

.top-bar div:last-child {
  color: var(--green);
  font-size: 16px;
}

.top-btn {
  border: 1px solid #fff8f3;
  background: #fff8f3;
  color: var(--pink);
  font-family: inherit;
  font-size: 14px;
  margin-right: 8px;
  cursor: pointer;
}

.site {
  width: 1240px;
  margin: 24px auto;
  display: grid;
  grid-template-columns: 270px 1fr 330px;
  gap: 22px;
  align-items: start;
}

.window {
  background: var(--paper);
  margin-bottom: 22px;
  box-shadow: 2px 2px 0 var(--shadow);
}

.window.pink {
  border: 2px solid var(--pink);
}

.window.green {
  border: 2px solid var(--green);
}

.title-bar {
  height: 32px;
  padding: 5px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  border-bottom: 2px solid currentColor;
  cursor: move;
  user-select: none;
}

.pink .title-bar {
  background: var(--pink-light);
  color: var(--pink);
}

.green .title-bar {
  background: var(--green-light);
  color: #fffaf4;
}

.window-buttons {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-left: 10px;
}

.window-buttons button {
  width: 18px;
  height: 18px;
  background: var(--paper);
  border: 1px solid var(--pink);
  color: var(--pink);
  padding: 0;
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-family: Arial, sans-serif;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
}

.window.minimized {
  height: auto !important;
  overflow: hidden !important;
}

.window.minimized > *:not(.title-bar) {
  display: none !important;
}

.window.minimized .title-bar {
  border-bottom: none !important;
}

.window.closed {
  display: none !important;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 28px 30px;
  color: var(--pink);
  font-size: 18px;
  line-height: 2.55;
}

.menu-list li {
  position: relative;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    color 0.18s ease,
    background-color 0.18s ease;
}

.menu-list li::before {
  content: "♡";
  position: absolute;
  left: -20px;
  opacity: 0;
  color: var(--green);
  transform: scale(0.5);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.menu-list li:hover {
  color: var(--green);
  background: #fff1f6;
  transform: translateX(8px);
}

.menu-list li:hover::before {
  opacity: 1;
  transform: scale(1);
}

body.night-mode .menu-list li:hover {
  color: #d8ffd1;
  background: #3b243d;
}

.welcome {
  height: 330px;
}

.welcome-inner {
  margin: 16px;
  height: calc(100% - 64px);
  border: 1px dashed #f58bad;
  text-align: center;
  padding-top: 46px;
}

.deco {
  color: var(--green);
  font-size: 22px;
  letter-spacing: 12px;
  margin-bottom: 16px;
}

h1 {
  margin: 0;
  color: #e95678;
  font-size: 58px;
  letter-spacing: 4px;
}

.welcome p {
  color: var(--green);
  font-size: 20px;
}

.line {
  color: var(--pink);
  letter-spacing: 4px;
  margin-top: 24px;
}

.content {
  padding: 28px;
  font-size: 17px;
  line-height: 2;
}

.notice .content {
  color: #222;
}

.visitor,
.bgm-player,
.diary,
.favorite,
.link-box,
.playlist-window {
  margin-top: 22px;
}

.mini-content {
  padding: 22px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--green);
}

.counter {
  display: flex;
  gap: 4px;
  margin: 10px 0 22px;
}

.counter span {
  display: inline-block;
  width: 25px;
  height: 34px;
  border: 1px dotted var(--pink);
  background: #fff;
  text-align: center;
  line-height: 34px;
  font-size: 22px;
  color: var(--green);
}

.bunny {
  color: var(--pink);
  text-align: right;
  font-size: 18px;
}

.tape {
  width: 58px;
  height: 58px;
  border: 1px dashed var(--pink);
  color: var(--pink);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0;
}

.tape img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  image-rendering: pixelated;
}

audio {
  width: 100%;
  margin-top: 8px;
}

.bar {
  height: 5px;
  background: #d6e4c8;
  margin: 16px 0;
  overflow: hidden;
}

.bar-fill {
  width: 0%;
  height: 100%;
  background: var(--pink);
}

.controls {
  color: var(--pink);
  font-size: 22px;
  text-align: center;
}

.controls button {
  border: none;
  background: transparent;
  color: var(--pink);
  font-size: 18px;
  cursor: pointer;
}

.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 14px;
  padding: 14px;
}

.about-photo {
  height: 260px;
  border: 1px dashed var(--pink);
  background: var(--paper);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 58px;
}

.about-text {
  border: 1px dashed var(--pink);
  background: var(--paper);
  padding: 24px;
  color: #3f8d3a;
  font-size: 16px;
  line-height: 1.9;
}

.about-text span {
  color: #222;
}

.about-deco {
  color: var(--pink);
  margin-top: 18px;
  letter-spacing: 8px;
}

.diary-list {
  padding: 18px 34px 20px;
}

.diary-row {
  display: grid;
  grid-template-columns: 30px 1fr 46px;
  align-items: center;
  border-bottom: 1px dashed #ff9ab8;
  padding: 12px 0;
  color: var(--green);
  font-size: 16px;
  line-height: 1.6;
}

.diary-row span {
  color: var(--pink);
  font-size: 22px;
  text-align: center;
}

.diary-row p {
  margin: 0;
}

.diary-row b {
  color: var(--pink);
  font-weight: 700;
}

.more {
  color: var(--green);
  padding: 16px 0 0 30px;
  font-size: 16px;
}

.favorite-content {
  color: #3f8d3a;
}

.photo-box {
  height: 190px;
  border: 1px dashed var(--pink);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 68px;
  margin-bottom: 18px;
}

.hearts-small {
  color: var(--pink);
  text-align: center;
  letter-spacing: 10px;
  margin-top: 12px;
}

.link-list {
  color: var(--pink);
  line-height: 2;
}

.footer {
  width: 1240px;
  margin: 26px auto 40px;
  text-align: center;
  color: var(--pink);
  font-size: 15px;
  position: relative;
  border-top: none;
}

.footer p {
  margin: 4px 0;
}

.thank-you {
  position: absolute;
  right: 0;
  bottom: 0;
  border: 2px solid #3f8d3a;
  background: var(--paper);
  color: #333;
  padding: 12px 24px;
  font-size: 16px;
  line-height: 1.4;
  box-shadow: 2px 2px 0 var(--shadow);
}

.thank-you span {
  color: var(--pink);
}

.playlist-list {
  height: 260px;
  overflow-y: auto;
  padding: 10px;
  background: #fffdfb;
}

.playlist-item {
  padding: 7px 10px;
  font-size: 14px;
  color: #679f3b;
  border-bottom: 1px dashed #f7bfd3;
  cursor: pointer;
  transition: 0.15s;
}

.playlist-item:hover {
  background: #fff2f7;
  color: #ef4b82;
  padding-left: 16px;
}

.playlist-item.active {
  background: #ef4b82;
  color: white;
  font-weight: bold;
}

.playlist-list::-webkit-scrollbar {
  width: 8px;
}

.playlist-list::-webkit-scrollbar-thumb {
  background: #ef4b82;
  border-radius: 20px;
}

.playlist-list::-webkit-scrollbar-track {
  background: #fff5f8;
}

/* click effect */
.effect {
  position: fixed;
  left: 0;
  top: 0;
  width: 75px;
  height: auto;
  pointer-events: none;
  z-index: 999999;
  image-rendering: pixelated;
  animation: effectPop 0.9s ease-out forwards;
}

@keyframes effectPop {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform:
      translate(
        calc(-50% + var(--x)),
        calc(-50% + var(--y))
      )
      scale(1.5)
      rotate(var(--r));
  }
}

/* ribbon cursor */
.cursor-trail {
  position: fixed;
  left: 0;
  top: 0;
  width: 78px;
  height: auto;
  pointer-events: none;
  z-index: 999998;
  image-rendering: pixelated;
  opacity: 0.95;
  animation: trailFade 1500ms ease-out forwards;
}

@keyframes trailFade {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.65);
  }
}

/* glitter */
.glitter {
  position: fixed;
  width: 36px;
  height: auto;
  pointer-events: none;
  z-index: 999999;
  image-rendering: pixelated;
  animation: glitterPop 1000ms ease-out forwards;
}

@keyframes glitterPop {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.4);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -90px) scale(1.8);
  }
}

/* cursor symbols */
.cursor-symbol {
  position: fixed;
  left: 0;
  top: 0;
  color: #ff8dbf;
  font-size: 32px;
  pointer-events: none;
  z-index: 999999;
  user-select: none;
  text-shadow:
    0 0 4px white,
    0 0 10px #ff8dbf;
  animation: symbolFade 1800ms ease-out forwards;
}

@keyframes symbolFade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -80px) scale(0.6) rotate(80deg);
  }
}

/* falling hearts */
.falling-heart {
  position: fixed;
  top: -40px;
  pointer-events: none;
  user-select: none;
  z-index: 99999;
  animation: fall linear forwards;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(calc(100vh + 80px)) rotate(360deg);
    opacity: 0;
  }
}

/* CRT */
body.crt-on::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999999;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.08) 0px,
      rgba(255,255,255,0.08) 1px,
      rgba(0,0,0,0.10) 2px,
      rgba(0,0,0,0.10) 4px
    );
  mix-blend-mode: multiply;
}

body.crt-on {
  animation: crtFlicker 0.18s infinite;
}

@keyframes crtFlicker {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.04); }
  100% { filter: brightness(0.98); }
}

/* night mode */
body.night-mode {
  background-color: #15101e;
  background-image:
    linear-gradient(rgba(255, 141, 191, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 141, 191, 0.16) 1px, transparent 1px);
  color: #ffd6e8;
}

body.night-mode .top-bar {
  background: #2a1835;
  border-bottom-color: #ff8dbf;
  color: #ffd6e8;
}

body.night-mode .window {
  background: #24182d;
  box-shadow: 2px 2px 0 #ff8dbf;
}

body.night-mode .window.pink {
  border-color: #ff8dbf;
}

body.night-mode .window.green {
  border-color: #8fd16a;
}

body.night-mode .pink .title-bar {
  background: #4a2240;
  color: #ffd6e8;
}

body.night-mode .green .title-bar {
  background: #23441f;
  color: #d8ffd1;
}

body.night-mode .mini-content,
body.night-mode .content,
body.night-mode .about-text,
body.night-mode .diary-row,
body.night-mode .favorite-content,
body.night-mode .playlist-list {
  background: #24182d;
  color: #d8ffd1;
}

body.night-mode h1,
body.night-mode .song-title,
body.night-mode .link-list,
body.night-mode .more,
body.night-mode .playlist-item {
  color: #ff8dbf;
}

body.night-mode .playlist-item.active {
  background: #ff8dbf;
  color: #24182d;
}
.album-spin {
  animation: albumSpin 6s linear infinite;
}

@keyframes albumSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}
/* active window effect */
.window {
  transition:
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.window.active-window {
  transform: translate(-2px, -2px);
  box-shadow:
    5px 5px 0 rgba(237, 120, 167, 0.35),
    8px 8px 0 rgba(11, 118, 46, 0.16);
}

body.night-mode .window.active-window {
  box-shadow:
    5px 5px 0 rgba(255, 141, 191, 0.42),
    8px 8px 0 rgba(143, 209, 106, 0.22);
}
.top-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

#digital-clock {
  color: #fff8f3;
  font-size: 14px;
  letter-spacing: 1px;
}

.online-dot {
  color: #0b762e;
  font-size: 13px;
  animation: onlineBlink 1.1s steps(1) infinite;
}

@keyframes onlineBlink {
  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0.35;
  }
}

body.night-mode #digital-clock {
  color: #ffd6e8;
}

body.night-mode .online-dot {
  color: #8fd16a;
}
.window.opening {
  animation: windowPop .28s ease-out;
}

@keyframes windowPop {

  0%{
    opacity:0;
    transform:scale(.85);
  }

  70%{
    opacity:1;
    transform:scale(1.03);
  }

  100%{
    transform:scale(1);
  }

}
.window.opening {
  animation: windowPop 0.28s ease-out;
}

@keyframes windowPop {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }

  70% {
    opacity: 1;
    transform: scale(1.03);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}
.window.maximized {
  position: fixed !important;

  width: 60vw !important;
  height: 60vh !important;

  left: 50% !important;
  top: 50% !important;

  transform: translate(-50%, -50%) !important;

  margin: 0 !important;
  z-index: 999999 !important;

  overflow: auto;
}

.window.maximized > *:not(.title-bar) {
  display: block;
}

.window.maximized .title-bar {
  position: sticky;
  top: 0;
  z-index: 2;
}