@import './variables.css';

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Перекрыть браузерный автофил на всех инпутах платформы */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-tertiary) inset;
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--text-primary);
  transition: background-color 5000s ease-in-out 0s;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

/* ── Tavern ambient glow ────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(ellipse 320px 500px at 0% 65%,  rgba(180,70,15,0.10), transparent),
    radial-gradient(ellipse 120px 120px at 18% 28%, rgba(232,160,48,0.07), transparent),
    radial-gradient(ellipse  80px  80px at 52% 12%, rgba(232,160,48,0.05), transparent),
    radial-gradient(ellipse 100px 100px at 83% 22%, rgba(220,140,40,0.06), transparent),
    radial-gradient(ellipse  70px  70px at 70% 58%, rgba(232,160,48,0.04), transparent),
    radial-gradient(ellipse 200px 160px at 95% 80%, rgba(180,80,20,0.07), transparent),
    radial-gradient(ellipse 500px 200px at 50% 100%, rgba(30,12,4,0.5),   transparent);
}

#app { display: flex; height: 100vh; position: relative; z-index: 1; }

/* ── Topbar ─────────────────────────────────────── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background-color: #0D0602;
  background-image: url('/images/games/lazy-guild-topbar.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(196,120,32,0.12), 0 2px 12px rgba(10,5,2,0.8);
  border-bottom: none;
  display: flex; align-items: center; padding: 0 16px;
  gap: 12px; z-index: 100;
}



#topbar .logo {
  font-weight: 800; font-size: 17px; color: var(--glow);
  letter-spacing: -0.3px; white-space: nowrap;
  text-shadow: 0 0 18px rgba(232,160,48,0.55), 0 1px 4px rgba(0,0,0,0.8);
  display: flex; align-items: center; gap: 7px;
  cursor: pointer;
}
.logo-icon {
  width: 52px; height: 52px; object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(232,160,48,0.6));
}

.tag-filters { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; }
.tag-chip {
  padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
  background: var(--bg-tertiary); color: var(--text-muted);
  border: 1px solid transparent; cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.tag-chip:hover { background: var(--bg-hover); color: var(--text-secondary); border-color: var(--border); }
.tag-chip.active { background: var(--glow-soft); color: var(--glow); border-color: var(--glow-border); }

.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.rating-badge { font-size: 12px; color: var(--warning); font-weight: 700; }


/* ── Layout ─────────────────────────────────────── */
#layout {
  display: flex; width: 100%; margin-top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
}

/* ── Panels ─────────────────────────────────────── */
.panel {
  background: rgba(22, 10, 4, 0.97);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column;
  transition: width var(--transition);
  overflow: hidden; flex-shrink: 0;
}
#left-panel  { width: var(--panel-width); border-right: 1px solid var(--border); }
#left-panel.collapsed  { width: var(--panel-width-collapsed); }
#right-panel { width: var(--panel-width); border-left: 1px solid var(--border); }
#right-panel.collapsed { width: var(--panel-width-collapsed); }

/* ── Collapsed panel — hide text, center icons ─── */
.panel.collapsed .panel-header h3,
.panel.collapsed .panel-filters,
.panel.collapsed .panel-search,
.panel.collapsed .create-lobby-btn,
.panel.collapsed .panel-section-label,
.panel.collapsed .panel-empty { display: none; }
.rp-game-icon-outer {
  position: relative; flex-shrink: 0;
  width: 38px; height: 38px;
}
.rp-act-badge {
  position: absolute; top: -5px; right: -6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--glow); color: #0a1628;
  border-radius: 8px; font-size: 10px; font-weight: 800;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--bg-secondary);
  z-index: 2;
}
.rp-act-badge-idle {
  background: var(--bg-tertiary); color: var(--text-muted);
  border: 1px solid var(--border); font-size: 9px; padding: 0 3px;
}
.panel.collapsed .rp-act-badge { display: flex; }

.panel.collapsed .rp-game-info { display: none; }
.panel.collapsed .rp-game-card { justify-content: center; padding: 6px 0; }

.panel.collapsed .panel-header {
  justify-content: center; padding: 12px 0;
}
.panel.collapsed .panel-toggle { margin: 0 auto; }

/* Player card collapsed */
.panel.collapsed .player-card .info,
.panel.collapsed .player-card .invite-btn { display: none; }
.panel.collapsed .player-card { justify-content: center; padding: 6px 0; }

/* Lobby card collapsed */
.panel.collapsed .lobby-card .lobby-name,
.panel.collapsed .lobby-card .lobby-game,
.panel.collapsed .lobby-card .lobby-meta { display: none; }
.panel.collapsed .lobby-card {
  display: flex; justify-content: center; align-items: center;
  padding: 8px 0; font-size: 20px;
}
.panel.collapsed .lobby-card::before { content: '🎮'; }

/* User chip collapsed */
.panel.collapsed .panel-user .user-info,
.panel.collapsed .panel-user .settings-btn { display: none; }
.panel.collapsed .panel-user { justify-content: center; }

.panel-toggle { transition: var(--transition); }

.panel-header {
  padding: 12px 16px 8px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.panel-header h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.9px; color: var(--text-muted); flex: 1; }

.panel-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; display: flex; align-items: center; font-size: 11px; }
.panel-toggle:hover { color: var(--glow); background: var(--glow-soft); }

.panel-filters { display: flex; gap: 4px; padding: 8px 12px; flex-shrink: 0; }
.filter-btn {
  flex: 1; padding: 5px 4px; font-size: 11px; font-weight: 600;
  border: 1px solid transparent; border-radius: var(--border-radius-sm);
  background: var(--bg-tertiary); color: var(--text-muted); cursor: pointer; transition: var(--transition);
}
.filter-btn.active { background: var(--glow-soft); color: var(--glow); border-color: var(--glow-border); }
.filter-btn:hover:not(.active) { background: var(--bg-hover); color: var(--text-secondary); }

.panel-search { padding: 4px 12px 8px; flex-shrink: 0; }
.panel-search input {
  width: 100%; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--border-radius-sm); color: var(--text-primary);
  padding: 6px 10px; font-size: 13px; outline: none; transition: var(--transition);
}
.panel-search input:focus { border-color: var(--accent); }
.panel-search input::placeholder { color: var(--text-muted); }

.panel-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.panel-list::-webkit-scrollbar { width: 4px; }
.panel-list::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 2px; }

/* ── User chip (bottom-left) ─────────────────────── */
.panel-user {
  padding: 10px 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; cursor: pointer;
  transition: var(--transition);
}
.panel-user:hover { background: var(--bg-hover); }
.panel-user .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--glow));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 0 12px rgba(232,160,48,0.25);
}
.panel-user .user-info { flex: 1; min-width: 0; }
.panel-user .user-info .username { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 4px; min-width: 0; }
.panel-user .user-info .username > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.panel-user .user-info .username .rank-badge-ic { flex-shrink: 0; }
.panel-user .user-info .user-rating { font-size: 11px; color: var(--warning); font-weight: 600; }
.panel-user .settings-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; font-size: 15px; display: flex; align-items: center; }
.panel-user .settings-btn:hover { color: var(--glow); }

/* ── Main content ────────────────────────────────── */
#main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Main view tabs (Игры / Лента) ───────────────── */
.main-view-tabs {
  display: flex; gap: 6px; padding: 10px 20px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.main-view-tab {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  padding: 6px 14px 8px; border-radius: 6px 6px 0 0;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.main-view-tab:hover { color: var(--text-primary); }
.main-view-tab.active { color: var(--glow); border-bottom-color: var(--glow); font-weight: 700; font-size: 14px; text-shadow: 0 0 12px rgba(232,160,48,0.35); }

.feed-unread-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--glow); margin-left: 5px; vertical-align: middle;
  animation: feed-dot-pulse 1.4s ease-in-out infinite;
}
@keyframes feed-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.65); }
}

/* ── Games section ───────────────────────────────── */
#games-section {
  flex: 1; overflow-y: auto; padding: 20px;
  transition: padding 0.2s ease;
}

/* ── Subscription feed ───────────────────────────── */
#feed-section { flex: 1; overflow-y: auto; padding: 16px 20px; }
#guild-section, #tavern-section { flex: 1; overflow-y: auto; }
#cinema-section { flex: 1; min-height: 0; display: flex; }

