/* Base profile layout. Every theme in themes.css only changes these variables (plus a few extras). */
body.profile-page {
  --bg: #e5e5e5;
  --bg-image: none;
  --bg-repeat: repeat;
  --bg-size: auto;
  --bg-pos: top left;
  --bg-attach: scroll;
  --wrap-bg: transparent;
  --text: #000;
  --muted: #666;
  --link: #003399;
  --box: #ffffff;
  --box-alpha: 100%;
  --border: #6699cc;
  --border-w: 1px;
  --border-style: solid;
  --head-bg: #6699cc;
  --head-text: #ffffff;
  --head2-bg: #ffcc99;
  --head2-text: #ff6600;
  --accent: #6699cc;
  --cell-head: color-mix(in srgb, var(--accent) 24%, var(--box));
  --cell-head-text: var(--text);
  --cell-bg: color-mix(in srgb, var(--accent) 9%, var(--box));
  --name: var(--text);
  --font: Verdana, Geneva, sans-serif;
  --head-font: var(--font);
  --name-font: var(--head-font);
  --font-size: 12px;
  --name-size: 1.7em;
  --radius: 0px;
  --shadow: none;
  --cursor: auto;
  --player-bg: #1d1d1d;
  --player-text: #f2f2f2;
  --player-accent: #6699cc;

  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-repeat: var(--bg-repeat);
  background-size: var(--bg-size);
  background-position: var(--bg-pos);
  background-attachment: var(--bg-attach);
  font-family: var(--font);
  font-size: var(--font-size);
  line-height: 1.45;
  cursor: var(--cursor);
  overflow-x: hidden;
}
.profile-page a { color: var(--link); cursor: inherit; }
.profile-page a:hover { text-decoration: underline; }
.profile-page img { max-width: 100%; }
.profile-page .muted { color: var(--muted); }
.profile-page button { cursor: pointer; }

