:root{
  --bg:#0f1011;
  --panel:#141516;
  --panel2:#171819;
  --line:rgba(255,255,255,.08);

  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.55);

  --blue:#2f84ff;
  --chipBg:rgba(255,255,255,.10);
  --chipBd:rgba(255,255,255,.12);
  --orange:#f0b429;
  --red:#f05050;

  --radius:16px;
  --radius2:12px;

  --sidebarW:260px;
  --rightSidebarW:280px;
  --rightSidebarCollapsedW:64px;
  --heroSocialW:52px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  background:#0b0c0d;
  color:var(--text);
  font-family:"Segoe UI",Tahoma,Arial,system-ui,-apple-system,sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overflow:hidden;
}
body.embed{ background:var(--bg); }

img{ display:block; }
a{ color:inherit; }
button,input,textarea,select{ font:inherit; }
::selection{ background:rgba(47,132,255,.28); }

.app{
  height:100%;
  display:grid;
  grid-template-columns:var(--sidebarW) minmax(0,1fr) var(--rightSidebarW);
}

.sidebar{
  position:relative;
  background:linear-gradient(180deg,#141516,#121314);
  padding:18px 16px 12px;
  overflow:hidden;
  border-right:1px solid #0c0c0c;
}

.sidebar-right{
  position:relative;
  background:linear-gradient(180deg,#141516,#121314);
  padding:18px 16px 12px;
  overflow:hidden;
  border-left:1px solid rgba(255,255,255,.06);
}

.brand{ padding:6px 6px 14px; line-height:1; }
.brand-logo{
  font-weight:900;
  font-size:34px;
  letter-spacing:1px;
  line-height:1;
  text-transform:uppercase;
  margin-top:15px;
}
.brand-sub{
  margin-top:6px;
  font-size:12px;
  letter-spacing:2px;
  color:var(--muted);
}

.nav{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }

.nav-item{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  height:40px;
  padding:0 12px;
  border-radius:12px;
  text-decoration:none;
  background:transparent;
  border:1px solid transparent;
  transition:background .12s ease,border-color .12s ease;
  user-select:none;
}
.nav-ico{ width:24px; height:24px; object-fit:contain; opacity:.92; flex:0 0 auto; }
.nav-item span{ font-size:15px; letter-spacing:.2px; opacity:.92; }
.nav-item:hover{ background:rgba(255,255,255,.03); border-color:rgba(255,255,255,.05); }
.nav-item.active{ background:rgba(255,255,255,.04); border-color:rgba(255,255,255,.06); }
.nav-item.active::before{
  content:"";
  position:absolute;
  left:-16px;
  top:50%;
  width:3px;
  height:34px;
  transform:translateY(-50%);
  border-radius:3px;
  background:var(--orange);
}

.side-section-title{
  margin:18px 6px 10px;
  font-size:11px;
  letter-spacing:1.3px;
  text-transform:uppercase;
  color:var(--muted);
}

.fav-list{ display:flex; flex-direction:column; gap:10px; }

.fav-empty{
  padding:10px 10px;
  border-radius:12px;
  background:rgba(255,255,255,.02);
  border:1px solid rgba(255,255,255,.06);
  color:rgba(255,255,255,.55);
  font-size:12px;
  line-height:1.35;
}

.game-row{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius:12px;
  background:rgba(255,255,255,.02);
  border:1px solid rgba(255,255,255,.06);
  cursor:pointer;
  text-align:left;
  text-decoration:none;
  transition:background .12s ease,border-color .12s ease;
  user-select:none;
}
.game-row:hover{ background:rgba(255,255,255,.03); border-color:rgba(255,255,255,.08); }
.game-row.active{ border-color:rgba(240,180,41,.25); }

.game-ico{ width:30px; height:30px; border-radius:999px; object-fit:cover; opacity:.95; }
.game-meta{ line-height:1.05; min-width:0; }
.game-name{ font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:700; }
.game-sub{ margin-top:4px; font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.side-footer{
  position:absolute;
  left:0; right:0; bottom:0;
  height:150px;
  pointer-events:none;
}
.side-watermark{
  position:absolute;
  inset:0;
  background:url("../img/sidebar_mark.png") no-repeat center 62%;
  background-size:220px auto;
  opacity:.05;
  margin-bottom:20px;
}

.main{
  height:100%;
  min-width:0;
  padding:16px 18px 22px;
  background:
    radial-gradient(1200px 700px at 50% 10%, rgba(255,255,255,.04), transparent 60%),
    linear-gradient(180deg,#101112,#0f1011);
  overflow:auto;
  scrollbar-width:none;
}
.main::-webkit-scrollbar{ width:0; height:0; }

.hero-slider{
  position:relative;
  height:280px;
  border-radius:var(--radius);
  border:1px solid var(--line);
  overflow:hidden;
  background:#151617;
}

.hero{
  position:absolute;
  inset:0;
  opacity:0;
  pointer-events:none;
  transition:opacity .32s ease;
}
.hero.active{ opacity:1; pointer-events:auto; }

.hero-bg{
  position:absolute;
  inset:0;
  background:
    radial-gradient(900px 520px at 68% 40%, rgba(255,255,255,.14), transparent 55%),
    linear-gradient(90deg, rgba(0,0,0,.72), rgba(0,0,0,.18));
  z-index:1;
}
.hero::after{
  content:"";
  position:absolute;
  inset:0;
  background-image:var(--heroImg, none);
  background-size:cover;
  background-position:center;
  opacity:.55;
  filter:saturate(.85) contrast(1.05);
  z-index:0;
}

.hero-inner{
  position:relative;
  z-index:2;
  padding:22px;
  height:100%;
  display:block;
  padding-bottom:74px; /* reserve for actions */
}

.hero-top{ position:relative; }

.hero-title{
  display:flex;
  flex-direction:column;
  gap:2px;
  max-width:calc(100% - var(--heroSocialW));
}
.hero-title-main{ font-size:34px; font-weight:900; letter-spacing:1px; line-height:1; text-transform:uppercase; }
.hero-title-sub{ font-size:12px; letter-spacing:2px; color:var(--muted); margin-top:2px; text-transform:uppercase; }

.hero-social{
  position:absolute;
  top:0;
  right:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.social-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  transition:background .12s ease,border-color .12s ease;
  opacity: .35;
}
.social-btn img{ width:28px; height:28px; opacity:.95; }
.social-btn:hover{ opacity: .95; }

.hero-tags{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:14px 0 12px;
}
.chip{
  height:28px;
  padding:0 12px;
  border-radius:8px;
  background:var(--chipBg);
  border:1px solid var(--chipBd);
  color:rgba(255,255,255,.88);
  font-size:12px;
  cursor:pointer;
  transition:background .12s ease,border-color .12s ease;
}
.chip:hover{ background:rgba(255,255,255,.14); border-color:rgba(255,255,255,.16); }
.chip-orange{ background:#f0b429; border-color:#f0b429; color:#111; font-weight:700; }
.chip-gold{
  background:#f0b429;
  border-color:#f0b429;
  color:#111;
  font-weight:700;
  display:inline-flex;
  gap:8px;
  align-items:center;
}
.chip-star{ width:12px; height:12px; }

.hero-text{
  margin:8px 0 14px;
  max-width:520px;
  font-size:12.5px;
  line-height:1.35;
  color:rgba(255,255,255,.78);
}

.hero-actions{
  position:absolute;
  left:22px;
  right:22px;
  bottom:16px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin:0;
  padding:0;
}

.btn-play{
  width:132px;
  height:42px;
  border-radius:8px;
  border:0;
  background:#f0b429;
  color:#111;
  font-size:18px;
  font-weight:700;
  letter-spacing:.5px;
  cursor:pointer;
  transition:filter .12s ease;
}
.btn-play:hover{ filter:brightness(1.07); }

.btn-secondary{
  height:42px;
  font-size:18px;
  padding:0 14px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.10);
  font-weight:600;
  background:#121314;
  color:rgba(255,255,255,.78);
  cursor:pointer;
  transition:background .12s ease,border-color .12s ease;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  user-select:none;
}
.btn-secondary:hover{ background:#171819; border-color:rgba(255,255,255,.18); }

.btn-primary{
  height:42px;
  padding:0 14px;
  border-radius:10px;
  border:0;
  background:var(--blue);
  color:#fff;
  cursor:pointer;
  transition:filter .12s ease;
  text-decoration:none !important;
}
.btn-primary:hover{ filter:brightness(1.07); text-decoration:none !important; }

.btn-ghost{
  height:42px;
  padding:0 14px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.12);
  background:transparent;
  color:rgba(255,255,255,.78);
  cursor:pointer;
  transition:background .12s ease,border-color .12s ease;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  user-select:none;
}
.btn-ghost:hover{ background:rgba(255,255,255,.03); border-color:rgba(255,255,255,.18); }

.heart{
  height:42px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:#121314;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:background .12s ease,border-color .12s ease;
  user-select:none;
}
.heart:hover{ background:#171819; border-color:rgba(255,255,255,.18); }
.heart.on{ border-color:rgba(240,180,41,.35); }

.heart.small{ width:38px; height:38px; border-radius:12px; }

.heart.heart-text{
  width:auto;
  padding:0 14px;
  gap:8px;
  font-weight:600;
  font-size:18px;
  letter-spacing:.4px;
  color:rgba(255,255,255,.78);
}
.heart.heart-text .t-added{ display:none; }
.heart.heart-text.on{
  border-color:rgba(240,180,41,.35);
  color:rgba(255,255,255,.92);
}
.heart.heart-text.on .t-add{ display:none; }
.heart.heart-text.on .t-added{ display:inline; }

.hero-dots{
  position:absolute;
  left:50%;
  bottom:14px;
  transform:translateX(-50%);
  display:flex;
  gap:8px;
  z-index:5;
}
.hero-dots button{
  width:7px;
  height:7px;
  border-radius:999px;
  border:0;
  padding:0;
  background:rgba(255,255,255,.28);
  cursor:pointer;
}
.hero-dots button.on{ background:rgba(255,255,255,.62); }

.page-wrap{ margin-top:16px; }

.page{
  padding:16px;
  border-radius:var(--radius);
  background:rgba(20,21,22,.72);
  border:1px solid rgba(255,255,255,.07);
}

.page-head{ padding:0px 0px 14px; }
.page-title{ font-size:16px; font-weight:600; letter-spacing:.2px; }
.page-sub{ margin-top:6px; font-size:12px; color:rgba(255,255,255,.62); line-height:1.35; }

.rules-grid{ display:grid; gap:14px; margin-top:6px; }

.panel{
  border-radius:var(--radius);
  background:#141516;
  border:1px solid rgba(255,255,255,.07);
  padding:14px;
}
.panel-title{
  font-size:13px;
  font-weight:700;
  color:rgba(255,255,255,.88);
  margin-bottom:10px;
}

.ul,.ol{
  margin:0;
  padding-left:16px;
  color:rgba(255,255,255,.74);
  font-size:12.5px;
  line-height:1.55;
}

.grid-3{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.mini{
  border-radius:14px;
  background:#121314;
  border:1px solid rgba(255,255,255,.08);
  padding:12px;
}
.mini-k{ font-weight:700; font-size:12px; }
.mini-v{ margin-top:6px; font-size:12px; color:rgba(255,255,255,.65); line-height:1.35; }

.form-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,50%);
  gap:14px;
  align-items:start;
}
.form{
  border-radius:var(--radius);
  background:#141516;
  border:1px solid rgba(255,255,255,.07);
  padding:14px;
}
.form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.field{ display:flex; flex-direction:column; gap:8px; }
.field.full{ grid-column:1 / -1; }

.label{
  font-size:11px;
  color:rgba(255,255,255,.62);
  letter-spacing:.6px;
  text-transform:uppercase;
}
.help{ font-size:12px; color:rgba(255,255,255,.58); }

.input,.textarea{
  width:100%;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background:#121314;
  color:rgba(255,255,255,.90);
  padding:10px 10px;
  outline:none;
  transition:border-color .12s ease,background .12s ease;
}
.input{ height:40px; }
.textarea{ resize:none; }
.input:focus,.textarea:focus{ border-color:rgba(47,132,255,.45); background:#111213; }

.form-actions{
  margin-top:12px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.rows{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.row{
  border-radius:var(--radius);
  background:#141516;
  border:1px solid rgba(255,255,255,.07);
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.row-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.rank{
  width:34px;
  height:34px;
  border-radius:12px;
  background:#121314;
  border:1px solid rgba(255,255,255,.08);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  color:rgba(255,255,255,.82);
  flex:0 0 auto;
}
.row-ico{
  width:38px;
  height:38px;
  border-radius:12px;
  object-fit:cover;
  opacity:.95;
  flex:0 0 auto;
}
.row-meta{ min-width:0; }

.row-title{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.row-title .link{
  text-decoration:none;
  font-weight:600;
  color:rgba(255,255,255,.90);
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.row-title .link:hover{ text-underline-offset:3px; text-decoration:none !important; }

.row-sub{ margin-top:4px; font-size:12px; color:rgba(255,255,255,.62); }

.row-tags{ margin-top:8px; display:flex; flex-wrap:wrap; gap:8px; }
.tag{
  height:20px;
  padding:0 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:#121314;
  color:rgba(255,255,255,.70);
  font-size:11px;
  display:inline-flex;
  align-items:center;
}

.pill{
  height:18px;
  padding:0 8px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  color:rgba(255,255,255,.76);
  font-size:11px;
  font-weight:700;
  flex:0 0 auto;
}
.pill-orange{ background:rgba(240,180,41,.18); border-color:rgba(240,180,41,.30); }

.row-right{
  display:flex;
  align-items:center;
  gap:12px;
  flex:0 0 auto;
}

.score{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:700;
  color:rgba(255,255,255,.88);
  min-width:84px;
  justify-content:flex-end;
}
.score img{ width:16px; height:16px; opacity:.92; }

.count{ text-align:right; min-width:140px; }
.count-k{ font-size:11px; color:rgba(255,255,255,.55); letter-spacing:.6px; text-transform:uppercase; }
.count-v{ margin-top:4px; font-weight:500; color:rgba(255,255,255,.88); }

.filters.simple{ margin-top:8px; }
.chips{ display:flex; gap:8px; flex-wrap:wrap; }

.chiplink{
  height:30px;
  padding:0 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background:#121314;
  color:rgba(255,255,255,.72);
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  transition:background .12s ease,border-color .12s ease;
}
.chiplink:hover{ background:#171819; border-color:rgba(255,255,255,.16); }
.chiplink.on{ background:rgba(255,255,255,.04); border-color:rgba(240,180,41,.25); color:rgba(255,255,255,.86); }

.placeholder{
  padding:14px;
  border-radius:var(--radius);
  background:#141516;
  border:1px solid rgba(255,255,255,.07);
  color:rgba(255,255,255,.70);
  font-size:12px;
}

.note{
  border-radius:var(--radius);
  border:1px solid rgba(255,255,255,.08);
  padding:12px;
  background:#121314;
}
.note-title{ font-weight:700; font-size:12px; letter-spacing:.3px; }
.note-text{ margin-top:6px; font-size:12px; color:rgba(255,255,255,.70); line-height:1.35; }
.note.ok{ border-color:rgba(47,132,255,.22); background:linear-gradient(180deg, rgba(47,132,255,.10), #121314); margin-top:10px; }
.note.info{ border-color:rgba(255,255,255,.10); background:linear-gradient(180deg, rgba(255,255,255,.06), #121314); margin-top:10px; }
.note.err{ border-color:rgba(240,80,80,.22); background:linear-gradient(180deg, rgba(240,80,80,.10), #121314); margin-top:10px; }

.notify-area{
  position:sticky;
  top:10px;
  z-index:20;
  margin-top:10px;
  pointer-events:none;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.notify{
  width:100%;
  max-width:calc(100% - 2px);
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(18,19,20,.82);
  backdrop-filter:blur(10px);
  padding:12px;
  opacity:0;
  transform:translateY(-6px);
  transition:opacity .18s ease,transform .18s ease;
  pointer-events:none;
}
.notify.show{ opacity:1; transform:translateY(0); }
.notify-title{ font-weight:700; font-size:12px; letter-spacing:.3px; }
.notify-text{ margin-top:6px; font-size:12px; color:rgba(255,255,255,.70); line-height:1.35; }
.notify.ok{ border-color:rgba(47,132,255,.22); }
.notify.info{ border-color:rgba(255,255,255,.12); }
.notify.err{ border-color:rgba(240,80,80,.22); }

/* Right sidebar: allow toggle to sit on frame (outside) */
.sidebar-right{
  position:relative;
  overflow:visible;
}

/* Right sidebar toggle (ON FRAME) */
.rs-toggle{
  position:absolute;
  top:32px;
  left:-12px;

  width:24px;
  height:24px;

  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;

  cursor:pointer;
  z-index:999;

  background:linear-gradient(180deg,#141516,#121314);
  border-style:solid;
  border-color:rgba(255,255,255,.10);
  border-width:0px 0 0px 0px;
  border-radius:14px 0 0 14px;

  transition:background .12s ease,border-color .12s ease;
}


.rs-toggle-ico{
  width:18px;
  height:18px;
  opacity:.9;
  transform:rotate(-90deg);
  transition:transform .12s ease,opacity .12s ease;
}

/* inner */
.rs-inner{
  height:100%;
  overflow:auto;
  scrollbar-width:none;
}
.rs-inner::-webkit-scrollbar{ width:0; height:0; }

/* collapsed state */
.app.rs-collapsed{
  grid-template-columns:var(--sidebarW) minmax(0,1fr) var(--rightSidebarCollapsedW);
}
.app.rs-collapsed .sidebar-right{
  padding:18px 10px 12px;
  overflow:visible;
}
.app.rs-collapsed .rs-toggle-ico{
  transform:rotate(90deg);
  opacity:1;
}

/* keep presence visible (avatars only) */
.app.rs-collapsed .rs-inner{
  opacity:1;
  transform:none;
  pointer-events:auto;
  filter:none;
}

/* hide only auth + titles */
.app.rs-collapsed .auth-card,
.app.rs-collapsed .presence-title{
  display:none;
}

/* collapsed presence spacing + remove hover */
.app.rs-collapsed .presence{
  margin-top:8px;
  gap:8px;
}
.app.rs-collapsed .presence-group{
  padding:0px 0px;
}
.app.rs-collapsed .presence-list{
  gap:6px;
}
.app.rs-collapsed .p-user{
  padding:0;
  border-radius:12px;
  justify-content:center;
}
.app.rs-collapsed .p-user:hover{
  background:transparent;
}
.app.rs-collapsed .p-meta{
  display:none;
}
.app.rs-collapsed .p-ava-wrap{
  width:34px;
  height:34px;
  flex:0 0 34px;
}
.app.rs-collapsed .p-ava{
  width:34px;
  height:34px;
}

/* Auth card (right) */
.auth-card{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:10px;
  border-radius:12px;
  background:rgba(255,255,255,.02);
  border:1px solid rgba(255,255,255,.06);
  text-decoration:none;
  transition:background .12s ease,border-color .12s ease;
  user-select:none;
  margin-bottom:10px;
}
a.auth-card{ flex-direction:row; align-items:center; gap:10px; }
.auth-card:hover{ background:rgba(255,255,255,.03); border-color:rgba(255,255,255,.10); }
.auth-card.is-on:hover{ border-color:rgba(240,180,41,.18); }

.auth-ico{ width:34px; height:34px; object-fit:contain; opacity:.95; flex:0 0 auto; }

.auth-head{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  border:0;
  padding:0;
  background:transparent;
  color:inherit;
  cursor:pointer;
  text-align:left;
}

.auth-avatar{
  width:30px;
  height:30px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.08);
  background:#121314;
  object-fit:cover;
  flex:0 0 auto;
}

.auth-meta{ min-width:0; line-height:1.05; }
.auth-title{ font-weight:700; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.auth-sub{ margin-top:4px; font-size:11px; color:rgba(255,255,255,.55); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.auth-caret{
  margin-left:auto;
  width:18px;
  height:18px;
  opacity:.85;
  transform:rotate(0deg);
  transition:transform .12s ease,opacity .12s ease;
  flex:0 0 auto;
}
.auth-card.open .auth-caret{ transform:rotate(180deg); opacity:1; }

.auth-menu{ display:none; margin-top:6px; }
.auth-card.open .auth-menu{ display:block; }

.auth-item{
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:10px 10px;
  border-radius:12px;
  text-decoration:none;
  border:1px solid transparent;
  transition:background .12s ease,border-color .12s ease;
}
.auth-item:hover{ background:rgba(255,255,255,.03); border-color:rgba(255,255,255,.06); }
.auth-item span:first-child{ font-weight:700; font-size:12.5px; }
.auth-item-sub{ font-size:11px; color:rgba(255,255,255,.55); }
.auth-item-logout:hover{ background:rgba(240,80,80,.08); border-color:rgba(240,80,80,.24); }

/* Presence */
.presence{ margin-top:10px; display:flex; flex-direction:column; gap:10px; }

.presence-title{
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:rgba(255,255,255,.55);
  padding:2px 2px 8px;
}
.presence-list{ display:flex; flex-direction:column; gap:6px; }

.p-user{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 8px;
  border-radius:10px;
  text-decoration:none;
  color:inherit;
}
.p-user:hover{ background:rgba(255,255,255,.04); }

.p-ava-wrap{ position:relative; width:28px; height:28px; flex:0 0 28px; }
.p-ava{ width:28px; height:28px; border-radius:999px; object-fit:cover; display:block; }

.p-dot{
  position:absolute;
  right:-1px;
  bottom:-1px;
  width:10px;
  height:10px;
  border-radius:999px;
  border:2px solid var(--panel2);
  background:#3ba55c;
}
.p-user.offline .p-dot{ background:gray; box-shadow:none; }
.p-user.is-admin:not(.offline) .p-dot{ background:#3ba55c; }

.p-meta{ display:flex; flex-direction:column; line-height:1.1; min-width:0; }
.p-name{
  font-size:14px;
  color:rgba(255,255,255,.92);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.p-role{
  margin-top:2px;
  font-size:11px;
  opacity:.7;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.p-user.is-admin .p-name{ color:#f0b429; }
.p-user.is-admin .p-role{ color:#f0b429; opacity:1; }

/* Posts / tiles */
.post-list{ display:flex; flex-direction:column; gap:10px; }

.post-card{
  border-radius:14px;
  background:#121314;
  border:1px solid rgba(255,255,255,.08);
  padding:12px;
}
.post-card-top{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.post-card-title{ font-weight:700; font-size:12.5px; letter-spacing:.2px; }
.post-card-meta{ font-size:11px; color:rgba(255,255,255,.55); }
.post-card-body{
  margin-top:8px;
  font-size:12px;
  color:rgba(255,255,255,.72);
  line-height:1.45;
}
.post-card-actions{ margin-top:10px; display:flex; justify-content:flex-end; }

.post-card-body,
.post-card-body.bb,
.post-card-body.bb *{
  overflow-wrap: anywhere;
  word-break: break-word;
}

.row-expand{
  margin-top:-6px;
  margin-bottom:10px;
  border-radius:var(--radius);
  background:#141516;
  border:1px solid rgba(255,255,255,.07);
  padding:12px;
}

.post-wrap{ display:flex; flex-direction:column; gap:10px; }
.post-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  padding:4px 4px 10px;
}
.post-title{ font-weight:700; font-size:13px; color:rgba(255,255,255,.88); }
.post-hint{ font-size:12px; color:rgba(255,255,255,.55); }

.post-form{
  margin-top:6px;
  border-top:1px solid rgba(255,255,255,.06);
  padding-top:12px;
}
.post-form-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) 180px;
  gap:12px;
}
.post-form-actions{
  margin-top:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.post-check{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:12px;
  color:rgba(255,255,255,.70);
  user-select:none;
}
.post-check input{ width:16px; height:16px; }

.posts-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:0px 0px 14px;
}
.posts-head-title{ font-size:16px; font-weight:700; letter-spacing:.2px; }
.posts-head-sub{ margin-top:6px; font-size:12px; color:rgba(255,255,255,.62); line-height:1.35; }
.posts-head-nav{ display:flex; gap:8px; flex:0 0 auto; }

.posts-nav-btn{
  width:30px;
  height:30px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background:#121314;
  color:rgba(255,255,255,.75);
  cursor:pointer;
  opacity:.55;
}

.posts-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:12px;
}

.post-tile{
  border-radius:14px;
  background:#121314;
  border:1px solid rgba(255,255,255,.08);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height:260px;
}

.post-tile-media{
  position:relative;
  height:225px;
  display:block;
  background-image:var(--postImg, none);
  background-size:cover;
  background-position:center;
  filter:saturate(.92) contrast(1.05);
}

.post-tile-media-overlay{
  position:absolute;
  inset:0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.62)),
    radial-gradient(900px 240px at 20% 30%, rgba(255,255,255,.16), transparent 55%);
  pointer-events:none;
}

.post-tile-body{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
  min-height:140px;
}

.post-tile-title{
  font-weight:700;
  font-size:12.5px;
  letter-spacing:.2px;
  color:rgba(255,255,255,.92);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.post-tile-meta{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:11px;
  color:rgba(255,255,255,.55);
}

.post-type{
  height:18px;
  padding:0 8px;
  border-radius:999px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.10);
  color:rgba(255,255,255,.72);
  font-weight:700;
  display:inline-flex;
  align-items:center;
}

.post-dot{ opacity:.65; }

.post-tile-text{
  margin-top:2px;
  font-size:12px;
  color:rgba(255,255,255,.72);
  line-height:1.45;
  flex:1 1 auto;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
}

.post-tile-actions{
  display:flex;
  justify-content:flex-start;
  margin-top:2px;
}

.btn-read{
  height:34px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid var(--chipBd);
  background:rgba(255,255,255,.04);
  color:rgba(255,255,255,.85);
}
.btn-read:hover{ background:rgba(255,255,255,.06); }

.post-tile-text{ overflow:visible; word-break:break-word; }
.post-tile-text img{ max-width:100%; height:auto; }
.post-tile-text pre{ overflow:auto; }

/* Focus */
.nav-item:focus-visible,
.game-row:focus-visible,
.auth-card:focus-visible,
.auth-head:focus-visible,
.auth-item:focus-visible,
.btn-play:focus-visible,
.btn-secondary:focus-visible,
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.btn-read:focus-visible,
.heart:focus-visible,
.chiplink:focus-visible,
.input:focus-visible,
.textarea:focus-visible,
.rs-toggle:focus-visible,
.social-btn:focus-visible{
  outline:2px solid rgba(47,132,255,.35);
  outline-offset:2px;
}

/* ===== Top chips ===== */
.chips-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.chips-left{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.chips-right{display:flex;align-items:center;gap:8px}
.btn-create{height:30px;padding:0 10px;border-radius:10px;border: 1px solid rgba(255, 255, 255, .10);display: inline-flex;align-items: center}

/* ===== Posts head nav ===== */
.posts-head-nav{display:flex;gap:8px;align-items:center}
.posts-nav-btn{
  width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:12px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color:rgba(255,255,255,.9);
  text-decoration:none;
  font-size:18px;
  transition:transform .15s ease, background .15s ease, border-color .15s ease;
}
.posts-nav-btn:hover{background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.18);transform:translateY(-1px)}
.posts-nav-btn:active{transform:translateY(0)}
.posts-nav-btn-mini{width:34px;height:34px;border-radius:12px;font-size:14px}
.posts-nav-btn.danger{background:rgba(255,90,90,.10);border-color:rgba(255,90,90,.20);color:rgba(255,220,220,.95)}
.posts-nav-btn.danger:hover{background:rgba(255,90,90,.14);border-color:rgba(255,90,90,.26)}

/* ===== Inline form ===== */
.inline-form{display:inline}

/* ===== Rows / avatars ===== */
.row-left{display:flex;align-items:center;gap:12px}
.row-ava{
  width:36px;height:36px;border-radius:999px;object-fit:cover;
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 8px 18px rgba(0,0,0,.28);
}

/* ===== Post header ===== */
.post-author{display:flex;align-items:center;gap:10px;min-width:0}
.post-ava{
  width:34px;height:34px;border-radius:999px;object-fit:cover;
  border:1px solid rgba(255,255,255,.14);
}
.post-author-meta{min-width:0}
.post-right{display:flex;align-items:center;gap:10px}

/* ===== Post actions (Edit/Delete/Quote) ===== */
.post-act{
  padding:2px 10px;border-radius:10px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color:rgba(255,255,255,.88);
  cursor:pointer;
  text-decoration:none;
  font:inherit;
  line-height:1.6;
  transition:background .15s ease, border-color .15s ease, transform .15s ease;
}
.post-act:hover{background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.18);transform:translateY(-1px)}
.post-act:active{transform:translateY(0)}
.post-act.danger{background:rgba(255,90,90,.10);border-color:rgba(255,90,90,.20);color:rgba(255,220,220,.95)}
.post-act.danger:hover{background:rgba(255,90,90,.14);border-color:rgba(255,90,90,.26)}

/* Quote button (same style, slightly clearer) */
.post-act.quote{opacity:.92}
.post-act.quote:hover{opacity:1}

/* ===== OP post ===== */
.post-op{border:1px solid rgba(255,215,128,.28);background:linear-gradient(180deg, rgba(255,215,128,.08), rgba(255,255,255,.02))}
.post-op-badge{
  display:inline-flex;align-items:center;justify-content:center;
  height:18px;padding:0 8px;margin-left:8px;
  border-radius:999px;
  font-size:11px;font-weight:700;letter-spacing:.04em;
  background:rgba(255,183,77,.18);
  border:1px solid rgba(255,183,77,.28);
  color:rgba(255,220,180,.95);
}

/* ===== Reply / edit boxes ===== */
.reply-box{margin-top:12px;padding:14px;border-radius:16px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.08)}
.reply-title{font-weight:900;margin-bottom:10px;color:rgba(255,255,255,.92)}
.edit-box{margin:12px 0;padding:14px;border-radius:16px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.10)}
.edit-box-inner{margin-top:12px}
.edit-title{font-weight:900;margin-bottom:10px}

/* ===== BB toolbar ===== */
.bbbar{
  display:flex;flex-wrap:wrap;gap:6px;
  padding:10px;
  border-radius:12px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  margin:10px 0;
}
.bbbtn{
  height:30px;min-width:34px;padding:0 10px;
  border-radius:10px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color:rgba(255,255,255,.88);
  cursor:pointer;
  font-weight:700;
  transition:background .15s ease, border-color .15s ease, transform .15s ease;
}
.bbbtn:hover{background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.18);transform:translateY(-1px)}
.bbbtn:active{transform:translateY(0)}
.bbsep{width:1px;height:22px;background:rgba(255,255,255,.12);align-self:center;margin:0 2px}

/* ===== BB content ===== */
.bb .bb-u{text-decoration:underline}
.bb .bb-s{text-decoration:line-through}
.bb .bb-link{color:rgba(180,220,255,.95);text-decoration:underline}
.bb .bb-list{margin:10px 0 10px 18px}
.bb .bb-img{max-width:100%;border-radius:12px;border:1px solid rgba(255,255,255,.12)}
.bb .bb-imglink{display:inline-block}
.bb .bb-code{
  margin:10px 0;padding:12px;border-radius:12px;
  background:rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.10);
  overflow:auto;
}
.bb .bb-code code{
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace
}

/* ===== QUOTE (важное: ссылка на оригинал + ref) ===== */
.bb .bb-quote{
  margin:10px 0;
  padding:10px 12px;
  border-radius:12px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
}
.bb .bb-quote-head{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
  font-weight:900;
  color:rgba(255,255,255,.86);
}
.bb .bb-quote-link{
  color:rgba(180,220,255,.95);
  text-decoration:none;
}
.bb .bb-quote-link:hover{ text-decoration:underline; }
.bb .bb-quote-ref{
  font-size:12px;
  padding:2px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  color:rgba(255,255,255,.75);
}

/* ===== Highlight original post when jumped to #post-id ===== */
.post-flash{
  animation: postFlash 1.3s ease-out;
  border-radius: 16px;
}
@keyframes postFlash{
  0%{ box-shadow: 0 0 0 0 rgba(180,220,255,.30); transform: translateY(-1px); }
  100%{ box-shadow: 0 0 0 18px rgba(180,220,255,0); transform: translateY(0); }
}

/* ===== Force no underline for buttons/links you use as buttons ===== */
.btn-primary,.btn-secondary,.btn-ghost,.posts-nav-btn,.post-act,.chiplink{ text-decoration:none !important; }
.btn-primary:hover,.btn-secondary:hover,.btn-ghost:hover,.posts-nav-btn:hover,.post-act:hover,.chiplink:hover{ text-decoration:none !important; }
a.btn-primary{ text-decoration:none !important; }

/* Responsive */
@media (max-width:1280px){
  :root{ --rightSidebarW:260px; }
}

@media (max-width:1100px){
  .posts-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}

@media (max-width:980px){
  .app{ grid-template-columns:1fr; }
  .sidebar{ display:none; }
  .sidebar-right{ display:none; }

  .hero-slider{ height:280px; }
  .hero-title{ max-width:100%; }

  .hero-social{
    position:static;
    flex-direction:row;
    flex-wrap:wrap;
    gap:10px;
    margin-top:10px;
  }

  .rules-grid{ grid-template-columns:1fr; }
  .grid-3{ grid-template-columns:1fr; }
  .form-layout{ grid-template-columns:1fr; }
  .form-grid{ grid-template-columns:1fr; }
  .post-form-grid{ grid-template-columns:1fr; }

  .count{ min-width:auto; }
}

@media (max-width:740px){
  .posts-grid{ grid-template-columns:1fr; }
  .post-tile-media{ height:225px; }
}
