/* =========================================================
   Lawliet's Lair — from-scratch layout & window styling
   Written against the real markup structure (header, #desktop-container,
   main > .left/.middle/.right > section > .window > .title/.content).
   No original assets/CSS used — pure recreation, design only.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap');

:root {
  --bg-lavender: #cbb6e0;
  --window-bg: #ffffff;
  --window-border-outer: #abfaf9;
  --window-border: #553799;
  --titlebar-bg: #f1c2ec;
  --titlebar-text: #4d23cf;
  --text-color: #4a3966;
  --link: #4d23cf;
  --link-visited: #8a76a8;
  --accent-blue: #abfaf9;
  --accent-pink: #e35b9b;
  --font-ui: 'Silkscreen', Verdana, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-color);
  background-color: var(--bg-lavender);
  background-image: url('/bg-tile.jpg');
  background-repeat: repeat;
}

/* ---------- Header: logo + icon rows ---------- */
header {
  padding: 16px 12px 8px;
}

header .center {
  display: flex;
  justify-content: center;
}

#header-name {
  max-width: 420px;
  width: 90%;
  height: auto;
}

#desktop-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 900px;
  margin: 8px auto 0;
  padding: 0 8px;
}

.desktop {
  display: flex;
  gap: 20px;
}

.desktop .app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 10px;
  width: 56px;
  text-align: center;
}

.desktop .app img {
  width: 32px;
  height: 32px;
}

.desktop .app:hover {
  color: var(--accent-pink);
}

/* ---------- Main 3-column layout ---------- */
main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  max-width: 1080px;
  margin: 16px auto;
  padding: 0 12px 40px;
  flex-wrap: wrap;
}

main .left,
main .right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 280px;
  flex: 0 0 280px;
}

main .middle {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 360px;
  flex: 0 0 360px;
}

/* ---------- Window card: matches the user's reference drawing ---------- */
.window {
  background: var(--window-bg);
  border: 3px solid var(--window-border-outer);
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px var(--window-border);
  overflow: hidden;
  position: relative;
  padding-bottom: 22px; /* room for footer bar */
}

/* ---------- Title bar ---------- */
.title {
  padding: 5px 8px 5px 6px;
  background: var(--titlebar-bg);
  color: var(--titlebar-text);
  font-size: 11px;
  font-weight: bold;
  border-bottom: 3px solid var(--window-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.title .label {
  display: flex;
  align-items: center;
}

.title span { display: inline-block; }

/* filled rounded-square icon before the label */
.title::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 4px;
  background: var(--titlebar-text);
  flex-shrink: 0;
}

.title.ico-love::before,
.title.ico-smile::before,
.title.ico-star::before { background: var(--accent-pink); }

.title.ico-warning::before { background: #f4c542; }

/* three window-control icons, top-right — boxed icon images */
.title::after {
  content: '';
  width: 88px;
  height: 26px;
  flex-shrink: 0;
  background-image: url('/icon_minimize_boxed.png'), url('/icon_maximize_boxed.png'), url('/icon_close_boxed.png');
  background-repeat: no-repeat;
  background-size: 26px 26px, 26px 26px, 26px 26px;
  background-position: 0 0, 31px 0, 62px 0;
  image-rendering: pixelated;
}

/* ---------- Footer status bar (matches reference: cyan bar + pill) ---------- */
.window::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20px;
  background-color: var(--window-border-outer);
  background-image: url('/footer_pill.png');
  background-repeat: no-repeat;
  background-position: 6px center;
  border-top: 2px solid var(--window-border);
  image-rendering: pixelated;
  pointer-events: none;
}

/* ---------- Content area ---------- */
.content {
  padding: 10px;
  line-height: 1.5;
}

.content img { max-width: 100%; height: auto; display: block; }

.content ul { margin: 4px 0; padding-left: 18px; }

/* ---------- Scrollable content (chat, updates, achievements) ---------- */
.content[style*="height"] { overflow-y: auto; }

.content::-webkit-scrollbar { width: 7px; }
.content::-webkit-scrollbar-track { background: #ece3f5; }
.content::-webkit-scrollbar-thumb { background: #b79fce; border-radius: 4px; }

/* ---------- Links ---------- */
a { color: var(--link); text-decoration: underline; }
a:visited { color: var(--link-visited); }
a:hover { color: var(--accent-pink); }

/* ---------- Buttons row (88x31 webring badges) ---------- */
.banners { display: flex; flex-wrap: wrap; gap: 4px; }
.banners img,
#buttons-misc img { width: 88px; height: 31px; border: 1px solid var(--window-border); }

/* ---------- Blog entries ---------- */
.blog-frame {
  border: 1px solid var(--window-border);
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
}

.subtitle, .site-date { color: var(--link-visited); font-size: 10px; }

/* ---------- Music player ---------- */
.mp-title {
  font-size: 11px;
  font-weight: bold;
  color: var(--titlebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px !important;
}

.mp-thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border: 1px solid var(--window-border);
  background: #ffffff;
  flex-shrink: 0;
}

.mp-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.mp-top-row {
  display: flex;
  justify-content: flex-end;
}

.mp-bottom-row {
  display: flex;
  align-items: center;
  gap: 3px;
}

.mp-icon-btn {
  background: none;
  border: none;
  padding: 2px;
  margin: 0;
  color: var(--window-border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mp-icon-btn:hover { color: var(--accent-pink); }

.mp-play-btn svg { width: 16px; height: 16px; }

.mp-seek {
  position: relative;
  flex: 1;
  height: 12px;
  margin: 0 6px;
  cursor: pointer;
}

.mp-seek-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--window-border);
  transform: translateY(-50%);
}

.mp-seek-fill {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--window-border);
  transform: translateY(-50%);
}

.mp-seek-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 6px;
  height: 6px;
  background: var(--window-border);
  transform: translate(-50%, -50%);
}

.mp-time {
  font-size: 9px;
  color: var(--window-border);
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'Courier New', monospace;
}

/* ---------- Webring caption ---------- */
.webring-caption {
  text-align: center;
  font-size: 9px;
  line-height: 1.6;
  color: var(--text-color);
  margin: 6px 0 0;
}

.webring-caption a {
  text-decoration: underline;
}

/* ---------- Decorative vertical sidebar banner (left edge) ---------- */
#nso-sidebar {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  image-rendering: pixelated;
  width: 24px;
  height: auto;
  pointer-events: none;
  display: none;
}

@media (min-width: 1180px) {
  #nso-sidebar { display: block; }
}
@media (max-width: 720px) {
  main { flex-direction: column; align-items: center; }
  main .left, main .middle, main .right { width: 100%; max-width: 380px; flex: none; }
  #desktop-container { flex-direction: column; gap: 10px; align-items: center; }
}