/* ── Кинозал ── */
.cinema-page { flex:1; min-height:0; display:flex; flex-direction:column; gap:14px; padding:16px 20px 20px; width:100%; }
.cinema-bar { display:flex; gap:10px; }
.cinema-bar input { flex:1; background:var(--bg-primary); border:1px solid var(--border); border-radius:10px; color:var(--text-primary); padding:11px 16px; font-size:14px; outline:none; transition:border-color .15s; }
.cinema-bar input:focus { border-color:var(--accent); }
.cinema-load-btn { padding:11px 24px; border:none; border-radius:10px; background:linear-gradient(135deg,var(--accent),var(--glow)); color:#2a1700; font-weight:700; font-size:14px; cursor:pointer; transition:filter .15s; }
.cinema-load-btn:hover { filter:brightness(1.08); }
.cinema-main { flex:1; min-height:0; display:flex; gap:14px; }
.cinema-stage { flex:1; min-width:0; position:relative; background:#000; border:1px solid var(--border); border-radius:14px; overflow:hidden; display:flex; align-items:center; justify-content:center; }
.cinema-stage video { width:100%; height:100%; object-fit:contain; display:none; background:#000; }
.cinema-stage.cinema-has-video video { display:block; }
.cinema-stage.cinema-has-video .cinema-placeholder { display:none; }
.cinema-placeholder { text-align:center; padding:30px; color:var(--text-muted); }
.cinema-ph-ic { font-size:46px; margin-bottom:12px; }
.cinema-ph-title { font-size:20px; font-weight:800; color:var(--text-primary); margin-bottom:8px; }
.cinema-ph-sub { font-size:14px; line-height:1.6; max-width:430px; margin:0 auto; }
.cinema-side { width:230px; flex-shrink:0; background:var(--bg-secondary); border:1px solid var(--border); border-radius:14px; padding:14px; display:flex; flex-direction:column; gap:6px; overflow-y:auto; }
.cinema-side-head { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:var(--text-muted); margin-bottom:4px; }
.cinema-member { display:flex; align-items:center; gap:9px; padding:5px 4px; font-size:14px; color:var(--text-primary); }
.cinema-av { width:30px; height:30px; border-radius:50%; overflow:hidden; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; background:linear-gradient(135deg,var(--accent),var(--glow)); color:#2a1700; font-size:11px; font-weight:700; }
.cinema-empty-m { font-size:13px; color:var(--text-muted); padding:6px 4px; }
.cinema-now-wrap { margin-top:auto; padding-top:10px; border-top:1px solid var(--border); }
.cinema-now-label { font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.6px; margin-bottom:4px; }
.cinema-now { font-size:13px; color:var(--text-secondary); word-break:break-all; }

/* ── Кинозал v2: список комнат / выбор источника / плеер ── */
.cin-page { flex:1; min-height:0; display:flex; flex-direction:column; gap:16px; padding:20px 24px 24px; width:100%; overflow-y:auto; }
.cin-head { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.cin-title { font-size:24px; font-weight:800; margin:0; color:var(--text-primary); }
.cin-sub { font-size:14px; color:var(--text-muted); flex-basis:100%; }
.cin-back { background:rgba(255,255,255,.06); border:1px solid var(--border); color:var(--text-secondary); border-radius:9px; padding:7px 14px; font-size:13px; font-weight:600; cursor:pointer; transition:background .15s; }
.cin-back:hover { background:rgba(255,255,255,.12); color:var(--text-primary); }
/* список комнат */
.cin-rooms { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:14px; }
.cin-empty { grid-column:1/-1; color:var(--text-muted); font-size:14px; padding:6px 2px; }
/* полоска создания комнаты (в стиле .games-filter-bar) */
.cin-bar { margin-bottom:16px; }
.cin-createrow { display:flex; gap:8px; flex:1; align-items:center; }
.cin-createrow input { flex:1; background:var(--bg-tertiary); border:1px solid var(--border); border-radius:20px; color:var(--text-primary); padding:7px 16px; font-size:13px; outline:none; transition:var(--transition); }
.cin-createrow input:first-child { flex:2; }
.cin-createrow input:focus { border-color:var(--glow); }
.cin-createrow input::placeholder { color:var(--text-muted); }
.cin-go-btn { width:32px; height:32px; flex-shrink:0; border:none; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--glow)); color:#2a1700; cursor:pointer; display:flex; align-items:center; justify-content:center; padding-left:2px; transition:filter .15s, transform .1s; }
.cin-go-btn:hover { filter:brightness(1.1); }
.cin-go-btn:active { transform:scale(.95); }

/* Тумблер приватности в строке создания */
.cin-lock-btn { width:32px; height:32px; flex-shrink:0; border:1px solid var(--border); border-radius:50%; background:var(--bg-tertiary); color:var(--text-muted); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:var(--transition); }
.cin-lock-btn:hover { color:var(--text-primary); border-color:var(--glow); }
.cin-lock-btn.on { background:linear-gradient(135deg,var(--accent),var(--glow)); color:#2a1700; border-color:transparent; }
.cin-code-btn { flex-shrink:0; }
/* Поле ввода кода */
.cin-coderow .cin-code-inp { text-transform:uppercase; letter-spacing:5px; font-weight:700; }
/* Шапка плеера переиспользует классы лобби (.cp-header / .lp-header-*). */
.cin-invite-code { font-size:13px; color:var(--text-secondary); margin:0 0 10px; }

/* ── Плавающий плеер (PiP): один контейнер, который не пересобирает iframe ── */
.cin-pip { position:fixed; z-index:200; background:#000; overflow:hidden; }
.cin-pip-hidden { display:none !important; }
.cin-pip-docked { border:1px solid var(--border); border-radius:14px; }
.cin-pip-float {
  right:18px; bottom:18px; width:360px; height:auto; border-radius:12px;
  border:1px solid var(--glow-border); box-shadow:0 14px 44px rgba(0,0,0,.6);
  animation:cinPipIn .2s ease;
}
@keyframes cinPipIn { from { opacity:0; transform:translateY(12px) scale(.96); } to { opacity:1; transform:none; } }
.cin-pip-bar { display:none; align-items:center; gap:4px; height:32px; padding:0 4px 0 8px; background:rgba(22,10,4,0.97); }
.cin-pip-float .cin-pip-bar { display:flex; cursor:move; user-select:none; touch-action:none; }
.cin-pip-grip { display:flex; align-items:center; color:var(--text-muted); flex-shrink:0; }
.cin-pip-float:active .cin-pip-bar { cursor:grabbing; }
.cin-pip-title { flex:1; min-width:0; font-size:12px; font-weight:600; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cin-pip-btn { width:24px; height:24px; flex-shrink:0; border:none; background:transparent; color:var(--text-muted); cursor:pointer; display:flex; align-items:center; justify-content:center; border-radius:6px; font-size:13px; line-height:1; transition:var(--transition); }
.cin-pip-btn:hover { background:rgba(255,255,255,.1); color:var(--text-primary); }
.cin-pip-close:hover { background:rgba(220,80,80,.2); color:#f99; }
.cin-pip-video { position:relative; width:100%; height:100%; background:#000; }
.cin-pip-float .cin-pip-video { height:202px; }
.cin-invite-code b { color:var(--glow); letter-spacing:3px; }
/* Бейдж комнаты кинозала в левом списке */
.cinema-entry-badge { background:linear-gradient(135deg,var(--accent),var(--glow)); color:#2a1700; }
.cin-recs-title { margin-top:8px; }
/* карточка-постер (в стиле .game-card) */
.cin-room { position:relative; aspect-ratio:16/9; border-radius:var(--border-radius-lg); overflow:hidden; cursor:pointer; border:1px solid var(--border); transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.cin-room:hover { border-color:var(--glow-border); box-shadow:0 12px 40px rgba(232,160,48,.14); transform:translateY(-3px); }
.cin-room-bg { position:absolute; inset:0; z-index:0; background-image:linear-gradient(135deg,#2c1a0a,#140b04); background-size:cover; background-position:center; background-repeat:no-repeat; transition:transform .5s ease; }
.cin-room:hover .cin-room-bg { transform:scale(1.04); }
.cin-room-ov { position:absolute; inset:0; z-index:1; background:linear-gradient(to bottom, rgba(13,6,2,.04) 0%, rgba(13,6,2,.35) 45%, rgba(13,6,2,.93) 100%); }
.cin-room-play { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); z-index:2; width:54px; height:54px; border-radius:50%; background:rgba(0,0,0,.5); color:#fff; display:flex; align-items:center; justify-content:center; font-size:19px; padding-left:3px; transition:background .15s, transform .15s; }
.cin-room:hover .cin-room-play { background:linear-gradient(135deg,var(--accent),var(--glow)); color:#2a1700; transform:translate(-50%,-50%) scale(1.08); }
.cin-room-info { position:absolute; left:0; right:0; bottom:0; z-index:2; padding:12px 14px 13px; }
.cin-room-title { font-size:15px; font-weight:700; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-shadow:0 1px 4px rgba(0,0,0,.7); }
.cin-room-meta { display:flex; align-items:center; gap:8px; margin-top:6px; }
.cin-badge { font-size:10px; font-weight:700; padding:2px 8px; border-radius:10px; background:rgba(196,120,32,.22); color:var(--glow); border:1px solid var(--glow-border); }
.cin-badge-yt { background:rgba(220,50,50,.22); color:#f88; border-color:rgba(220,50,50,.4); }
.cin-badge-rt { background:rgba(0,170,90,.22); color:#5fe0a8; border-color:rgba(0,170,90,.4); }
.cin-badge-vk { background:rgba(60,120,220,.22); color:#8ab4ff; border-color:rgba(60,120,220,.4); }
.cin-room-viewers { font-size:12px; color:rgba(255,255,255,.85); }
/* выбор источника */
.cin-sources { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:14px; }
.cin-source { background:var(--bg-secondary); border:1px solid var(--border); border-radius:14px; padding:18px 16px; text-align:center; cursor:pointer; transition:transform .15s, border-color .15s; }
.cin-source:hover { transform:translateY(-2px); border-color:rgba(232,160,48,.5); }
.cin-source-sel { border-color:var(--glow); box-shadow:0 0 0 1px var(--glow); }
.cin-source-off { opacity:.5; cursor:not-allowed; }
.cin-source-off:hover { transform:none; border-color:var(--border); }
.cin-source-ic { font-size:26px; font-weight:800; margin-bottom:8px; color:var(--glow); }
.cin-source-name { font-size:14px; font-weight:700; color:var(--text-primary); }
.cin-source-hint { font-size:11.5px; color:var(--text-muted); margin-top:4px; }
.cin-create { display:flex; gap:10px; flex-wrap:wrap; align-items:center; padding:14px; background:var(--bg-secondary); border:1px solid var(--border); border-radius:14px; }
.cin-create input { flex:1; min-width:200px; background:var(--bg-primary); border:1px solid var(--border); border-radius:10px; color:var(--text-primary); padding:11px 14px; font-size:14px; outline:none; }
.cin-create input:focus { border-color:var(--accent); }
/* плеер */
.cin-player-page { overflow:hidden; padding:0; gap:0; }
.cin-player-page .cinema-main { flex:1; min-height:0; padding:16px; }
/* Сменить видео в шапке — без выталкивания вправо */
.cin-player-page .cin-change-btn { margin-left:6px; }
#cin-mount { position:absolute; inset:0; width:100%; height:100%; }
#cin-mount > *, #cin-mount iframe, #cin-mount video { width:100%; height:100%; border:none; display:block; background:#000; }
.cin-pl-msg { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; text-align:center; padding:30px; color:var(--text-secondary); font-size:14px; line-height:1.6; }
.cin-change-btn { margin-left:auto; }
.cin-change { position:absolute; inset:0; z-index:5; display:flex; align-items:center; justify-content:center; background:rgba(8,4,1,.82); backdrop-filter:blur(3px); padding:24px; }
.cin-change-card { width:100%; max-width:440px; background:var(--bg-secondary); border:1px solid var(--glow-border); border-radius:14px; padding:22px 24px; text-align:center; }
.cin-change-title { font-size:18px; font-weight:800; color:var(--text-primary); margin-bottom:6px; }
.cin-change-sub { font-size:13px; color:var(--text-muted); line-height:1.5; margin-bottom:16px; }
.cin-change-card input { width:100%; background:var(--bg-primary); border:1px solid var(--border); border-radius:10px; color:var(--text-primary); padding:11px 14px; font-size:14px; outline:none; box-sizing:border-box; margin-bottom:14px; }
.cin-change-card input:focus { border-color:var(--accent); }
.cin-change-actions { display:flex; gap:10px; justify-content:center; }
.cin-host-tag { font-size:10px; font-weight:700; color:#2a1700; background:linear-gradient(135deg,var(--accent),var(--glow)); padding:1px 7px; border-radius:9px; vertical-align:middle; }
/* Единый маркер владельца/хоста/ведущего — корона (лобби, кинозал, группы, стол) */
.host-crown { display:inline-flex; align-items:center; color:var(--glow); vertical-align:middle; margin-left:4px; }
.host-crown svg { width:14px; height:14px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.lp-p-role .host-crown, .gmem-actions .host-crown { margin-left:0; }
/* чат комнаты (сайдбар плеера) */
.cin-chat { width:280px; overflow:hidden; gap:0; padding:0; }
.cin-chat-head { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:var(--text-muted); padding:13px 14px; border-bottom:1px solid var(--border); flex-shrink:0; }
.cin-chat-msgs { flex:1; min-height:0; overflow-y:auto; padding:10px 12px; display:flex; flex-direction:column; gap:8px; }
.cin-msg { font-size:13px; line-height:1.4; }
.cin-msg-name { color:var(--glow); font-weight:700; margin-right:6px; }
.cin-msg-text { color:var(--text-primary); word-break:break-word; }
.cin-msg-own .cin-msg-name { color:var(--text-secondary); }
.cin-chat-input { display:flex; gap:6px; padding:10px; border-top:1px solid var(--border); flex-shrink:0; }
.cin-chat-input input { flex:1; min-width:0; background:var(--bg-primary); border:1px solid var(--border); border-radius:9px; color:var(--text-primary); padding:9px 12px; font-size:13px; outline:none; }
.cin-chat-input input:focus { border-color:var(--accent); }
.cin-chat-input button { flex-shrink:0; width:40px; border:none; border-radius:9px; background:linear-gradient(135deg,var(--accent),var(--glow)); color:#2a1700; font-size:14px; cursor:pointer; }
#author-section { flex: 1; overflow-y: auto; }

.feed-empty, .feed-loading {
  color: var(--text-muted); font-size: 14px;
  text-align: center; padding: 40px 20px; line-height: 1.6;
}

.feed-posts-list { display: flex; flex-direction: column; gap: 12px; }

.feed-post-wrap { border-radius: 10px; }

.feed-goto-btn {
  background: none; border: 1px solid var(--glow-border); border-radius: 6px;
  color: var(--glow); font-size: 11px; padding: 3px 9px; cursor: pointer;
  white-space: nowrap; transition: background 0.15s; flex-shrink: 0;
}
.feed-goto-btn:hover { background: rgba(232,160,48,0.12); }
.games-filter-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}

.games-chips-row {
  display: flex; gap: 6px; flex-wrap: wrap; flex: 1;
}

.games-search-row {
  display: flex; align-items: center; gap: 8px; flex: 1;
}

.games-search-input {
  flex: 1; background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text-primary);
  padding: 6px 14px; font-size: 13px; outline: none; transition: var(--transition);
}
.games-search-input:focus { border-color: var(--glow); }
.games-search-input::placeholder { color: var(--text-muted); }

.games-search-close {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 14px; padding: 4px 6px; border-radius: 4px; transition: var(--transition);
}
.games-search-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.games-search-btn {
  width: 30px; height: 30px; flex-shrink: 0;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 50%; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.games-search-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.games-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* ── Game card — 16:9 poster ─────────────────────── */
.game-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--border-radius-lg);
  overflow: hidden; cursor: pointer;
  border: 1px solid var(--border);

  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s ease, transform 0.45s ease,
              border-color 0.18s ease, box-shadow 0.18s ease;
}
.game-card.loaded { opacity: 1; transform: translateY(0); }
.game-card:hover  {
  border-color: var(--glow-border);
  box-shadow: 0 12px 40px rgba(232,160,48,0.14);
  transform: translateY(-3px);
}
.game-card.loaded:hover { transform: translateY(-3px); }

/* Background image fills entire card */
.game-card .card-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  transition: transform 0.5s ease;
}
.game-card:hover .card-bg { transform: scale(1.04); }

/* Gradient overlay — darkens bottom for text */
.game-card .card-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(13,6,2,0.05) 0%,
    rgba(13,6,2,0.32) 42%,
    rgba(13,6,2,0.90) 66%,
    rgba(13,6,2,0.99) 100%
  );
}

/* Icon badge — top-left corner */
.game-card .card-thumb {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 26px; line-height: 1;
  background: none; border: none; padding: 0;
  transition: transform 0.35s ease;
  display: flex; align-items: center; justify-content: center;
}
.game-card:hover .card-thumb { transform: scale(1.1) rotate(5deg); }
.game-card .card-thumb img {
  width: 72px; height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.7));
}
.game-card .card-thumb::before { display: none; }
.game-card .card-thumb::after  { display: none; }

/* Subscribe button — wide pill, bell on right, text area hidden under icon */
.card-subscribe-btn {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  width: 120px; height: 72px; padding: 0 16px;
  display: flex; align-items: center; justify-content: flex-end;
  border-radius: 36px;
  border: 1px solid var(--glow-border);
  background: rgba(10,4,1,0.88); backdrop-filter: blur(10px);
  color: var(--glow);
  cursor: pointer;
  opacity: 0; transform: translateX(0);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.15s;
  pointer-events: none;
}
.game-card:hover .card-subscribe-btn {
  opacity: 1; transform: translateX(2px);
  pointer-events: auto;
}
.card-subscribe-btn:hover { background: rgba(232,160,48,0.18); }
.card-subscribe-btn.subscribed { color: var(--text-muted); border-color: var(--border); }
.card-subscribe-btn:hover { background: rgba(232,160,48,0.18); }
.card-subscribe-btn.subscribed {
  color: var(--text-muted); border-color: var(--border);
  background: rgba(10,4,1,0.82);
}

/* Content block — pinned to bottom */
.game-card .card-body {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 0 14px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.game-card .card-body h4 {
  font-size: 17px; font-weight: 800; color: var(--text-primary); line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.9), 0 0 20px rgba(232,160,48,0.25);
  margin: 0;
}
.game-card .card-body .card-desc {
  font-size: 11px; color: var(--text-secondary); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 6px rgba(0,0,0,0.95);
  margin: 0;
}
.game-card .card-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.game-card .players-badge {
  font-size: 11px; color: var(--text-secondary); font-weight: 600;
  background: rgba(19,10,4,0.75); padding: 3px 9px; border-radius: 10px;
  border: 1px solid var(--border); backdrop-filter: blur(6px);
}
.subscription-badge { background: var(--warning); color: #000; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px; }

/* ── Auth page ───────────────────────────────────── */
#auth-page {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100vh; background: var(--bg-primary);
}
.auth-card {
  background: rgba(26, 12, 4, 0.97); border-radius: var(--border-radius-lg);
  padding: 40px 36px; width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 80px rgba(196,100,20,0.08);
  border: 1px solid var(--border); backdrop-filter: blur(16px);
}
.auth-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; color: var(--glow); text-shadow: 0 0 18px rgba(232,160,48,0.45); }
.auth-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.auth-tabs { display: flex; margin-bottom: 24px; border-radius: var(--border-radius-sm); overflow: hidden; border: 1px solid var(--border); }
.auth-tab { flex: 1; padding: 8px; text-align: center; font-size: 14px; font-weight: 500; cursor: pointer; background: var(--bg-tertiary); color: var(--text-muted); border: none; transition: var(--transition); }
.auth-tab.active { background: var(--accent); color: #fff; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input {
  width: 100%; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--border-radius-sm); color: var(--text-primary);
  padding: 10px 12px; font-size: 14px; outline: none; transition: var(--transition);
}
.form-group input:focus { border-color: var(--glow); box-shadow: 0 0 0 3px var(--glow-soft); }
.btn {
  width: 100%; padding: 11px; border: none; border-radius: var(--border-radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: var(--transition);
  background: linear-gradient(135deg, var(--accent), var(--glow));
  color: #fff;
}
.btn:hover { filter: brightness(1.1); box-shadow: 0 4px 16px rgba(232,160,48,0.3); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg-tertiary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--border-radius-sm);
  padding: 11px; font-size: 15px; font-weight: 600; cursor: pointer; transition: var(--transition);
  width: 100%;
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--accent); }
.btn-danger {
  background: rgba(232,64,80,0.12); color: var(--danger);
  border: 1px solid rgba(232,64,80,0.25); border-radius: var(--border-radius-sm);
  padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%;
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.auth-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; }

/* ── Player card ─────────────────────────────────── */
.player-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--border-radius-sm); cursor: pointer; transition: var(--transition); }
.player-card:hover { background: var(--bg-hover); }
.player-card .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--glow));
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; position: relative;
}
.player-card .avatar .status-dot { position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg-secondary); background: var(--text-muted); }
.player-card .avatar .status-dot.online { background: var(--success); }
.player-card .info { flex: 1; min-width: 0; }
.player-card .info .name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-card .info .rating { font-size: 11px; color: var(--text-muted); }

/* ── Lobby card ──────────────────────────────────── */
.lobby-card {
  background: var(--bg-tertiary); border-radius: var(--border-radius-sm);
  padding: 10px 12px; margin-bottom: 6px; cursor: pointer;
  transition: var(--transition); border: 1px solid var(--border);
}
.lobby-card:hover { background: var(--bg-hover); border-color: var(--glow-border); box-shadow: 0 2px 12px var(--glow-soft); }
.lobby-card.invited { border-color: var(--glow-border); background: rgba(232,160,48,0.06); }
.lobby-card .lobby-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby-card .lobby-game { font-size: 12px; color: var(--glow); margin-bottom: 4px; }
.lobby-card .lobby-meta { display: flex; align-items: center; justify-content: space-between; }
.lobby-card .lobby-players { font-size: 12px; color: var(--text-muted); }
.lobby-card .invited-badge { font-size: 10px; color: var(--glow); font-weight: 700; }
.lobby-card .private-icon { font-size: 11px; color: var(--text-muted); }

/* ── Right panel: contextual game cards ────────── */
.rp-game-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--border-radius-sm);
  cursor: pointer; transition: var(--transition);
  border: 1px solid transparent;
}
.rp-game-card:hover { background: var(--bg-hover); border-color: var(--glow-border); }
.rp-game-card.rp-game-invited { border-color: var(--glow-border); background: rgba(232,160,48,0.06); }
.rp-game-icon-wrap { width: 38px; height: 38px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; }
.rp-game-icon { width: 100%; height: 100%; object-fit: cover; }
.rp-game-icon-fallback { font-size: 16px; font-weight: 700; color: var(--glow); }
.rp-game-info { flex: 1; min-width: 0; }
.rp-game-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.rp-game-meta { display: flex; gap: 10px; }
.rp-game-stat { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-muted); }
.rp-game-stat svg { flex-shrink: 0; opacity: 0.7; }

