/* Tom's Face base layout. Colors come from the tokens below.
   css/themes.css overrides the tokens per body.theme-* class (Pimp My Profile). */
:root {
  --page-bg: #e5e5e5;
  --page-bg-img: none;
  --page-w: 820px;
  --text: #000;
  --muted: #555;
  --link: #003399;
  --link-hover: #cc0000;
  --top-bg: #003399;
  --top-text: #fff;
  --nav-bg: #6698cb;
  --nav-text: #fff;
  --box-bg: #fff;
  --box-border: #6698cb;
  --head-bg: #6698cb;
  --head-text: #fff;
  --hot-bg: #ffcc99;
  --hot-text: #ff6600;
  --accent: #ff6600;
  --online: #00aa00;
  --font: Verdana, Tahoma, Arial, sans-serif;
  --font-head: Arial, Helvetica, sans-serif;
  --radius: 0px;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page-bg) var(--page-bg-img);
  color: var(--text);
  font: 11px/1.45 var(--font);
  overflow-x: hidden;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }

#page { max-width: var(--page-w); margin: 0 auto; background: transparent; }

/* ---------- top bar ---------- */
#topbar { background: var(--top-bg); color: var(--top-text); }
.topbar-inner { display: flex; align-items: center; gap: 12px; padding: 8px 10px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--top-text); text-decoration: none; }
.logo-mark { display: inline-grid; grid-template-columns: repeat(3, 9px); gap: 2px; }
.logo-mark i { width: 9px; height: 9px; border-radius: 50%; background: var(--top-text); }
.logo-mark i:nth-child(2) { transform: translateY(-3px); }
.logo-word { font: bold 26px/1 var(--font-head); letter-spacing: -1px; text-transform: lowercase; }
.logo-word sup { font-size: 9px; letter-spacing: 0; opacity: .7; }
.logo-tag { font-size: 10px; opacity: .85; align-self: flex-end; padding-bottom: 3px; }
.top-search { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.top-search label { font-weight: bold; }
.top-search input { width: 230px; font: 11px var(--font); padding: 2px 4px; border: 1px solid #7f9db9; }
.top-search select { font: 11px var(--font); }
.top-search button { font-size: 11px; }
.topbar-links { font-size: 10px; }
.topbar-links a { color: var(--top-text); }
#nav { background: var(--nav-bg); padding: 4px 8px; font-size: 10px; color: var(--nav-text); text-align: center; line-height: 1.9; }
#nav a { color: var(--nav-text); font-weight: bold; text-decoration: none; white-space: nowrap; }
#nav a:hover { text-decoration: underline; }

/* ---------- ticker ---------- */
.ticker { overflow: hidden; background: #000; color: #ffff00; font: bold 11px/22px var(--font); white-space: nowrap; border-bottom: 2px solid var(--accent); }
.ticker-track { display: inline-block; padding-left: 100%; animation: ticker 60s linear infinite; }
.ticker-track span { margin-right: 48px; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ---------- 2 columns ---------- */
#profile { display: grid; grid-template-columns: 300px 1fr; gap: 12px; padding: 12px 10px; background: transparent; }
.col-left, .col-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.box { background: var(--box-bg); border: 1px solid var(--box-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; }
.box h2 { margin: -8px -8px 8px; padding: 3px 6px; background: var(--head-bg); color: var(--head-text); font: bold 12px var(--font-head); border-radius: var(--radius) var(--radius) 0 0; }
.box h2 .sub { font-weight: normal; font-size: 10px; }
.box h2 .sub a { color: var(--head-text); }
.box h3 { margin: 10px 0 4px; color: var(--hot-text); font: bold 12px var(--font-head); }
.box-friends h2, .box-comments h2, .box-blog h2 { background: var(--hot-bg); color: var(--hot-text); }
.box-friends h2 .sub a, .box-comments h2 .sub a, .box-blog h2 .sub a { color: var(--hot-text); }

/* id box */
.box-id { border: none; background: transparent; box-shadow: none; padding: 0; }
.profile-name { margin: 0 0 6px; font: bold 22px var(--font-head); color: var(--text); }
.id-row { display: flex; gap: 10px; }
.profile-pic { padding: 0; border: 0; background: none; flex: 0 0 170px; }
.profile-pic img { display: block; width: 170px; height: auto; border: 1px solid #999; }
.id-meta p { margin: 0 0 8px; }
.id-meta .quote { font-style: italic; }
.online { color: var(--online); font-weight: bold; }
.online-dot { display: inline-block; width: 9px; height: 9px; background: var(--online); border-radius: 50%; margin-right: 4px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.mood, .viewmy { margin: 6px 0 0; }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 6px; }
.contact-grid button { display: flex; align-items: center; gap: 5px; background: none; border: 0; padding: 2px 0; color: var(--link); text-align: left; font-size: 10px; font-weight: bold; }
.contact-grid button:hover { color: var(--link-hover); text-decoration: underline; }
.ci { width: 16px; height: 13px; flex: 0 0 16px; border: 1px solid #7a9cc9; background: linear-gradient(#fff, #c9dbf2); border-radius: 2px; position: relative; }
.ci::after { content: "+"; position: absolute; inset: -2px 0 0; text-align: center; font: bold 10px/14px Arial; color: #036; }
.ci-msg::after { content: "@"; } .ci-fwd::after { content: ">"; } .ci-fav::after { content: "*"; color: #e8a400; }
.ci-im::after { content: "IM"; font-size: 7px; } .ci-block::after { content: "x"; color: #c00; }
.ci-grp::after { content: "#"; } .ci-rank::after { content: "8"; color: #c60; }

/* url / CA */
.url-line { margin: 0 0 8px; font-weight: bold; }
.ca-line { display: block; width: 100%; text-align: left; background: #ffffcc; border: 1px dashed var(--accent); padding: 5px; }
.ca-line code { font: 10px/1.3 "Courier New", monospace; word-break: break-all; }

/* tables */
table.kv { width: 100%; border-collapse: separate; border-spacing: 2px; }
table.kv th { width: 34%; background: #b1d0f0; color: #336699; text-align: left; vertical-align: top; padding: 3px; font-weight: bold; }
table.kv td { background: #d5e8fb; padding: 3px; vertical-align: top; word-break: break-word; }

/* network box */
.box-network { border: 1px solid #ccc; text-align: center; }
.network-line { margin: 6px 0 2px; font: bold 17px var(--font-head); color: var(--text); }
.network-sub { margin: 0 0 4px; color: var(--muted); }

/* blog */
.blog-list { margin: 0; padding-left: 16px; }
.blog-list li { margin: 3px 0; }
.blog-list a { font-weight: bold; }
.blog-list .when { color: var(--muted); }

/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.photo-grid button { padding: 0; border: 1px solid #999; background: #000; aspect-ratio: 1; overflow: hidden; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.photo-grid button:hover img { transform: scale(1.08) rotate(-2deg); }

/* comments */
.comments-count { margin: 0 0 6px; }
.comment-list { display: flex; flex-direction: column; gap: 3px; }
.comment { display: grid; grid-template-columns: 110px 1fr; gap: 6px; background: #ffcc99; padding: 4px; }
.comment .who { text-align: center; font-weight: bold; min-width: 0; overflow-wrap: anywhere; }
.comment .who img { display: block; width: 90px; height: 90px; object-fit: cover; margin: 3px auto 0; border: 1px solid #999; }
.comment .body { background: #f9e0c7; padding: 5px; min-width: 0; }
.comment .when { color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.comment .body img { display: block; max-width: 100%; max-height: 320px; margin-top: 6px; border: 2px solid #fff; cursor: zoom-in; }
.add-comment { display: grid; gap: 4px; margin-top: 10px; border-top: 1px dashed var(--box-border); padding-top: 8px; }
.add-comment input, .add-comment textarea { font: 11px var(--font); padding: 3px; border: 1px solid #7f9db9; }
.add-comment button { justify-self: start; }
.fine { color: var(--muted); font-size: 10px; margin: 0; }

/* chart */
.chart-frame iframe { width: 100%; height: 360px; border: 0; display: block; }

/* footer */
#footer { text-align: center; padding: 14px 10px 40px; font-size: 10px; color: var(--muted); }
#footer .disclaimer { max-width: 620px; margin: 8px auto; }

/* ---------- popups (XP style) ---------- */
#popLayer { position: fixed; inset: 0; pointer-events: none; z-index: 900; }
.xp-win { position: absolute; pointer-events: auto; min-width: 260px; max-width: min(92vw, 560px); background: #ece9d8; border: 1px solid #0831d9; border-radius: 7px 7px 0 0; box-shadow: 3px 3px 12px rgba(0,0,0,.45); font: 11px Tahoma, var(--font); color: #000; }
.xp-win.modal { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); max-height: 88vh; display: flex; flex-direction: column; }
.xp-title { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; background: linear-gradient(#0a5fe6, #0844c5 40%, #0b3fb9); color: #fff; font-weight: bold; border-radius: 6px 6px 0 0; cursor: move; user-select: none; }
.xp-title span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-close { width: 21px; height: 21px; border: 1px solid #fff; border-radius: 3px; background: linear-gradient(#e37b5b, #c1381c); color: #fff; font: bold 12px/1 Arial; padding: 0; }
.xp-body { padding: 12px; overflow: auto; }
.xp-body img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; }
.xp-btns { display: flex; justify-content: center; gap: 8px; padding: 0 12px 12px; flex-wrap: wrap; }
.xp-btns button { min-width: 75px; padding: 3px 10px; background: linear-gradient(#fff, #e3e3db); border: 1px solid #003c74; border-radius: 3px; }
.xp-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); pointer-events: auto; }

#toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(120px); background: #ffffe1; border: 1px solid #000; padding: 6px 12px; font: 11px Tahoma, var(--font); z-index: 1000; transition: transform .25s; box-shadow: 2px 2px 6px rgba(0,0,0,.3); max-width: 90vw; }
#toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- phone ---------- */
@media (max-width: 720px) {
  #profile { grid-template-columns: 1fr; padding: 10px 8px; }
  .top-search { margin-left: 0; width: 100%; }
  .top-search input { flex: 1; width: auto; min-width: 0; }
  .top-search select { display: none; }
  .comment { grid-template-columns: 80px 1fr; }
  .comment .who img { width: 64px; height: 64px; }
  .logo-word { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .online-dot { animation: none; }
}

.comment-more { display: block; width: 100%; margin-top: 6px; padding: 6px; background: var(--hot-bg); color: var(--hot-text); border: 1px solid var(--hot-text); font-weight: bold; }
.comment .body img { max-height: 260px; }

/* phone: one column, most important boxes first */
@media (max-width: 720px) {
  .col-left, .col-right { display: contents; }
  #profile > * , .col-left > *, .col-right > * { min-width: 0; }
  .box-id { order: 1; } .box-contact { order: 2; } .box-url { order: 3; } .box-network { order: 4; }
  .box-friends { order: 5; } .box-song { order: 6; } .box-blog { order: 7; } .box-chart { order: 8; }
  .box-card { order: 9; } .box-photos { order: 10; } .box-blurbs { order: 11; } .box-comments { order: 12; }
  .box-layouts { order: 13; } .box-table { order: 14; }
}
.chart-frame { min-height: 360px; background: #131722; }
