* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
.public-message { margin: 40px auto; max-width: 600px; padding: 20px; background: #fff; color: #111; border: 2px solid #333; font-family: Verdana, Arial, sans-serif; }

.default-public-profile {
  min-height: 100vh;
  background: #d7edff;
  padding: 24px;
  font-family: Verdana, Arial, sans-serif;
  color: #eaf7ff;
}
.default-profile-card {
  max-width: 900px;
  margin: 0 auto;
  background: #0b4fa6;
  border: 1px solid #7fd1ff;
  box-shadow: 0 0 12px rgba(0,0,0,.45);
  padding: 12px;
}
.default-title {
  background: linear-gradient(#2b8fe9, #08498e);
  border: 1px solid #9de0ff;
  text-align: center;
  font-weight: bold;
  padding: 10px;
  margin-bottom: 14px;
}
.default-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.default-avatar { min-height: 210px; background: #073b80; border: 1px solid #8bd8ff; display:flex; align-items:center; justify-content:center; text-align:center; padding:12px; }
.default-avatar img { max-width: 180px; max-height: 190px; }
.default-right h1 { margin: 0 0 8px; color: white; }
.default-bio { background: #073b80; border: 1px dotted #8bd8ff; padding: 10px; white-space: pre-wrap; }
.default-info-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.default-info-grid div { background:#063b7b; border:1px solid #59bfff; padding:8px; }

.scene-public-profile {
  min-height: 100vh;
  background: #000;
  color: white;
  font-family: Verdana, Arial, sans-serif;
  cursor: crosshair;
  background-image:
    radial-gradient(circle at 10% 20%, #ff00cc 0 3px, transparent 4px),
    radial-gradient(circle at 80% 15%, #39ff14 0 3px, transparent 4px),
    radial-gradient(circle at 40% 70%, #00eaff 0 3px, transparent 4px),
    linear-gradient(45deg, transparent 45%, rgba(255,0,204,.18) 45% 55%, transparent 55%);
  background-size: 90px 90px, 120px 120px, 100px 100px, 40px 40px;
  padding: 20px;
}
.scene-page {
  max-width: 980px;
  margin: 0 auto;
  border: 4px solid #ff00cc;
  box-shadow: 0 0 25px #ff00cc, 0 0 45px #00eaff;
  background: rgba(0,0,0,.88);
}
.scene-top { text-align:center; padding:18px; border-bottom:3px dashed #39ff14; background:rgba(255,0,204,.18); }
.scene-top h1 { margin:0; font-family:"Comic Sans MS", cursive; color:#39ff14; font-size:42px; text-shadow:3px 3px #ff00cc, 0 0 12px #00eaff; }
.scene-top p { color:#00eaff; font-weight:bold; }
.scene-nav { text-align:center; padding:10px; border-bottom:3px solid #00eaff; }
.scene-nav a { color:#ff00cc; margin:0 10px; font-weight:bold; text-decoration:none; }
.scene-public-profile marquee { color:#39ff14; font-weight:bold; font-size:18px; border-top:2px dotted #ff00cc; border-bottom:2px dotted #ff00cc; padding:8px; }
.scene-profile-grid { display:grid; grid-template-columns:260px 1fr; gap:15px; padding:15px; }
.scene-box { background:rgba(0,0,0,.82); border:3px dashed #ff00cc; padding:12px; box-shadow:0 0 12px #00eaff; margin-bottom:15px; }
.scene-box h2 { margin-top:0; font-family:"Comic Sans MS", cursive; color:#39ff14; text-shadow:2px 2px #ff00cc; }
.scene-avatar { width:210px; height:210px; margin:auto; border:4px solid #00eaff; box-shadow:0 0 15px #ff00cc; background:linear-gradient(135deg,#ff00cc,#000,#39ff14); display:flex; align-items:center; justify-content:center; text-align:center; font-weight:bold; overflow:hidden; }
.scene-avatar img { width:100%; height:100%; object-fit:cover; }
.scene-details p { border-bottom:1px dotted #00eaff; padding-bottom:6px; }
.scene-status { font-size:18px; color:#ff00cc; font-weight:bold; }
.scene-stickers { font-size:34px; text-align:center; line-height:1.7; }
.scene-comment { border:2px solid #39ff14; padding:10px; margin:10px 0; background:rgba(255,0,204,.12); }
.scene-footer { text-align:center; padding:12px; color:#00eaff; border-top:3px dashed #ff00cc; }

@media(max-width:700px){
  .default-layout, .default-info-grid, .scene-profile-grid { grid-template-columns:1fr; }
  .scene-top h1 { font-size:32px; }
  .scene-avatar { width:180px; height:180px; }
}


/* Scene Queen full public profile layout enhancements */
.scene-public-profile {
  overflow-x: hidden;
  animation: sceneBgMove 18s linear infinite;
  position: relative;
}

.scene-public-profile::before,
.scene-public-profile::after {
  content: "★  ✨  💖  ☆  🎀  ⭐  💚  🎧  💜  ";
  position: fixed;
  left: -10%;
  width: 120%;
  pointer-events: none;
  z-index: 0;
  font-size: 28px;
  letter-spacing: 28px;
  opacity: .55;
  white-space: nowrap;
  text-shadow: 0 0 12px #ff00cc, 0 0 18px #00eaff;
  animation: sceneFloat 16s linear infinite;
}

.scene-public-profile::before { top: 12%; }
.scene-public-profile::after {
  bottom: 10%;
  animation-duration: 22s;
  animation-direction: reverse;
}

.scene-page {
  position: relative;
  z-index: 1;
  animation: sceneGlow 2.8s ease-in-out infinite alternate;
}

.scene-top h1 {
  animation: sceneTitlePulse 1.8s ease-in-out infinite alternate;
}

.scene-box {
  animation: sceneBoxGlow 2.5s ease-in-out infinite alternate;
}

.scene-public-profile marquee {
  background: rgba(0,0,0,.75);
  box-shadow: 0 0 10px #ff00cc;
}

@keyframes sceneBgMove {
  from { background-position: 0 0, 40px 40px, 80px 80px, 0 0; }
  to { background-position: 90px 90px, 160px 160px, 180px 180px, 40px 40px; }
}

@keyframes sceneFloat {
  from { transform: translateX(-8%); }
  to { transform: translateX(8%); }
}

@keyframes sceneGlow {
  from { box-shadow: 0 0 18px #ff00cc, 0 0 30px #00eaff; }
  to { box-shadow: 0 0 35px #39ff14, 0 0 55px #ff00cc; }
}

@keyframes sceneTitlePulse {
  from { text-shadow: 3px 3px #ff00cc, 0 0 10px #00eaff; }
  to { text-shadow: 3px 3px #ff00cc, 0 0 20px #39ff14, 0 0 30px #ff00cc; }
}

@keyframes sceneBoxGlow {
  from { box-shadow: 0 0 8px #00eaff; }
  to { box-shadow: 0 0 16px #ff00cc, inset 0 0 12px rgba(57,255,20,.18); }
}

@media (prefers-reduced-motion: reduce) {
  .scene-public-profile,
  .scene-public-profile::before,
  .scene-public-profile::after,
  .scene-page,
  .scene-top h1,
  .scene-box {
    animation: none !important;
  }
}

/* Emo public profile preview */
.emo-public-profile {
  min-height: 100vh;
  padding: 20px;
  color: #fff;
  font-family: Verdana, Arial, sans-serif;
  cursor: crosshair;
  background-color: #000;
  background-image: url('../assets/layouts/emo/background.gif');
  background-repeat: repeat;
  background-size: 360px auto;
  background-attachment: fixed;
}
.emo-page {
  max-width: 1000px;
  margin: 0 auto;
  background: rgba(0,0,0,.58);
  border: 4px solid #ff1493;
  box-shadow: 0 0 18px #ff1493, 0 0 40px #ff69b4;
}
.emo-header,
.emo-menu,
.emo-box,
.emo-title,
.emo-music,
.emo-info-grid div,
.emo-guestbook {
  background: rgba(0,0,0,.86);
  border: 3px dashed #ff8bd1;
  box-shadow: 0 0 10px #ff1493;
}
.emo-header { text-align:center; padding:22px 10px; }
.emo-header h1,
.emo-title,
.emo-palace-name,
.emo-box h2 {
  font-family: "Comic Sans MS", cursive;
  color: #ffd6f0;
  text-shadow: 0 0 8px #ff1493, 0 0 16px #fff;
}
.emo-header h1 { margin:0; font-size:42px; }
.emo-grid { display:grid; grid-template-columns:220px 1fr; gap:12px; padding:12px; background-image: url('../assets/layouts/emo/2ndbground.jpg'); background-repeat: repeat; background-size:220px auto; }
.emo-menu { padding:10px; }
.emo-menu a { display:block; margin-bottom:8px; padding:10px; color:#fff; text-decoration:none; background:rgba(60,0,35,.88); border:2px solid #ff9bd8; font-weight:bold; }
.emo-collectibles { min-height:330px; text-align:center; margin-top:12px; }
.emo-title { text-align:center; padding:12px; font-size:32px; }
.emo-music { text-align:center; padding:10px; margin-top:12px; font-weight:bold; }
.emo-music button { margin:6px 3px 0; padding:6px 10px; background:#ff69b4; border:2px solid #fff; border-radius:6px; color:#000; font-weight:bold; }
.emo-profile-grid { display:grid; grid-template-columns:250px 1fr; gap:12px; margin-top:12px; }
.emo-box { padding:12px; margin-bottom:12px; }
.emo-avatar { width:205px; height:205px; margin:auto; display:flex; align-items:center; justify-content:center; text-align:center; background:rgba(0,0,0,.75); border:4px solid #ffd6f0; box-shadow:0 0 14px #ff1493; overflow:hidden; }
.emo-avatar img { width:100%; height:100%; object-fit:cover; }
.emo-palace-name { font-size:30px; }
.emo-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.emo-info-grid div { padding:8px; }
@media(max-width:700px){ .emo-grid,.emo-profile-grid,.emo-info-grid{grid-template-columns:1fr}.emo-header h1,.emo-title{font-size:28px} }

/* v27 public Emo preview title/music polish */
.emo-title {
  color:#ffd6f0 !important;
  text-shadow:0 0 8px #ff1493,0 0 18px #fff,0 0 26px #ff69b4 !important;
}
.emo-music-note {
  color:#ff69b4 !important;
  font-size:22px !important;
  font-weight:900 !important;
  text-shadow:0 0 6px #fff,0 0 12px #ff1493,0 0 22px #ff69b4 !important;
  animation:emoMusicNoteBounce .85s ease-in-out infinite !important;
  display:inline-block !important;
}
@keyframes emoMusicNoteBounce {
  0%,100%{transform:translateY(0) rotate(-8deg) scale(1)}
  35%{transform:translateY(-7px) rotate(8deg) scale(1.22)}
  70%{transform:translateY(1px) rotate(-3deg) scale(1.08)}
}

/* Cyber public profile preview */
.cyber-public-profile {
  min-height: 100vh;
  padding: 20px;
  color: #fff;
  font-family: Verdana, Arial, sans-serif;
  cursor: crosshair;
  background-color: #030014;
  background-image: url('../assets/layouts/cyber/background.gif');
  background-repeat: repeat;
  background-size: 520px auto;
  background-attachment: fixed;
}
.cyber-page {
  max-width: 1000px;
  margin: 0 auto;
  background: rgba(2,0,22,.75);
  border: 4px solid #00eaff;
  box-shadow: 0 0 20px #00eaff, 0 0 42px #8a2be2;
}
.cyber-header,
.cyber-nav,
.cyber-box {
  background: rgba(1,0,18,.88);
  border: 3px solid #00eaff;
  box-shadow: 0 0 10px #00eaff, inset 0 0 14px rgba(138,43,226,.35);
}
.cyber-header { text-align:center; padding:22px 10px; }
.cyber-header h1,
.cyber-palace-name,
.cyber-box h2 {
  color: #dffbff;
  text-shadow: 0 0 8px #00eaff, 0 0 18px #8a2be2, 0 0 26px #fff;
}
.cyber-header h1 { margin:0; font-size:42px; }
.cyber-header p { color:#c7f8ff; font-weight:bold; }
.cyber-nav { text-align:center; padding:10px; margin:12px; }
.cyber-nav a { color:#c7f8ff; margin:0 10px; font-weight:bold; text-decoration:none; text-shadow:0 0 7px #00eaff; }
.cyber-profile-grid {
  display:grid;
  grid-template-columns:250px 1fr;
  gap:12px;
  padding:12px;
  background-image:
    linear-gradient(rgba(0,234,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,234,255,.08) 1px, transparent 1px);
  background-size:34px 34px;
}
.cyber-box { padding:12px; margin-bottom:12px; }
.cyber-avatar { width:205px; height:205px; margin:auto; display:flex; align-items:center; justify-content:center; text-align:center; background:rgba(0,0,0,.72); border:4px solid #9a7cff; box-shadow:0 0 14px #00eaff,0 0 22px #8a2be2; overflow:hidden; }
.cyber-avatar img { width:100%; height:100%; object-fit:cover; }
.cyber-palace-name { font-size:30px; font-weight:bold; }
.cyber-status p { border-bottom:1px dotted #00eaff; padding-bottom:6px; }
@media(max-width:700px){ .cyber-profile-grid{grid-template-columns:1fr}.cyber-header h1{font-size:30px} }

/* v39: public profile now uses the real palace layout instead of placeholder preview boxes */
.public-palace-main {
  padding-top: 12px;
}
.public-palace-card {
  max-width: 900px;
  margin: 0 auto;
}
.public-palace-layout {
  align-items: start;
}
.public-palace-left .blinkies-sidebar-box {
  margin-top: 14px;
  width: 100%;
}
.public-action-row {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.public-action-row .palace-button {
  display: block;
  text-align: center;
  text-decoration: none;
}
.public-palace-card .scene-moving-title {
  display: block;
}
.public-palace-card .guestbook-section {
  margin-top: 14px;
}
.public-palace-card .blinkies-view img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 6px auto;
}
.public-palace-card .blinkies-view marquee img,
.public-palace-card .blinkies-view center img {
  display: inline-block;
}


/* v40: public profile page uses the same moving title animation selectors as palace.html */
body.scene-palace-selected #profile-root.profile-layout-scene .scene-moving-title,
body.emo-palace-selected #profile-root.profile-layout-emo .scene-moving-title,
body.cyber-palace-selected #profile-root.profile-layout-cyber .scene-moving-title {
  display: block !important;
  overflow: hidden !important;
  width: 100% !important;
  margin: 0 0 10px !important;
  text-align: center !important;
}
body.scene-palace-selected #profile-root.profile-layout-scene .scene-moving-title span,
body.emo-palace-selected #profile-root.profile-layout-emo .scene-moving-title span,
body.cyber-palace-selected #profile-root.profile-layout-cyber .scene-moving-title span {
  display: inline-block !important;
  white-space: nowrap !important;
  animation: publicProfileTitleSlide 5s ease-in-out infinite alternate !important;
}
@keyframes publicProfileTitleSlide {
  from { transform: translateX(-18%); }
  to { transform: translateX(18%); }
}

/* v41: public profile cleanup */
.public-palace-card .palace-title-bar {
  display: none !important;
}

.public-profile-music {
  display: block;
  margin: 0 0 12px !important;
  padding: 8px 10px !important;
  text-align: center;
}
.public-profile-music[hidden] {
  display: none !important;
}
.public-profile-music .profile-music-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.public-profile-music .now-playing-text,
.public-profile-music .now-playing-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.public-palace-card .guestbook-section {
  display: block !important;
  margin-top: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.public-palace-card .guestbook-form {
  display: grid !important;
  gap: 8px !important;
  margin-top: 10px !important;
}
.public-palace-card .guestbook-form textarea {
  width: 100% !important;
  min-height: 72px !important;
  box-sizing: border-box !important;
}

.public-palace-card .palace-layout.public-palace-layout {
  align-items: start !important;
}
.public-palace-card .public-palace-right {
  min-height: auto !important;
}

/* Only the main moving title should move on visitor profiles. */
.public-palace-card .scene-moving-title + .palace-title-bar,
.public-palace-card .palace-title-bar:empty {
  display: none !important;
}


/* v42: Visitor profiles should reuse the same real palace layout shell. */
#palace-view.public-palace-card {
  display: block;
}
#palace-view.public-palace-card .palace-title-bar {
  display: block !important;
}
#palace-view.public-palace-card .scene-moving-title + .palace-title-bar {
  display: block !important;
}
#palace-view.public-palace-card .guestbook-section {
  clear: both;
  margin-top: 14px !important;
}
#palace-view.public-palace-card .public-action-row {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}
#palace-view.public-palace-card .public-action-row .palace-button {
  text-align: center;
  text-decoration: none;
}
body.scene-palace-selected #palace-view.profile-layout-scene .palace-title-bar {
  display: block !important;
}
body.emo-palace-selected #palace-view.profile-layout-emo .palace-title-bar,
body.cyber-palace-selected #palace-view.profile-layout-cyber .palace-title-bar {
  display: block !important;
}

/* v43: keep public guestbook in the right profile content area, not below the whole layout */
.public-palace-right .guestbook-section {
  margin-top: 14px;
  width: 100%;
}
.public-palace-right .guestbook-section h2 {
  margin-top: 0;
}
.public-palace-right .guestbook-form textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
}
.public-palace-right .guestbook-form button {
  width: 100%;
  margin-top: 8px;
}


/* Guestbook inline replies + delete buttons */
.guestbook-inline-reply {
  margin-top: 8px !important;
  display: grid !important;
  gap: 6px !important;
}
.guestbook-reply-input {
  width: 100% !important;
  min-height: 48px !important;
  box-sizing: border-box !important;
  resize: vertical !important;
  font: inherit !important;
}
.guestbook-inline-actions {
  display: flex !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}
.guestbook-send-reply-btn,
.guestbook-cancel-reply-btn,
.guestbook-delete-btn {
  cursor: pointer !important;
}
.guestbook-delete-btn {
  margin-left: 6px !important;
}
.guestbook-replies {
  margin-top: 8px !important;
  padding-left: 12px !important;
  border-left: 2px dotted currentColor !important;
}
.guestbook-reply {
  margin-top: 6px !important;
  padding: 6px !important;
  border-radius: 6px !important;
}

/* v80: stretch public profile collectibles sidebar to match right profile content */
.public-palace-card .palace-layout.public-palace-layout,
#palace-view.public-palace-card .palace-layout.public-palace-layout {
  align-items: stretch !important;
}

.public-palace-card .public-palace-left,
#palace-view.public-palace-card .public-palace-left {
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
}

.public-palace-card .public-palace-left .blinkies-sidebar-box,
#palace-view.public-palace-card .public-palace-left .blinkies-sidebar-box {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 640px !important;
}

.public-palace-card .public-palace-left .blinkies-view,
#palace-view.public-palace-card .public-palace-left .blinkies-view {
  flex: 1 1 auto !important;
  align-items: flex-start !important;
  align-content: flex-start !important;
  justify-content: center !important;
}

@media (max-width: 760px) {
  .public-palace-card .public-palace-left .blinkies-sidebar-box,
  #palace-view.public-palace-card .public-palace-left .blinkies-sidebar-box {
    min-height: 360px !important;
  }
}

/* v81: force public profile collectibles panel to stretch with the right column */
.public-palace-card .palace-layout.public-palace-layout,
#palace-view.public-palace-card .palace-layout.public-palace-layout {
  align-items: stretch !important;
}
.public-palace-card .public-palace-left,
#palace-view.public-palace-card .public-palace-left {
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
  height: auto !important;
}
.public-palace-card .public-palace-left .blinkies-sidebar-box,
#palace-view.public-palace-card .public-palace-left .blinkies-sidebar-box,
#blinkies-sidebar-box.blinkies-sidebar-box {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 900px !important;
}
.public-palace-card .public-palace-left .blinkies-view,
#palace-view.public-palace-card .public-palace-left .blinkies-view,
#blinkies-sidebar-box .blinkies-view {
  flex: 1 1 auto !important;
  align-items: flex-start !important;
  align-content: flex-start !important;
  justify-content: flex-start !important;
}