/* ── Right panel: subscription feed cards ────────── */
.rp-feed-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: var(--border-radius-sm);
  gap: 8px; transition: var(--transition);
}
.rp-feed-card:hover { background: var(--bg-hover); }
.rp-feed-main {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0; cursor: pointer;
}
.rp-feed-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-feed-actions { display: flex; gap: 4px; flex-shrink: 0; }
.rp-feed-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.rp-feed-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.rp-bell-btn.active { color: var(--glow); border-color: var(--glow-border); }
.rp-unsub-btn:hover { color: var(--danger, #f87171); border-color: var(--danger, #f87171); }
.rp-feed-icon-wrap {
  position: relative; flex-shrink: 0;
  width: 38px; height: 38px;
}
.rp-feed-sub-badge {
  position: absolute; top: -5px; right: -6px;
  font-size: 14px; line-height: 1;
  display: none;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.7));
  z-index: 1;
}
.panel.collapsed .rp-feed-sub-badge { display: block; }
.panel.collapsed .rp-feed-card { justify-content: center; padding: 6px 0; }
.panel.collapsed .rp-feed-name,
.panel.collapsed .rp-feed-actions { display: none; }
.panel.collapsed .rp-feed-main { justify-content: center; }

/* ── Карточки игр как баннеры (фон = обложка игры, затухает в прозрачность) ── */
.rp-game-banner { position: relative; display: block; min-height: 72px; padding: 0; gap: 0;
  border-radius: 10px; overflow: hidden; background-color: transparent;
  border: 1px solid transparent; cursor: pointer; transition: border-color var(--transition); }
.rp-game-banner::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(180deg, rgba(10,10,21,.5), rgba(10,10,21,.12) 50%, rgba(10,10,21,0)), var(--card-bg);
  background-size: cover; background-position: center;
  -webkit-mask-image: linear-gradient(to bottom, #000 8%, transparent 72%);
  mask-image: linear-gradient(to bottom, #000 8%, transparent 72%);
  transition: transform .25s ease; }
.rp-game-banner:hover::before { transform: scale(1.04); }
.rp-game-banner:hover { border-color: var(--glow-border); }
.rp-game-banner > * { position: relative; z-index: 1; }
.rp-game-banner.rp-game-invited { border-color: var(--glow); }
.rp-game-banner .rp-game-info { position: absolute; left: 11px; right: 11px; bottom: 8px; flex: none; }
.rp-game-banner .rp-feed-name { position: absolute; left: 12px; right: 66px; bottom: 10px; margin: 0; }
.rp-game-banner .rp-game-name, .rp-game-banner .rp-feed-name { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.85); }
.rp-game-banner .rp-game-stat { color: rgba(255,255,255,.92); text-shadow: 0 1px 3px rgba(0,0,0,.85); }
.rp-game-banner .rp-game-stat svg { opacity: .95; }
.rp-game-banner .rp-act-badge { position: absolute; top: 7px; right: 8px; margin: 0; }
.rp-game-banner .rp-feed-actions { position: absolute; top: 7px; right: 8px; }
.rp-game-banner .rp-feed-btn { background: rgba(0,0,0,.45); border-color: rgba(255,255,255,.22); color: #fff; }
.rp-game-banner .rp-feed-btn:hover { background: rgba(0,0,0,.65); color: #fff; }
.rp-game-banner .rp-bell-btn.active { color: var(--glow); border-color: var(--glow); background: rgba(0,0,0,.5); }
.rp-game-banner .rp-unsub-btn:hover { color: #ff6b6b; border-color: #ff6b6b; }
/* Свёрнутая панель — квадратные миниатюры-баннеры */
.panel.collapsed .rp-game-banner { min-height: 0; width: 46px; height: 46px; margin: 0 auto; padding: 0; }
.panel.collapsed .rp-game-banner .rp-game-info,
.panel.collapsed .rp-game-banner .rp-feed-name,
.panel.collapsed .rp-game-banner .rp-feed-actions { display: none; }
.panel.collapsed .rp-game-banner .rp-act-badge { top: 3px; right: 3px; }

/* ── Right panel: participant cards (chat state) ─── */
.rp-member-card {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--border-radius-sm);
  cursor: pointer; transition: var(--transition);
}
.rp-member-card:hover:not(.rp-member-self) { background: var(--bg-hover); }
.rp-member-self { cursor: default; }
.rp-member-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--glow); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; position: relative;
}
.rp-member-avatar.admin-av { background: linear-gradient(135deg, var(--glow), #818cf8); color: #fff; }
.rp-member-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}
.rp-member-dot-on  { background: var(--glow); }
.rp-member-dot-off { background: var(--text-muted); }
.rp-member-info { flex: 1; min-width: 0; }
.rp-member-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-member-you  { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.rp-member-status { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.panel.collapsed .rp-member-info { display: none; }
.panel.collapsed .rp-member-card { justify-content: center; padding: 6px 0; }

/* ── Right panel: author stats cards ────────────── */
.rp-author-card {
  padding: 10px; border-radius: var(--border-radius-sm);
  border: 1px solid var(--border); margin-bottom: 8px;
  background: var(--bg-tertiary);
}
.rp-author-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rp-author-card-head .rp-game-name { font-size: 13px; font-weight: 600; }
.rp-author-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rp-author-stat {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg-secondary); border-radius: 6px; padding: 5px 4px;
}
.rp-author-stat-val { font-size: 16px; font-weight: 700; color: var(--glow); line-height: 1.2; }
.rp-author-stat-lbl { font-size: 10px; color: var(--text-muted); text-align: center; line-height: 1.3; }
.panel.collapsed .rp-author-card { display: none; }

/* ── Right panel extras ──────────────────────────── */
.lobby-filters { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.lobby-filters select {
  width: 100%; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--border-radius-sm); color: var(--text-primary);
  padding: 6px 8px; font-size: 12px; outline: none;
}
.lobby-filters select:focus { border-color: var(--glow); }
.create-lobby-btn {
  margin: 8px 12px; padding: 8px;
  background: linear-gradient(135deg, var(--accent), var(--glow));
  color: #fff; border: none; border-radius: var(--border-radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.create-lobby-btn:hover { filter: brightness(1.1); box-shadow: 0 4px 16px rgba(232,160,48,0.3); }

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5,2,0,0.78);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  backdrop-filter: blur(6px);
}
.modal {
  background: var(--bg-secondary); border-radius: var(--border-radius-lg);
  padding: 28px; width: 420px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border: 1px solid var(--border);
}
.modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--text-primary); }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal .modal-actions button { flex: 1; }

/* ── Popover (flyout from button) ────────────────── */
.popover-backdrop {
  position: fixed; inset: 0; z-index: 899;
}
.popover {
  position: fixed; z-index: 900;
  background: var(--bg-secondary);
  border: 1px solid var(--glow-border);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  width: 300px; max-width: calc(100vw - 24px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(232,160,48,0.08);
  animation: popover-in 0.16s cubic-bezier(0.2,0,0,1);
}
@keyframes popover-in {
  from { opacity: 0; transform: translateX(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.popover h3 {
  font-size: 14px; font-weight: 700; margin: 0 0 14px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em;
}
.popover-divider { height: 1px; background: var(--border); margin: 12px -16px; }
.popover-actions { display: flex; gap: 8px; margin-top: 14px; }
.popover-actions button { flex: 1; padding: 9px 0; font-size: 13px; }

/* ── Chat FAB ─────────────────────────────────────── */
.chat-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 500;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--glow));
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(232,160,48,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chat-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(232,160,48,0.55); }
.chat-fab-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* ── Chat overlay ────────────────────────────────── */
.chat-overlay {
  position: fixed; bottom: 92px; right: 24px; z-index: 499;
  pointer-events: none; opacity: 0;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.chat-overlay.open {
  pointer-events: all; opacity: 1;
  transform: translateY(0) scale(1);
}

.chat-panel {
  width: 340px; height: 480px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
  display: flex; flex-direction: column; overflow: hidden;
}

.chat-panel-header {
  display: flex; align-items: center;
  padding: 10px 12px 0;
  background: rgba(19,10,4,0.65);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; gap: 8px;
}
.chat-panel-tabs { display: flex; flex: 1; gap: 2px; }
.chat-tab {
  flex: 1; padding: 8px 4px; font-size: 11px; font-weight: 600;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); cursor: pointer; transition: var(--transition);
  white-space: nowrap;
}
.chat-tab.active { color: var(--glow); border-bottom-color: var(--glow); }
.chat-tab:hover:not(.active) { color: var(--text-secondary); }
.chat-close-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 14px; padding: 4px 6px;
  border-radius: 4px; transition: var(--transition); flex-shrink: 0;
}
.chat-close-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ── Chat messages ───────────────────────────────── */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 12px 12px 8px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 2px; }

/* Message row */
.msg-row { display: flex; align-items: flex-end; gap: 8px; }
.msg-row.own   { flex-direction: row-reverse; }
.msg-row.other { flex-direction: row; }

/* Avatar */
.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.own-avatar   { background: linear-gradient(135deg, var(--accent), var(--glow)); }
.other-avatar { background: linear-gradient(135deg, #4a3060, #2d1b5e); }

/* Group */
.msg-group { display: flex; flex-direction: column; max-width: 220px; }
.msg-row.own .msg-group { align-items: flex-end; }

.msg-sender-name { font-size: 10px; color: var(--text-muted); margin-bottom: 2px; padding-left: 4px; }

/* Bubble */
.msg-bubble {
  padding: 8px 12px; border-radius: 16px;
  font-size: 13px; line-height: 1.4; word-break: break-word;
  position: relative;
}
.own-bubble {
  background: linear-gradient(135deg, var(--accent), var(--bg-active));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.other-bubble {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg-time {
  font-size: 10px; opacity: 0.6; margin-left: 8px;
  display: inline-block; vertical-align: bottom;
}

/* ── Chat input ──────────────────────────────────── */
.chat-input-row {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.chat-input-row input {
  flex: 1; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text-primary);
  padding: 8px 14px; font-size: 13px; outline: none; transition: var(--transition);
}
.chat-input-row input:focus { border-color: var(--glow); }
.chat-input-row input::placeholder { color: var(--text-muted); }
.chat-send-btn {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--glow));
  border: none; color: #fff; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.chat-send-btn:hover { filter: brightness(1.15); transform: scale(1.05); }

/* ── Notification bell ───────────────────────────── */
.notif-btn {
  position: relative; background: none; border: none; cursor: pointer;
  font-size: 18px; padding: 6px 8px; border-radius: 8px;
  transition: var(--transition); color: var(--text-muted);
}
.notif-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.notif-btn.notif-glow {
  color: var(--warning);
  animation: notif-pulse 1.8s ease infinite;
}
@keyframes notif-pulse {
  0%, 100% { filter: drop-shadow(0 0 0px var(--warning)); }
  50%       { filter: drop-shadow(0 0 8px var(--warning)); }
}
.notif-count {
  position: absolute; top: 0; right: 0;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 2px solid var(--bg-primary);
}

/* Notification modal items */
.notif-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 8px; margin-bottom: 6px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
}
.notif-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--glow));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.notif-info { flex: 1; }
.notif-text { font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.notif-actions { display: flex; gap: 6px; flex-shrink: 0; }
.notif-accept, .notif-decline {
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.notif-accept  { background: rgba(232,160,48,0.15); color: var(--glow); }
.notif-accept:hover  { background: var(--glow); color: #fff; }
.notif-decline { background: rgba(232,96,122,0.15); color: var(--danger); }
.notif-decline:hover { background: var(--danger); color: #fff; }

/* ── Notifications ───────────────────────────────── */
#notifications { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; }
.notification {
  background: var(--bg-secondary); border-radius: var(--border-radius);
  padding: 12px 16px; font-size: 14px; min-width: 260px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4); border-left: 3px solid var(--accent);
  animation: slideIn 0.18s ease; border: 1px solid var(--border); border-left-width: 3px;
}
.notification.success { border-left-color: var(--glow); }
.notification.danger  { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }


/* ═══════════════════════════════════════════════════
   AUTHOR CABINET
═══════════════════════════════════════════════════ */
#author-section {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px;
}
.ac-wrap {
  width: 100%; max-width: 820px;
  display: flex; flex-direction: column;
}
.ac-wrap > .ac-header,
.ac-wrap > .ac-tabs,
.ac-wrap > .ac-body,
.ac-wrap > .ac-no-access {
  width: 100%;
}

.ac-header {
  display: flex; align-items: center;
  padding: 16px 20px; margin-bottom: 0;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
}
.ac-engine-btn {
  margin-left: auto; border: 1px solid var(--glow-border);
  background: rgba(232,160,48,.08); color: var(--glow);
  border-radius: 9px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.ac-engine-btn:hover { background: rgba(232,160,48,.16); }
.ac-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: var(--glow);
}
.ac-tabs {
  display: flex; gap: 0;
  background: var(--bg-tertiary); border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  padding: 0 20px;
}
.ac-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  padding: 10px 16px 9px; cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.ac-tab:hover { color: var(--text-primary); }
.ac-tab.active { color: var(--glow); border-bottom-color: var(--glow); }

.ac-body {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-top: none; border-radius: 0 0 12px 12px;
  padding: 20px; min-height: 300px;
}

/* ── No access ─────────────────────────────────── */
.ac-no-access {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-top: none; border-radius: 0 0 12px 12px;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 40px 24px 40px;
  color: var(--text-muted); text-align: center;
  overflow-y: auto;
}
.ac-no-access svg { opacity: 0.3; }
.ac-no-access p { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.ac-no-access span { font-size: 13px; }

/* ── Games list ────────────────────────────────── */
.ac-games-list { display: flex; flex-direction: column; gap: 10px; }
.ac-loading, .ac-empty { color: var(--text-muted); font-size: 13px; padding: 20px 0; text-align: center; }

.ac-game-card {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  transition: border-color 0.15s;
}
.ac-game-card:hover { border-color: var(--glow-border); }

.ac-game-thumb {
  width: 56px; height: 56px; border-radius: 8px; overflow: hidden;
  background: var(--bg-active); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ac-game-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ac-game-icon { font-size: 24px; }

.ac-game-info { flex: 1; min-width: 0; }
.ac-game-name { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.ac-game-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.ac-badge {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px;
  border: 1px solid transparent;
}
.ac-badge-active  { color: var(--glow); border-color: var(--glow-border); background: var(--glow-soft); }
.ac-badge-draft   { color: var(--text-muted); border-color: var(--border); background: var(--bg-active); }
.ac-badge-type    { color: #a78bfa; border-color: rgba(167,139,250,0.3); background: rgba(167,139,250,0.08); }
.ac-badge-players { color: var(--text-secondary); border-color: var(--border); background: var(--bg-active); }

.ac-game-stats { display: flex; gap: 14px; font-size: 11px; color: var(--text-muted); }

.ac-game-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

.ac-btn-primary {
  padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--glow); border: none; color: #0D1B2A;
  transition: opacity 0.15s;
}
.ac-btn-primary:hover { opacity: 0.85; }
.ac-btn-secondary {
  padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: none; border: 1px solid var(--border); color: var(--text-secondary);
  transition: var(--transition); white-space: nowrap;
}
.ac-btn-secondary:hover { border-color: var(--glow-border); color: var(--glow); }
.ac-btn-publish {
  padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--glow-soft); border: 1px solid var(--glow-border); color: var(--glow);
  transition: var(--transition); white-space: nowrap;
}
.ac-btn-publish:hover { background: rgba(232,160,48,0.22); }
.ac-btn-hide {
  padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  transition: var(--transition); white-space: nowrap;
}
.ac-btn-hide:hover { border-color: #f87171; color: #f87171; }

/* ── New game form ──────────────────────────────── */
.ac-form-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.ac-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.ac-field { display: flex; flex-direction: column; gap: 5px; }
.ac-field-wide { grid-column: span 2; }
.ac-field label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ac-field input, .ac-field select, .ac-field textarea {
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text-primary); font-size: 13px; padding: 7px 10px; outline: none;
  transition: border-color 0.15s; resize: vertical; font-family: inherit;
}
.ac-field input:focus, .ac-field select:focus, .ac-field textarea:focus { border-color: var(--glow); }
.ac-field input::placeholder, .ac-field textarea::placeholder { color: var(--text-muted); }

.ac-form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ac-form-note { font-size: 11px; color: var(--text-muted); }

/* ── Edit modal ─────────────────────────────────── */
.ac-edit-modal {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(5,2,0,0.82); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  border-radius: 0 0 12px 12px;
}
.ac-edit-modal-box {
  background: var(--bg-secondary); border: 1px solid var(--glow-border);
  border-radius: 12px; padding: 20px; width: 100%; max-width: 600px;
  max-height: 80vh; overflow-y: auto;
}
.ac-edit-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 16px;
}

/* ── Author request form ───────────────────────── */
.ac-request-form {
  display: flex; flex-direction: column; gap: 16px;
  width: 100%; max-width: 640px; margin-top: 12px; text-align: left;
}

/* Вводный блок */
.ac-form-intro {
  background: linear-gradient(135deg, rgba(232,160,48,0.08), rgba(196,120,32,0.05));
  border: 1px solid var(--glow-border); border-radius: 10px;
  padding: 14px 18px;
}
.ac-form-intro-title { font-size: 15px; font-weight: 700; color: var(--glow); margin-bottom: 4px; }
.ac-form-intro-sub   { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* Секции */
.ac-form-section { display: flex; flex-direction: column; gap: 10px; }
.ac-form-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--glow);
  padding-bottom: 6px; border-bottom: 1px solid var(--glow-border);
}

/* Вопрос */
.ac-form-q {
  display: flex; gap: 10px; align-items: flex-start;
}
.ac-form-q-row { flex-wrap: wrap; gap: 10px; }
.ac-form-q-num {
  min-width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-active); color: var(--text-muted);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.ac-form-q .ac-field { flex: 1; }
.ac-form-optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); font-size: 10px; }

