/* ============================================================
   ✦ INTERACTIVE RETRO FEATURES • skaeszun.uwu.ai ✦
   ============================================================ */

/* --- 1. Kirara Pet Controls, Animations & Speech Bubble --- */
.cat-wrapper {
  position: relative;
}

.kirara-pet-ctrls {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}
.kirara-happiness {
  font-size: 10.5px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.04em;
}
.kirara-hearts {
  color: var(--tab-on, #8f8f8f);
  font-weight: bold;
  letter-spacing: 0.1em;
  transition: transform 0.2s ease;
}
.kirara-hearts.pulse {
  animation: heartPulse 0.4s ease-in-out;
}
@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); color: #e28da8; }
}

.kirara-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.kirara-act-btn {
  background: var(--window);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 3px 10px;
  font-family: inherit;
  font-size: 10.5px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.kirara-act-btn:hover {
  background: var(--tab-on);
  color: #fff;
  border-color: var(--tab-on);
  transform: translateY(-1px);
}
.kirara-act-btn:active {
  transform: translateY(1px) scale(0.96);
}

/* Speech Bubble */
.kirara-bubble {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%) translateY(4px) scale(0.9);
  background: var(--box, #fafafa);
  border: 1px solid var(--line-soft, #d6d6d6);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 10.5px;
  color: var(--text, #3a3a3a);
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 120;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.kirara-bubble::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: var(--line-soft, #d6d6d6) transparent transparent transparent;
}
body.dark .kirara-bubble {
  background: var(--window, #1e1e22);
  border-color: var(--line, #383842);
  color: var(--text, #e2e2e8);
}
body.dark .kirara-bubble::after {
  border-color: var(--line, #383842) transparent transparent transparent;
}
.kirara-bubble.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Kirara Eating / Chewing Animation */
.cat.cat-chewing .cat-pixel {
  animation: kiraraChew 0.8s ease-in-out;
}
@keyframes kiraraChew {
  0% { transform: scale(1) rotate(0); }
  20% { transform: scale(1.15, 0.88) rotate(-4deg); }
  40% { transform: scale(0.92, 1.12) rotate(4deg); }
  60% { transform: scale(1.1, 0.94) rotate(-2deg); }
  80% { transform: scale(0.96, 1.05) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Kirara Purring / Gentle Cuddle Animation */
.cat.cat-purring .cat-pixel {
  animation: kiraraPurr 0.85s ease-in-out;
}
@keyframes kiraraPurr {
  0%, 100% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.1, 0.95) rotate(-3deg); }
  50% { transform: scale(1.05, 1.08) rotate(3deg); }
  75% { transform: scale(1.08, 0.98) rotate(-2deg); }
}

/* Floating Sushi Particle Animation */
.kirara-flying-sushi {
  position: absolute;
  pointer-events: none;
  font-size: 20px;
  z-index: 130;
  animation: flySushi 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes flySushi {
  0% {
    opacity: 1;
    transform: translate(0, 20px) scale(0.6) rotate(-20deg);
  }
  60% {
    opacity: 1;
    transform: translate(0, -14px) scale(1.25) rotate(15deg);
  }
  100% {
    opacity: 0;
    transform: translate(0, -22px) scale(0.8) rotate(0deg);
  }
}

/* Floating Heart Particles Animation */
.kirara-floating-heart {
  position: absolute;
  pointer-events: none;
  font-size: 16px;
  z-index: 130;
  animation: riseHeart 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes riseHeart {
  0% {
    opacity: 0;
    transform: translate(var(--dx, 0px), 10px) scale(0.5) rotate(0deg);
  }
  20% {
    opacity: 1;
    transform: translate(var(--dx, 0px), -10px) scale(1.2) rotate(var(--rot, 10deg));
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--dx, 0px) * 1.5), -50px) scale(0.9) rotate(calc(var(--rot, 10deg) * -1));
  }
}

/* --- 2. Celestial Fortune Cookie Card --- */
.fortune-box {
  background: var(--box);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.fortune-inner {
  text-align: center;
  background: var(--window);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 14px 12px;
  margin-top: 6px;
}
.fortune-cookie-icon {
  font-size: 36px;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.25s ease;
  user-select: none;
  line-height: 1;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.12));
}
.fortune-cookie-icon:hover {
  transform: scale(1.18) rotate(8deg);
}
.fortune-cookie-icon.cracking {
  animation: cookieShake 0.4s ease-in-out;
}
@keyframes cookieShake {
  0%, 100% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.15) rotate(-12deg); }
  75% { transform: scale(1.15) rotate(12deg); }
}
.fortune-paper {
  background: var(--box);
  border: 1px dashed var(--tab-on);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px auto 12px auto;
  max-width: 440px;
  font-size: 12px;
  color: var(--text);
  font-style: italic;
  line-height: 1.5;
  display: none;
  animation: paperSlide 0.3s ease-out forwards;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
@keyframes paperSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.fortune-btn {
  background: var(--tab-off);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 6px 18px;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.fortune-btn:hover {
  background: var(--tab-on);
  color: #fff;
  border-color: var(--tab-on);
}

/* --- 3. Retro Celestial Guestbook --- */
.guestbook-box {
  background: var(--box);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.guestbook-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  background: var(--window);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 12px;
}
.gb-row {
  display: flex;
  gap: 8px;
}
.gb-input {
  flex: 1;
  background: var(--box);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}
.gb-input:focus {
  border-color: var(--tab-on);
}
.gb-select {
  background: var(--box);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 7px 8px;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.gb-textarea {
  width: 100%;
  height: 56px;
  resize: vertical;
  background: var(--box);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--text);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s ease;
}
.gb-textarea:focus {
  border-color: var(--tab-on);
}
.gb-submit-wrap {
  display: flex;
  justify-content: flex-end;
}
.gb-submit-btn {
  background: var(--tab-off);
  color: var(--text);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 5px 16px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}
.gb-submit-btn:hover {
  background: var(--tab-on);
  color: #fff;
  border-color: var(--tab-on);
}
.gb-submit-btn.btn-success {
  background: var(--tab-on) !important;
  color: #fff !important;
}
.gb-status-msg {
  display: none;
  font-size: 11px;
  padding: 7px 10px;
  border-radius: 4px;
  margin-bottom: 9px;
  text-align: center;
  transition: all 0.3s ease;
}
.gb-status-msg.show {
  display: block;
  animation: fadeInStatus 0.3s ease;
}
.gb-status-msg.success {
  background: rgba(143, 143, 143, 0.15);
  border: 1px solid var(--tab-on);
  color: var(--text);
}
.gb-status-msg.error {
  background: rgba(226, 141, 168, 0.18);
  border: 1px solid #e28da8;
  color: #e28da8;
}
@keyframes fadeInStatus {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.gb-entries-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 4px;
}
.gb-entry {
  background: var(--window);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 9px 12px;
  font-size: 11.5px;
  line-height: 1.5;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.gb-entry-new {
  border-color: var(--tab-on) !important;
  box-shadow: 0 0 10px rgba(143, 143, 143, 0.35) !important;
  animation: newEntryPulse 0.8s ease;
}
@keyframes newEntryPulse {
  0% { transform: scale(0.98); opacity: 0.7; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}
.gb-entry-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
  font-size: 11px;
}
.gb-entry-author {
  font-weight: bold;
  color: var(--text);
}
.gb-entry-time {
  color: var(--text-soft);
  font-size: 10px;
}
.gb-entry-msg {
  color: var(--text-soft);
  word-break: break-word;
}

/* --- 4. 88x31 Button & Webring Box --- */
.webring-box {
  background: var(--box);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.webring-content {
  background: var(--window);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.webring-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.webring-badge-wrap {
  display: inline-block;
  line-height: 0;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  border: 1px solid var(--line);
  transition: transform 0.2s ease;
  overflow: hidden;
  background: #000;
}
.webring-badge-wrap:hover {
  transform: translateY(-2px) scale(1.03);
}
.webring-badge-wrap img {
  image-rendering: pixelated;
  display: block;
  width: 88px;
  height: 31px;
}
.webring-hint {
  font-size: 11.5px;
  color: var(--text-soft);
}
.webring-copy-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.webring-input {
  flex: 1;
  background: var(--box);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 6px 10px;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  color: var(--text-soft);
  outline: none;
  box-sizing: border-box;
}
.webring-copy-btn {
  background: var(--tab-off);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.webring-copy-btn:hover {
  background: var(--tab-on);
  color: #fff;
  border-color: var(--tab-on);
}
