/* MGK Show Tracker — dark, edgy, mobile-first fan product */
:root {
  --bg: #0a0a0f;
  --bg2: #101016;
  --card: #15151d;
  --card2: #1b1b25;
  --line: #262633;
  --text: #f4f1f7;
  --muted: #9b94ab;
  --accent: #ff2d78;
  --accent-deep: #c2145b;
  --accent2: #ff7847;
  --gold: #f5c518;
  --ok: #34d399;
  --danger: #f87171;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --font-display: 'Oswald', 'Arial Narrow', 'Helvetica Neue Condensed', sans-serif;
  --font-marker: 'Permanent Marker', 'Oswald', cursive;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(900px 480px at 50% -8%, rgba(255, 45, 120, .14) 0%, transparent 60%) fixed,
    radial-gradient(700px 500px at 90% 110%, rgba(255, 120, 71, .07) 0%, transparent 55%) fixed,
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  padding-bottom: 72px;
  line-height: 1.45;
}
/* subtle film-grain over everything */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  position: sticky; top: 0; z-index: 30;
  background: rgba(10, 10, 15, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; letter-spacing: .14em; font-size: 16px; }
.brand-mark {
  background: #fff;
  padding: 6px 11px; border-radius: 9px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
  display: inline-flex; align-items: center;
}
.brand-mark svg { height: 24px; width: auto; display: block; }
.user-chip { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; background: var(--card); }
.user-chip span { color: var(--text); font-weight: 800; }

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 2px; padding: 8px 10px;
  position: sticky; top: 58px; z-index: 29;
  background: rgba(10, 10, 15, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; background: none; border: none; color: var(--muted);
  font-size: 14px; font-weight: 800; padding: 12px 14px; border-radius: 10px;
  cursor: pointer; white-space: nowrap; min-height: 44px;
  transition: color .15s, background .15s;
}
.tab.active { color: #fff; background: var(--card2); box-shadow: inset 0 -3px 0 var(--accent); text-shadow: 0 0 12px rgba(255, 45, 120, .65); }

main { max-width: 780px; margin: 0 auto; padding: 18px 14px 8px; }
.panel[hidden] { display: none; }

/* ---------- hero ---------- */
.hero { padding: 26px 4px 16px; position: relative; }
.hero-xx {
  position: absolute; right: 0; top: -16px;
  font-family: var(--font-display); font-weight: 700; font-size: 118px; line-height: 1;
  color: transparent; -webkit-text-stroke: 2px rgba(255, 45, 120, .18);
  user-select: none; pointer-events: none;
}
.hero-eyebrow {
  font-family: var(--font-marker); color: var(--accent); font-size: 15px;
  margin: 0 0 8px; display: inline-block; transform: rotate(-2deg);
}
.hero h1 {
  margin: 0; font-size: 38px; line-height: 1.1; font-weight: 700;
  font-family: var(--font-display); letter-spacing: .02em; text-transform: uppercase;
}
.hero-accent {
  font-family: var(--font-marker); text-transform: none; letter-spacing: 0;
  background: linear-gradient(100deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { color: var(--muted); font-size: 14px; margin: 10px 0 0; max-width: 34em; }
.hero .lede b { color: var(--text); }

/* ---------- filters ---------- */
.filters { margin-bottom: 14px; }
.filters input[type="search"] {
  width: 100%; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; font-size: 16px; margin-bottom: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.filters input[type="search"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 45, 120, .18); }

/* ---------- songs tab ---------- */
.search-wrap { margin-bottom: 14px; }
.search-wrap input {
  width: 100%; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 45, 120, .18); }
.song-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 24px; }
.song-row { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.song-main {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: none; color: var(--text);
  padding: 13px 14px; cursor: pointer; text-align: left; font-size: 15px;
}
.song-count {
  flex: 0 0 auto; min-width: 52px; text-align: center;
  font-weight: 900; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-radius: 999px; padding: 5px 10px;
}
.song-main b { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-chev { color: var(--muted); transition: transform .15s; }
.song-row.open .song-chev { transform: rotate(90deg); }
.song-shows { border-top: 1px solid var(--line); padding: 4px 14px 10px; }
.song-show { font-size: 13px; color: var(--muted); padding: 5px 0; border-bottom: 1px dashed var(--line); }
.song-show:last-child { border-bottom: none; }
.song-show span { color: var(--text); font-weight: 700; }
.year-chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.year-chips::-webkit-scrollbar { height: 8px; }
.year-chips::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.year-chips::-webkit-scrollbar-track { background: transparent; }
/* Touch devices: native swipe handles it, hide the bar for a cleaner look. */
@media (hover: none) {
  .year-chips { scrollbar-width: none; }
  .year-chips::-webkit-scrollbar { display: none; }
}
@media (hover: hover) {
  .year-chips.drag-scroll { cursor: grab; }
  .year-chips.drag-scroll.dragging { cursor: grabbing; }
}
/* Keyboard users: always show where focus is. */
.chip:focus-visible, .btn:focus-visible, .seg-btn:focus-visible {
  outline: 2px solid var(--accent2); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
.chip {
  flex: 0 0 auto; background: var(--card); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 800; cursor: pointer;
  min-height: 44px; transition: all .15s;
}
.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 16px rgba(255, 45, 120, .4);
}

/* ---------- tour groups (each tour gets its own background) ---------- */
.tour-group {
  margin-bottom: 22px; animation: rise .3s ease both;
  border-radius: 16px; padding: 14px 12px 4px;
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: var(--shadow);
}
.tour-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 0 4px 8px; border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--accent), transparent) 1;
  margin-bottom: 10px;
}
.tour-name { font-size: 19px; font-family: var(--font-marker); letter-spacing: .02em; }
.tour-count {
  font-size: 12px; font-weight: 800; color: var(--accent2);
  background: rgba(255, 120, 71, .12); border-radius: 999px; padding: 4px 12px;
  white-space: nowrap;
}