/* Инфо-блок внизу */
.ac-form-process-info {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  font-size: 12px; color: var(--text-muted); line-height: 1.55;
}
.ac-form-process-info svg { flex-shrink: 0; margin-top: 1px; color: var(--glow); }
.ac-req-identity {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
}
.ac-req-avatar-img {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.ac-req-avatar-placeholder {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--glow); color: #fff; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ac-req-identity-info { display: flex; flex-direction: column; gap: 2px; }
.ac-req-username { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.ac-req-contact-hint { font-size: 12px; color: var(--text-muted); }
.ac-request-form .ac-form-grid { margin-bottom: 0; }
.ac-request-sent {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--glow);
  background: var(--glow-soft); border: 1px solid var(--glow-border);
  border-radius: 8px; padding: 10px 14px; margin-top: 4px;
}
.ac-request-rejected {
  font-size: 12px; color: #f87171; margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════
   ADMIN PANEL
═══════════════════════════════════════════════════ */
#admin-section { flex: 1; overflow: hidden; display: flex; flex-direction: column; align-items: stretch; padding: 0; }

.admin-request-card {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
}
.admin-request-head {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px;
}
.admin-request-user { display: flex; flex-direction: column; gap: 2px; }
.admin-req-username { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.admin-req-email { font-size: 12px; color: var(--text-muted); }
.admin-request-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.admin-req-date { font-size: 11px; color: var(--text-muted); }
.admin-request-body {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
  white-space: pre-wrap; max-height: 160px; overflow-y: auto;
  border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px;
}
.admin-request-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.admin-btn-approve {
  padding: 6px 14px; border-radius: 6px; border: none; cursor: pointer; font-size: 12px; font-weight: 600;
  background: rgba(52,211,153,0.15); color: #34d399; border: 1px solid rgba(52,211,153,0.3);
  transition: background 0.15s;
}
.admin-btn-approve:hover { background: rgba(52,211,153,0.25); }
.admin-btn-reject {
  padding: 6px 14px; border-radius: 6px; border: none; cursor: pointer; font-size: 12px; font-weight: 600;
  background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.25);
  transition: background 0.15s;
}
.admin-btn-reject:hover { background: rgba(248,113,113,0.22); }

.admin-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.admin-badge-pending  { background: rgba(251,191,36,0.15);  color: #fbbf24; }
.admin-badge-approved { background: rgba(52,211,153,0.15);  color: #34d399; }
.admin-badge-rejected { background: rgba(248,113,113,0.12); color: #f87171; }

.admin-role-select {
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 5px; color: var(--text-secondary); font-size: 11px;
  font-weight: 600; padding: 3px 6px; outline: none;
  transition: border-color 0.15s, color 0.15s;
  cursor: pointer; appearance: none; -webkit-appearance: none;
  min-width: 70px;
}
.admin-role-select:not(:disabled):hover { border-color: var(--border-hover); }
.admin-role-select:not(:disabled):focus { border-color: var(--glow); }
.admin-role-select:disabled { opacity: 0.7; cursor: default; }
.admin-role-select.admin-role-admin  { color: #34d399; border-color: rgba(52,211,153,0.35); background: rgba(52,211,153,0.07); }
.admin-role-select.admin-role-author { color: #fbbf24; border-color: rgba(251,191,36,0.35); background: rgba(251,191,36,0.07); }
.admin-role-select.admin-role-user   { color: var(--text-secondary); }

.admin-users-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.admin-users-table th {
  text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.admin-users-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.admin-td-muted { color: var(--text-muted) !important; }
.admin-btn-role {
  padding: 4px 10px; border-radius: 5px; border: 1px solid var(--border); cursor: pointer;
  font-size: 11px; font-weight: 600; background: var(--bg-tertiary); color: var(--text-secondary);
  transition: border-color 0.15s, color 0.15s;
}
.admin-btn-role:hover { border-color: var(--glow); color: var(--glow); }

/* ── Admin chat split layout ───────────────────── */
#admin-section .ac-wrap { max-width: none; flex: 1; min-height: 0; }
#admin-section .ac-body {
  flex: 1; min-height: 0; height: auto; overflow: hidden; padding: 0;
  display: flex; flex-direction: column;
}
#admin-tab-requests { flex: 1; overflow-y: auto; padding: 20px; }
#admin-tab-users    { flex: 1; overflow-y: auto; padding: 20px; }
#admin-tab-messages { display: none; flex: 1; min-height: 0; overflow: hidden; }
.admin-chat-wrap { display: flex; flex: 1; min-height: 0; overflow: hidden; }

.admin-chat-sidebar {
  width: 220px; flex-shrink: 0; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.admin-chat-sidebar-header {
  padding: 12px 16px; font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#admin-conv-list { flex: 1; overflow-y: auto; }

.admin-conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; transition: background 0.12s;
}
.admin-conv-item:hover { background: var(--bg-hover); }
.admin-conv-item.active { background: var(--bg-active); }
.admin-conv-item-av {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-active); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.admin-conv-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-conv-item-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.admin-conv-item-preview { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.admin-chat-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-chat-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--text-muted); font-size: 13px;
}
.admin-conv-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.admin-conv-av {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-active); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.admin-conv-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }

.admin-conv-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px;
}
.admin-conv-msg { display: flex; }
.admin-conv-msg.own  { justify-content: flex-end; }
.admin-conv-msg.other { justify-content: flex-start; }
.admin-conv-bubble {
  max-width: 70%; padding: 8px 12px; border-radius: 12px;
  font-size: 13px; line-height: 1.5; position: relative;
  display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap;
}
.admin-conv-msg.own   .admin-conv-bubble { background: var(--glow); color: #0a1628; border-radius: 12px 12px 2px 12px; }
.admin-conv-msg.other .admin-conv-bubble { background: var(--bg-tertiary); color: var(--text-primary); border-radius: 12px 12px 12px 2px; }
.admin-conv-time { font-size: 10px; opacity: 0.6; white-space: nowrap; flex-shrink: 0; }

.admin-conv-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0;
}
#admin-conv-input {
  flex: 1; background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 20px; padding: 8px 16px; font-size: 13px; color: var(--text-primary);
  outline: none; transition: border-color 0.15s;
}
#admin-conv-input:focus { border-color: var(--glow); }
#admin-conv-send {
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer; flex-shrink: 0;
  background: var(--glow); color: #0a1628;
  display: flex; align-items: center; justify-content: center; transition: opacity 0.15s;
}
#admin-conv-send:hover { opacity: 0.85; }

/* ── Support chat entry in left panel ──────────── */
.support-entry-card { margin-bottom: 4px; }
.support-entry-av {
  background: linear-gradient(135deg, var(--glow), var(--accent)) !important;
  color: #0a1628 !important; font-weight: 800; font-size: 11px !important;
  box-shadow: 0 0 6px rgba(232,160,48,0.4);
}
.support-entry-name { display: flex; align-items: center; gap: 4px; }

/* ── Support chat page (user side) ─────────────── */
.support-chat-av {
  background: linear-gradient(135deg, var(--glow), var(--accent)) !important;
  color: #0a1628 !important; font-weight: 800;
  box-shadow: 0 0 10px rgba(232,160,48,0.5);
}
.support-chat-title {
  display: flex; align-items: center; gap: 6px;
  color: var(--glow) !important; font-weight: 700;
}

.admin-btn-msg {
  padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer;
  font-size: 12px; font-weight: 600; background: var(--bg-tertiary); color: var(--text-secondary);
  transition: border-color 0.15s, color 0.15s; margin-left: auto;
}
.admin-btn-msg:hover { border-color: var(--glow); color: var(--glow); }

/* ── Admin verified badge ──────────────────────── */
.admin-verified-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--glow); color: #0a1628;
  margin-left: 5px; vertical-align: middle; flex-shrink: 0;
  box-shadow: 0 0 6px rgba(232,160,48,0.7), 0 0 12px rgba(232,160,48,0.35);
  animation: admin-badge-pulse 2.5s ease-in-out infinite;
}
@keyframes admin-badge-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(232,160,48,0.7), 0 0 12px rgba(232,160,48,0.35); }
  50%       { box-shadow: 0 0 10px rgba(232,160,48,0.9), 0 0 20px rgba(232,160,48,0.5); }
}
.admin-verified-badge svg { display: block; }

/* Admin avatar & bubble */
.admin-av {
  background: linear-gradient(135deg, var(--glow), var(--accent)) !important;
  color: #0a1628 !important; font-weight: 800;
  box-shadow: 0 0 8px rgba(232,160,48,0.5);
}
.admin-bubble {
  border: 1px solid var(--glow-border) !important;
  background: var(--glow-soft) !important;
}
.cp-sender:has(.admin-verified-badge),
.msg-sender-name:has(.admin-verified-badge) {
  display: flex; align-items: center; color: var(--glow) !important; font-weight: 700;
}

/* ── Right panel — game lobbies ──────────────────── */
.rp-lobby-card {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 4px; border-radius: 8px; cursor: pointer;
  transition: background 0.12s;
}
.rp-lobby-card:hover { background: var(--bg-hover); }
.rp-lobby-card.rp-lobby-full { opacity: 0.55; }
.rp-lobby-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.rp-lobby-icon-img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 7px;
}
.rp-lobby-icon-fallback {
  font-size: 15px; font-weight: 800; color: var(--glow);
}
.rp-lobby-info { flex: 1; min-width: 0; }
.rp-lobby-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px;
}
.rp-lobby-name {
  font-size: 12px; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.rp-lobby-count {
  font-size: 10px; font-weight: 700; color: var(--glow); flex-shrink: 0;
  background: rgba(232,160,48,0.12); border-radius: 4px; padding: 1px 5px; margin-left: 5px;
}
.rp-lobby-count-full { color: #f87171; background: rgba(239,68,68,0.1); }
.rp-lobby-host {
  font-size: 11px; color: var(--text-muted); margin-bottom: 5px;
}
.rp-lobby-join-btn {
  width: 100%; padding: 4px 0; border-radius: 5px;
  background: var(--glow); color: #0a1628;
  border: none; font-size: 11px; font-weight: 700; cursor: pointer;
  transition: opacity 0.15s;
}
.rp-lobby-join-btn:hover { opacity: 0.85; }
.rp-lobby-you, .rp-lobby-full-lbl {
  display: block; font-size: 11px; color: var(--text-muted);
}
.rp-lobby-you { color: var(--glow); }

/* Collapsed state — icon only */
.panel.collapsed .rp-lobby-info { display: none; }
.panel.collapsed .rp-lobby-card { justify-content: center; padding: 5px 0; }

/* ── Admin panel — overview dashboard ────────────── */
.admin-overview-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px;
}
.admin-stat-card {
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 12px; display: flex; align-items: center; gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-stat-card:hover { border-color: var(--border-hover); box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.admin-stat-card-alert { border-color: rgba(251,191,36,0.45) !important; }
.admin-stat-card-alert:hover { border-color: rgba(251,191,36,0.75) !important; }
.admin-stat-icon {
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-size: 18px;
}
.asi-blue   { background: rgba(59,130,246,0.15); }
.asi-green  { background: rgba(34,197,94,0.15); }
.asi-purple { background: rgba(168,85,247,0.15); }
.asi-orange { background: rgba(249,115,22,0.15); }
.asi-teal   { background: rgba(232,160,48,0.15); }
.asi-red    { background: rgba(239,68,68,0.15); }
.admin-stat-body { min-width: 0; }
.admin-stat-val {
  font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.1;
}
.admin-stat-lbl {
  font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* Alert badges on overview tab */
.admin-overview-alerts { display: flex; flex-direction: column; gap: 8px; }
.admin-overview-alert {
  background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.3);
  border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
}
.admin-overview-alert strong { color: var(--text-primary); }

/* Badge on admin sub-tabs */
.admin-tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: rgba(251,191,36,0.2); color: #fbbf24;
  border-radius: 9px; font-size: 11px; font-weight: 700; margin-left: 5px;
}

/* ── Admin panel — questionnaire ──────────────────── */
.admin-questionnaire {
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; margin-top: 8px;
}
.admin-q-section {
  border-bottom: 1px solid var(--border);
}
.admin-q-section:last-child { border-bottom: none; }
.admin-q-section-title {
  padding: 6px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted);
  background: rgba(255,255,255,0.03);
}
.admin-q-row {
  display: flex; gap: 0; border-top: 1px solid rgba(255,255,255,0.04);
}
.admin-q-row:first-of-type { border-top: none; }
.admin-q-num {
  width: 28px; flex-shrink: 0; padding: 6px 0 6px 10px;
  font-size: 11px; color: var(--text-muted); font-weight: 600;
}
.admin-q-key {
  width: 140px; flex-shrink: 0; padding: 6px 8px;
  font-size: 12px; color: var(--text-secondary); font-weight: 500;
}
.admin-q-val {
  flex: 1; padding: 6px 10px 6px 0;
  font-size: 12px; color: var(--text-primary); word-break: break-word;
}
.admin-q-cont .admin-q-key { padding-left: 28px; color: var(--text-muted); font-weight: 400; }

/* ── Admin panel — users toolbar ─────────────────── */
.admin-users-toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.admin-search-input {
  flex: 1; min-width: 160px; max-width: 280px;
  padding: 7px 12px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg-tertiary);
  color: var(--text-primary); font-size: 13px; outline: none;
  transition: border-color 0.15s;
}
.admin-search-input:focus { border-color: var(--glow); }
.admin-filter-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.admin-filter-tab {
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary); font-size: 12px;
  cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.admin-filter-tab:hover { border-color: var(--border-hover); color: var(--text-primary); }