.pf-wrap { max-width: 900px; margin: 14px auto 40px; padding: 12px; background: var(--wrap-bg); position: relative; z-index: 1; }
.pf-grid { display: grid; grid-template-columns: minmax(0, 310px) minmax(0, 1fr); gap: 14px; align-items: start; }
.pf-left, .pf-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.pf-preview-flag { position: sticky; top: 0; z-index: 30; background: #fff3a0; color: #5a4a00; font: bold 12px Verdana, sans-serif; text-align: center; padding: 5px; border: 1px solid #d4b106; margin-bottom: 10px; }

/* ---------- boxes ---------- */
.pf-box {
  background: color-mix(in srgb, var(--box) var(--box-alpha), transparent);
  border: var(--border-w) var(--border-style) var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0 10px 10px;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.pf-box > h2 {
  margin: 0 -10px 8px;
  padding: 4px 10px;
  background: var(--head-bg);
  color: var(--head-text);
  font: bold 1.05em/1.35 var(--head-font);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; justify-content: space-between;
}
.pf-box.alt > h2 { background: var(--head2-bg); color: var(--head2-text); }
.pf-box > h2 .h-link { color: inherit; font-size: .85em; font-weight: normal; }
.pf-box h3 { font: bold 1em var(--head-font); color: var(--head2-text); margin: 10px 0 4px; }
.pf-box.alt h3 { color: var(--accent); }

/* ---------- identity ---------- */
.pf-identity { padding: 4px 2px; }
.pf-name { margin: 0 0 8px; font: bold var(--name-size)/1.15 var(--name-font); color: var(--name); overflow-wrap: anywhere; }
.pf-id-row { display: flex; gap: 10px; align-items: flex-start; }
.pf-avatar { width: 150px; max-width: 48%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--border); border-radius: min(var(--radius), 12px); background: #f3f3f3; flex: none; }
.pf-avatar.small { width: 80px; }
.pf-id-info { display: grid; gap: 2px; font-size: .95em; min-width: 0; overflow-wrap: anywhere; }
.pf-headline { font-style: italic; margin-bottom: 6px; }
.pf-lastlogin { margin-top: 6px; color: var(--muted); font-size: .92em; }
.pf-online { color: #2ecc40; font-weight: bold; margin-top: 4px; text-shadow: 0 0 1px rgba(0, 0, 0, .4); }
.pf-mood { margin-top: 8px; }
.pf-views { margin-top: 4px; }
.pf-viewmy { margin-top: 6px; font-size: .95em; }
.pf-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; padding: 0; }
.pf-badges li { border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-size: .9em; background: color-mix(in srgb, var(--box) var(--box-alpha), transparent); }

.pf-story-ring { position: relative; flex: none; width: 150px; max-width: 48%; padding: 4px; border-radius: 14px; background: conic-gradient(#feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75); line-height: 0; text-decoration: none; }
.pf-story-ring .pf-avatar { width: 100%; max-width: none; border: 3px solid #fff; border-radius: 10px; }
.pf-story-label { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); background: #d62976; color: #fff; font: bold 11px/1.6 Verdana, sans-serif; padding: 0 8px; border-radius: 999px; border: 2px solid #fff; white-space: nowrap; }

/* ---------- likes + keep me updated ---------- */
.pf-likes { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .95em; }
.pf-like { font: bold 1em var(--font); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: color-mix(in srgb, var(--box) var(--box-alpha), transparent); color: var(--link); }
.pf-like.on { background: #ff2d55; border-color: #ff2d55; color: #fff; }
.pf-like.small { padding: 0 8px; font-size: .9em; }
.pf-like-text { color: var(--muted); }
.pf-watch-box { margin-top: 10px; padding: 8px; border: 2px dashed var(--accent); border-radius: min(var(--radius), 10px); background: color-mix(in srgb, var(--box) var(--box-alpha), transparent); }
.pf-watch { display: block; width: 100%; text-align: center; font: bold 1.05em var(--font); padding: 8px; border: 0; border-radius: min(var(--radius), 8px); background: linear-gradient(90deg, #ff512f, #dd2476); color: #fff; text-decoration: none; box-shadow: 0 3px 10px rgba(221, 36, 118, .35); animation: ns-nudge 4s ease-in-out infinite; }
.profile-page a.pf-watch { color: #fff; }
.pf-watch.on { background: #2e7d32; box-shadow: none; animation: none; }
@keyframes ns-nudge { 0%, 90%, 100% { transform: none; } 93% { transform: rotate(-2deg) scale(1.03); } 96% { transform: rotate(2deg) scale(1.03); } }
.pf-watch-fomo { margin-top: 6px; font-size: .9em; color: var(--muted); text-align: center; }
.pf-comment-likes { margin-top: 4px; }
.pf-friend .avatar-wrap { width: 100%; max-width: 96px; line-height: 0; }
.pf-friend .avatar-wrap img { width: 100%; }
.avatar-wrap.story-ring { padding: 3px; border-radius: 10px; background: conic-gradient(#feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75); }
.avatar-wrap.story-ring img { border: 2px solid #fff; }

/* ---------- contacting / url / tables ---------- */
.pf-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.pf-contact-grid a, .pf-contact-grid button, .pf-contact-note {
  display: flex; align-items: center; gap: 6px; font: bold .95em var(--font); color: var(--link);
  background: none; border: 0; padding: 2px 0; text-align: left; text-decoration: none;
}
.pf-contact-grid form { margin: 0; }
.pf-contact-grid button:hover, .pf-contact-grid a:hover { text-decoration: underline; }
.pf-contact-note { color: var(--muted); }
.pf-contact .ic { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--border); background: var(--cell-bg); font-size: 11px; color: var(--accent); border-radius: min(var(--radius), 4px); flex: none; }
.pf-url-text { font-size: .95em; word-break: break-all; }
.pf-table { width: 100%; border-collapse: separate; border-spacing: 2px; }
.pf-table th { width: 32%; background: var(--cell-head); color: var(--cell-head-text); text-align: left; vertical-align: top; padding: 4px; font-weight: bold; }
.pf-table td { background: var(--cell-bg); padding: 4px; vertical-align: top; }

/* ---------- right column ---------- */
.pf-network { border: var(--border-w) var(--border-style) var(--border); border-radius: var(--radius); padding: 12px; background: color-mix(in srgb, var(--box) var(--box-alpha), transparent); box-shadow: var(--shadow); }
.pf-network h2 { margin: 0; font: bold 1.35em/1.25 var(--head-font); color: var(--text); }
.pf-blog-list { margin: 0; padding-left: 18px; }
.pf-blog-list li { margin: 3px 0; }
.rich { overflow-wrap: anywhere; }
.rich img { height: auto; }
.rich p:first-child { margin-top: 0; }
.rich table { max-width: 100%; }
blink { animation: ns-blink 1s steps(2, start) infinite; }
@keyframes ns-blink { to { visibility: hidden; } }

/* ---------- friend space ---------- */
.pf-friend-count .count { color: #e00; font-size: 1.1em; }
.pf-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; }
.pf-top.top-24 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pf-friend { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; text-decoration: none; position: relative; font-size: .92em; }
.pf-friend-name { font-weight: bold; overflow-wrap: anywhere; line-height: 1.2; min-height: 2.4em; display: flex; align-items: flex-end; }
.pf-friend img { width: 100%; max-width: 96px; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--border); background: #eee; }
.pf-friend-online { position: absolute; right: 8%; bottom: 4px; width: 10px; height: 10px; border-radius: 50%; background: #2ecc40; border: 2px solid #fff; }

.friends-polaroid .pf-friend { background: #fff; color: #222; padding: 6px 6px 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); flex-direction: column-reverse; }
.friends-polaroid .pf-friend:nth-child(odd) { transform: rotate(-2.5deg); }
.friends-polaroid .pf-friend:nth-child(even) { transform: rotate(2deg); }
.friends-polaroid .pf-friend:hover { transform: rotate(0) scale(1.06); z-index: 2; }
.friends-polaroid .pf-friend-name { color: #333; font: 1em "Comic Sans MS", "Marker Felt", cursive; min-height: 0; }
.friends-polaroid .pf-friend img { border: 0; max-width: none; }
.friends-bubbles .pf-friend img { border-radius: 50%; border: 3px solid var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.friends-bubbles .pf-friend { flex-direction: column-reverse; }
.friends-bubbles .pf-friend-name { min-height: 0; }
.friends-list .pf-top, .friends-list .pf-top.top-24 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.friends-list .pf-friend { flex-direction: row-reverse; justify-content: flex-end; gap: 8px; text-align: left; }
.friends-list .pf-friend img { width: 36px; }
.friends-list .pf-friend-name { min-height: 0; }
.friends-list .pf-friend-online { left: 28px; right: auto; }

/* ---------- friend groups ---------- */
.pf-group-list { display: grid; gap: 6px; }
.pf-group { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 8px; border-left: 5px solid var(--gc); background: var(--cell-bg); text-decoration: none; border-radius: min(var(--radius), 6px); }
.pf-group-faces { display: flex; align-items: center; gap: 2px; font-size: .9em; }
.pf-group-faces img { width: 24px; height: 24px; object-fit: cover; border-radius: 50%; border: 2px solid var(--box); margin-left: -6px; }
.pf-group-faces img:first-child { margin-left: 0; }
.pf-group-faces .muted { margin-left: 6px; }

/* ---------- comments ---------- */
.pf-comment-list { display: grid; gap: 3px; }
.pf-comment { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 3px; }
.pf-comment-who { background: var(--cell-head); color: var(--link); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; text-align: center; font-weight: bold; text-decoration: none; overflow-wrap: anywhere; }
.pf-comment-who img { width: 80px; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--border); }
.pf-online-small { font-size: .8em; color: #2ecc40; }
.pf-comment-body { background: var(--cell-bg); padding: 6px 8px; min-width: 0; }
.pf-comment-date { font-weight: bold; margin-bottom: 4px; }
.pf-comment-del { margin-top: 6px; }
.pf-comment-del .linkish { color: var(--muted); font-size: .9em; background: none; border: 0; text-decoration: underline; padding: 0; }
.pf-comment-form { margin-top: 10px; }
.pf-comment-form label { display: block; margin-bottom: 4px; }
.pf-comment-form textarea { width: 100%; font: 1em var(--font); padding: 6px; background: #fff; color: #222; border: 1px solid var(--border); border-radius: min(var(--radius), 8px); }
.pf-comment-form button { margin-top: 6px; font: bold 1em var(--font); padding: 5px 14px; background: var(--head-bg); color: var(--head-text); border: 1px solid var(--border); border-radius: min(var(--radius), 8px); }

/* ---------- music player ---------- */
.pf-player { padding: 8px; }
.np-player { display: flex; align-items: center; gap: 10px; background: var(--player-bg); color: var(--player-text); padding: 8px 10px; border-radius: min(var(--radius), 10px); font-family: Verdana, sans-serif; font-size: 11px; }
.np-play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--player-accent); background: radial-gradient(circle at 35% 30%, #fff8, transparent 60%), var(--player-accent); color: #fff; font-size: 15px; display: grid; place-items: center; padding: 0; }
.np-meta { flex: 1; min-width: 0; }
.np-title { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-bar { height: 6px; background: rgba(255, 255, 255, .2); border-radius: 3px; margin: 5px 0 3px; cursor: pointer; }
.np-progress { height: 100%; width: 0; background: var(--player-accent); border-radius: 3px; }
.np-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.np-vol { width: 70px; accent-color: var(--player-accent); padding: 0; border: 0; background: none; }
.np-viz { display: flex; gap: 2px; align-items: flex-end; height: 26px; flex: none; }
.np-viz i { width: 4px; height: 20%; background: var(--player-accent); border-radius: 1px; transition: height .2s; }
.np-player.playing .np-viz i { animation: np-eq .9s ease-in-out infinite alternate; }
.np-player.playing .np-viz i:nth-child(2) { animation-delay: -.3s; animation-duration: .7s; }
.np-player.playing .np-viz i:nth-child(3) { animation-delay: -.6s; }
.np-player.playing .np-viz i:nth-child(4) { animation-delay: -.2s; animation-duration: 1.1s; }
.np-player.playing .np-viz i:nth-child(5) { animation-delay: -.5s; animation-duration: .8s; }
.np-player.playing .np-viz i:nth-child(6) { animation-delay: -.1s; }
.np-player.playing .np-viz i:nth-child(7) { animation-delay: -.4s; animation-duration: .6s; }
@keyframes np-eq { from { height: 15%; } to { height: 100%; } }
.np-embed-title { font-weight: bold; margin-bottom: 6px; }
.np-embed { width: 100%; border: 0; display: block; border-radius: min(var(--radius), 12px); }
.np-yt { aspect-ratio: 16 / 9; }
.np-sc { height: 120px; }
.np-sp { height: 152px; }

/* ---------- marquee + glitter name ---------- */
.pf-marquee { overflow: hidden; white-space: nowrap; border: var(--border-w) var(--border-style) var(--border); background: color-mix(in srgb, var(--box) var(--box-alpha), transparent); border-radius: var(--radius); margin-bottom: 12px; padding: 4px 0; font-weight: bold; color: var(--accent); }
.pf-marquee span { display: inline-block; padding-left: 100%; animation: ns-marquee 16s linear infinite; }
@keyframes ns-marquee { to { transform: translateX(-100%); } }
.glitter-name .pf-name span {
  background: linear-gradient(90deg, #ff3cac, #ffd23f, #3bff9b, #3ad7ff, #b26bff, #ff3cac);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: ns-glitter 2.5s linear infinite;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, .9));
}
.glitter-name .pf-name::after { content: " \2728"; }
@keyframes ns-glitter { to { background-position: -200% 0; } }

/* ---------- effects layer (falling things, cursor trails) ---------- */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.fx-fall { position: absolute; top: -40px; will-change: transform; animation-name: ns-fall; animation-timing-function: linear; animation-fill-mode: forwards; user-select: none; }
@keyframes ns-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate(var(--drift, 30px), 110vh) rotate(var(--spin, 180deg)); opacity: .8; }
}
.fx-bubble { border-radius: 50%; border: 1px solid rgba(255, 255, 255, .8); background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .9), rgba(255, 255, 255, .15) 40%, rgba(120, 200, 255, .15)); animation-name: ns-rise; top: auto; bottom: -40px; }
@keyframes ns-rise {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate(var(--drift, 30px), -110vh); opacity: .6; }
}
.fx-trail { position: fixed; pointer-events: none; z-index: 41; animation: ns-trail .8s ease-out forwards; user-select: none; transform: translate(-50%, -50%); }
@keyframes ns-trail { to { opacity: 0; transform: translate(-50%, 10px) scale(.3); } }
.fx-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---------- layouts ---------- */
.layout-flipped .pf-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 310px); }
.layout-flipped .pf-left { order: 2; }
.layout-single .pf-wrap { max-width: 680px; }
.layout-single .pf-grid { grid-template-columns: minmax(0, 1fr); }
.layout-bento .pf-wrap { max-width: 1100px; }
.layout-bento .pf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 16px; }
.layout-bento .pf-left, .layout-bento .pf-right { display: contents; }
.layout-bento .pf-identity { grid-row: span 2; background: color-mix(in srgb, var(--box) var(--box-alpha), transparent); border: var(--border-w) var(--border-style) var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.layout-bento .pf-id-row { flex-direction: column; }
.layout-bento .pf-avatar { width: 100%; max-width: 100%; }
.layout-bento .pf-network, .layout-bento .pf-blurbs, .layout-bento .pf-friends { grid-column: span 2; }
.layout-bento .pf-comments { grid-column: 1 / -1; }
.layout-bento .pf-box { padding: 0 16px 16px; }
.layout-bento .pf-box > h2 { margin: 0 -16px 12px; padding: 10px 16px; }

/* ---------- blog page ---------- */
.pf-blog-page { max-width: 760px; display: grid; gap: 12px; }
.pf-blog-head { display: flex; gap: 12px; align-items: center; background: color-mix(in srgb, var(--box) var(--box-alpha), transparent); border: var(--border-w) var(--border-style) var(--border); border-radius: var(--radius); padding: 10px; }
.pf-blog-head .pf-name { margin-bottom: 4px; }
.pf-post-meta { color: var(--muted); margin-bottom: 8px; }
.clamp { max-height: 12em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .pf-wrap { margin-top: 8px; padding: 8px; }
  .pf-grid, .layout-flipped .pf-grid, .layout-bento .pf-grid { grid-template-columns: minmax(0, 1fr); }
  .layout-flipped .pf-left { order: 0; }
  .layout-bento .pf-network, .layout-bento .pf-blurbs, .layout-bento .pf-friends, .layout-bento .pf-comments { grid-column: auto; }
  .layout-bento .pf-identity { grid-row: auto; }
  .layout-bento .pf-id-row { flex-direction: row; }
  .layout-bento .pf-avatar { width: 150px; max-width: 48%; }
  .pf-top.top-24 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pf-comment { grid-template-columns: 80px minmax(0, 1fr); }
  .pf-comment-who img { width: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-marquee span { animation: none; padding-left: 8px; }
  .glitter-name .pf-name span, blink, .np-player.playing .np-viz i { animation: none; }
  #fx-layer { display: none; }
}
