/* ============================================================
   OpenChat — base skin (authentic Y2K / MySpace era)
   NOTE: users restyle their own pages via custom CSS targeting
   the #profile-root classes below; keep these names stable.
   ============================================================ */
:root {
  --ink: #16203a;
  --paper: #cfe8ff;
  --panel: #ffffff;
  --accent: #2f6bff;      /* electric blue */
  --accent-2: #00b3d6;    /* teal/cyan     */
  --accent-3: #00e0c6;    /* aqua          */
  --lime: #9dff3d;
  --line: #2f6bff;
  --title-grad: linear-gradient(180deg, #3d8bff 0%, #2f6bff 50%, #1f4fd6 100%);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Tahoma, Verdana, Geneva, sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  background:
    radial-gradient(circle at 12% 18%, rgba(0,224,198,.16), transparent 40%),
    radial-gradient(circle at 88% 8%, rgba(47,107,255,.20), transparent 42%),
    linear-gradient(160deg, #d3ebff 0%, #d7e6ff 55%, #cffaf2 100%);
  background-attachment: fixed;
}
a { color: #1f6feb; }
a:hover { color: #00a3c4; }

/* ---- glossy Web-2.0 header ---- */
.site-header {
  display: flex; align-items: center; gap: 16px;
  padding: 9px 18px;
  background: linear-gradient(180deg, #3d8bff, #2f6bff 55%, #1f3fb0);
  border-bottom: 3px solid #00e0c6;
  box-shadow: 0 2px 0 rgba(255,255,255,.4) inset, 0 3px 8px rgba(0,0,0,.25);
  color: #fff;
}
.site-logo {
  color: #fff; font-weight: bold; text-decoration: none; font-size: 20px;
  letter-spacing: .5px; text-shadow: 1px 1px 0 #1f3fb0, 0 0 8px #00e0c6;
}
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-nav a { color: #fff; text-decoration: none; font-weight: bold; text-shadow: 1px 1px 0 rgba(0,0,0,.25); }
.site-nav a:hover { color: var(--lime); }
.inline { display: inline; margin: 0; }

.btn, .site-nav button {
  font: inherit; cursor: pointer; font-weight: bold; color: #fff;
  border: 1px solid #1f3fb0; border-radius: 7px; padding: 6px 14px;
  background: linear-gradient(180deg, #57b0ff 0%, #2f6bff 50%, #1f4fd6 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 3px rgba(0,0,0,.2);
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.btn:hover { filter: brightness(1.06) saturate(1.1); }
.btn:active { transform: translateY(1px); }
.site-nav button { padding: 4px 10px; }
.linkish { background: none; border: 0; color: #1f6feb; cursor: pointer; padding: 0; font: inherit; text-decoration: underline; box-shadow: none; text-shadow: none; }

.site-main { max-width: 920px; margin: 20px auto; padding: 0 16px; }
.site-footer { text-align: center; color: #6a5a99; padding: 26px 0; font-size: 12px; }
.site-footer::before { content: "✧ ˚ ⋆ "; }
.site-footer::after { content: " ⋆ ˚ ✧"; }

h1, h2, h3 { font-family: "Trebuchet MS", Tahoma, sans-serif; }

/* ---- cards & forms ---- */
.card { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: 3px 3px 0 rgba(108,60,233,.25); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-weight: bold; font-size: 13px; color: #5a2fc2; }
.field input, .field textarea, .field select {
  font: inherit; padding: 8px 10px; border: 2px solid #c9b8ff; border-radius: 7px; background: #fff; width: 100%;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent-2); border-color: var(--accent-2); }
.field textarea { min-height: 120px; resize: vertical; }
.field .hint, .hint { color: #7a6ba6; font-size: 12px; }
.error { color: #c62828; font-weight: bold; font-size: 14px; margin-bottom: 10px; background: #ffe3ea; border: 1px solid #ffb3c6; padding: 8px 10px; border-radius: 7px; }
.muted { color: #7a6ba6; }

/* ---- custom CSS editor + live preview ---- */
.css-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; }
.css-editor textarea { min-height: 260px; font-family: "Courier New", monospace; font-size: 13px; }
.css-editor #css-preview {
  width: 100%; min-height: 260px; border: 2px solid #c9b8ff; border-radius: 7px; background: #e9d7ff;
}
code { background: #f1eaff; border: 1px solid #d8ccff; border-radius: 4px; padding: 0 4px; font-size: 12px; }
@media (max-width: 720px) { .css-editor { grid-template-columns: 1fr; } }

/* ---- home feed ---- */
.feed-item { border-bottom: 2px dotted #c9b8ff; padding: 12px 0; }
.feed-item h3 { margin: 0 0 4px; }
.feed-item .byline { font-size: 13px; color: #7a6ba6; }

/* ---- friend grid ---- */
.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.friend-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; border: 2px solid #c9b8ff; border-radius: 9px;
  text-align: center; background: linear-gradient(180deg,#fff,#f1eaff); text-decoration: none; font-size: 12px;
}
.friend-cell:hover { border-color: var(--accent-2); }
.friend-cell .friend-name { word-break: break-all; font-weight: bold; }

/* ---- comments / guestbook ---- */
.comment { border-bottom: 2px dotted #c9b8ff; padding: 10px 0; }
.comment:last-of-type { border-bottom: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.comment-head .post-date { color: #7a6ba6; }
.comment-body { margin-top: 4px; }
.comment-body p { margin: 4px 0; }
.comment-form { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.comment-form textarea { width: 100%; font: inherit; padding: 8px 10px; border: 2px solid #c9b8ff; border-radius: 7px; }

/* ============================================================
   Profile fixed layout (custom CSS targets these)
   ============================================================ */
#profile-root { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }
#profile-root .profile-sidebar {
  background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 16px; text-align: center;
  box-shadow: 3px 3px 0 rgba(108,60,233,.25);
}
#profile-root .profile-avatar {
  width: 170px; height: 170px; object-fit: cover; border-radius: 10px;
  border: 3px solid var(--accent-2); background: #eee; display: block; margin: 0 auto 10px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent-3);
}
#profile-root .profile-name { font-size: 20px; font-weight: bold; margin: 6px 0; color: #5a2fc2; }
#profile-root .profile-username { color: #7a6ba6; font-size: 13px; }
#profile-root .profile-visibility { font-size: 12px; margin-top: 8px; }
#profile-root .profile-main { min-width: 0; }
#profile-root .panel {
  background: var(--panel); border: 2px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 18px; box-shadow: 3px 3px 0 rgba(108,60,233,.25);
}
#profile-root .panel h2 {
  margin: -16px -16px 14px; padding: 8px 16px; font-size: 15px; color: #fff;
  background: var(--title-grad); border-radius: 10px 10px 0 0;
  text-shadow: 1px 1px 0 rgba(0,0,0,.3); box-shadow: 0 1px 0 rgba(255,255,255,.4) inset;
}
#profile-root .panel h2::before { content: "★ "; color: var(--lime); }
#profile-root .blog-post { border-bottom: 2px dotted #c9b8ff; padding-bottom: 14px; margin-bottom: 14px; }
#profile-root .blog-post:last-child { border-bottom: 0; margin-bottom: 0; }
#profile-root .blog-post h3 { margin: 0 0 4px; }
#profile-root .blog-post .post-date { color: #7a6ba6; font-size: 12px; }
#profile-root .post-body img { max-width: 100%; }
#profile-root .post-actions { font-size: 13px; margin-top: 6px; }
#profile-root .friend-cell { background: linear-gradient(180deg,#fff,#f1eaff); }

@media (max-width: 640px) {
  #profile-root { grid-template-columns: 1fr; }
}

/* ---- theme presets (starter skins; custom CSS layers on top) ---- */
.theme-neon #profile-root .panel { background: #10021f; color: #f6e8ff; border-color: #ff3df0; }
.theme-neon #profile-root .panel h2 { background: linear-gradient(180deg,#ff5cf5,#ff3df0); color: #10021f; }
.theme-neon #profile-root .profile-sidebar { background: #10021f; color: #f6e8ff; border-color: #3df0ff; }
.theme-neon #profile-root a { color: #3df0ff; }

.theme-y2k #profile-root .panel { background: #eafcff; border-color: #00c2ff; }
.theme-y2k #profile-root .panel h2 { background: linear-gradient(180deg,#37d6ff,#00a6e0); }
.theme-y2k #profile-root .profile-sidebar { background: #e9fff9; border-color: #00e0c6; }

.theme-dark #profile-root .panel,
.theme-dark #profile-root .profile-sidebar { background: #1c1a27; color: #e7e3f5; border-color: #4a3f77; }
.theme-dark #profile-root .panel h2 { background: linear-gradient(180deg,#5a4fa0,#3a3550); }
.theme-dark #profile-root a { color: #b7a6ff; }