.admin-filter-tab.active {
  background: var(--glow); color: #0a1628; border-color: var(--glow); font-weight: 700;
}
.admin-filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: rgba(255,255,255,0.12); color: inherit;
  border-radius: 8px; font-size: 10px; font-weight: 700; margin-left: 4px;
}
.admin-filter-tab.active .admin-filter-count { background: rgba(0,0,0,0.2); }

/* ── Admin panel — user table cells ──────────────── */
.admin-user-cell {
  display: flex; align-items: center; gap: 8px;
}
.admin-user-av {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-quaternary); display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700;
  color: var(--text-primary); overflow: hidden;
}
.admin-user-av img { width: 100%; height: 100%; object-fit: cover; }
.admin-ban-label {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700; background: rgba(239,68,68,0.15); color: #f87171;
  margin-left: 4px;
}
.admin-user-banned td { opacity: 0.6; }
.admin-user-actions { display: flex; gap: 4px; }

/* Small admin action buttons */
.admin-btn-sm {
  padding: 4px 10px; border-radius: 5px; border: 1px solid var(--border);
  background: var(--bg-tertiary); color: var(--text-secondary);
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.admin-btn-sm:hover { border-color: var(--border-hover); color: var(--text-primary); }
.admin-btn-ban {
  border-color: rgba(239,68,68,0.35); color: #f87171;
}
.admin-btn-ban:hover { border-color: #f87171; background: rgba(239,68,68,0.1); }
.admin-btn-unban {
  border-color: rgba(34,197,94,0.35); color: #4ade80;
}
.admin-btn-unban:hover { border-color: #4ade80; background: rgba(34,197,94,0.1); }
.admin-btn-role {
  border-color: rgba(168,85,247,0.35); color: #c084fc;
}
.admin-btn-role:hover { border-color: #c084fc; background: rgba(168,85,247,0.1); }
.admin-btn-questionnaire {
  border-color: rgba(59,130,246,0.35); color: #60a5fa;
}
.admin-btn-questionnaire:hover { border-color: #60a5fa; background: rgba(59,130,246,0.1); }

/* ── Admin panel — games grid ────────────────────── */
.admin-games-grid {
  display: flex; flex-direction: column; gap: 8px;
}
.admin-game-card {
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; transition: border-color 0.15s;
}
.admin-game-card:hover { border-color: var(--border-hover); }
.admin-game-card[data-status="pending"] { border-color: rgba(251,191,36,0.35); }
.admin-game-card[data-status="rejected"] { opacity: 0.6; }
.admin-game-card-head {
  display: flex; align-items: flex-start; gap: 10px;
}
.admin-game-thumb {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  background: var(--bg-quaternary);
}
.admin-game-info { flex: 1; min-width: 0; }
.admin-game-name {
  font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px;
}
.admin-game-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px;
}
.admin-game-type {
  padding: 1px 7px; border-radius: 4px; font-size: 10px; font-weight: 600;
  background: rgba(59,130,246,0.15); color: #60a5fa; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-game-status-badge {
  padding: 1px 7px; border-radius: 4px; font-size: 10px; font-weight: 700;
}
.admin-game-status-badge.pending  { background: rgba(251,191,36,0.15); color: #fbbf24; }
.admin-game-status-badge.approved { background: rgba(34,197,94,0.15);  color: #4ade80; }
.admin-game-status-badge.rejected { background: rgba(239,68,68,0.15);  color: #f87171; }
.admin-game-author {
  font-size: 11px; color: var(--text-muted);
}
.admin-game-desc {
  font-size: 12px; color: var(--text-secondary); margin-top: 6px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.admin-game-actions {
  display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap;
}
.admin-btn-approve {
  border-color: rgba(34,197,94,0.4); color: #4ade80;
}
.admin-btn-approve:hover { border-color: #4ade80; background: rgba(34,197,94,0.1); }
.admin-btn-reject {
  border-color: rgba(239,68,68,0.4); color: #f87171;
}
.admin-btn-reject:hover { border-color: #f87171; background: rgba(239,68,68,0.1); }
.admin-btn-unpublish {
  border-color: rgba(249,115,22,0.4); color: #fb923c;
}
.admin-btn-unpublish:hover { border-color: #fb923c; background: rgba(249,115,22,0.1); }

/* ─── Lobby Page ─────────────────────────────────────────────────────── */
#lobby-page { display: flex; flex-direction: column; height: 100%; }

/* Header — reuses .cp-header, only extra pieces needed */
.lp-header-info { flex: 1; min-width: 0; }
.lp-game-label  { font-size: 11px; color: var(--glow); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.lp-lobby-title { font-size: 15px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lp-header-action { flex-shrink: 0; display: flex; flex-direction: row; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.lp-start-btn {
  background: var(--glow); color: #0a0a15; border: none;
  border-radius: 8px; padding: 8px 16px;
  font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity 0.15s;
}
.lp-start-btn:hover:not(:disabled) { opacity: 0.85; }
.lp-btn-dim, .lp-start-btn:disabled { background: var(--bg-tertiary); color: var(--text-muted); cursor: not-allowed; }
.lp-start-warn { font-size: 10px; color: var(--warning); text-align: right; }
.lp-waiting-label { font-size: 13px; color: var(--text-secondary); padding: 8px 14px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 8px; font-weight: 600; }
.lp-playing-label { font-size: 13px; color: var(--glow); padding: 8px 14px; background: rgba(232,160,48,.1); border: 1px solid var(--glow-border); border-radius: 8px; font-weight: 600; }
.lp-rejoin-btn { animation: lp-pulse 2s ease-in-out infinite; }
.lp-abandon-btn { font-size: 12px; color: var(--danger); background: none; border: 1px solid rgba(220,50,50,.3); border-radius: 6px; padding: 4px 10px; cursor: pointer; margin-left: 6px; font-weight: 600; }
.lp-abandon-btn:hover { background: rgba(220,50,50,.1); border-color: var(--danger); }
.lp-code-chip { display: flex; align-items: center; gap: 5px; background: rgba(232,160,48,.07); border: 1px solid rgba(232,160,48,.25); border-radius: 6px; padding: 4px 10px; cursor: pointer; user-select: none; margin-right: 6px; }
.lp-code-chip:hover { border-color: rgba(232,160,48,.5); background: rgba(232,160,48,.12); }
.lp-code-label { font-size: 10px; font-weight: 700; color: var(--text-muted); letter-spacing: .08em; }
.lp-code-val { font-family: monospace; font-size: 14px; font-weight: 700; color: var(--text-muted); letter-spacing: .2em; transition: color .2s; }
.lp-code-chip.revealed .lp-code-val { color: var(--glow); letter-spacing: .25em; }
@keyframes lp-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(232,160,48,.4); } 50% { box-shadow: 0 0 0 6px rgba(232,160,48,0); } }
.lp-system-msg { text-align: center; font-size: 12px; color: var(--text-muted); padding: 8px 16px; font-style: italic; }

/* ── Voice chat ──────────────────────────────────────────────────────── */
.lp-voice-btn[data-state="off"]   { color: var(--text-muted); }
.lp-voice-btn[data-state="on"]    { color: #4ade80; box-shadow: 0 0 0 1px rgba(74,222,128,.3); }
.lp-voice-btn[data-state="muted"] { color: var(--danger); }
.lp-voice-btn[data-state="on"]:hover    { background: rgba(74,222,128,.12); }
.lp-voice-btn[data-state="muted"]:hover { background: rgba(220,50,50,.12); }

.rp-member-card.rp-speaking {
  box-shadow: inset 0 0 0 1px rgba(74,222,128,.6), 0 0 8px rgba(74,222,128,.25);
}
.rp-member-card.rp-speaking .rp-member-avatar {
  box-shadow: 0 0 0 2px rgba(74,222,128,.7);
  transition: box-shadow .15s;
}

/* Body — no sidebar, just the chat */
.lp-body { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

/* Chat area */
.lp-messages {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.lp-messages::-webkit-scrollbar { width: 4px; }
.lp-messages::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 2px; }
.lp-empty { color: var(--text-muted); font-size: 13px; text-align: center; padding: 24px; align-self: center; }

.lp-timer {
  flex-shrink: 0; text-align: center; font-size: 11px;
  color: var(--text-muted); padding: 3px 16px 0;
}
.lp-timer-warn { color: var(--danger); }

/* ── Embedded game ─────────────────────────────────────────────── */
#game-embed-wrap { position: relative; width: 100%; height: 100%; display: flex; }
#game-iframe { flex: 1; width: 100%; height: 100%; border: none; background: #0d0906; }
#game-exit-btn { position: absolute; top: 12px; left: 12px; z-index: 110; display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: rgba(10,10,20,.75); border: 1px solid rgba(255,255,255,.15); border-radius: 20px; color: rgba(255,255,255,.7); cursor: pointer; font-size: 13px; backdrop-filter: blur(8px); transition: background .15s, color .15s; }
#game-exit-btn:hover { background: rgba(30,30,50,.9); color: #fff; border-color: rgba(255,255,255,.3); }

/* Overlay is just a 48×48 anchor — never blocks game clicks */
#game-chat-overlay { position: absolute; bottom: 20px; right: 20px; z-index: 100; width: 48px; height: 48px; pointer-events: none; }

.game-chat-toggle { position: relative; width: 48px; height: 48px; border-radius: 50%; background: var(--glow); color: #0a0a15; border: none; cursor: grab; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(232,160,48,.4); transition: transform .15s; pointer-events: auto; user-select: none; }
.game-chat-toggle:hover { transform: scale(1.08); }
.game-chat-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 0 4px; align-items: center; justify-content: center; }

/* Panel is absolutely positioned relative to the overlay — doesn't affect layout */
.game-chat-panel { position: absolute; right: 0; width: 300px; max-height: 420px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,.5); transform: scale(0); opacity: 0; transition: transform .18s ease, opacity .18s ease; pointer-events: none; }
.game-chat-panel.panel-above { bottom: 56px; transform-origin: bottom right; }
.game-chat-panel.panel-below { top: 56px; transform-origin: top right; }
.game-chat-panel.open { transform: scale(1); opacity: 1; pointer-events: auto; }

.game-chat-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text-primary); flex-shrink: 0; }
.game-chat-header.has-game-bg { position: relative; background-size: cover; background-position: center; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.8); padding: 14px 12px; border-bottom-color: rgba(255,255,255,.12); }
.game-chat-header.has-game-bg::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,0,0,.7) 0%, rgba(0,0,0,.45) 100%); }
.game-chat-header.has-game-bg > * { position: relative; z-index: 1; }
.game-chat-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 4px; }
.game-chat-close:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.game-chat-header.has-game-bg .game-chat-close { color: rgba(255,255,255,.65); }
.game-chat-header.has-game-bg .game-chat-close:hover { color: #fff; background: rgba(255,255,255,.15); }

.game-chat-messages { flex: 1; overflow-y: auto; padding: 8px 0; min-height: 200px; }

/* ── Игровой оверлей: стрим-чат + кнопки управления (game-agnostic) ──── */
#game-overlay {
  position: absolute; right: 20px; bottom: 20px; z-index: 120;
  width: 300px; max-height: 48%;
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;                 /* пустые зоны пропускают клики в игру */
  opacity: 1; transition: opacity .45s ease;
  touch-action: none;
}
#game-overlay.gov-idle { opacity: .42; }                          /* блекнет в покое */
#game-overlay:hover, #game-overlay:focus-within { opacity: 1; }   /* ярче при наведении */

/* строка управления = ручка перетаскивания + кнопки за «…» */
.gov-controls {
  align-self: flex-end; display: flex; align-items: center; gap: 8px;
  padding: 4px 6px;                       /* без фона-«облачка» — только зона захвата */
  cursor: grab; pointer-events: auto; user-select: none;
}
.gov-controls:active { cursor: grabbing; }
.gov-dots, .gov-ctl {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  border: none; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: transparent;                /* по умолчанию — без «облачка» */
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.9));
  transition: background .15s, transform .1s, width .2s ease, opacity .2s ease, margin .2s ease;
}
.gov-ctl:hover { background: rgba(255,255,255,.16); }
.gov-ctl:active { transform: scale(.92); }
.gov-call  { background: rgba(46,204,113,.32); }
.gov-call:hover  { background: rgba(46,204,113,.55); }
.gov-leave { background: rgba(220,84,64,.30); }
.gov-leave:hover { background: rgba(220,84,64,.55); }
/* кнопка звонка → красная «выйти из звонка», когда уже в звонке */
.gov-call.gov-incall { background: rgba(220,84,64,.42); }
.gov-call.gov-incall:hover { background: rgba(220,84,64,.6); }
.gov-ic-hang { display: none; }
.gov-call.gov-incall .gov-ic-call { display: none; }
.gov-call.gov-incall .gov-ic-hang { display: inline; }
/* кнопки скрыты, пока не навели на оверлей или не нажали «…» (как у войс-оверлея) */
.gov-ctl { width: 0; opacity: 0; pointer-events: none; overflow: hidden; }
#game-overlay:hover .gov-ctl,
#game-overlay.gov-revealed .gov-ctl { width: 34px; opacity: 1; pointer-events: auto; }
#game-overlay:hover .gov-dots,
#game-overlay.gov-revealed .gov-dots { width: 0; opacity: 0; pointer-events: none; margin: 0 -3px; }

/* стрим-чат: прозрачный, аватарки, без плашек, не блокирует игру */
.gov-feed {
  flex: 1 1 auto; min-height: 0; pointer-events: none;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 5px;
  overflow: hidden; padding: 2px 2px 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30px);
          mask-image: linear-gradient(to bottom, transparent 0, #000 30px);
}
.gov-msg { display: flex; align-items: flex-start; gap: 7px; }
.gov-av {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; overflow: hidden;
  background: var(--glow-soft); color: var(--glow); font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.gov-line {
  font-size: 13px; line-height: 1.4; color: #fff; word-break: break-word;
  text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 3px rgba(0,0,0,.85);
}
.gov-name { color: var(--glow); margin-right: 4px; font-weight: 700; }

/* поле ввода — без «облачка», текст просто поверх игры (с тенью для читаемости) */
.gov-input-row {
  display: flex; align-items: flex-end; gap: 6px;
  padding: 4px 4px 4px 6px;
  cursor: grab; pointer-events: auto;
}
.gov-input {
  flex: 1; background: transparent; border: none; outline: none; resize: none;
  color: #fff; font-size: 13px; line-height: 1.4; max-height: 80px; font-family: inherit; padding: 7px 0;
  cursor: text; text-shadow: 0 1px 3px rgba(0,0,0,.9);
}
.gov-input::placeholder { color: rgba(255,255,255,.55); text-shadow: 0 1px 3px rgba(0,0,0,.9); }
/* кнопка отправки появляется только при наведении — анимация как у «…» */
.gov-send {
  width: 0; opacity: 0; pointer-events: none; overflow: hidden;
  height: 34px; flex-shrink: 0; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--glow); color: #0a0a15;
  transition: width .2s ease, opacity .2s ease;
}
#game-overlay:hover .gov-send,
#game-overlay:focus-within .gov-send { width: 34px; opacity: 1; pointer-events: auto; }
.gov-send:hover { filter: brightness(1.08); }

/* ── Game-end voting overlay ─────────────────────────────────────── */
.game-end-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(5px); display: flex; align-items: flex-start; justify-content: center; padding-top: 48px; z-index: 200; }
.ge-panel { background: var(--bg-secondary); border: 1px solid var(--glow-border); border-radius: 16px; padding: 22px 24px 18px; width: 320px; max-height: 80vh; overflow-y: auto; box-shadow: 0 16px 48px rgba(0,0,0,.7), 0 0 0 1px var(--glow-border); }
.ge-title { font-size: 20px; font-weight: 800; color: var(--glow); text-align: center; margin-bottom: 3px; }
.ge-subtitle { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 10px; }
.ge-votes-info { font-size: 12px; color: var(--text-muted); text-align: center; margin-bottom: 12px; }
.ge-votes-left { color: var(--glow); font-weight: 700; }
.ge-timer-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.ge-timer-bar { flex: 1; height: 4px; background: var(--bg-tertiary); border-radius: 2px; overflow: hidden; }
.ge-timer-fill { height: 100%; background: var(--glow); border-radius: 2px; transition: width 1s linear, background .3s; }
.ge-timer-fill.ge-timer-warn { background: var(--danger); }
.ge-timer-num { font-size: 13px; font-weight: 700; color: var(--text-muted); min-width: 24px; text-align: right; }
.ge-players-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.ge-player-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--bg-tertiary); border-radius: 8px; border: 1px solid var(--border); }
.ge-p-av { width: 30px; height: 30px; border-radius: 50%; background: var(--glow-soft); color: var(--glow); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ge-p-name { flex: 1; font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ge-you { color: var(--text-muted); font-size: 11px; }
.ge-p-votes { font-size: 12px; color: var(--text-muted); flex-shrink: 0; min-width: 38px; text-align: center; }
.ge-vote-btn { width: 28px; height: 28px; border-radius: 50%; background: var(--glow-soft); color: var(--glow); border: 1px solid var(--glow-border); font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s, transform .1s; cursor: pointer; }
.ge-vote-btn:hover:not(:disabled) { background: var(--glow); color: var(--bg-primary); transform: scale(1.1); }
.ge-vote-btn:disabled { opacity: .3; cursor: not-allowed; }
.ge-vote-btn.ge-voted { background: rgba(0,200,150,.15); color: #00c896; border-color: #00c896; opacity: 1; font-size: 13px; }
.ge-vote-placeholder { width: 28px; flex-shrink: 0; }
.ge-skip-btn { display: block; width: 100%; padding: 9px; border-radius: 8px; background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-muted); font-size: 13px; cursor: pointer; transition: background .15s; }
.ge-skip-btn:hover { background: var(--bg-active); color: var(--text-primary); }

/* ── Game ratings leaderboard (game page) ────────────────────────── */
.ge-leaderboard { padding: 4px 0 8px; }
.ge-lb-meta { font-size: 11px; color: var(--text-muted); text-align: center; margin-bottom: 12px; }
.ge-lb-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; margin-bottom: 4px; }
.ge-lb-row.ge-lb-top { background: var(--bg-tertiary); border: 1px solid var(--border); }
.ge-lb-rank { font-size: 18px; width: 28px; text-align: center; flex-shrink: 0; }
.ge-lb-av { width: 32px; height: 32px; border-radius: 50%; background: var(--glow-soft); color: var(--glow); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ge-lb-name { flex: 1; font-size: 14px; color: var(--text-primary); font-weight: 500; }
.ge-lb-votes { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.game-chat-input-row { padding: 8px; border-top: 1px solid var(--border); }

/* ── Panels collapsed (normal mode, no game) ──────────────────────── */
body.panels-collapsed #left-panel,
body.panels-collapsed #right-panel {
  width: 0 !important; min-width: 0 !important;
  opacity: 0 !important; pointer-events: none !important;
  transition: width 0.32s ease, min-width 0.32s ease, opacity 0.25s ease;
}
/* ── Game fullscreen mode ──────────────────────────────────────────── */
/* Transitions live ONLY inside game-fullscreen so normal platform is untouched */
body.game-fullscreen #topbar      { transition: background-color 0.35s ease, box-shadow 0.35s ease; }
body.game-fullscreen #topbar .logo { transition: gap 0.3s ease, color 0.3s ease, max-width 0.35s ease, overflow 0s,
                                                  box-shadow 0.3s ease, background-color 0.3s ease,
                                                  border-radius 0.3s ease, padding 0.3s ease; }
body.game-fullscreen #left-panel,
body.game-fullscreen #right-panel  { transition: width 0.32s ease, min-width 0.32s ease, opacity 0.25s ease; }
body.game-fullscreen #main-view-tabs { overflow: hidden; transition: max-height 0.3s ease, opacity 0.25s ease; }
body.game-fullscreen #layout       { transition: margin-top 0.35s ease, height 0.35s ease; }

/* ── Collapsed state (no panels) ── */
body.game-fullscreen #topbar {
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  border: none !important;
  pointer-events: none !important;
}
body.game-fullscreen #topbar .logo { display: none !important; }
@keyframes mh-glow-pulse {
  0%,100% { box-shadow: 0 0 0 2px rgba(232,160,48,.55), 0 0 14px rgba(232,160,48,.25); }
  50%      { box-shadow: 0 0 0 2px rgba(232,160,48,.85), 0 0 24px rgba(232,160,48,.5);  }
}
body.game-fullscreen #left-panel,
body.game-fullscreen #right-panel { width: 0 !important; min-width: 0 !important; flex-basis: 0 !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden !important; }
body.game-fullscreen #main-view-tabs { max-height: 0 !important; opacity: 0 !important; pointer-events: none !important; }
body.game-fullscreen #main-content { width: 100% !important; }
body.game-fullscreen #games-section { height: 100vh !important; padding: 0 !important; overflow: hidden !important; }
body.game-fullscreen #layout { margin-top: 0 !important; height: 100vh !important; }

/* ── Panels visible (toggle) ── */
body.game-fullscreen.game-panels-visible #topbar {
  background-color: #0D0602 !important;
  background-image: url('/images/games/lazy-guild-topbar.png') !important;
  background-size: cover !important; background-position: center center !important;
  background-repeat: no-repeat !important;
  box-shadow: 0 1px 0 rgba(196,120,32,.12), 0 2px 12px rgba(10,5,2,.8) !important;
  pointer-events: auto !important;
}
body.game-fullscreen.game-panels-visible #topbar .logo {
  display: flex !important;
  background-color: transparent !important;
  border-radius: 0 !important;
  padding: 0 !important;
  backdrop-filter: none !important;
  color: var(--glow) !important;
  gap: 7px !important;
  max-width: 300px !important;
  overflow: visible !important;
  box-shadow: none !important;
  animation: none !important;
  cursor: pointer !important;
}
body.game-fullscreen.game-panels-visible #topbar .logo .logo-icon { width: 52px !important; height: 52px !important; }
body.game-fullscreen.game-panels-visible #left-panel,
body.game-fullscreen.game-panels-visible #right-panel { width: var(--panel-width) !important; min-width: unset !important; flex-basis: var(--panel-width) !important; opacity: 1 !important; pointer-events: auto !important; overflow: hidden !important; }
body.game-fullscreen.game-panels-visible #left-panel.collapsed,
body.game-fullscreen.game-panels-visible #right-panel.collapsed { width: var(--panel-width-collapsed) !important; flex-basis: var(--panel-width-collapsed) !important; }
body.game-fullscreen.game-panels-visible #main-view-tabs { max-height: 50px !important; opacity: 1 !important; pointer-events: auto !important; }
body.game-fullscreen.game-panels-visible #layout { margin-top: var(--topbar-height) !important; height: calc(100vh - var(--topbar-height)) !important; }
body.game-fullscreen.game-panels-visible #games-section { height: calc(100% - 41px) !important; }