/* ---------- show rows ---------- */
.show-list { display: flex; flex-direction: column; gap: 10px; }
.tour-group .show-list, .tour-group > .show-row { margin-bottom: 0; }
.tour-group .show-row { margin-bottom: 10px; }
.show-row {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
  animation: rise .25s ease both;
}
.show-row.attended { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.show-main { display: flex; gap: 12px; align-items: flex-start; }
.show-date {
  flex: 0 0 56px; text-align: center; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 2px;
}
.show-row.attended .show-date { border-color: var(--accent); }
.show-date .d { display: block; font-size: 19px; font-weight: 900; }
.show-date .m { display: block; font-size: 11px; color: var(--accent); font-weight: 900; letter-spacing: .06em; }
.show-date .y { display: block; font-size: 11px; color: var(--muted); }
.show-info { flex: 1; min-width: 0; border-left: 2px dashed var(--line); padding-left: 12px; }
.show-bill { font-weight: 800; font-size: 15px; }
.show-venue { color: var(--muted); font-size: 13px; margin-top: 3px; }
.show-actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.attend-btn { flex: 1; min-height: 44px; font-size: 14px; }
.attend-btn.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border: none; color: #fff;
  box-shadow: 0 4px 14px rgba(255, 45, 120, .35);
  font-family: var(--font-marker); text-transform: uppercase; letter-spacing: .06em;
  transform: rotate(-1.2deg);
}
.expand-btn { flex: 0 0 auto; min-height: 44px; }
.setlist { margin-top: 12px; border-top: 2px dashed var(--line); padding-top: 12px; position: relative; }
.setlist h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .12em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stub-tag {
  font-family: var(--font-display); font-size: 10px; font-weight: 600; letter-spacing: .18em;
  color: var(--accent2); border: 1px dashed var(--accent2); border-radius: 6px; padding: 2px 8px;
  margin-left: auto; white-space: nowrap;
}
.setlist ol { margin: 0; padding-left: 22px; font-size: 14px; }
.setlist li { margin: 4px 0; }
.no-setlist { color: var(--muted); font-size: 13px; font-style: italic; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--card2); color: var(--text);
  border-radius: 12px; padding: 12px 18px; font-size: 14px; font-weight: 800;
  cursor: pointer; min-height: 44px; transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); border: none; color: #fff; box-shadow: 0 4px 16px rgba(255, 45, 120, .35); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

