@font-face {
  font-family: "Galmuri11";
  src: url("../fonts/Galmuri11.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Galmuri11";
  src: url("../fonts/Galmuri11-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --sky: #d9ecff;
  --ink: #4b3f72;
  --ink-soft: #7d6fa8;
  --link: #1d27b8;
  --frame: #d9a3d6;
  --line: #b9b5c4;
  --cream: #fffff8;
  --pink: #f47fb0;
  --pink-deep: #c93a7c;
  --pink-pale: #ffe3ef;
  --check-pink: rgba(255, 140, 185, .32);
  --check-blue: rgba(130, 175, 235, .28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 12px 30px;
  color: var(--ink);
  background: var(--sky) url("../img/clouds.svg") repeat;
  font: 12px/1.7 "Galmuri11", "Malgun Gothic", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: clip;
}

a { color: var(--link); }
a:hover { color: var(--pink-deep); }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
.pixel { image-rendering: pixelated; }

/* ---------- page frame ---------- */
.page {
  position: relative;
  max-width: 808px;
  margin: 0 auto;
}
/* Lace strips hanging off both sides. They sit in the body's side padding, so they never add sideways scrolling. */
.page::before,
.page::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22px;
  background: url("../img/lace.svg") repeat-y left top / 22px 24px;
}
.page::before { left: -20px; }
.page::after { right: -20px; transform: scaleX(-1); }

.frame {
  position: relative;
  z-index: 1;
  background: #fff;
  border: 4px solid var(--frame);
  border-radius: 10px;
  box-shadow: 0 0 0 1px #fff, 0 0 0 2px var(--frame);
  overflow: hidden;
}

/* ---------- game page ---------- */
.game-stage {
  min-height: 420px;
  padding: 12px;
  border-top: 1px solid var(--frame);
  background-color: #eef5ff;
}

/* ---------- mouse cursor and falling sparkles ---------- */
/* Angel Wing Heart - https://www.cursors-4u.com/cursor/angel-wing-heart */
* {
  cursor: url("https://cdn.cursors-4u.net/previews/angel-wing-heart-800e0eca-32.webp") 32 32, auto !important;
}
/* End www.Cursors-4U.com Code */
.sparkle-layer { position: fixed; inset: 0; z-index: 9999; overflow: hidden; pointer-events: none; }
.cursor-sparkle {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: sparkle-fall .8s ease-in forwards;
}
.cursor-sparkle-glow {
  position: absolute;
  filter: drop-shadow(0 0 1px #f47fb0) drop-shadow(0 0 2px #ff9cc5);
}
@keyframes sparkle-fall {
  from { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
  to { opacity: 0; transform: translate(var(--drift), var(--fall)) scale(.4) rotate(120deg); }
}

/* ---------- stickers pasted over the page ---------- */
/* Tall enough to clip at the page bottom, wide enough to stick out past the sides. */
.sticker-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-x: visible;
  overflow-y: clip;
  pointer-events: none;
}
.sticker {
  position: absolute;
  height: auto;
  max-width: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.sticker-editing .sticker { cursor: grab !important; pointer-events: auto; outline: 1px dashed var(--pink); touch-action: none; }
.sticker-editing .sticker.dragging { cursor: grabbing !important; }
.sticker-editing .sticker.selected { outline: 2px solid var(--pink-deep); }
.sticker-panel {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 10000;
  width: 220px;
  padding: 8px 10px;
  border: 2px solid var(--frame);
  border-radius: 8px;
  background: #fff;
  box-shadow: 2px 3px 0 rgba(75, 63, 114, .25);
}
.sticker-panel[hidden],
.sticker-controls[hidden] { display: none; }
.sticker-panel-title { font-weight: 700; color: var(--pink-deep); }
.sticker-status { float: right; font-weight: 400; color: var(--ink-soft); }
.sticker-hint { color: var(--ink-soft); }
.sticker-selected { margin-top: 4px; font-weight: 700; }
.sticker-panel label { display: flex; align-items: center; gap: 6px; }
.sticker-panel input[type="range"] { flex: 1; min-width: 0; accent-color: var(--pink-deep); }
.sticker-panel button { margin-top: 4px; font: inherit; cursor: pointer; }
.sticker-done { display: block; width: 100%; }

.hero img { display: block; width: 100%; height: auto; }

/* ---------- 88x31 style buttons ---------- */
.banners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border-block: 1px solid var(--frame);
  background: #fff;
}
.btn88 {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 94px;
  height: 31px;
  padding: 0 2px;
  border: 2px outset #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
}
a.btn88:hover { border-style: inset; color: var(--pink-deep); }
.b-pink { background: linear-gradient(#fff, #ffc4dc); color: var(--pink-deep); }
.b-blue { background: linear-gradient(#fff, #bcd9ff); color: #2a4fb5; }
.b-yellow { background: linear-gradient(#fffde0, #ffe680); color: #a86500; }
.b-mint { background: linear-gradient(#f4fff7, #bdeccc); color: #1f7d4d; }
.b-lilac { background: linear-gradient(#fbf5ff, #dcc6f7); color: #6a3fb0; }
.b-peach { background: linear-gradient(#fff5ec, #ffd1ae); color: #b5541d; }
.b-sky { background: linear-gradient(#e8f6ff, #a7dcf5); color: #1d6c96; }
.b-rose { background: linear-gradient(#fff, #ffb3c8); color: #b52a56; }

/* ---------- three columns ---------- */
.columns {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr) 184px;
}
.side { padding: 8px 10px 16px; background: #fff; }

.center {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 10px 14px;
  border-inline: 1px solid var(--frame);
  border-bottom: 1px solid var(--frame);
  border-radius: 0 0 22px 22px;
  background-color: #eef5ff;
  background-image:
    linear-gradient(90deg, var(--check-blue) 50%, transparent 50%),
    linear-gradient(var(--check-blue) 50%, transparent 50%);
  background-size: 16px 16px;
}

/* ---------- boxes ---------- */
.box {
  position: relative;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--cream);
}
.side .box { margin-bottom: 8px; }
.box > p + p { margin-top: 6px; }

/* ---------- gingham pill headings ---------- */
.pill {
  margin: 8px auto;
  max-width: 150px;
  padding: 2px 8px;
  border: 1px solid #ff9cc5;
  border-radius: 999px;
  background-color: #fff;
  background-image:
    linear-gradient(90deg, var(--check-pink) 50%, transparent 50%),
    linear-gradient(var(--check-pink) 50%, transparent 50%);
  background-size: 8px 8px;
  color: var(--pink-deep);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-shadow: 1px 0 #fff, -1px 0 #fff, 0 1px #fff, 0 -1px #fff;
}

/* ---------- side menu ---------- */
.menu { margin: 0 0 12px; padding: 0 0 0 12px; list-style: none; }
.menu li { position: relative; padding-left: 14px; }
.menu li::before {
  content: "";
  position: absolute;
  top: .5em;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 10%, var(--pink) 55%, var(--pink-deep));
}
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover { color: var(--pink-deep); }
/* ---------- BGM player, drawn as an old mp3 player ---------- */
.mp3 {
  position: relative;
  width: 152px;
  margin: 16px auto 4px;
  padding: 8px 8px 12px;
  border: 1px solid var(--frame);
  border-radius: 14px;
  background: linear-gradient(145deg, #ffe9f3, #ecdcf9 55%, #dbe9ff);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #cbb6e8, 2px 3px 0 rgba(75, 63, 114, .18);
}
.mp3-screen {
  padding: 3px 5px 4px;
  border: 4px solid var(--ink);
  border-radius: 5px;
  background: linear-gradient(#f5fbff, #bfe0f7);
  color: #2b3d68;
  line-height: 1.3;
}
.mp3-status { display: flex; align-items: center; justify-content: space-between; font-size: 9px; }
.mp3-battery { display: block; width: 16px; height: 7px; padding: 1px; border: 1px solid #2b3d68; background: #fff; }
.mp3-battery i { display: block; width: 80%; height: 100%; background: #62c26b; }
.mp3-flow { display: flex; align-items: center; justify-content: center; gap: 3px; margin: 3px 0; perspective: 90px; }
.mp3-pane { width: 22px; height: 40px; background: linear-gradient(#ffd4e6, #c3a6ef); }
.mp3-pane.left { transform: rotateY(50deg); }
.mp3-pane.right { background: linear-gradient(#bcd9ff, #fff4b8); transform: rotateY(-50deg); }
.mp3-cover { width: 54px; height: 54px; object-fit: cover; border: 1px solid #fff; box-shadow: 0 1px 2px rgba(43, 61, 104, .5); }
.mp3-title,
.mp3-artist {
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mp3-title { font-size: 11px; font-weight: 700; }
.mp3-artist { min-height: 13px; font-size: 9px; }
.mp3-time { display: flex; align-items: center; gap: 3px; font-size: 9px; }
.mp3-track { flex: 1; height: 4px; border: 1px solid #2b3d68; background: #fff; }
.mp3-track i { display: block; width: 0; height: 100%; background: #f47fb0; }
.mp3-wheel {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 10px auto 0;
  border: 1px solid var(--frame);
  border-radius: 50%;
  background: #fffdfe;
  box-shadow: inset 0 1px 2px rgba(75, 63, 114, .2);
}
.mp3-label {
  position: absolute;
  top: 6px;
  left: 0;
  width: 100%;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}
.mp3-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.mp3-btn svg { width: 16px; height: 10px; fill: currentColor; }
.mp3-btn:hover:not(:disabled) { background: #ffe3ef; color: var(--pink-deep); }
.mp3-btn:focus-visible { outline: 2px solid var(--pink-deep); }
.mp3-btn:disabled { opacity: .35; cursor: default; }
.mp3-prev { top: 36px; left: 1px; }
.mp3-next { top: 36px; right: 1px; }
.mp3-play { bottom: 1px; left: 36px; }
.mp3-play .icon-pause,
.mp3-play.playing .icon-play { display: none; }
.mp3-play.playing .icon-pause { display: block; }
.mp3-center {
  position: absolute;
  top: 34px;
  left: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #e3c3e6;
  border-radius: 50%;
  background: var(--pink-pale);
}
.mp3-center img { width: 16px; height: 16px; }
.mp3-sticker { position: absolute; width: 16px; height: 16px; pointer-events: none; }
.sticker-star { left: 5px; bottom: 7px; transform: rotate(-12deg); }

/* ---------- welcome ---------- */
.logo {
  width: fit-content;
  max-width: 100%;
  font-size: 48px;
  line-height: 1.25;
  font-weight: 700;
  font-style: italic;
  background: linear-gradient(90deg, #8fb7f2, #c3a6ef 45%, #ff8fc0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub { margin-bottom: 4px; color: #6a55c9; font-size: 12px; font-weight: 700; }
.sub.big { font-size: 16px; line-height: 1.5; }
.deco { position: absolute; width: 30px; height: auto; }
.deco-star { top: 10px; right: 12px; }
.deco-heart { top: 46px; right: 42px; width: 22px; }

.meta { color: var(--ink-soft); }
.more { margin-top: 6px; text-align: right; }

/* ---------- home: today's note, site updates ---------- */
.today-note { background: var(--pink-pale); border-color: #ff9cc5; }
.note-text {
  padding: 6px 10px;
  border: 1px dashed #ff9cc5;
  border-radius: 8px;
  background: #fff;
  color: var(--pink-deep);
  font-weight: 700;
  text-align: center;
}
.updates { margin: 4px 0 0; padding: 0; list-style: none; }
.updates li { display: flex; gap: 10px; padding: 3px 0; border-top: 1px dashed var(--line); }
.updates li:first-child { border-top: 0; }
.update-date { flex: none; }

/* ---------- post lists ---------- */
.post-item { padding: 8px 0; border-top: 1px dashed var(--line); }
.post-item:first-of-type { border-top: 0; padding-top: 2px; }
.post-item::after { content: ""; display: block; clear: both; }
.post-item h3 { font-size: 12px; font-weight: 700; }
.thumb { float: right; width: 72px; height: 72px; margin-left: 8px; object-fit: cover; border: 1px solid var(--line); }

.post-image { display: block; margin: 8px auto; border: 1px solid var(--line); }
.post-body { margin-top: 8px; }
.post-body p { margin-bottom: 1em; }
.draft { padding: 0 4px; background: var(--pink-pale); color: var(--pink-deep); }

.pager { display: flex; justify-content: center; gap: 12px; margin-top: 8px; }

/* ---------- gallery: always three across, on phones too ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.gallery a {
  display: block;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: #fff;
}
.gallery a:hover { border-color: var(--pink-deep); }
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- wishlist: one memo per row ---------- */
.wishes { margin: 6px 0 0; padding: 0; list-style: none; }
.wish {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px dashed var(--line);
}
.wish:first-child { border-top: 0; }
.wish-image { flex: none; display: block; width: 44px; height: 44px; border: 1px solid var(--line); }
.wish-image:hover { border-color: var(--pink-deep); }
.wish-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wish-text { flex: 1; min-width: 0; }
.wish-date { flex: none; white-space: nowrap; }
.wish.done .wish-text { color: var(--ink-soft); text-decoration: line-through; }

/* ---------- link list: one line each ---------- */
.link-list { margin: 6px 0 0; padding: 0; list-style: none; }
.link-list li {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  border-top: 1px dashed var(--line);
  white-space: nowrap;
}
.link-list li:first-child { border-top: 0; }
.link-title { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.link-list a { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---------- friend banners ---------- */
.friend-banners {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.friend-banners a { display: block; line-height: 0; }
.friend-banners img { display: block; max-height: 62px; border: 1px solid var(--line); }
.friend-banners a:hover img { border-color: var(--pink-deep); }
.friend-banners .own-banner img { width: 200px; max-width: 100%; height: auto; border: 0; image-rendering: pixelated; }
.side-banner { display: block; width: 100%; height: auto; margin-top: 8px; }

/* ---------- guestbook ---------- */
.guest-form { margin-top: 6px; }
.guest-form .field { margin-bottom: 6px; }
.guest-form label { display: block; font-weight: 700; }
.guest-form input[type="text"],
.guest-form textarea {
  display: block;
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #ff9cc5;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.guest-form input:focus,
.guest-form textarea:focus { outline: 2px solid #ffc4dc; border-color: var(--pink-deep); }
.guest-form .trap { position: absolute; left: -9999px; }
.submit {
  padding: 3px 18px;
  border: 2px outset #ff9cc5;
  border-radius: 999px;
  background: var(--pink-deep);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.submit:hover { background: #a82a65; }
.notice { margin: 6px 0; padding: 4px 8px; border: 1px solid #a7dcb6; background: #e6f8eb; color: #1f6b3d; }
.form-error { color: #c0183f; }

/* ---------- profile box ---------- */
.profile { padding: 8px; }
.photo { text-align: center; }
.photo img {
  display: block;
  width: 100px;
  height: 100px;
  margin: 2px auto;
  padding: 4px;
  object-fit: contain;
  border: 1px solid #5560c9;
  background: #fff4fa;
}
.visits { text-align: center; }
.counter-label { margin-bottom: 4px; color: #6a55c9; font-size: 12px; }
.counter { display: flex; justify-content: center; gap: 2px; }
.heart-digit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 25px;
  padding-bottom: 3px;
  background: url("../img/heart.svg") center / contain no-repeat;
  color: #7a1b4d;
  font-weight: 700;
}


/* ---------- calendar ---------- */
.calendar {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--frame);
  background: #fff;
  table-layout: fixed;
}
.calendar caption {
  padding: 2px 0;
  border: 1px solid var(--frame);
  border-bottom: 0;
  background: #d3f3d9;
  color: #24663b;
  font-weight: 700;
}
.calendar caption a { padding: 0 4px; color: #24663b; text-decoration: none; }
.calendar th, .calendar td {
  height: 22px;
  padding: 0;
  border: 1px solid #f4cfe3;
  text-align: center;
}
.calendar th { background: var(--pink-pale); font-weight: 700; }
.calendar td { background: #f2fbff; }
.calendar .sun { color: #d4213f; }
.calendar .sat { color: #2348d1; }
.calendar td.has-post { background: #ffc4dc; }
.calendar td.has-post a { display: block; color: inherit; font-weight: 700; }
.calendar td.today { outline: 2px solid var(--pink-deep); outline-offset: -2px; }

/* ---------- phone width ---------- */
@media (max-width: 720px) {
  body { padding: 6px 16px; }
  .page::before,
  .page::after { width: 14px; background-size: 14px 15px; }
  .page::before { left: -13px; }
  .page::after { right: -13px; }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .center { border-inline: 0; border-top: 1px solid var(--frame); border-radius: 0; }
  .menu { display: flex; flex-wrap: wrap; gap: 2px 16px; padding-left: 4px; }
  /* Phone layouts stack everything differently, so desktop positions would land on top of the text. */
  .sticker-layer,
  .sticker-panel,
  .sticker-menu { display: none; }
  .mp3 { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 340px; }
  .mp3-screen { flex: 1; min-width: 0; }
  .mp3-wheel { flex: none; margin: 0; }
  .sticker-star { top: 5px; right: 5px; bottom: auto; left: auto; }
  .logo { font-size: 40px; }
  .banners { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .banners .btn88 { width: auto; }
}
@media (max-width: 380px) {
  .banners .btn88 { padding: 0; font-size: 11px; letter-spacing: -0.5px; }
}