/* ── Right-panel role settings (new-world lobby) ─── */
.rp-roles-sep { height: 1px; background: var(--border); margin: 8px 0 4px; }
.rp-roles-wrap { padding: 0 4px 8px; }
.rp-roles-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 6px; }
.rp-roles-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text-muted); text-transform: uppercase; }
.rp-roles-rnd-all { background: transparent; border: 1px solid var(--border); color: var(--text-muted); font-size: 10px; border-radius: 5px; padding: 2px 7px; cursor: pointer; white-space: nowrap; }
.rp-roles-rnd-all:hover { border-color: var(--glow); color: var(--glow); }
.rp-rs-row { display: flex; align-items: center; gap: 7px; padding: 3px 8px; }
.rp-rs-av { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg,var(--bg-hover),var(--bg-active)); display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: var(--text-secondary); flex-shrink: 0; }
.rp-rs-name { font-size: 12px; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-rs-badge { font-size: 11px; font-weight: 600; white-space: nowrap; }
.rp-rs-random { color: var(--text-muted) !important; }
.rp-rs-select { background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-primary); font-size: 11px; border-radius: 5px; padding: 2px 5px; cursor: pointer; max-width: 130px; width: 100%; }
.rp-rs-select:focus { outline: none; border-color: var(--glow); }
.rp-roles-legend { padding: 6px 8px 2px; border-top: 1px solid var(--border); margin-top: 4px; }
.rp-roles-legend-row { font-size: 10px; color: var(--text-muted); padding: 2px 0; line-height: 1.4; }
.panel.collapsed .rp-roles-sep,
.panel.collapsed .rp-roles-wrap { display: none; }

/* ── Lobby settings button ───────────────────────── */
.rp-settings-btn {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  width: calc(100% - 16px); margin: 4px 8px 8px;
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px; font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}
.rp-settings-btn:hover { border-color: var(--glow); color: var(--glow); }
.panel.collapsed .rp-settings-btn { display: none; }