/* ---------- pager ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
#pg-info { color: var(--muted); font-size: 13px; }

/* ---------- stats / my shows ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); animation: rise .3s ease both;
}
.stat-card .v { font-size: 28px; font-weight: 900; }
.stat-card .v.sm { font-size: 15px; line-height: 1.35; }
.stat-card .l { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 600; }
.stat-card.hero {
  grid-column: span 2; border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255, 45, 120, .16), var(--card) 60%);
}
.stat-card.hero .v { color: var(--accent); font-size: 40px; }
.share-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--ok); font-weight: 700; }
.section-title { font-size: 15px; letter-spacing: .05em; margin: 6px 0 12px; font-weight: 900; }
.empty-card, .auth-card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px; text-align: center; box-shadow: var(--shadow);
}
.empty-card h2, .auth-card h2 { margin: 0 0 8px; font-size: 22px; font-weight: 900; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.lede { color: var(--muted); font-size: 14px; }

/* ---------- trophies ---------- */
.trophy-progress {
  grid-column: 1 / -1; text-align: center; color: var(--gold);
  font-weight: 800; font-size: 14px; padding: 6px 0 4px;
}
.trophy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.trophy {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 12px; text-align: center; opacity: .4; filter: grayscale(1);
  transition: all .2s;
}
.trophy.unlocked {
  opacity: 1; filter: none; border-color: var(--gold);
  box-shadow: 0 0 18px rgba(245, 197, 24, .15);
  animation: pop .35s ease both;
}
.trophy .icon { font-size: 34px; }
.trophy .n { font-weight: 900; font-size: 14px; margin-top: 8px; }
.trophy .d { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- leaderboard ---------- */
.board-list { display: flex; flex-direction: column; gap: 8px; }
.board-row {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
  animation: rise .25s ease both;
}
.board-row.me { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.board-rank { font-size: 20px; font-weight: 900; width: 40px; text-align: center; color: var(--muted); flex: 0 0 auto; }
.board-name { flex: 1; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.board-title { font-size: 11px; color: var(--accent2); font-weight: 800; }
.board-count { font-size: 22px; font-weight: 900; flex: 0 0 auto; }
.board-count small { font-size: 11px; color: var(--muted); font-weight: 600; }
.board-me {
  background: linear-gradient(135deg, rgba(255, 45, 120, .18), var(--card) 65%);
  border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; font-weight: 700; font-size: 15px;
}

/* ---------- app tab / waitlist ---------- */
.wl-platforms { display: flex; gap: 8px; margin: 14px 0 4px; }
.wl-platforms .chip { flex: 1 1 0; padding-left: 8px; padding-right: 8px; }
#wl-done { margin-top: 14px; font-weight: 800; color: var(--ok); font-size: 15px; }

/* ---------- community: chat + threads ---------- */
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg-btn { flex: 1; border: none; background: none; color: var(--muted); font-weight: 800; font-size: 14px; padding: 10px; border-radius: 9px; cursor: pointer; min-height: 44px; }
.seg-btn.active { background: var(--card2); color: #fff; box-shadow: inset 0 -3px 0 var(--accent); }
.chat-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; margin-bottom: 12px; }
.chat-msg { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.chat-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.chat-meta b { color: var(--accent2); font-size: 13px; }
.chat-del { margin-left: auto; background: none; border: none; color: var(--danger); font-size: 20px; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px; }
.chat-body { font-size: 14px; overflow-wrap: anywhere; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 16px; color: var(--text); }
.chat-input-row input:focus { outline: none; border-color: var(--accent); }
.chat-topic { font-size: 13px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.topic-label { font-weight: 800; color: var(--accent2); }
.chat-head-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.chat-presence { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; margin-right: 6px; box-shadow: 0 0 6px #3ddc84; }
.typing-line { font-size: 12px; color: var(--accent2); font-style: italic; margin-top: 2px; }
.chat-sound { min-width: 44px; min-height: 44px; padding: 6px 10px; font-size: 18px; }
.chat-action .chat-body { font-style: italic; color: var(--text); }
.chat-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chat-join { font-size: 12px; color: var(--muted); font-style: italic; text-align: center; padding: 2px 0; }
.unread-badge { display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; text-align: center; }
.thread-new { width: 100%; margin-bottom: 4px; }
.thread-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.thread-row { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; }
.thread-title { font-weight: 800; font-size: 15px; }
.thread-title-lg { font-weight: 900; font-size: 20px; margin-bottom: 6px; }
.thread-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.thread-op { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin: 12px 0 18px; }
.thread-body { font-size: 15px; margin-top: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
#thread-back { margin-bottom: 4px; }
.auth-card select, .auth-card textarea { width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 16px; font-family: inherit; }
.auth-card textarea { resize: vertical; }
#thread-form { margin-top: 12px; }

/* ---------- ads (only rendered when AdSense is configured) ---------- */
.ad-slot { margin: 2px auto 14px; max-width: 728px; position: relative; }
.ad-close { position: absolute; top: 0; right: 0; z-index: 5; width: 24px; height: 24px; padding: 0;
  border: none; border-radius: 0 0 0 10px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer; }
.ad-close:hover { background: rgba(0,0,0,.8); }

/* ---------- states tab: real US map ---------- */
.states-mine {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.states-progress-top { font-size: 14px; margin-bottom: 10px; }
.states-progress-top b { color: var(--accent); }
.states-progress { height: 10px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; }
.states-progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .5s ease; }
.states-login { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.state-map { margin-bottom: 18px; }
.us-map { width: 100%; height: auto; display: block; }
.map-state {
  fill: var(--card); stroke: var(--line); stroke-width: 1.5;
  cursor: pointer; transition: fill .15s ease;
}
.map-state:hover { fill: var(--card2); }
.map-state.hit { fill: url(#mapHit); stroke: var(--accent); stroke-width: 1.5; }
.map-state.hit:hover { filter: brightness(1.15); }
.map-state:active { filter: brightness(1.3); }
#mapHit .map-g1 { stop-color: var(--accent); }
#mapHit .map-g2 { stop-color: var(--accent-deep); }
.region-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.region-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; color: var(--text); cursor: pointer; text-align: left;
  font-size: 14px;
}
.region-row:active { transform: scale(.98); }
.region-name { font-weight: 800; flex: 1; }
.region-count { color: var(--muted); font-size: 13px; }
.region-go { color: var(--accent); font-weight: 900; }
#state-detail { margin-top: 18px; }
#state-back { margin-bottom: 10px; }
#state-show-list .show-row { margin-bottom: 10px; }

/* ---------- fan profiles ---------- */
.profile-view {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0, 0, 0, .62);
  display: flex; align-items: flex-end; justify-content: center;
}
.profile-view[hidden] { display: none; }
.profile-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px 20px 0 0; width: 100%; max-width: 520px;
  max-height: 88vh; overflow-y: auto; padding: 22px 20px;
  position: relative; box-shadow: 0 -12px 48px rgba(0, 0, 0, .5);
}
@media (min-width: 700px) {
  .profile-view { align-items: center; padding: 20px; }
  .profile-card { border-radius: 20px; }
}
.profile-close {
  position: absolute; top: 8px; right: 10px;
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer;
}
.profile-top { text-align: center; margin-bottom: 6px; }
.profile-top h2 { margin: 10px 0 4px; font-size: 24px; }
.profile-badge-big .badge-chip {
  font-size: 38px; min-width: 76px; height: 76px; border-radius: 20px; margin: 0; vertical-align: 0;
}
.profile-badge-big .badge-txt { font-size: 22px; }
.profile-nobadge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 76px; height: 76px; border-radius: 20px;
  background: var(--bg2); border: 1px dashed var(--line); color: var(--muted);
  font-family: var(--font-display); font-size: 22px;
}
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.profile-actions { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 8px; flex-wrap: wrap; }

/* ---------- DM inbox ---------- */
.dm-row {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left;
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; margin-bottom: 8px; color: var(--text); cursor: pointer;
}
.dm-row:active { transform: scale(.99); }
.dm-row.unread { border-color: var(--accent); box-shadow: 0 0 12px rgba(255, 45, 120, .18); }
.dm-avatar { font-size: 24px; flex: 0 0 auto; display: flex; }
.dm-avatar .badge-chip { font-size: 20px; min-width: 42px; height: 42px; margin: 0; vertical-align: 0; }
.dm-main2 { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dm-name { font-weight: 800; }
.dm-preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.dm-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.dm-time { font-size: 11px; color: var(--muted); }
.unread-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent); display: inline-block;
}
.dm-head { padding: 8px 2px 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.dm-head .dm-name { font-size: 17px; }
#dm-back { margin-bottom: 6px; }
#dm-messages { max-height: 46vh; }
.chat-msg.mine .chat-body {
  background: rgba(255, 45, 120, .12);
  border: 1px solid rgba(255, 45, 120, .3);
  border-radius: 14px; padding: 8px 12px;
}

/* tappable fan names */
.chat-name, [data-profile] { cursor: pointer; }
.chat-name:hover, .board-name[data-profile]:hover .badge-chip { filter: brightness(1.2); }
.board-name[data-profile]:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- badges ---------- */
.badge-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 5px; border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  background: color-mix(in srgb, var(--badge, #888) 16%, transparent);
  border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--badge, #888) 55%, var(--line));
  vertical-align: -6px; margin-left: 3px; font-size: 14px; line-height: 1;
}
.badge-txt { font-family: var(--font-display); font-weight: 700; font-size: 10px; letter-spacing: .06em; }
.badge-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 6px; }
.badge-pick {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: var(--card); border: 2px solid var(--line); border-radius: 12px;
  padding: 12px 6px; cursor: pointer; color: var(--text);
}
.badge-pick .badge-chip { font-size: 22px; min-width: 40px; height: 40px; margin-left: 0; vertical-align: 0; }
.badge-pick.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(255, 45, 120, .25); }
.badge-pick-label { color: var(--muted); font-size: 11px; text-align: center; line-height: 1.25; }
.badge-pick.sel .badge-pick-label { color: var(--text); font-weight: 800; }
.badge-none { font-size: 22px; color: var(--muted); line-height: 40px; }
.chat-badge-btn { flex: 0 0 auto; padding: 10px 12px; font-size: 17px; }
.chat-badge-picker {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-top: 8px;
  max-height: 160px; overflow-y: auto;
}
.chat-badge-picker[hidden] { display: none; }
.chat-badge-picker .badge-chip { cursor: pointer; font-size: 19px; min-width: 34px; height: 34px; margin-left: 0; vertical-align: 0; }
.chat-badge-picker .badge-chip:active { transform: scale(.9); }

/* ---------- account ---------- */
.auth-card label { display: block; text-align: left; font-size: 13px; font-weight: 800; margin: 14px 0 6px; }
.auth-card input {
  width: 100%; background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 16px;
}
.auth-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 45, 120, .18); }
.auth-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.auth-actions .btn { flex: 1; }
.auth-error { color: var(--danger); font-size: 13px; margin-top: 12px; font-weight: 700; }

/* ---------- modal + toast ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .7); padding: 22px; backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--card2); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px 24px; max-width: 380px; width: 100%; text-align: center;
  box-shadow: var(--shadow); animation: pop .25s ease both;
}
.modal-card h2 { margin: 0 0 8px; }

/* bottom-sheet variant (playlist): slides up, list scrolls, close stays visible */
.modal.sheet { align-items: flex-end; padding: 0; }
.modal.sheet .modal-card {
  max-width: 560px; width: 100%; margin: 0 auto; text-align: left;
  border-radius: 20px 20px 0 0; border-bottom: none;
  padding: 10px 18px calc(16px + env(safe-area-inset-bottom));
  max-height: 82vh; max-height: 82dvh;
  display: flex; flex-direction: column;
  animation: sheetUp .28s ease both;
}
.sheet-grab { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 2px auto 10px; flex: 0 0 auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; }
.sheet-head h2 { margin: 0; }
.sheet-x {
  border: none; background: var(--card); color: var(--muted);
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 22px; line-height: 1; cursor: pointer; flex: 0 0 auto;
}
.sheet-x:active { transform: scale(.94); }
#track-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  margin: 10px -6px 0; padding: 0 6px;
}
.modal.sheet .player-attrib { flex: 0 0 auto; margin-bottom: 6px; }
.modal.sheet .auth-actions { flex: 0 0 auto; }
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--card2); border: 1px solid var(--accent); color: var(--text);
  border-radius: 999px; padding: 12px 22px; font-size: 14px; font-weight: 700;
  z-index: 70; box-shadow: var(--shadow); max-width: 92vw; text-align: center;
  animation: pop .2s ease both;
}
.toast[hidden] { display: none; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 28px 16px 8px; }
.foot-est {
  font-family: var(--font-marker); color: var(--accent); font-size: 17px;
  transform: rotate(-2deg); margin-bottom: 8px;
}
.loading { text-align: center; color: var(--muted); padding: 28px; font-size: 14px; }

