:root {
  --bg: #15112A;
  --bg-soft: #1D1838;
  --panel: #251F48;
  --panel-2: #2F2858;
  --line: #4E3F94;
  --line-soft: #33295F;
  --text: #F5F2FF;
  --muted: #B4ABD4;
  --brand: #8C68FF;
  --brand-2: #B56CF0;
  --accent: #FF5C93;
  --danger: #ff5c72;
  --ok: #38e08a;
  --radius: 26px;
  --radius-sm: 12px;
  --shadow: 0 26px 64px -24px rgba(0, 0, 0, .75);
  --glow: 0 18px 44px -18px rgba(124, 92, 255, .7);
  --maxw: 1160px;
  --header-h: 70px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
::selection { background: rgba(124, 92, 255, .4); color: #fff; }

body {
  margin: 0; position: relative;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(124, 92, 255, .22), transparent 60%),
    radial-gradient(900px 560px at 92% 4%, rgba(34, 211, 238, .16), transparent 62%),
    var(--bg);
  color: var(--text); font: 17px/1.6 "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
  overflow-x: hidden;
}
body::before, body::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%;
  filter: blur(70px); opacity: .55;
}
body::before { width: 560px; height: 560px; top: -180px; left: -140px; background: radial-gradient(closest-side, rgba(124, 92, 255, .55), transparent); animation: drift 22s ease-in-out infinite; }
body::after { width: 620px; height: 620px; bottom: -220px; right: -180px; background: radial-gradient(closest-side, rgba(34, 211, 238, .4), transparent); animation: drift 26s ease-in-out infinite reverse; }
@keyframes drift { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(30px, 24px, 0) scale(1.12); } }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.18; margin: 0 0 .5em; letter-spacing: -.4px; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }
main { flex: 1 0 auto; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===== header ===== */
.site-header { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(18px) saturate(140%); background: linear-gradient(180deg, rgba(9, 11, 22, .92), rgba(9, 11, 22, .62)); border-bottom: 1px solid var(--line-soft); }
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 18px; letter-spacing: -.2px; min-width: 0; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo { width: 34px; height: 34px; border-radius: 11px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 10px 24px -8px rgba(124, 92, 255, .9); transition: transform .2s var(--ease); }
.brand:hover .brand-logo { transform: translateY(-1px) rotate(-3deg); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 900; }
/* The panel is a layout-only wrapper on desktop (children behave as direct header items);
   on mobile it becomes a single sliding menu that holds both the links and the account actions. */
.nav-panel { display: contents; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav-link { padding: 9px 15px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; transition: .18s var(--ease); }
.nav-link:hover { color: var(--text); background: rgba(124, 92, 255, .14); }
.nav-link.active { color: #fff; background: linear-gradient(135deg, rgba(124, 92, 255, .85), rgba(34, 211, 238, .55)); box-shadow: var(--glow); }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.account-chip { display: inline-flex; align-items: center; gap: 9px; padding: 4px 12px 4px 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(18, 23, 43, .7); transition: .18s var(--ease); }
.account-chip:hover { border-color: rgba(124, 92, 255, .5); }
.account-name { font-weight: 700; font-size: 14px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; align-items: center; justify-content: center; background: none; border: 0; color: var(--text); cursor: pointer; border-radius: 12px; transition: background .18s var(--ease); }
.nav-toggle:hover { background: rgba(124, 92, 255, .14); }
.nav-toggle-icon { display: inline-flex; flex-direction: column; gap: 5px; width: 22px; }
.nav-toggle-bar { display: block; height: 2px; width: 100%; border-radius: 2px; background: currentColor; transition: transform .25s var(--ease), opacity .2s var(--ease); }
.site-header.open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-header.open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dim the page behind the open mobile menu; a tap anywhere here closes it. */
.nav-backdrop { position: fixed; inset: var(--header-h) 0 0 0; z-index: 38; border: 0; background: rgba(4, 5, 12, .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: fadeIn .2s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
body.nav-open { overflow: hidden; }

/* ===== admin panel button (header) ===== */
.admin-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px 8px 12px; border-radius: 999px;
  font-weight: 800; font-size: 13px; letter-spacing: .1px; color: #fff; white-space: nowrap;
  border: 1px solid rgba(124, 92, 255, .55);
  background: linear-gradient(135deg, rgba(124, 92, 255, .34), rgba(34, 211, 238, .2));
  box-shadow: 0 12px 28px -16px rgba(124, 92, 255, .95), inset 0 0 0 1px rgba(255, 255, 255, .05);
  overflow: hidden; transition: .2s var(--ease); }
.admin-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .22), transparent 70%);
  transform: translateX(-120%); transition: transform .6s var(--ease); }
.admin-btn:hover { transform: translateY(-2px); border-color: rgba(124, 92, 255, .9);
  background: linear-gradient(135deg, rgba(124, 92, 255, .5), rgba(34, 211, 238, .32)); box-shadow: 0 18px 36px -16px rgba(124, 92, 255, 1); }
.admin-btn:hover::after { transform: translateX(120%); }
.admin-btn.active { background: linear-gradient(120deg, var(--brand), #9d7bff 52%, var(--brand-2)); box-shadow: var(--glow); border-color: transparent; }
.admin-btn-icon { display: inline-grid; place-items: center; }
.admin-btn-icon svg { width: 16px; height: 16px; display: block; }

/* ===== avatar ===== */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; overflow: hidden; font-weight: 800; font-size: 12px;
  color: #fff; background: linear-gradient(135deg, hsl(var(--h, 250) 72% 56%), hsl(calc(var(--h, 250) + 45) 72% 46%)); flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-row { display: flex; align-items: center; gap: 16px; }
.avatar-row .avatar { width: 72px; height: 72px; }
.avatar-row-info { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.avatar-row-info .form-note { margin: 0; }

/* ===== buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 13px; border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; transition: .2s var(--ease); background: var(--panel-2); color: var(--text); white-space: nowrap; }
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: linear-gradient(120deg, var(--brand), #9d7bff 52%, var(--brand-2)); background-size: 160% 160%; color: #fff; box-shadow: 0 14px 34px -12px rgba(124, 92, 255, .9); }
.btn.primary:hover { background-position: 100% 0; }
.btn.ghost { background: rgba(255, 255, 255, .02); border-color: var(--line); backdrop-filter: blur(6px); }
.btn.ghost:hover { background: rgba(124, 92, 255, .12); border-color: rgba(124, 92, 255, .5); }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 15px 26px; font-size: 16px; border-radius: 15px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: rgba(255, 92, 114, .12); border-color: rgba(255, 92, 114, .45); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.is-busy { opacity: .7; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(124, 92, 255, .16); color: #c3b7ff; border: 1px solid rgba(124, 92, 255, .32); }
.pill.muted { background: var(--panel-2); color: var(--muted); border-color: var(--line); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }

/* ===== layout helpers ===== */
.page-head { padding: 46px 0 14px; }
.page-head h1 { font-size: clamp(28px, 3.4vw, 36px); font-weight: 900; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.card { position: relative; background: linear-gradient(180deg, rgba(24, 29, 51, .92), rgba(14, 17, 33, .92)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 22px; }
.tab { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: rgba(18, 23, 43, .6); cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); transition: .18s var(--ease); }
.tab:hover { color: var(--text); border-color: rgba(124, 92, 255, .45); }
.tab.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--brand), #9d7bff); box-shadow: var(--glow); }
.empty { padding: 52px 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(18, 23, 43, .35); }

/* ===== hero / home ===== */
.hero { position: relative; padding: 84px 0 48px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(28px, 4vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(40px, 5.6vw, 64px); font-weight: 900; letter-spacing: -1.6px; line-height: 1.04; }
.hero .lead { font-size: 18px; color: var(--muted); max-width: 54ch; margin-top: 14px; }
.hero .hero-cta { margin-top: 26px; }
.download-mobile-note { margin-top: 12px; font-size: 13px; color: var(--muted); display: none; }
@media (max-width: 900px) {
  .hero-frame-desktop { display: none !important; }
  .download-mobile-note { display: block !important; }
  #download-link.btn.primary.lg { opacity: .45; pointer-events: none; cursor: not-allowed; background: rgba(255,255,255,.06); border-color: var(--line); color: var(--muted); box-shadow: none; }
}
.gradient { background: linear-gradient(115deg, var(--brand-2), #9d7bff 52%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-visual { position: relative; display: flex; align-items: center; justify-content: center; }
.hero-frame { border-radius: 22px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: #0a0c14; width: clamp(320px, 36vw, 520px); max-width: 520px; }
.hero-frame img { width: 100%; height: auto; display: block; aspect-ratio: 16/9; object-fit: cover; }
.hero-card { background: linear-gradient(160deg, var(--panel-2), #10142a); border: 1px solid var(--line); border-radius: 24px; padding: 26px; box-shadow: var(--shadow); }
.hero-card h3 { font-size: 18px; }
.hero-card .stack { margin-top: 14px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 46px 0; }
.feature { padding: 26px; transition: .25s var(--ease); }
.feature:hover { transform: translateY(-4px); border-color: rgba(124, 92, 255, .45); box-shadow: var(--glow); }
.feature .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; background: linear-gradient(135deg, rgba(124, 92, 255, .28), rgba(34, 211, 238, .22)); border: 1px solid var(--line); }
.feature h3 { font-size: 17px; }
.feature p { color: var(--muted); margin: 0; font-size: 14px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 48px 0 18px; }
.section-title h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; }
.section-title a { color: #b9b0ff; font-weight: 700; font-size: 14px; }

/* ===== discord banner ===== */
.discord-banner { margin: 10px 0 8px; }
.discord-banner a { display: block; position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); transition: .22s var(--ease); }
.discord-banner a:hover { transform: translateY(-3px); border-color: rgba(124, 92, 255, .6); box-shadow: var(--glow); }
.discord-banner img { width: 100%; height: auto; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.discord-banner .banner-tag { position: absolute; left: 16px; bottom: 14px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(8, 10, 20, .7); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .12); font-weight: 800; font-size: 14px; }
.discord-banner .banner-tag span:last-child { color: var(--muted); font-weight: 600; }

/* ===== loaders ===== */
.skeleton { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line); border-radius: var(--radius); }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
.skeleton-card { height: 300px; }
.skeleton-line { height: 14px; border-radius: 8px; margin: 10px 0; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ===== forms ===== */
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
input, select, textarea { width: 100%; padding: 13px 15px; border-radius: 13px; border: 1px solid var(--line); background: rgba(13, 16, 32, .8); color: var(--text); font: inherit; transition: .15s var(--ease); }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(124, 92, 255, .7); box-shadow: 0 0 0 4px rgba(124, 92, 255, .18); }
textarea { resize: vertical; min-height: 90px; }
.form-note { font-size: 13px; color: var(--muted); }
.auth-shell { max-width: 460px; margin: 60px auto; }
.auth-shell .card { padding: 32px; box-shadow: var(--shadow); }
.auth-shell h1 { font-size: 28px; font-weight: 900; }
.switch { margin-top: 16px; font-size: 14px; color: var(--muted); text-align: center; }
.switch a { color: #b9b0ff; font-weight: 700; }

/* ===== feed + photos ===== */
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.photo-card { background: linear-gradient(180deg, rgba(24, 29, 51, .92), rgba(14, 17, 33, .92)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: .25s var(--ease); }
.photo-card:hover { transform: translateY(-4px); border-color: rgba(124, 92, 255, .4); box-shadow: var(--glow); }
.photo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; }
.photo-author { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.photo-author-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.photo-frame { display: block; aspect-ratio: 4 / 3; background: #0a0c14; }
.photo-img { width: 100%; height: 100%; object-fit: cover; }
.photo-img--fail { background: repeating-linear-gradient(45deg, #12162a, #12162a 12px, #0e1120 12px, #0e1120 24px); }
.photo-caption { padding: 13px 15px 0; margin: 0; font-size: 14px; }
.photo-actions { display: flex; gap: 6px; padding: 11px 13px 15px; margin-top: auto; }
.action { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(23, 29, 53, .7); color: var(--muted); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; transition: .15s var(--ease); }
.action:hover { color: var(--text); border-color: rgba(124, 92, 255, .5); }
.action.on { color: #ffd166; border-color: rgba(255, 209, 102, .45); background: rgba(255, 209, 102, .1); }
.action.danger:hover { color: var(--danger); border-color: rgba(255, 92, 114, .45); }
.photo-single { max-width: 780px; margin: 0 auto; }
.photo-single .photo-frame { aspect-ratio: auto; }
.photo-single .photo-img { height: auto; object-fit: contain; }

/* ===== comments ===== */
.comments { margin-top: 22px; }
.comment { display: flex; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); }
.comment-body { flex: 1; }
.comment-body .name { font-weight: 700; font-size: 14px; }
.comment-body p { margin: 3px 0 0; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; gap: 10px; margin-top: 16px; }
.comment-form input { flex: 1; }

/* ===== profile ===== */
.profile-hero { display: flex; gap: 26px; align-items: center; padding: 30px; }
.profile-hero .avatar { width: 100px; height: 100px; font-size: 32px; }
.profile-name { font-size: 30px; font-weight: 900; }
.profile-stats { display: flex; gap: 28px; margin-top: 12px; }
.profile-stats b { font-size: 21px; display: block; }
.profile-stats span { color: var(--muted); font-size: 13px; }

/* ===== rooms ===== */
.rooms-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 6px; }
.rooms-head p { margin: 6px 0 0; max-width: 62ch; }
.rooms-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 18px; }
.rooms-search { position: relative; flex: 1 1 300px; max-width: 420px; min-width: 0; }
.rooms-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.rooms-search input { width: 100%; padding-left: 42px; }
.rooms-tabs { margin: 0; }
.rooms-status { margin: -6px 0 18px; }
.rooms-empty .empty-actions { margin-top: 6px; }

.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 256px), 1fr)); gap: 22px; align-items: start; }
.room-card { padding: 0; overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(24, 29, 51, .92), rgba(14, 17, 33, .92));
  border: 1px solid var(--line); border-radius: var(--radius); transition: .25s var(--ease); }
.room-card:hover { transform: translateY(-4px); border-color: rgba(124, 92, 255, .45); box-shadow: var(--glow); }
.room-card.mine { border-color: rgba(124, 92, 255, .35); }

/* Covers keep a fixed 16/9 box with object-fit so images never distort, and fall back to an
   on-brand gradient with a glassy glyph when a room has no usable image. */
.room-cover { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background:
    radial-gradient(120% 130% at 18% 8%, hsla(var(--rh, 268), 85%, 62%, .5), transparent 58%),
    linear-gradient(135deg, #221b52, #153048); }
.room-cover::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 74% 16%, rgba(255, 255, 255, .16), transparent 55%), linear-gradient(180deg, rgba(7, 9, 18, .45), transparent 42%); }
.room-cover-media { position: absolute; inset: 0; display: block; }
.room-cover-img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), filter .3s var(--ease); }
.room-card:hover .room-cover-img { transform: scale(1.05); filter: brightness(1.06); }
.room-cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.room-cover-glyph { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 20px; color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(4px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16); }
.room-cover-glyph .icon { width: 30px; height: 30px; }

.room-cover .room-badges { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 2; margin: 0; pointer-events: none; }
.room-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.room-badge { font-size: 11px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); }
.room-cover .room-badge { backdrop-filter: blur(6px); box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .85); }
.room-badge.official { color: #1b1400; background: linear-gradient(120deg, #ffe08a, #ffb020); border-color: transparent; }
.room-badge.public { color: #d7fff0; background: rgba(11, 22, 20, .62); border-color: rgba(56, 224, 138, .45); }
.room-badge.private { color: #ffdde3; background: rgba(26, 12, 16, .62); border-color: rgba(255, 92, 114, .45); }
.room-badge.unpublished { color: #ffe6bd; background: rgba(26, 18, 8, .62); border-color: rgba(255, 176, 32, .4); }

.room-body { padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.room-card-title { font-size: 17px; margin: 0; }
.room-card-title a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .15s; }
.room-card-title a:hover { color: #c9bdff; }
.room-owner { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; max-width: 100%; }
.room-owner .icon { width: 14px; height: 14px; flex: none; color: var(--muted); }
.room-owner-name { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-owner:hover .room-owner-name { color: #c9bdff; }
.room-facts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.room-fact { display: inline-flex; align-items: center; gap: 6px; }
.room-fact .icon { width: 15px; height: 15px; color: var(--muted); }
.room-actions { margin-top: auto; display: flex; gap: 10px; padding-top: 6px; }
.room-actions .btn { flex: 1 1 auto; min-width: 0; }
.room-join { font-weight: 800; }
.room-join .icon { width: 13px; height: 13px; }
.room-hero { position: relative; aspect-ratio: 16 / 9; margin: -22px -22px 18px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; background: linear-gradient(135deg, #1a2140, #0d1122); }
.room-hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room-hero-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.join-box { margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(18, 23, 43, .6); }
.join-code { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.join-code code { background: #0a0c14; padding: 6px 12px; border-radius: 9px; font-size: 14px; border: 1px solid var(--line); }
.join-actions { display: flex; gap: 10px; margin-top: 12px; }

/* ===== notifications ===== */
.notif { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(18, 23, 43, .6); }
.notif.unread { border-color: rgba(124, 92, 255, .5); background: linear-gradient(180deg, rgba(124, 92, 255, .12), rgba(18, 23, 43, .6)); }
.notif-body { flex: 1; }
.notif-actions { display: flex; gap: 8px; }

/* ===== toasts ===== */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 90; }
.toast { padding: 13px 17px; border-radius: 13px; background: rgba(23, 29, 53, .95); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; max-width: 350px; animation: toastIn .35s var(--ease); }
.toast.ok { border-color: rgba(56, 224, 138, .5); }
.toast.error, .toast.err, .toast.danger { border-color: rgba(255, 92, 114, .55); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ===== footer ===== */
.site-footer { border-top: 1px solid var(--line-soft); margin-top: 72px; padding: 34px 0; color: var(--muted); font-size: 14px; flex-shrink: 0; backdrop-filter: blur(8px); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { transition: .15s; }
.footer-links a:hover { color: var(--text); }

/* ===== stats grid (admin) ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { padding: 20px; text-align: center; }
.stat b { font-size: 28px; display: block; background: linear-gradient(120deg, var(--brand-2), #9d7bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.link { background: none; border: 0; color: #b9b0ff; cursor: pointer; font: inherit; font-weight: 700; padding: 0; }

/* ===== admin: photo moderation ===== */
.admin-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.admin-photo { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.admin-thumb-link { display: block; background: #0a0c14; }
.admin-thumb { display: block; width: 100%; height: 160px; object-fit: cover; }
.admin-thumb.photo-img--fail { object-fit: contain; }
.admin-photo-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; }
.admin-photo-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  :root { --header-h: 62px; }
  .header-inner { gap: 12px; }
  .hero { grid-template-columns: 1fr; padding: 48px 0 28px; gap: 30px; }
}
@media (max-width: 900px) {
  .hero-frame { display: none !important; }
  .download-mobile-note { display: block !important; }
  #download-link.btn.primary { opacity: .5; pointer-events: none; cursor: not-allowed; background: rgba(255,255,255,.08); border-color: var(--line); color: var(--muted); }
  .profile-hero { flex-direction: column; text-align: center; }
  .nav-toggle { display: inline-flex; }

  /* One overlay panel holds the links and the account actions together. */
  .nav-panel {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column;
    padding: 14px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, var(--bg-soft), var(--bg));
    border-top: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-10px); opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
    z-index: 39;
  }
  .site-header.open .nav-panel { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
  .nav { position: static; flex-direction: column; gap: 4px; margin: 0; padding: 0; border: 0; background: none; }
  .nav-link { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-radius: 12px; font-size: 16px; }
  .nav-link .badge { margin-left: auto; }
  .account { flex-direction: column; align-items: stretch; gap: 10px; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
  .account .btn { width: 100%; justify-content: center; padding: 14px 16px; font-size: 15px; }
  .account-chip { width: 100%; justify-content: flex-start; }
  .account-name { max-width: none; }
}

/* ===== focus visibility ===== */
a:focus-visible, button:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand-2); outline-offset: 2px;
}
.avatar-initials { font-weight: 800; letter-spacing: .5px; }

/* ===== profile (v2) ===== */
.profile-card { position: relative; overflow: hidden; padding: 0; margin-top: 22px; }
.profile-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 130px; pointer-events: none;
  background:
    radial-gradient(620px 210px at 16% 0%, rgba(124, 92, 255, .38), transparent 70%),
    radial-gradient(520px 200px at 88% 0%, rgba(34, 211, 238, .24), transparent 72%); }
.profile-body { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px 26px; align-items: start; padding: 30px; }
.profile-avatar { position: relative; justify-self: start; }
.profile-avatar .avatar { width: 120px; height: 120px; font-size: 40px;
  box-shadow: 0 0 0 4px rgba(124, 92, 255, .18), 0 22px 44px -18px rgba(124, 92, 255, .9); }
.profile-avatar-level { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); padding: 3px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 800; color: #fff; white-space: nowrap;
  background: linear-gradient(120deg, var(--brand), var(--brand-2)); border: 2px solid var(--bg-soft); }
.profile-info { min-width: 0; }
.profile-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-name { font-size: clamp(24px, 3.4vw, 32px); font-weight: 900; margin: 0; overflow-wrap: anywhere; }
.profile-role { text-transform: capitalize; }
.profile-friend { background: rgba(56, 224, 138, .14); color: #7ff0b6; border-color: rgba(56, 224, 138, .35); }
.profile-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 0; }
.profile-handle { color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.profile-chip { font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); background: rgba(255, 255, 255, .03); padding: 3px 10px; border-radius: 999px; }
.profile-bio { margin: 14px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; max-width: 480px; }
.profile-stat { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(13, 16, 32, .6); }
.profile-stat b { font-size: 22px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-stat span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.profile-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 148px; }
.profile-actions .btn { width: 100%; }

/* tabs attached to the card */
.profile-tabs { display: inline-flex; gap: 4px; margin: 20px 0 22px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(13, 16, 32, .75); }
.profile-tabs .tab { border: 0; background: transparent; padding: 9px 20px; }
.profile-tabs .tab.active { background: linear-gradient(135deg, var(--brand), #9d7bff); box-shadow: var(--glow); color: #fff; }

/* photos grid + tiles */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 14px; }
.photo-tile { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; padding: 0; color: inherit; cursor: pointer;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #0a0c14; transition: .22s var(--ease); }
.photo-tile:hover { transform: translateY(-3px); border-color: rgba(124, 92, 255, .55); box-shadow: var(--glow); }
.photo-tile-frame { position: absolute; inset: 0; display: block; }
.photo-tile-frame .photo-img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.photo-tile:hover .photo-tile-frame .photo-img { transform: scale(1.06); }
.photo-tile-cap { position: absolute; inset: auto 0 0 0; padding: 24px 12px 10px; text-align: left; font-size: 13px; font-weight: 600; color: #fff;
  background: linear-gradient(transparent, rgba(4, 5, 12, .88)); opacity: 0; transform: translateY(6px); transition: .22s var(--ease);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-tile:hover .photo-tile-cap, .photo-tile:focus-visible .photo-tile-cap { opacity: 1; transform: none; }
.photo-tile-badges { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.photo-tile-badge { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; backdrop-filter: blur(6px);
  background: rgba(8, 10, 20, .75); border: 1px solid rgba(255, 255, 255, .16); }
.skeleton-tile { aspect-ratio: 1 / 1; border-radius: 16px; pointer-events: none; }
.profile-empty { display: grid; gap: 8px; place-items: center; padding: 30px 22px; text-align: center; }
.profile-empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 4px; border-radius: 16px; color: #c3b7ff;
  background: linear-gradient(135deg, rgba(124, 92, 255, .24), rgba(34, 211, 238, .16)); border: 1px solid var(--line); }
.profile-empty-title { margin: 0; font-size: 18px; }
.profile-empty-text { margin: 0; max-width: 44ch; font-size: 14px; }
.profile-empty .btn { margin-top: 10px; }

/* about tab */
.profile-about { padding: 12px 26px 24px; }
.about-list { display: grid; gap: 0; margin: 0; }
.about-row { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.about-row:last-child { border-bottom: 0; }
.about-row dt { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.about-row dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.about-row dd.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; color: #c3b7ff; }
.about-row.block { grid-template-columns: 1fr; gap: 4px; }
.about-note { margin: 18px 0 0; font-size: 13px; }

/* lightbox */
body.lightbox-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background: rgba(4, 5, 12, .88); backdrop-filter: blur(6px); animation: lightboxIn .18s var(--ease); }
.lightbox.out { opacity: 0; transition: opacity .18s; }
.lightbox-figure { margin: 0; max-width: min(1100px, 94vw); max-height: 92vh; display: flex; flex-direction: column; gap: 12px; }
.lightbox-img { max-width: 100%; max-height: 80vh; width: auto; height: auto; object-fit: contain; border-radius: 14px; background: #0a0c14; box-shadow: var(--shadow); }
.lightbox-cap { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.lightbox-cap span { color: var(--text); }
.lightbox-link { color: #b9b0ff; font-weight: 700; }
.lightbox-close { position: absolute; top: 18px; right: 20px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(18, 23, 43, .85); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.lightbox-close:hover { border-color: rgba(124, 92, 255, .6); }
@keyframes lightboxIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .profile-body { grid-template-columns: auto minmax(0, 1fr); }
  .profile-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .profile-actions .btn { width: auto; flex: 1 1 auto; }
}
@media (max-width: 640px) {
  .profile-body { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 20px; padding: 26px 18px; }
  .profile-avatar .avatar { width: 96px; height: 96px; font-size: 32px; }
  .profile-name-row, .profile-sub { justify-content: center; }
  .profile-stats { width: 100%; margin-left: auto; margin-right: auto; }
  .profile-stat { padding: 10px 12px; }
  .profile-bio { margin-left: auto; margin-right: auto; }
  .profile-actions { flex-direction: column; width: 100%; }
  .profile-actions .btn { width: 100%; }
  .profile-tabs { display: flex; width: 100%; justify-content: center; }
  .profile-tabs .tab { flex: 1; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .about-row { grid-template-columns: 1fr; gap: 3px; }
  .lightbox { padding: 14px; }
  .lightbox-img { max-height: 72vh; }
}

/* ===== community feed ===== */
.community-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.community-main { min-width: 0; }
.community-head { margin: 30px 0 18px; }
.community-head h1 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 900; }
.community-head p { margin: 6px 0 0; max-width: 62ch; }
.feed-more { margin: 22px 0 10px; }

.feed-filters { display: flex; gap: 4px; width: fit-content; max-width: 100%; margin: 0 0 22px; padding: 6px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(13, 16, 32, .75); overflow-x: auto; }
.feed-filters .tab { border: 0; background: transparent; padding: 9px 18px; white-space: nowrap; }
.feed-filters .tab.active { color: #fff; background: linear-gradient(135deg, var(--brand), #9d7bff); box-shadow: var(--glow); }

/* action bar */
.action .icon { width: 16px; height: 16px; display: block; }
.action.on .icon { fill: currentColor; }
.action:disabled { opacity: .55; cursor: default; }
.action:disabled:hover { color: var(--muted); border-color: var(--line); }
.action.on:disabled:hover { color: #ffd166; border-color: rgba(255, 209, 102, .45); }

/* feed card image polish */
.photo-frame { position: relative; overflow: hidden; }
.photo-frame .photo-img { transition: transform .5s var(--ease); }
.photo-card:hover .photo-frame .photo-img { transform: scale(1.04); }
.photo-img--fail { object-fit: contain !important; }

/* sidebar */
.community-side { display: grid; gap: 18px; }
.side-card { padding: 20px; }
.side-title { font-size: 15px; margin: 0 0 12px; font-weight: 800; letter-spacing: .2px; }
.side-note { margin: -6px 0 12px; }
.side-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; transition: background .15s var(--ease); }
.side-user:hover { background: rgba(124, 92, 255, .12); }
.side-user-name { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.side-news { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.side-news:first-of-type { border-top: 0; padding-top: 0; }
.side-news b { display: block; font-size: 14px; }
.side-news p { margin: 4px 0 0; font-size: 13px; overflow-wrap: anywhere; }

@media (max-width: 1000px) {
  .community-layout { grid-template-columns: 1fr; gap: 22px; }
  .community-side { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
}
@media (max-width: 520px) {
  .community-side { grid-template-columns: 1fr; }
  .feed-filters { width: 100%; }
}

/* ===== shared empty states ===== */
.empty-icon { display: inline-grid; place-items: center; width: 54px; height: 54px; margin-bottom: 12px; border-radius: 16px;
  background: rgba(124, 92, 255, .12); border: 1px solid rgba(124, 92, 255, .3); color: #b9b0ff; }
.empty-icon .icon { width: 26px; height: 26px; }
.empty-title { margin: 0 0 6px; font-size: 17px; }
.empty-text { margin: 0 auto; max-width: 44ch; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* ===== responsive tweaks for rooms ===== */
@media (max-width: 640px) {
  .rooms-toolbar { gap: 10px; }
  .rooms-search { flex-basis: 100%; max-width: none; }
  .rooms-tabs { width: 100%; }
}

/* ===== reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  body::before, body::after { animation: none; }
  .room-card:hover, .photo-card:hover, .btn:hover { transform: none; }
  .room-card:hover .room-cover-img, .photo-card:hover .photo-frame .photo-img { transform: none; }
  .spinner { animation: none; }
}

/* ===== friends page ===== */
.friends-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.friends-head p { margin: 6px 0 0; max-width: 62ch; }
.friend-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.friend-stat {
  min-width: 92px; padding: 12px 16px; border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 29, 51, .9), rgba(14, 17, 33, .9));
}
.friend-stat b {
  display: block; font-size: 24px; font-weight: 900; line-height: 1.1;
  background: linear-gradient(120deg, var(--brand-2), #9d7bff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.friend-stat span { font-size: 12px; color: var(--muted); }

.friend-add { margin-bottom: 8px; }
.friend-add h3 { margin: 0 0 14px; }
.friend-search { display: flex; align-items: center; gap: 10px; position: relative; }
.friend-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.friend-search input { flex: 1; min-width: 0; padding-left: 42px; }
.friend-search .btn { flex: none; }
.friend-results { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); margin-top: 16px; }
.friend-results:empty { margin-top: 0; }
.fr-loading { display: flex; align-items: center; gap: 10px; padding: 14px 4px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(124, 92, 255, .35); border-top-color: var(--brand); display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.friend-section { margin-top: 34px; }
.friend-filter { margin-bottom: 14px; max-width: 340px; }
.friend-filter input { width: 100%; }
.friend-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.friend-grid > .empty { grid-column: 1 / -1; }
.friend-requests { display: block; }
.fr-group { margin-bottom: 18px; }
.fr-group:last-child { margin-bottom: 0; }
.fr-group-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.fr-group-title { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); }
.fr-group-count { font-size: 12px; font-weight: 800; color: #b9b0ff; }
.fr-group-note { flex-basis: 100%; margin: 2px 0 0; }
.fr-group-empty { margin: 0 0 4px; }

.fr-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(24, 29, 51, .75), rgba(14, 17, 33, .75));
  transition: .2s var(--ease);
}
.fr-card:hover { border-color: rgba(124, 92, 255, .4); background: rgba(124, 92, 255, .07); }
.fr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-name { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-body:hover .fr-name { color: #c9bdff; }
.fr-state {
  flex: none; font-size: 11px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); color: var(--muted); background: var(--panel-2);
}
.fr-state.pending { color: #ffe6bd; background: rgba(255, 176, 32, .12); border-color: rgba(255, 176, 32, .35); }
.fr-state.friends { color: #9ff0d2; background: rgba(56, 224, 138, .12); border-color: rgba(56, 224, 138, .35); }
.fr-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: none; }
.fr-actions .btn { flex: none; }

@media (max-width: 720px) {
  .friend-grid, .friend-results { grid-template-columns: 1fr; }
  .fr-card { flex-wrap: wrap; }
  .fr-actions { width: 100%; }
  .fr-actions .btn { flex: 1; }
  .friend-search { flex-wrap: wrap; }
  .friend-search input { flex-basis: 100%; }
  .friend-search .btn { width: 100%; }
  .friend-stat { flex: 1; min-width: 0; }
}

/* ===== login background (animated premium) ===== */
body.login-page { background: #07050f; }
body.login-page::before,
body.login-page::after { display: none; }

.login-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1200px 820px at 16% 10%, rgba(91, 62, 176, .6), transparent 60%),
    radial-gradient(1100px 780px at 86% 90%, rgba(58, 40, 128, .55), transparent 62%),
    linear-gradient(158deg, #0a0616 0%, #1a0e3d 44%, #130a30 68%, #08050f 100%);
}

/* 2. ambient light blobs */
.login-bg::before,
.login-bg::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none; border-radius: 50%;
  filter: blur(64px); opacity: .5; will-change: transform;
}
.login-bg::before { width: 62vmax; height: 62vmax; top: -20vmax; left: -14vmax; background: radial-gradient(closest-side, rgba(124, 92, 255, .5), transparent 72%); animation: loginGlow 26s ease-in-out infinite; }
.login-bg::after { width: 66vmax; height: 66vmax; bottom: -24vmax; right: -16vmax; background: radial-gradient(closest-side, rgba(99, 102, 241, .45), transparent 72%); animation: loginGlow 32s ease-in-out infinite reverse; }
@keyframes loginGlow {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .42; }
  50% { transform: translate3d(3vmax, 2vmax, 0) scale(1.14); opacity: .6; }
}

/* 3. diagonal watermark pattern of the official Roomix mark */
.login-bg__pattern {
  position: absolute; left: 50%; top: 50%; width: 200vmax; height: 200vmax; z-index: 1;
  transform: translate(-50%, -50%) rotate(-45deg);
  background-color: #a78bfa; opacity: .05;
  -webkit-mask-image: url('../img/roomix-mark.png'); mask-image: url('../img/roomix-mark.png');
  -webkit-mask-repeat: repeat; mask-repeat: repeat;
  -webkit-mask-size: 230px 230px; mask-size: 230px 230px;
  -webkit-mask-position: 40px 20px; mask-position: 40px 20px;
}
.login-bg__pattern.is-back {
  background-color: #8b7bff; opacity: .032;
  -webkit-mask-size: 360px 360px; mask-size: 360px 360px;
  -webkit-mask-position: 150px 110px; mask-position: 150px 110px;
}

/* 4. animated violet light beam sweeping on the diagonal */
.login-bg__beam {
  position: absolute; left: 50%; top: 50%; z-index: 3;
  width: 200vmax; height: 10vmax; margin: -5vmax 0 0 -100vmax;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(196, 181, 253, .16) 40%,
    rgba(224, 214, 254, .30) 50%,
    rgba(196, 181, 253, .16) 60%,
    transparent 100%);
  filter: blur(22px); will-change: transform;
  animation: loginBeam 20s linear infinite;
}
@keyframes loginBeam {
  0%   { transform: translate3d(-100vmax, -100vmax, 0) rotate(-45deg); opacity: 0; }
  12%  { opacity: .85; }
  50%  { opacity: 1; }
  88%  { opacity: .85; }
  100% { transform: translate3d(100vmax, 100vmax, 0) rotate(-45deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .login-bg::before, .login-bg::after { animation: none !important; }
  .login-bg__beam { animation: none !important; transform: translate3d(0, 0, 0) rotate(-45deg); opacity: .5; }
}

/* ===== extra mobile polish ===== */
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .page-head { padding: 30px 0 12px; }
  .section-title { margin: 36px 0 14px; }
  .section-title h2 { font-size: 22px; }
  .hero { padding: 34px 0 22px; gap: 24px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .hero .lead { font-size: 16px; }
  .brand-name { font-size: 16px; }
  .auth-shell { margin: 30px auto; }
  .auth-shell .card { padding: 24px 20px; }
  .footer-inner { flex-direction: column; gap: 14px; }
  .footer-links { gap: 12px; }
  .toasts { left: 12px; right: 12px; }
  .toast { max-width: none; width: 100%; }
}
@media (max-width: 520px) {
  .discord-banner .banner-tag { left: 10px; right: 10px; bottom: 10px; padding: 6px 10px; font-size: 12px; flex-wrap: wrap; }
  .photo-card .photo-author-name { max-width: 110px; }
  .room-facts { gap: 10px; }
  .friend-stat { font-size: 11px; padding: 10px 12px; }
  .friend-stat b { font-size: 20px; }
  .comment-form { flex-direction: column; }
  .profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .profile-card::before { height: 90px; }
}
/* Comfortable tap targets for rows of small buttons/links (mobile). */
@media (any-pointer: coarse) and (max-width: 900px) {
  .btn.sm, .action { min-height: 42px; }
  input, select, textarea { font-size: 16px; }
}
