﻿:root {
  --bg: #ffffff;
  --bg2: #f8f9fa;
  --card: #ffffff;
  --card2: #f1f3f5;
  --line: #dddddd;
  --text: #1a1a1a;
  --dim: #666666;
  --acc: #0044cc;
  --acc2: #0077ff;
  --ok: #28a745;
  --warn: #fd7e14;
  --radius: 12px;
  --nav-bg: #ffcc00;
  --foot-bg: #0044cc;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--acc2); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { max-width: 720px; margin: 0 auto; padding: 0 16px; width: 100%; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: var(--nav-bg); border-bottom: 1px solid rgba(0,0,0,0.1); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: 0.06em; color: #000; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  background: #000; color: #fff; font-weight: 800;
}
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav button.link {
  color: rgba(0,0,0,0.6); padding: 8px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; position: relative;
}
.nav a:hover, .nav button.link:hover { color: #000; background: rgba(0,0,0,0.05); text-decoration: none; }
.nav a.on { color: #000; background: rgba(0,0,0,0.08); }
.nav a.cta { background: #000; color: #fff; font-weight: 600; }
.nav a.cta.on { color: #fff; }
.nav .badge {
  position: absolute; top: 2px; right: 2px; margin: 0;
  min-width: 14px; height: 14px; line-height: 14px; font-size: 0.6rem;
}
.navform { display: inline; margin: 0; }
button.link { background: none; border: 0; font: inherit; cursor: pointer; }

/* main */
main { flex: 1; padding: 22px 0 30px; }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 0.95rem; }
.flash.ok { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash.warn { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.low { color: var(--warn); font-weight: 600; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

h1 { font-size: 1.5rem; margin: 0 0 6px; color: #000; }
h2 { font-size: 1.1rem; margin: 0 0 10px; color: #000; }

.hero { padding: 14px 0 6px; }
.hero h1 { font-size: 2rem; color: #000; }
.hero p { color: var(--dim); margin: 4px 0 0; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }

/* forms */
input, textarea, select {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font: inherit; margin-top: 6px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--acc); border-color: transparent; }
input[type="checkbox"], input[type="file"] { width: auto; padding: 0; margin-top: 0; background: none; border: 0; }
label { display: block; margin: 14px 0; font-size: 0.92rem; color: var(--dim); }
label.check { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; cursor: pointer; }
textarea { resize: vertical; }

.settings-av { margin: 16px 0 4px; }
.prof-edit { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.btn {
  display: inline-block; background: var(--acc); color: #fff;
  border: 0; padding: 9px 18px; border-radius: 10px; font-weight: 600; cursor: pointer; font: inherit;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; color: #fff; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--card2); color: var(--text); }

.dim { color: var(--dim); font-size: 0.88rem; }
.center { text-align: center; }
code { background: var(--card2); padding: 1px 6px; border-radius: 6px; }

/* wall */
.wall { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.shout { margin-bottom: 0; }
.shout-head { display: flex; gap: 12px; align-items: center; }
.shout-body { margin: 10px 0 0; white-space: pre-wrap; }
.shout-meta { display: flex; flex-direction: column; line-height: 1.3; }
.shout-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.who { color: var(--text); font-weight: 600; }
.who:hover { color: var(--acc); text-decoration: underline; }
.who.rainbow, .who.rainbow:hover {
  background: linear-gradient(90deg, #ff004c, #ff7a00, #ffe600, #21d07a, #00b3ff, #7a3cff, #ff004c);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  animation: rainbow-shift 3s linear infinite;
}
@keyframes rainbow-shift { to { background-position: 300% 0; } }
.who.mod-sky, .who.mod-sky:hover { color: #007bff; text-decoration: none; }
.who.vip-yellow, .who.vip-yellow:hover { color: #d39e00; text-decoration: none; }
.cc { color: var(--dim); font-size: 0.88rem; }

/* avatars */
.av {
  --h: 200;
  display: inline-block;
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--h), 65%, 55%), hsl(calc(var(--h) + 40), 65%, 40%));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}
.av-img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av.big { width: 64px; height: 64px; }
.av.sm { width: 34px; height: 34px; }
.av.xs { width: 28px; height: 28px; }

.onlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.onlist li { display: flex; align-items: center; gap: 10px; }
.side { margin-top: 12px; }

/* composer */
.composer, .invite { margin-top: 10px; }
.composer textarea { margin-top: 0; background: var(--bg2); }
.invite { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.invite p { flex: 1 0 100%; margin: 0 0 6px; }
.search { display: flex; gap: 10px; }
.search input { margin: 0; }

.empty { color: var(--dim); text-align: center; }
.showall { margin: 10px 0 14px; }
.home-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 18px; }
.home-sections .card { margin: 0; color: var(--text); display: block; }
.home-sections .card:hover { text-decoration: none; border-color: var(--acc); background: var(--card2); }
.home-sections h3 { margin: 0 0 2px; font-size: 1rem; }
.home-sections p { margin: 0; }

/* people grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.person { margin-bottom: 0; }
.person .card-body { margin: 10px 0 0; }

/* profile */
.profhead { padding: 24px; }
.profhead-main { display: flex; gap: 24px; align-items: flex-start; }
.profhead h1 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prof-info { flex: 1; }
.prof-bio { margin: 12px 0; line-height: 1.6; }
.pill { background: var(--card2); border: 1px solid var(--line); color: var(--dim); font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; vertical-align: middle; display: inline-flex; align-items: center; gap: 4px; }
.pill.live { color: var(--ok); border-color: rgba(40, 167, 69, 0.4); }
.male-pill { color: #007bff; border-color: rgba(0, 123, 255, 0.3); background: rgba(0, 123, 255, 0.05); }
.female-pill { color: #e83e8c; border-color: rgba(232, 62, 140, 0.3); background: rgba(232, 62, 140, 0.05); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 5px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

.prof-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }

@media (max-width: 600px) {
  .profhead-main { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
  .profhead h1 { justify-content: center; }
  .prof-actions { justify-content: center; }
  .profhead .pill { justify-content: center; }
}

/* comments & chat */
.comments h2 { margin-bottom: 4px; }
.thread { display: flex; flex-direction: column; gap: 14px; margin: 10px 0 4px; }
.comment { display: flex; gap: 10px; }
.comment .card-body { margin: 2px 0 0; }
.compose-comment { display: flex; gap: 10px; margin-top: 14px; }
.compose-comment input { margin: 0; }

.chatcard { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 12px; flex-wrap: wrap; }
.chat-head h1 { margin: 0; }
.rooms { display: flex; gap: 6px; flex-wrap: wrap; }
.rooms a { color: var(--dim); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.85rem; }
.rooms a:hover { text-decoration: none; color: var(--text); border-color: var(--acc); }
.rooms a.on { background: var(--acc); color: #fff; border-color: transparent; }
.ref-btn { border: 1px solid var(--line); background: var(--card2); color: var(--dim); width: 28px; height: 28px; border-radius: 999px; cursor: pointer; font-size: 1rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.ref-btn:hover { color: var(--text); border-color: var(--acc); }
.ref-btn.spin-on { animation: ref-spin 0.5s ease; color: var(--acc2); border-color: var(--acc2); }
@keyframes ref-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.chatfeed { padding: 16px; display: flex; flex-direction: column; gap: 14px; max-height: 54vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--acc2) var(--card2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--card2); border-radius: 8px; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 8px; border: 2px solid var(--card2); }
::-webkit-scrollbar-thumb:hover { background: #bbb; }
.chat-msg { display: flex; gap: 10px; }
.chat-msg .card-body { margin: 2px 0 0; }
.chatcard .compose-comment { padding: 14px 16px; border-bottom: 1px solid var(--line); margin: 0; }
.chatcard .compose-comment input { margin: 0; }

/* lucky wheels */
.spin { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.spin-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.spin-head h3 { margin: 0; }
.spin-head .dim { margin: 2px 0 0; }
.spin-reels { display: flex; gap: 10px; justify-content: center; padding: 14px 0 10px; }
.spin-reel {
  width: 64px; height: 72px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--card2); border: 1px solid var(--line);
}
.spin-reel img { width: 54px; height: 54px; object-fit: contain; }
.spin-reel.shake { animation: reel-shake 0.4s linear infinite; }
.l9-cards { display: flex; gap: 16px; justify-content: center; align-items: center; padding: 14px 0 10px; }
.l9-card { width: 74px; height: 106px; border-radius: 12px; background: #fff; color: #222; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); border: 1px solid #ddd; font-weight: 700; }
.l9-card .l9-rank { font-size: 38px; line-height: 1; }
.l9-card .l9-suit { font-style: normal; font-size: 24px; line-height: 1; }
.l9-card .red { color: #e3342f; }
.l9-card.shake { animation: reel-shake 0.4s linear infinite; }
.l9-total { font-size: 20px; font-weight: 700; color: var(--acc); min-width: 72px; text-align: center; }
@keyframes reel-shake {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.spin-ctrl { display: flex; align-items: center; gap: 12px; justify-content: center; }
.spin-ok { color: var(--ok); font-weight: 600; }

/* admin panel */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.stat { text-align: center; }
.stat b { font-size: 1.5rem; display: block; color: var(--text); }
.stat span { color: var(--dim); font-size: 0.85rem; }
.member { display: flex; align-items: center; gap: 12px; }
.member-info { flex: 1; min-width: 0; }
.member-info .who { font-weight: 600; }
.btn.danger { color: #dc3545; border: 1px solid #dc3545; background: #fff; }
.btn.danger:hover { background: #dc3545; color: #fff; }
.pill.ban { color: #dc3545; border-color: #dc3545; }
.pill.admin-pill { color: #856404; border-color: #ffeeba; background: #fff3cd; font-weight: 700; }
.pill.mod-pill { color: #004085; border-color: #b8daff; background: #cce5ff; font-weight: 700; }
.pill.vip-pill { color: #d39e00; border-color: #ffeeba; font-weight: 700; }
.ok-c { color: var(--ok); font-weight: 600; }
.row-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.emoji-wrap { position: relative; }
.emoji-btn { background: none; border: none; font-size: 1.15rem; line-height: 1; cursor: pointer; opacity: 0.75; padding: 3px 6px; border-radius: 8px; }
.emoji-btn:hover, .emoji-btn.on { opacity: 1; background: var(--card2); }
.emoji-panel { display: none; position: absolute; left: 0; top: 100%; z-index: 40; width: min(308px, 90vw); margin-top: 6px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1); grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-panel.open { display: grid; }
.emoji-panel button.emoji { background: none; border: none; font-size: 1.25rem; line-height: 1.2; padding: 4px 2px; cursor: pointer; border-radius: 6px; }
.emoji-panel button.emoji:hover { background: var(--card2); }

/* auth */
.auth { max-width: 420px; margin: 20px auto; }
.auth h1 { text-align: center; }
.auth .dim.center { margin: 16px 0 0; }

/* footer */
.foot { background: var(--foot-bg); color: #fff; padding: 24px 0 32px; margin-top: 40px; }
.foot p { margin: 6px 0; }
.foot a { color: #fff; text-decoration: underline; opacity: 0.8; }
.foot a:hover { opacity: 1; }
.foot .dim { color: rgba(255,255,255,0.7); }

/* badges + actions */
.badge { display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 4px; font-size: 0.7rem; font-weight: 700; line-height: 16px; text-align: center; border-radius: 999px; background: var(--acc); color: #fff; }

.act { display: inline-flex; align-items: center; gap: 10px; }
.act form, .inline { display: inline; margin: 0; }
.lk { background: none; border: 0; color: var(--dim); cursor: pointer; font: inherit; font-size: 0.88rem; padding: 2px 4px; }
.lk:hover { color: var(--acc); }
.lk.on { color: var(--acc); }
.likers { margin: 8px 0 0; font-size: 0.82rem; }

/* blogs */
.blogtitle { margin: 10px 0 4px; font-size: 1.2rem; line-height: 1.3; }
.blogtitle a { color: var(--text); }
.blogtitle a:hover { color: var(--acc); text-decoration: none; }
.blogexcerpt { color: var(--dim); margin: 0; }
.blogbody { margin: 8px 0 0; white-space: pre-wrap; }
.auth.wide { max-width: 680px; }
.tall { min-height: 120px; }

/* forum */
.catlink { display: block; }
.catlink:hover { text-decoration: none; border-color: var(--acc); background: var(--card2); }
.catmeta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--dim); font-size: 0.85rem; margin-top: 10px; }
.quote-btn { background: var(--card2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 8px; font-size: 0.8rem; color: var(--dim); cursor: pointer; }
.quote-btn:hover { color: var(--text); border-color: var(--acc); }
select.moodselect { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; }
option { background: #fff; color: #000; }

/* friends */
.addfriend { display: flex; gap: 10px; }
.addfriend input { margin: 0; }
.prof-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.prof-actions form { margin: 0; }
.sm-btn { padding: 6px 12px; font-size: 0.85rem; }

/* inbox */
.unread { border-color: var(--acc); background: #f0f7ff; }
.mood { margin: 6px 0; }
.mood .pill { color: var(--acc); background: #eef4ff; border-color: #d0e1ff; }

/* developer + oauth */
.app-row { background: var(--card2); margin-bottom: 10px; }
.app-row .row-between { margin-top: 0; }
.kv { margin: 6px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kv b { min-width: 84px; color: var(--dim); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; word-break: break-all; }
.codeblock { overflow-x: auto; background: #f8f9fa; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 0.82rem; color: #333; }
.codeblock code { background: none; padding: 0; }
button.lk.warn:hover { color: var(--warn); }
.perm-list { margin: 10px 0; padding-left: 20px; }
.perm-list li { margin: 4px 0; }

.member-search { margin: 4px 0 12px; }
.clan-create summary { list-style: none; cursor: pointer; display: inline-block; margin-bottom: 10px; }
.clan-create summary::-webkit-details-marker { display: none; }
.toggle-hint { font-size: 0.78rem; color: var(--acc); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; }
.clan-create summary:hover .toggle-hint { border-color: var(--acc); color: var(--acc); }
.vault-box summary { cursor: pointer; list-style: none; }
.vault-box summary::-webkit-details-marker { display: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vault-box summary::before { content: "▸ "; color: var(--acc); transition: transform .15s ease; display: inline-block; }
.vault-box[open] summary::before { transform: rotate(90deg); }
.vault-summary { display: inline-block; margin: 0; }
.vault-box summary:hover .vault-summary { color: var(--acc); }
.rules-box strong { display: block; margin-bottom: 6px; color: var(--acc); }
.member-search input { width: 100%; max-width: 380px; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; }
.member-search input:focus { outline: 2px solid var(--acc); border-color: transparent; }
.admin-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-tab {
  flex: 1 1 0; min-width: 150px; padding: 14px 16px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--text); font: inherit; font-weight: 700; text-align: center;
  text-decoration: none;
}
.admin-tab:hover { border-color: var(--acc); color: var(--acc); text-decoration: none; }
.admin-tab.active {
  background: var(--acc); color: #fff;
  border-color: transparent;
}
.foot-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.foot-nav a { color: #fff; text-decoration: underline; }

/* sign in with Ftag button (sdk) */
.ftag-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--acc); color: #fff;
  font-weight: 600; padding: 10px 18px; border-radius: 10px; text-decoration: none;
  margin: 6px 0;
}
.ftag-btn:hover { filter: brightness(1.1); text-decoration: none; color: #fff; }

/* downloads */
.field-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.field-stack .field { display: flex; flex-direction: column; gap: 4px; }
.field-stack .field > span { font-size: 0.85rem; color: var(--dim); }
.field-stack select, .field-stack input[type=text], .field-stack input[type=file] { padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; }
.dl-row { flex-wrap: wrap; }
.dl-actions { display: flex; align-items: center; gap: 8px; }
.dl-actions form { margin: 0; }

@media (max-width: 480px) {
  .shell { padding: 0 12px; }
  .hero h1 { font-size: 1.6rem; }
}