/* ---------- animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (min-width: 640px) {
  .hero h1 { font-size: 44px; }
  .trophy-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- moderation ---------- */
.modal-card label { display: block; text-align: left; font-size: 13px; font-weight: 800; margin: 14px 0 6px; }
.modal-card select, .modal-card textarea {
  width: 100%; background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 16px; font-family: inherit;
}
.modal-card textarea { resize: vertical; }
.modal-card select:focus, .modal-card textarea:focus { outline: none; border-color: var(--accent); }
.chat-flag {
  margin-left: auto; background: none; border: none; color: var(--muted);
  font-size: 15px; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px;
}
.chat-flag:hover { color: var(--accent2); }
.chat-del + .chat-flag { margin-left: 0; }
.thread-flag { margin-left: 8px; min-width: 44px; min-height: 44px; }
.thread-title { display: flex; align-items: center; }
.mod-queue-row { margin: 10px 0 2px; }
.mod-badge {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 900;
  border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: middle;
}
.report-card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 10px;
}
.report-head { font-size: 15px; margin-bottom: 4px; }
.report-context { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.report-preview { font-size: 14px; margin-bottom: 6px; overflow-wrap: anywhere; }
.report-details { font-size: 13px; color: var(--accent2); font-style: italic; margin-bottom: 8px; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.report-actions .btn { min-height: 44px; }
.mod-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.track-admin-btns { display: inline-flex; gap: 6px; align-items: center; }
.btn.sm { padding: 6px 10px; font-size: 13px; min-height: 0; }
.track-admin-row { gap: 10px; }
.track-admin-row > b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drag-handle {
  cursor: grab; color: var(--muted); font-size: 16px; letter-spacing: 1px;
  padding: 10px 6px; flex: 0 0 auto; touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.drag-handle:active { cursor: grabbing; color: var(--text); }
.track-admin-row { transition: transform .18s ease, background .18s ease; }
.track-admin-row.dragging {
  transition: none; background: var(--card2); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .55); position: relative; z-index: 5;
}
#account-admin { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- community feedback ---------- */
.fb-mine { margin-top: 14px; }
.fb-mine-title { font-size: 13px; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; text-transform: uppercase; }
.fb-row { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.fb-row b { font-family: var(--font-display); letter-spacing: .06em; text-transform: uppercase; font-size: 13px; }
.fb-status { float: right; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); color: var(--muted); }
.fb-status.fb-accepted { color: var(--accent2); border-color: var(--accent2); }
.fb-status.fb-done { color: var(--ok); border-color: var(--ok); }
.fb-status.fb-rejected { color: var(--muted); }

/* ---------- music player ---------- */
#player-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  display: flex; align-items: center; gap: 10px;
  padding: 16px 14px calc(8px + env(safe-area-inset-bottom));
  background: rgba(14, 14, 20, .96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#player-progress {
  position: absolute; top: 0; left: 0; right: 0; height: 28px;
  cursor: pointer; touch-action: none;
}
#player-progress-fill {
  position: absolute; top: 12px; left: 0; height: 4px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 0 4px 4px 0; pointer-events: none;
  transition: height .12s, top .12s;
}
#player-progress-fill::after {
  content: ''; position: absolute; right: -8px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 8px rgba(0, 0, 0, .55), 0 0 0 3px rgba(255, 45, 120, .35);
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
#player-progress.scrubbing #player-progress-fill { height: 8px; top: 10px; }
#player-progress.scrubbing #player-progress-fill::after { opacity: 1; }
#player-scrub-tip {
  position: absolute; bottom: calc(100% - 4px); transform: translateX(-50%);
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 9px;
  pointer-events: none; white-space: nowrap; z-index: 60;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
}
#player-scrub-tip[hidden] { display: none; }
#player-progress:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.player-btn {
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  font-size: 17px; border-radius: 50%; width: 44px; height: 44px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.player-btn:active { transform: scale(.94); }
.player-title {
  flex: 1; min-width: 0; background: none; border: none; color: var(--text);
  cursor: pointer; min-height: 44px; padding: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px;
}
#player-title-text {
  font-size: 14px; font-weight: 800; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.player-meta { font-size: 11px; color: var(--muted); font-weight: 600; }
