/* Youth World — black & gold */
:root {
  --gold: #d4af37;
  --gold-bright: #f5c542;
  --gold-dim: #8a6d1f;
  --bg: #0a0a0a;
  --card: #141414;
  --card2: #1c1c1c;
  --line: #2a2a2a;
  --text: #f2ede0;
  --muted: #a99f83;
  --danger: #e0655f;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
a { color: var(--gold-bright); }
button { font: inherit; cursor: pointer; }
input, textarea, select {
  font: inherit; color: var(--text); background: #0f0f0f;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--gold-dim); border-color: var(--gold); }
label { display: block; margin: 12px 0 4px; font-weight: 600; }
label .muted { font-weight: 400; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.fineprint { font-size: 13px; color: var(--muted); }
.error { color: var(--danger); font-weight: 600; }
.big { font-size: 18px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: rgba(10,10,10,.96);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--text); padding: 0; }
.brand-gem { color: var(--gold); font-size: 30px; line-height: 1; text-shadow: 0 0 14px rgba(212,175,55,.7); }
.brand-text { text-align: left; line-height: 1.1; }
.brand-text strong { font-size: 19px; letter-spacing: .4px; }
.brand-text span { display: block; font-size: 12px; color: var(--gold); letter-spacing: 2px; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.btn {
  border: 1px solid var(--gold-dim); background: transparent; color: var(--gold-bright);
  border-radius: 999px; padding: 8px 16px; font-weight: 700;
}
.btn:hover { border-color: var(--gold); }
.btn-gold { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #111; border-color: transparent; }
.btn-ghost { color: var(--text); border-color: var(--line); }
.btn-block { display: block; width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .45; cursor: default; }
.me-chip {
  display: flex; align-items: center; gap: 8px; background: var(--card2);
  border: 1px solid var(--gold-dim); border-radius: 999px; padding: 4px 12px 4px 4px; color: var(--text);
}
.me-chip .ava { width: 30px; height: 30px; font-size: 13px; }
.me-chip b { font-size: 14px; }
.me-chip small { color: var(--gold-bright); font-weight: 700; }

/* Banner */
.banner {
  margin: 12px auto 0; max-width: 960px; padding: 12px 16px;
  background: linear-gradient(90deg, #2a2103, #171204);
  border: 1px solid var(--gold); border-radius: 10px;
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}

/* Layout */
#app { max-width: 960px; margin: 0 auto; padding: 16px 14px 40px; }
.loading { text-align: center; padding: 60px 0; color: var(--muted); }
.gem-spin { display: inline-block; color: var(--gold); font-size: 34px; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

h1, h2, h3 { margin: 0 0 8px; }
.section { margin: 26px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section-head h2 { font-size: 20px; }
.section-head h2 .gem { color: var(--gold); }
.section-head small { color: var(--muted); }

/* Splash */
.splash { text-align: center; padding: 34px 12px 10px; }
.splash .gem-big { font-size: 84px; color: var(--gold); text-shadow: 0 0 34px rgba(212,175,55,.8); line-height: 1; }
.splash h1 { font-size: 34px; margin-top: 6px; }
.splash p { color: var(--muted); max-width: 560px; margin: 8px auto; }
.splash .btn { margin-top: 12px; padding: 12px 26px; font-size: 16px; }

/* Cast rail */
.rail { display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px 12px; scrollbar-width: thin; }
.cast-card {
  flex: 0 0 128px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 8px; text-align: center; cursor: pointer; color: var(--text);
}
.cast-card:hover { border-color: var(--gold); }
.cast-card .ava { margin: 0 auto 8px; }
.cast-card b { display: block; font-size: 14px; }
.cast-card small { color: var(--muted); display: block; font-size: 12px; }
.cast-card .count { color: var(--gold-bright); font-weight: 700; font-size: 13px; }
.ava {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3a2f05, #141414);
  border: 2px solid var(--gold-dim); color: var(--gold-bright);
  font-weight: 800; font-size: 24px; flex: 0 0 auto;
}
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava.sm { width: 40px; height: 40px; font-size: 16px; }

/* Gold Diamond glow — the lit-up icon */
.gold-ring { position: relative; }
.gold-ring::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(from 0deg, #fff6c9, var(--gold), #fff, var(--gold-bright), #fff6c9);
  animation: spin 2.2s linear infinite; z-index: -1;
  filter: blur(1px);
}
.gold-ring::after {
  content: "◆"; position: absolute; right: -4px; bottom: -2px;
  color: var(--gold-bright); font-size: 18px; text-shadow: 0 0 8px gold; z-index: 1;
}
.gold-pulse { animation: glowpulse 1.8s ease-in-out infinite; }
@keyframes glowpulse { 0%,100% { box-shadow: 0 0 6px rgba(245,197,66,.5); } 50% { box-shadow: 0 0 22px rgba(245,197,66,.95); } }
.gold-badge {
  display: inline-block; background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #111; font-weight: 800; font-size: 11px; border-radius: 999px; padding: 2px 8px;
  letter-spacing: .4px; text-transform: uppercase;
}

/* Feed + posts */
.post {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin: 12px 0;
}
.post.news { border-color: var(--gold-dim); }
.post-head { display: flex; gap: 10px; align-items: flex-start; }
.post-head .who { flex: 1; min-width: 0; }
.post-head .who b { font-size: 15px; }
.post-head .who small { color: var(--muted); display: block; font-size: 12px; }
.post h3 { font-size: 17px; margin: 10px 0 4px; }
.post .body { white-space: pre-wrap; word-wrap: break-word; }
.post .media { margin-top: 10px; border-radius: 10px; overflow: hidden; position: relative; }
.big-heart { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 110px; color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.55); pointer-events: none; animation: bigHeart .9s ease forwards; }
@keyframes bigHeart { 0% { transform: scale(.3); opacity: 0; } 25% { transform: scale(1.15); opacity: 1; } 45% { transform: scale(.95); } 100% { transform: scale(1.05) translateY(-14px); opacity: 0; } }
.views-chip { cursor: default; }
.post .media img, .post .media video { width: 100%; display: block; max-height: 520px; object-fit: cover; }
.post .media audio { width: 100%; }
.news-tag { color: var(--gold-bright); font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.share-tag { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .4px; }
.repost-tag { color: var(--muted); font-size: 12px; font-weight: 700; margin: 14px 0 -6px 4px; }
.post-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.chip-btn {
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600;
}
.chip-btn.on { border-color: var(--gold); color: var(--gold-bright); }
.follow-btn { margin-left: auto; }

/* Comments */
.comments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.comment { display: flex; gap: 8px; margin: 10px 0; }
.comment .cbody { flex: 1; min-width: 0; background: var(--card2); border-radius: 10px; padding: 8px 10px; }
.comment .cbody b { font-size: 13px; }
.comment .cbody p { margin: 2px 0 6px; font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.comment .cmeta { display: flex; gap: 10px; align-items: center; font-size: 12px; }
.comment .cmeta button { background: none; border: 0; color: var(--muted); padding: 0; font-size: 12px; font-weight: 700; }
.comment .cmeta button.on { color: var(--gold-bright); }
.comment.reply { margin-left: 44px; }
.comment-box { display: flex; gap: 8px; margin-top: 10px; }
.comment-box input { flex: 1; }
.reply-box { margin-left: 44px; }

/* Composer */
.composer { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.composer textarea { min-height: 64px; resize: vertical; }
.composer .row { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.composer .row label { margin: 0; font-weight: 400; font-size: 13px; color: var(--muted); }

/* Profile view */
.profile-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.profile-head .ava { width: 96px; height: 96px; font-size: 36px; }
.profile-head h1 { font-size: 26px; }
.profile-head .role { color: var(--gold-bright); font-weight: 700; }
.profile-stats { display: flex; gap: 22px; margin: 12px 0; flex-wrap: wrap; }
.profile-stats b { font-size: 19px; display: block; }
.profile-stats span { color: var(--muted); font-size: 13px; }
.climb { height: 10px; background: #222; border-radius: 999px; overflow: hidden; margin: 6px 0; }
.climb > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright)); }

/* Store */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.store-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.store-item b { display: block; }
.store-item .price { color: var(--gold-bright); font-weight: 800; font-size: 18px; margin: 6px 0; }
.store-item p { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.78);
  display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto;
}
.modal-card {
  position: relative; width: 100%; max-width: 520px; background: var(--card);
  border: 1px solid var(--gold-dim); border-radius: 16px; padding: 22px; margin-top: 4vh;
}
.modal-x { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--muted); font-size: 18px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: auto; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: #221c04; border: 1px solid var(--gold); color: var(--text);
  padding: 12px 18px; border-radius: 999px; z-index: 80; max-width: 92vw; text-align: center;
  box-shadow: 0 6px 30px rgba(0,0,0,.6);
}

/* Footer */
.foot { max-width: 960px; margin: 0 auto; padding: 0 14px 34px; color: var(--muted); font-size: 13px; text-align: center; }
.foot-small { font-size: 12px; }

.grant-list { list-style: none; padding: 0; margin: 8px 0; }
.grant-list li { background: var(--card2); border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 14px; }
.grant-list li small { color: var(--muted); display: block; }

/* Groups (Fort, 2026-11-19) */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.group-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.group-card:hover { border-color: var(--gold-dim); }
.group-card b { font-size: 16px; }
.group-card p { color: var(--muted); font-size: 13px; margin: 6px 0; }
.group-meta { font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.group-meta .count { color: var(--gold-bright); font-weight: 700; }
.group-vis { display: inline-block; border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: 11px; border-radius: 999px; padding: 2px 8px; letter-spacing: .4px; text-transform: uppercase; }
.gold-text { color: var(--gold-bright); font-weight: 700; }
.top-ten { background: linear-gradient(180deg, #1d1603, var(--card)); border: 1px solid var(--gold-dim); border-radius: 14px; padding: 14px; }
.top-ten-list { list-style: none; padding: 0; margin: 8px 0 0; }
.top-ten-list li { display: flex; gap: 10px; align-items: baseline; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.top-ten-list li:last-child { border-bottom: 0; }
.top-ten-list .rank { flex: 0 0 26px; text-align: center; color: #111; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-radius: 999px; font-weight: 800; font-size: 13px; padding: 2px 0; }
.top-ten-list .rank-empty { background: var(--card2); color: var(--muted); border: 1px solid var(--line); }
.top-ten-list a { color: var(--text); text-decoration: none; font-weight: 600; }
.top-ten-list a:hover { color: var(--gold-bright); }
.top-ten-preview { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; font-size: 13px; }
.top-ten-preview ol { margin: 6px 0 0; padding-left: 20px; color: var(--muted); }
.top-ten-preview li { margin: 3px 0; }
.top-ten-list .t10-main { flex: 1; min-width: 0; }
.t10-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.yt-embed { display: block; margin-top: 8px; }
.yt-embed iframe, .t10-video { width: 100%; max-width: 440px; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; display: block; }
.t10-video { margin-top: 8px; }
/* Friday Top Ten countdown player (Fort, 2026-11-19) */
.t10cd-bar { margin: 10px 0 4px; }
.t10cd { margin-top: 10px; border: 1px solid var(--gold-dim); border-radius: 12px; padding: 12px; background: var(--card2); }
.t10cd-head { display: flex; align-items: center; gap: 12px; }
.t10cd-logo { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; }
.t10cd-now { margin: 10px 0 6px; font-size: 16px; }
.t10cd-stage { margin-top: 6px; }
.t10cd-video, .t10cd-yt iframe, .t10cd .yt-embed iframe { width: 100%; max-width: 560px; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; display: block; }
.t10cd-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.t10cd-share { margin-top: 8px; }
.t10cd-progress { list-style: none; padding: 0; margin: 12px 0 0; }
.t10cd-progress li { display: flex; gap: 8px; align-items: baseline; padding: 5px 4px; border-bottom: 1px solid var(--line); color: var(--muted); }
.t10cd-progress li:last-child { border-bottom: 0; }
.t10cd-progress .rank { flex: 0 0 34px; text-align: center; color: #111; background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-weight: 800; font-size: 12px; padding: 2px 0; }
.t10cd-progress .t10cd-cur { color: var(--text); font-weight: 700; }
.t10cd-progress .t10cd-cur .rank { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-color: transparent; }
.t10cd-progress .t10cd-done { opacity: .55; }

/* Official group atmosphere (Fort, 2026-11-19) — realistic media-studio
 * backdrop, same black & gold scheme; only the official group gets it. */
.group-official-page { position: relative; z-index: 0; }
.group-official-page::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10,10,10,.82), rgba(10,10,10,.94) 55%, var(--bg)),
    url('assets/group-media-bg.webp') center top / cover no-repeat;
  opacity: .55;
}
.group-hero { position: relative; border: 1px solid var(--gold-dim); border-radius: 16px; overflow: hidden; box-shadow: 0 14px 44px rgba(0,0,0,.65); }
.group-hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,10,.45), rgba(10,10,10,.78) 62%, rgba(10,10,10,.94)),
    url('assets/group-media-bg.webp') center 30% / cover no-repeat;
}
.group-hero-inner { position: relative; padding: 22px 18px 18px; }
.group-hero-inner h1 { text-shadow: 0 2px 14px rgba(0,0,0,.9); }
.group-hero-inner p { text-shadow: 0 1px 8px rgba(0,0,0,.9); }
.group-card-official { padding: 0; overflow: hidden; border-color: var(--gold-dim); }
.group-card-bg {
  height: 92px;
  background:
    linear-gradient(180deg, rgba(10,10,10,.25), rgba(10,10,10,.72)),
    url('assets/group-media-bg.webp') center 32% / cover no-repeat;
  border-bottom: 1px solid var(--gold-dim);
}
.group-card-body { padding: 14px; }


@media (max-width: 640px) {
  .brand-text strong { font-size: 16px; }
  #btnNews { display: none; }
  .splash h1 { font-size: 27px; }
  .comment.reply, .reply-box { margin-left: 20px; }
}