/* ── Game settings flyout ────────────────────────── */
.lobby-settings-backdrop {
  position: fixed; inset: 0; z-index: 999;
}
.lobby-settings-box {
  position: fixed; z-index: 1000;
  background: var(--bg-secondary); border: 1px solid var(--glow-border);
  border-radius: 14px; overflow: hidden;
  width: min(480px, 92vw); height: min(600px, 88vh);
  display: flex; flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(232,160,48,0.08);
  animation: settings-in 0.2s cubic-bezier(0.2,0,0,1);
}
@keyframes settings-in {
  from { opacity: 0; transform: translateX(16px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.lobby-settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 700; color: var(--text-primary); flex-shrink: 0;
}
.lobby-settings-close {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 16px; padding: 2px 6px; border-radius: 4px; line-height: 1;
}
.lobby-settings-close:hover { color: var(--text-primary); }
.lobby-settings-iframe { flex: 1; border: none; width: 100%; background: var(--bg-primary); }

/* ── Lobby countdown ──────────────────────────────── */
.lp-countdown { padding: 4px 12px 8px; flex-shrink: 0; }
.lp-countdown-inner { display: flex; align-items: center; gap: 12px; background: rgba(232,160,48,.08); border: 1px solid rgba(232,160,48,.3); border-radius: 10px; padding: 10px 16px; }
.lp-countdown-label { font-size: 13px; color: var(--text-secondary); flex: 1; }
.lp-countdown-num { font-size: 28px; font-weight: 800; color: var(--glow); min-width: 36px; text-align: center; transition: color 0.3s; }
.lp-countdown-num.lp-countdown-warn { color: #f97316; animation: cd-pulse 0.5s ease-in-out infinite alternate; }
@keyframes cd-pulse { from { transform: scale(1); } to { transform: scale(1.15); } }
.lp-countdown-cancel { background: transparent; border: 1px solid rgba(255,255,255,.2); color: var(--text-muted); font-size: 12px; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.lp-countdown-cancel:hover { border-color: var(--danger); color: var(--danger); }

/* Lobby input — same as #cp-input but by id */
/* Lobby entry in left panel */
.lobby-entry-card { border: 1px solid rgba(196,120,32,0.2); background: rgba(196,120,32,0.04); border-radius: 8px; margin-bottom: 4px; }
.lobby-entry-card:hover { background: rgba(232,160,48,0.08); border-color: rgba(232,160,48,0.35); }
.lobby-entry-card.active { background: rgba(232,160,48,0.12); border-color: rgba(232,160,48,0.5); }
.lobby-entry-av {
  position: relative; background: linear-gradient(135deg,var(--bg-hover),var(--bg-active));
  display: flex; align-items: center; justify-content: center;
}
.lobby-entry-badge {
  position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  font-size: 7px; font-weight: 800; letter-spacing: 0.05em;
  background: var(--glow); color: #0a0a15;
  padding: 1px 4px; border-radius: 3px; white-space: nowrap;
}

/* Host badge in right panel */
.rp-host-badge {
  display: inline-block; font-size: 9px; font-weight: 700;
  color: var(--warning); text-transform: uppercase; letter-spacing: 0.05em;
  margin-left: 4px;
}

#lp-input {
  flex: 1; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text-primary);
  padding: 10px 16px; font-size: 14px; outline: none;
  resize: none; font-family: inherit; line-height: 1.4;
  transition: var(--transition); overflow: hidden;
  min-height: 42px; max-height: 120px;
}
#lp-input:focus { border-color: var(--glow); }
#lp-input::placeholder { color: var(--text-muted); }

/* ── Absurd Court game screen ─────────────────────── */
#game-embed-wrap { position: relative; width: 100%; height: 100%; }
.ac-game { flex: 1; height: 100%; display: flex; flex-direction: column; background: #12112a; color: #e8e8f0; overflow: hidden; }

.ac-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(0,0,0,0.35); border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.ac-phase-badge { background: #6c5ce7; color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ac-case { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ac-case-icon { font-size: 22px; flex-shrink: 0; }
.ac-case-info { min-width: 0; }
.ac-case-accused { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-case-charge { font-size: 11px; color: rgba(255,255,255,0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-leave-btn { background: none; border: none; color: rgba(255,255,255,0.5); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: color 0.2s, background 0.2s; flex-shrink: 0; }
.ac-leave-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

.ac-content { flex: 1; display: flex; overflow: hidden; }

.ac-players-panel { width: 220px; flex-shrink: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid rgba(255,255,255,0.07); }
.ac-player-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); border-radius: 9px; padding: 9px 11px; }
.ac-player-card.ac-me { border-color: #6c5ce7; background: rgba(108,92,231,0.12); }
.ac-player-card.ac-judge { border-color: #f9ca24; background: rgba(249,202,36,0.08); }
.ac-p-name { font-weight: 700; font-size: 12px; }
.ac-p-role { font-size: 11px; color: #a29bfe; margin-top: 2px; }
.ac-p-trait { font-size: 10px; color: rgba(255,255,255,0.45); margin-top: 3px; font-style: italic; line-height: 1.4; }
.ac-p-vote { font-size: 11px; margin-top: 4px; }
.ac-you { color: rgba(255,255,255,0.45); font-weight: 400; }

.ac-right-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.ac-log-wrap { flex: 1; display: flex; flex-direction: column; padding: 10px 12px 8px; overflow: hidden; }
.ac-log-title { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(255,255,255,0.35); margin-bottom: 6px; }
.ac-log { flex: 1; overflow-y: auto; font-size: 12px; line-height: 1.6; color: rgba(255,255,255,0.65); }
.ac-log-entry { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }

.ac-actions { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.07); display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; }
.ac-next-btn { background: #6c5ce7; color: #fff; border: none; border-radius: 8px; padding: 10px 16px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.ac-next-btn:hover { background: #7d70ed; }
.ac-verdict-prompt { font-size: 12px; color: rgba(255,255,255,0.6); }
.ac-verdict-row { display: flex; gap: 7px; }
.ac-verdict-btn { flex: 1; border: none; border-radius: 8px; padding: 9px 12px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.ac-guilty { background: #d63031; color: #fff; }
.ac-guilty:hover { background: #e53e3e; }
.ac-not-guilty { background: #00b894; color: #fff; }
.ac-not-guilty:hover { background: #00cca3; }
.ac-waiting-label, .ac-finished-label { font-size: 13px; color: rgba(255,255,255,0.5); text-align: center; padding: 6px 0; }
.ac-finished-label { color: #f9ca24; font-weight: 700; }

/* ── Импровизатор game screen ─────────────────── */
.im-game { flex: 1; height: 100%; display: flex; flex-direction: column; background: #1a1208; color: #f0e8d0; overflow: hidden; }

.im-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(0,0,0,0.4); border-bottom: 1px solid rgba(255,200,50,0.15); flex-shrink: 0; }
.im-phase-badge { background: #b8860b; color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.im-scenario-info { flex: 1; min-width: 0; }
.im-scenario-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-scenario-loc { font-size: 11px; color: rgba(240,232,208,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-leave-btn { background: none; border: none; color: rgba(240,232,208,0.5); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; flex-shrink: 0; transition: color 0.2s, background 0.2s; }
.im-leave-btn:hover { color: #f0e8d0; background: rgba(255,255,255,0.1); }

.im-content { flex: 1; display: flex; overflow: hidden; }

.im-players-panel { width: 190px; flex-shrink: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid rgba(255,200,50,0.1); }
.im-player-card { background: rgba(255,200,50,0.04); border: 1px solid rgba(255,200,50,0.1); border-radius: 9px; padding: 9px 11px; }
.im-player-card.im-me { border-color: #b8860b; background: rgba(184,134,11,0.12); }
.im-player-card.im-host { border-color: #f9ca24; background: rgba(249,202,36,0.08); }
.im-p-name { font-weight: 700; font-size: 12px; }
.im-p-role { font-size: 11px; color: #c8960f; margin-top: 2px; }
.im-p-desc { font-size: 10px; color: rgba(240,232,208,0.4); margin-top: 3px; font-style: italic; line-height: 1.4; }
.im-p-tasks { font-size: 10px; color: rgba(240,232,208,0.45); margin-top: 3px; }
.im-p-voted { font-size: 10px; color: #00b894; margin-top: 3px; }
.im-you { color: rgba(240,232,208,0.45); font-weight: 400; }

.im-right-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.im-tasklog-wrap { flex: 1; display: flex; flex-direction: column; padding: 10px 12px 8px; overflow: hidden; }
.im-tasklog-title { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(240,232,208,0.35); margin-bottom: 6px; }
.im-tasklog { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.im-tasklog-empty { font-size: 12px; color: rgba(240,232,208,0.3); text-align: center; padding: 20px 0; }
.im-task-entry { padding: 6px 10px; border-radius: 7px; font-size: 12px; line-height: 1.5; display: flex; align-items: flex-start; gap: 6px; flex-shrink: 0; }
.im-task-individual { background: rgba(184,134,11,0.14); border: 1px solid rgba(184,134,11,0.28); }
.im-task-common { background: rgba(108,92,231,0.14); border: 1px solid rgba(108,92,231,0.28); }
.im-task-badge { flex-shrink: 0; }
.im-task-target { font-weight: 700; color: #f9ca24; white-space: nowrap; flex-shrink: 0; }
.im-task-text { color: rgba(240,232,208,0.85); }

.im-actions { padding: 10px 12px; border-top: 1px solid rgba(255,200,50,0.1); display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; }
.im-actions-title { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(240,232,208,0.35); }
.im-player-task-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.im-player-task-btn { background: rgba(184,134,11,0.18); border: 1px solid rgba(184,134,11,0.35); color: #f0e8d0; font-size: 12px; border-radius: 7px; padding: 5px 10px; cursor: pointer; transition: background 0.2s; }
.im-player-task-btn:hover { background: rgba(184,134,11,0.38); }
.im-common-btn { background: rgba(108,92,231,0.22); border: 1px solid rgba(108,92,231,0.4); color: #f0e8d0; font-size: 13px; font-weight: 600; border-radius: 8px; padding: 9px 12px; cursor: pointer; transition: background 0.2s; }
.im-common-btn:hover { background: rgba(108,92,231,0.42); }
.im-end-btn { background: rgba(0,184,148,0.18); border: 1px solid rgba(0,184,148,0.35); color: #f0e8d0; font-size: 13px; font-weight: 600; border-radius: 8px; padding: 9px 12px; cursor: pointer; transition: background 0.2s; }
.im-end-btn:hover { background: rgba(0,184,148,0.38); }
.im-vote-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.im-vote-btn { background: rgba(255,80,80,0.18); border: 1px solid rgba(255,80,80,0.35); color: #f0e8d0; font-size: 12px; border-radius: 7px; padding: 6px 12px; cursor: pointer; transition: background 0.2s; }
.im-vote-btn:hover:not(:disabled) { background: rgba(255,80,80,0.38); }
.im-vote-btn:disabled { opacity: 0.45; cursor: default; }
.im-waiting-label, .im-finished-label { font-size: 13px; color: rgba(240,232,208,0.45); text-align: center; padding: 6px 0; }
.im-finished-label { color: #f9ca24; font-weight: 700; }

/* ── Подписка / ранги гильдии ── */
.rank-badge { display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; padding:0 5px; border-radius:5px; font-size:11px; font-weight:800; color:#0a0a15; background:var(--rk,#888); vertical-align:middle; box-shadow:0 1px 3px rgba(0,0,0,.3); }
.sub-cta { background:linear-gradient(135deg,var(--accent),var(--glow)); color:#0a0a15; font-weight:700; border:0; border-radius:9px; padding:9px; cursor:pointer; }
.sub-cta:hover { filter:brightness(1.08); }
.sub-modal-ov { position:fixed; inset:0; z-index:5200; background:rgba(0,0,0,.6); display:flex; align-items:center; justify-content:center; padding:20px; animation:subFade .15s ease; }
@keyframes subFade { from{opacity:0} to{opacity:1} }
.sub-modal { width:760px; max-width:95vw; max-height:88vh; overflow:auto; background:var(--bg-secondary); border:1px solid var(--border); border-radius:16px; box-shadow:0 18px 50px rgba(0,0,0,.6); }
.sub-head { display:flex; align-items:flex-start; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--bg-secondary); z-index:1; }
.sub-title { font-size:18px; font-weight:800; }
.sub-sub { font-size:12px; color:var(--text-muted); margin-top:3px; }
.sub-x { border:0; background:none; color:var(--text-secondary); font-size:18px; cursor:pointer; }
.sub-x:hover { color:var(--text-primary); }
.sub-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; padding:18px 22px; }
@media (max-width:680px){ .sub-grid{ grid-template-columns:1fr; } }
.sub-card { display:flex; flex-direction:column; gap:10px; padding:16px; border-radius:12px; background:var(--bg-tertiary); border:1px solid var(--border); border-top:3px solid var(--rk,#888); }
.sub-card-cur { box-shadow:0 0 0 1px var(--rk); }
.sub-card-top { display:flex; align-items:center; gap:11px; }
.sub-rank-letter { width:38px; height:38px; flex-shrink:0; border-radius:10px; background:var(--rk,#888); color:#0a0a15; font-size:18px; font-weight:800; display:flex; align-items:center; justify-content:center; }
.sub-rank-name { font-size:15px; font-weight:700; }
.sub-rank-price { font-size:12px; color:var(--text-muted); }
.sub-perks { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:5px; flex:1; }
.sub-perks li { font-size:12px; color:var(--text-secondary); padding-left:16px; position:relative; }
.sub-perks li::before { content:'✓'; position:absolute; left:0; color:var(--rk,var(--glow)); font-weight:700; }
.sub-card-foot { margin-top:auto; }
.sub-btn { width:100%; border:0; border-radius:9px; padding:9px; font-size:13px; font-weight:700; cursor:pointer; color:#0a0a15; background:var(--rk,var(--glow)); transition:filter .15s; }
.sub-btn:hover:not(:disabled) { filter:brightness(1.08); }
.sub-btn:disabled { opacity:.6; cursor:default; }
.sub-btn-ghost { background:var(--bg-hover); color:var(--text-secondary); }
.sub-cur { text-align:center; font-size:12px; font-weight:700; color:var(--rk,var(--glow)); padding:9px; border:1px dashed var(--rk,var(--border)); border-radius:9px; }

/* Иконки-гербы рангов */
.rank-badge-ic { width:19px; height:19px; vertical-align:middle; object-fit:contain; filter:drop-shadow(0 1px 2px rgba(0,0,0,.5)); margin-left:2px; }
.sub-rank-ic { width:46px; height:46px; flex-shrink:0; object-fit:contain; filter:drop-shadow(0 1px 3px rgba(0,0,0,.5)); }

/* Встроенная рамка аватара по рангу (внутри avatarInner, работает везде) */
.av-framed { position:relative; width:100%; height:100%; display:flex; align-items:center; justify-content:center; }
.av-framed-inner { width:80%; height:80%; border-radius:50%; overflow:hidden; background:var(--accent); display:flex; align-items:center; justify-content:center; }
.av-framed-inner img { width:100%; height:100%; object-fit:cover; }
.av-frame-ring { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:130%; height:130%; pointer-events:none; z-index:2; }
/* Косметические рамки «Таверны» — отверстие крупнее, прилегают к аватару */
.av-framed-cosm .av-framed-inner { width:84%; height:84%; }
.av-frame-ring-cosm { width:118%; height:118%; }
/* Контейнеры с рамкой не должны обрезать ажур в кружок */
.avatar:has(.av-framed),
.cp-avatar:has(.av-framed),
.cp-avatar-sm:has(.av-framed),
.rp-member-avatar:has(.av-framed),
.find-user-avatar:has(.av-framed),
#prof-avatar:has(.av-framed),
.uprof-av:has(.av-framed),
.pc-av:has(.av-framed) { overflow:visible !important; background:none !important; border-radius:0 !important; box-shadow:none !important; }


/* ── Профиль: баннер + тема ранга ── */
.popover.pop-card { padding:0 !important; background:none !important; border:none !important; box-shadow:none !important; width:300px !important; overflow:visible !important; }
.pc { position:relative; background:var(--bg-secondary); border:1px solid var(--border); border-radius:16px; overflow:hidden; box-shadow:0 18px 50px rgba(0,0,0,.6); }
.pc-banner { position:relative; height:118px; background-image:linear-gradient(135deg,#3a2410,#1c1006); background-position:center top; background-size:cover; background-repeat:no-repeat; background-color:var(--bg-tertiary); }
.pc-banner::after { content:''; position:absolute; inset:0; background:linear-gradient(180deg, transparent 42%, var(--bg-secondary) 97%); }
.pc-av-wrap { position:absolute; top:68px; left:50%; transform:translateX(-50%); width:84px; height:84px; z-index:3; }
.pc-av { width:100%; height:100%; border-radius:50%; background:var(--accent); display:flex; align-items:center; justify-content:center; font-size:24px; font-weight:800; color:#fff; cursor:pointer; overflow:hidden; box-shadow:0 0 0 4px var(--bg-secondary); }
.pc-av:has(.av-framed) { box-shadow:none; }
.pc-cam { position:absolute; right:2px; bottom:2px; width:24px; height:24px; border-radius:50%; background:var(--bg-tertiary); border:2px solid var(--bg-secondary); display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text-secondary); z-index:6; transition:color .15s; }
.pc-cam:hover { color:var(--glow); }
.pc-body { padding:48px 18px 16px; text-align:center; }
/* Косметический фон профиля — на всю карточку */
.pc-cosmbg { background-size:cover; background-position:center; }
.pc-cosmbg .pc-banner { background:transparent; }
.pc-cosmbg .pc-banner::after { background:linear-gradient(180deg, transparent 60%, rgba(16,8,3,.45) 100%); }
.pc-cosmbg .pc-body { background:linear-gradient(180deg, rgba(16,8,3,.32) 0%, rgba(16,8,3,.86) 58%); }
.pc-name { font-size:17px; font-weight:800; display:flex; align-items:center; justify-content:center; gap:6px; }
.pc-meta { margin-top:5px; font-size:13px; display:flex; align-items:center; justify-content:center; gap:7px; }
.pc-rating { color:var(--warning); font-weight:700; }
.pc-dot { color:var(--text-muted); }
.pc-status.on { color:#5fd16a; font-weight:600; }
.pc-status.off { color:var(--text-muted); }
.pc-support { margin-top:6px; font-size:11px; color:var(--text-muted); }
.pc-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:14px; }
.pc-stat { background:rgba(0,0,0,.28); border:1px solid var(--border); border-radius:10px; padding:9px 4px; }
.pc-stat b { font-size:18px; font-weight:800; display:block; line-height:1.1; }
.pc-stat span { font-size:10px; color:var(--text-muted); }
.pc-sub { width:100%; margin-top:13px; }
.pc-actions { display:flex; gap:8px; margin-top:10px; }
.pc-actions button { flex:1; }
.pc-body .prof-actions { margin-top:13px; }

/* ── Кошелёк и доска заданий ── */
.gold-chip { display:inline-flex; align-items:center; gap:5px; padding:5px 9px; border-radius:12px; border:1px solid var(--glow-border); background:rgba(232,160,48,.1); color:var(--glow); font-size:12px; font-weight:700; cursor:pointer; transition:background .15s; flex-shrink:0; }
.gold-chip:hover { background:rgba(232,160,48,.22); }
.gold-coin { font-size:13px; line-height:1; }
.tb-modal { width:560px; }
.tb-gold { display:flex; align-items:center; gap:6px; font-size:16px; font-weight:800; color:var(--glow); margin-left:auto; margin-right:14px; }
.tb-list { padding:14px 18px 18px; display:flex; flex-direction:column; gap:10px; }
.tb-task { display:flex; align-items:center; gap:12px; padding:13px 14px; border-radius:12px; background:var(--bg-tertiary); border:1px solid var(--border); transition:border-color .15s; }
.tb-task.tb-ready { border-color:var(--glow); box-shadow:0 0 0 1px var(--glow-border); }
.tb-task.tb-claimed { opacity:.55; }
.tb-task-ic { font-size:24px; flex-shrink:0; }
.tb-task-main { flex:1; min-width:0; }
.tb-task-title { font-size:14px; font-weight:700; display:flex; align-items:center; gap:8px; }
.tb-task-reward { font-size:11px; color:var(--glow); font-weight:700; }
.tb-task-desc { font-size:12px; color:var(--text-muted); margin:2px 0 7px; }
.tb-bar { height:6px; border-radius:3px; background:rgba(0,0,0,.3); overflow:hidden; }
.tb-bar-fill { height:100%; background:linear-gradient(90deg, var(--accent), var(--glow)); border-radius:3px; transition:width .3s; }
.tb-task-side { flex-shrink:0; }
.tb-claim { display:inline-flex; align-items:center; gap:4px; border:0; border-radius:9px; padding:9px 14px; font-size:13px; font-weight:700; cursor:pointer; color:#0a0a15; background:linear-gradient(135deg, var(--accent), var(--glow)); transition:filter .15s; white-space:nowrap; }
.tb-claim:hover:not(:disabled) { filter:brightness(1.08); }
.tb-claim:disabled { opacity:.6; cursor:default; }
.tb-done { font-size:12px; font-weight:600; color:#5fd16a; white-space:nowrap; }
.tb-pending { font-size:13px; font-weight:700; color:var(--text-muted); white-space:nowrap; }

/* ── Вкладка «Гильдия» ── */
/* Страница «Гильдия» — деревянная квест-доска во всю среднюю секцию */
.guild-page { position:relative; max-width:none; margin:12px; min-height:calc(100vh - 130px); box-sizing:border-box; padding:30px 38px 44px;
  background:#120800 url('/images/lazy-guild-lantern.gif') center center / cover no-repeat fixed;
  border:1px solid var(--border); border-radius:14px;
  box-shadow:0 16px 44px rgba(0,0,0,.45); }
.guild-page > * { position:relative; }

/* Шапка — деревянная табличка (9-slice border-image) */
.guild-hero { position:relative; display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 26px;
  min-height:92px; padding:12px 30px; background:transparent; border-radius:0;
  border:27px solid transparent; border-width:27px 30px;
  border-image:url('/images/ranks/plaque.png?v=1') 46 50 fill / 27px 30px / 0 stretch;
  filter:drop-shadow(0 10px 22px rgba(0,0,0,.5)); }
.guild-title { font-family:'PT Serif', Georgia, serif; font-size:30px; font-weight:700; margin:0; letter-spacing:.5px;
  background:linear-gradient(180deg,#ffe6ad,#e8a030); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; color:var(--glow);
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
.guild-sub { font-family:'PT Serif', serif; font-style:italic; font-size:13.5px; color:#e6cfa3; margin-top:4px; text-shadow:0 1px 2px rgba(0,0,0,.6); }
.guild-sub b { color:var(--glow); font-style:normal; }
.guild-wallet { display:flex; align-items:center; gap:8px; font-size:28px; font-weight:800; color:var(--glow); flex-shrink:0; }
.guild-wallet-label { font-size:11px; color:var(--text-secondary); font-weight:600; align-self:flex-end; margin-bottom:6px; }
/* Иконка монеты */
.coin-ic { width:1.05em; height:1.05em; vertical-align:-.18em; object-fit:contain; flex-shrink:0; }
.guild-block-title { font-family:'PT Serif', Georgia, serif; font-size:18px; font-weight:700; letter-spacing:.5px; margin:8px 0 18px; color:#f0d8a0; text-shadow:0 1px 0 #1c1006, 0 2px 5px rgba(0,0,0,.7); }

/* Задания — свитки с текстом поверх */
.guild-page .tb-list { padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:20px 16px; }
.guild-page .tb-task { position:relative; aspect-ratio:1; display:flex; flex-direction:column; align-items:stretch; gap:6px; text-align:left;
  background:url('/images/ranks/scroll.png') center/100% 100% no-repeat; color:#3a2a14; border:none;
  filter:drop-shadow(0 6px 12px rgba(0,0,0,.5)); padding:40px 32px 38px; }
.guild-page .tb-task.tb-claimed { opacity:.65; filter:drop-shadow(0 6px 12px rgba(0,0,0,.5)) grayscale(.3); }
.guild-page .tb-task-ic { display:none; }
.guild-page .tb-task { font-family:'PT Serif', Georgia, serif; }
.guild-page .tb-task-main { flex:1; min-width:0; display:flex; flex-direction:column; }
.guild-page .tb-task-title { font-family:'Caveat', 'Marck Script', cursive; font-weight:700; font-size:26px; line-height:1.02; color:#3a230b; letter-spacing:.4px; align-items:baseline; gap:7px; text-shadow:0 1px 0 rgba(255,255,255,.25); }
.guild-page .tb-task-reward { font-family:'PT Serif', serif; font-weight:700; font-size:12.5px; color:#8a5a14; }
.guild-page .tb-task-desc { font-family:'PT Serif', serif; font-style:italic; font-size:13.5px; color:#5b431f; line-height:1.34; margin:5px 0 0; }
.guild-page .tb-task-side { margin-top:10px; }
.guild-page .tb-bar { background:rgba(90,62,24,.22); margin-top:auto; }
.guild-page .tb-bar-fill { background:linear-gradient(90deg,#b8841e,#e3a92c); }
.guild-page .tb-claim { width:100%; justify-content:center; font-family:'PT Serif', serif; font-weight:700; background:linear-gradient(135deg,#8a4f12,#c3891c); color:#fff3da; box-shadow:0 2px 5px rgba(0,0,0,.3); }
.guild-page .tb-pending { text-align:center; font-family:'Caveat', cursive; font-weight:700; font-size:18px; color:#6a4f24; }
.guild-page .tb-done { text-align:center; font-family:'Caveat', cursive; font-weight:700; font-size:19px; color:#3e7a2e; }

.guild-hero-right { display:flex; align-items:center; gap:16px; flex-shrink:0; }
.guild-crown { width:50px; height:50px; border-radius:50%; flex-shrink:0; cursor:pointer; color:#3a2400;
  background:linear-gradient(135deg, var(--accent), var(--glow)); border:2px solid rgba(255,235,190,.4); display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 14px rgba(0,0,0,.5); transition:filter .15s, transform .15s; }
.guild-crown:hover { filter:brightness(1.1); transform:translateY(-2px); }
.guild-loading { padding:50px; text-align:center; color:var(--text-muted); }

/* Особые задания */
.guild-special-head { display:flex; align-items:center; gap:10px; margin-top:28px; }
.guild-period { font-family:'PT Serif', serif; font-style:italic; font-weight:400; font-size:12px; color:#e6cfa3; background:rgba(232,160,48,.16); border:1px solid var(--glow-border); padding:2px 10px; border-radius:12px; text-shadow:none; }
.guild-page .tb-task-locked { opacity:.82; }
.guild-page .tb-locked { width:100%; justify-content:center; display:inline-flex; align-items:center; font-family:'PT Serif', serif; font-weight:700; font-size:13px; padding:8px 12px; border:1px solid var(--glow-border); border-radius:9px; background:rgba(232,160,48,.14); color:#f0d8a0; cursor:pointer; transition:background .15s; }
.guild-page .tb-locked:hover { background:rgba(232,160,48,.26); }

/* Чип текущего ранга на табличке — без фона/рамки */
.guild-rank { display:flex; align-items:center; gap:9px; padding:4px 6px; border-radius:10px; cursor:pointer; flex-shrink:0;
  background:none; border:none; transition:transform .15s; }
.guild-rank:hover { transform:translateY(-1px); }
.guild-rank-ic { width:36px; height:36px; object-fit:contain; flex-shrink:0; filter:drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
.guild-rank-txt { display:flex; flex-direction:column; line-height:1.16; text-align:left; }
.guild-rank-name { font-family:'PT Serif', serif; font-weight:700; font-size:14px; color:#f6e0a8; text-shadow:0 1px 2px rgba(0,0,0,.5); }
.guild-rank-tag { font-size:11px; color:var(--text-secondary); }

/* Реклама-за-золото (компактная плашка в Таверне) */
.tav-ad { display:flex; align-items:center; gap:12px; padding:12px 16px; margin-bottom:18px; background:rgba(20,11,4,.55); border:1px solid var(--glow-border); border-radius:12px; }
.tav-ad-ic { font-size:24px; }
.tav-ad-txt { display:flex; flex-direction:column; flex:1; min-width:0; }
.tav-ad-txt b { font-size:14px; color:var(--text-primary); }
.tav-ad-txt span { font-size:12px; color:var(--text-muted); }
.tav-ad-soon { font-size:11px; font-weight:700; color:var(--text-secondary); background:rgba(255,255,255,.07); border:1px solid var(--border); padding:3px 10px; border-radius:10px; }

/* Таверна — магазин косметики */
.tav-soon { padding:22px; text-align:center; font-family:'PT Serif', serif; font-style:italic; font-size:14px; color:#cbb38a; margin-bottom:18px; }
.tav-subtitle { display:flex; align-items:center; gap:10px; font-family:'PT Serif', serif; font-size:14px; font-weight:700; color:var(--text-secondary); letter-spacing:.5px; margin:2px 0 12px; }
.tav-subtitle::after { content:''; flex:1; height:1px; background:linear-gradient(90deg, var(--glow-border), transparent); }
/* Кошелёк-кнопка (история золота) */
.guild-wallet-btn { border:none; background:none; cursor:pointer; font:inherit; padding:0; transition:transform .15s; }
.guild-wallet-btn:hover { transform:translateY(-1px); }
/* Переключатель Магазин/Инвентарь */
.tav-tabs { display:flex; gap:7px; margin:0 0 20px; }
.tav-tab { padding:7px 18px; border:1px solid var(--glow-border); background:rgba(20,11,4,.5); color:var(--text-secondary); border-radius:20px; cursor:pointer; font-size:13px; font-weight:700; font-family:inherit; transition:background .15s, color .15s; }
.tav-tab:hover { color:var(--text-primary); }
.tav-tab.active { background:linear-gradient(135deg, var(--accent), var(--glow)); color:#2a1700; border-color:transparent; }
/* Бейдж аренды на превью */
.tav-rentbadge { position:absolute; left:6px; bottom:6px; background:rgba(0,0,0,.72); color:#f0d8a0; font-size:10px; font-weight:600; padding:2px 7px; border-radius:8px; }
/* Модалка истории золота */
.gold-log { width:380px; max-width:92vw; max-height:80vh; display:flex; flex-direction:column; padding:0; overflow:hidden; }
.gold-log-head { display:flex; align-items:center; justify-content:space-between; padding:15px 18px; border-bottom:1px solid var(--border); font-weight:700; font-size:15px; color:var(--text-primary); }
.gold-log-x { background:none; border:none; color:var(--text-muted); font-size:15px; cursor:pointer; }
.gold-log-x:hover { color:var(--glow); }
.gold-log-body { overflow-y:auto; padding:6px 0; }
.gold-log-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 18px; }
.gold-log-row:not(:last-child) { border-bottom:1px solid rgba(196,120,32,.08); }
.gold-log-label { font-size:13px; color:var(--text-primary); }
.gold-log-date { font-size:11px; color:var(--text-muted); margin-top:2px; }
.gold-log-amt { font-weight:800; font-size:14px; display:flex; align-items:center; gap:4px; flex-shrink:0; }
.gold-log-amt.pos { color:#6ec06a; }
.gold-log-amt.neg { color:#d98a8a; }
.gold-log-amt .coin-ic { width:14px; height:14px; }
.tav-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:14px; margin-bottom:26px; }
.tav-card { background:rgba(20,11,4,.62); border:1px solid var(--glow-border); border-radius:14px; padding:16px 16px 14px; display:flex; flex-direction:column; gap:7px;
  box-shadow:0 6px 16px rgba(0,0,0,.35); transition:transform .15s, border-color .15s; }
.tav-card:hover { transform:translateY(-2px); border-color:rgba(232,160,48,.55); }
.tav-card.tav-on { border-color:var(--glow); box-shadow:0 0 0 1px var(--glow), 0 6px 18px rgba(0,0,0,.4); }
.tav-prev { position:relative; height:64px; display:flex; align-items:center; justify-content:center; border-radius:10px; background:rgba(0,0,0,.28); overflow:hidden; }
.tav-prev-nick { font-size:20px; font-weight:800; }
.tav-prev-title { font-family:'PT Serif', serif; font-style:italic; font-size:17px; color:#f0d8a0; }
.tav-prev-img { max-width:100%; max-height:100%; object-fit:contain; }
.tav-prev-bg { width:100%; height:100%; display:block; background-size:cover; background-position:center; }
.tav-name { font-weight:700; font-size:14px; color:var(--text-primary); }
.tav-desc { font-size:12px; color:var(--text-muted); line-height:1.35; flex:1; }
.tav-foot { display:flex; gap:7px; flex-wrap:wrap; margin-top:4px; }
.tav-btn { flex:1; min-width:0; display:inline-flex; align-items:center; justify-content:center; gap:5px; padding:8px 10px; border:none; border-radius:9px; cursor:pointer;
  font-size:12.5px; font-weight:700; background:linear-gradient(135deg, var(--accent), var(--glow)); color:#2a1700; transition:filter .15s, transform .1s; }
.tav-btn:hover:not(:disabled) { filter:brightness(1.08); }
.tav-btn:active:not(:disabled) { transform:translateY(1px); }
.tav-btn:disabled { opacity:.6; cursor:default; }
.tav-btn .coin-ic { width:14px; height:14px; }
.tav-ic { width:15px; height:15px; flex-shrink:0; }
.tav-btn-equip { background:linear-gradient(135deg,#3f7a3a,#5aa84f); color:#eafbe8; }
.tav-btn-off { background:rgba(255,255,255,.1); color:var(--text-secondary); border:1px solid var(--glow-border); }
.tav-btn-rent { flex:1; background:rgba(255,255,255,.08); color:var(--text-secondary); border:1px solid var(--border); }
.tav-btn-rent:hover:not(:disabled) { filter:none; background:rgba(255,255,255,.14); color:var(--text-primary); }

/* Титул под именем в карточке профиля */
.pc-title { font-family:'PT Serif', serif; font-style:italic; font-size:13px; color:var(--glow); margin-top:1px; }
/* Титул рядом с именем отправителя в чате и в списках */
.cp-sender-title { color:var(--text-muted); font-weight:400; font-size:11px; }
.lp-title { color:var(--glow); font-style:italic; }