.player-title:hover #player-title-text { color: var(--accent2); }
.track-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); padding: 14px; margin-top: 8px; cursor: pointer;
  font-size: 15px; font-weight: 700; text-align: left; min-height: 52px;
}
.track-row.active { border-color: var(--accent); background: var(--card2); }
.track-num { color: var(--accent2); font-weight: 900; width: 22px; text-align: center; }
.track-name { flex: 1; }
.player-attrib { margin-top: 16px; text-align: center; }
.player-attrib a { color: var(--accent2); }

/* thread media */
.media-attach { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.media-hint { font-size: 12px; color: var(--muted); }
.media-preview { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.media-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb .media-kind { position: absolute; left: 4px; bottom: 4px; font-size: 11px; background: rgba(0,0,0,.65); color: #fff; border-radius: 6px; padding: 1px 5px; }
.media-thumb .media-rm { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(0,0,0,.7); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; }
.media-uploading { font-size: 13px; color: var(--muted); width: 100%; }
.thread-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.thread-media img { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; cursor: zoom-in; border: 1px solid var(--line); display: block; }
.thread-media video { width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); background: #000; grid-column: 1 / -1; }
.thread-media-badge { font-size: 12px; color: var(--muted); margin-left: 6px; }
.media-lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; padding: 16px; }
.media-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.reply-attach-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
