/* villagemta.pl */


.forum-layout{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 330px;
  gap:18px;
  align-items:start;
  margin-top:10px;
}

.forum-main{
  min-width:0;
  overflow:clip;
}

.forum-sidebar{
  position:sticky;
  top:calc(var(--nav-offset, 80px) + 14px);
  display:flex;
  flex-direction:column;
  gap:14px;
  min-width:0;
  max-height:calc(100vh - var(--nav-offset, 80px) - 28px);
  overflow-y:auto;
  scrollbar-width:none;
}

.forum-sidebar::-webkit-scrollbar { display:none; }

.forum-side-box{
  padding:0;
  overflow:hidden;
}

.forum-side-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 15px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(135deg, rgba(166,206,57,.07), rgba(0,0,0,.12));
}

.forum-side-title{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--text);
  font-size:13px;
  font-weight:900;
  font-family:'Archivo', sans-serif;
  letter-spacing:-.2px;
}

.forum-side-title i{
  color:var(--accent);
}

.forum-side-head a{
  color:var(--accent);
  font-size:11px;
  font-weight:900;
  text-decoration:none;
  text-transform:uppercase;
  letter-spacing:.4px;
}

.forum-side-list{
  display:flex;
  flex-direction:column;
}

.forum-side-topic{
  display:grid;
  grid-template-columns:34px minmax(0, 1fr);
  gap:10px;
  padding:12px 15px;
  border-bottom:1px solid rgba(255,255,255,.06);
  text-decoration:none;
  transition:background .16s ease;
}

.forum-side-topic:last-child{
  border-bottom:0;
}

.forum-side-topic:hover{
  background:rgba(166,206,57,.06);
}

.forum-side-topic-icon{
  width:34px;
  height:34px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(166,206,57,.08);
  border:1px solid rgba(166,206,57,.16);
  color:var(--accent);
  font-size:13px;
}

.forum-side-topic-main{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}

.forum-side-topic-title{
  color:var(--text);
  font-size:13px;
  font-weight:900;
  line-height:1.3;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.forum-side-topic-meta,
.forum-side-topic-date{
  color:var(--text-muted);
  font-size:11px;
  font-weight:700;
  line-height:1.3;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.forum-side-topic-date{
  display:flex;
  align-items:center;
  gap:5px;
}

.forum-side-topic-date i{
  color:var(--accent);
  font-size:10px;
}

@media(max-width:1180px){
  .forum-layout{
    grid-template-columns:1fr;
  }

  .forum-sidebar{
    position:static;
  }
}

.forum-reg-notice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(88,101,242,.25);
  background: rgba(88,101,242,.07);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.forum-reg-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(88,101,242,.15);
  border: 1px solid rgba(88,101,242,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(170,180,255,.95);
  font-size: 17px;
  flex-shrink: 0;
}

.forum-reg-body { flex: 1; min-width: 0; }

.forum-reg-title {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: rgba(200,210,255,.95);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.forum-reg-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.forum-reg-channel {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(88,101,242,.15);
  border: 1px solid rgba(88,101,242,.2);
  color: rgba(170,180,255,.9);
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

.forum-reg-channel i { font-size: 10px; }

.forum-reg-cmd {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  background: rgba(166,206,57,.1);
  border: 1px solid var(--accent-glow);
  color: var(--accent);
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.forum-reg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: rgba(88,101,242,.18);
  border: 1px solid rgba(88,101,242,.3);
  color: rgba(170,180,255,.95);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .2s ease, border-color .2s ease;
}

.forum-reg-btn:hover {
  background: rgba(88,101,242,.3);
  border-color: rgba(88,101,242,.5);
}
/*
* UPDATE: 11.07.2026 / Zmieniono: chatbox — reply bar, licznik znaków, fullscreen, cb-head-btn, online pill, cb-actions
*/

.cb-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cb-status-text {
  font-size: 12px;
  white-space: nowrap;
}

.cb-head-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all .2s ease;
}

.cb-head-btn:hover {
  color: var(--accent);
  border-color: var(--accent-glow);
  background: var(--accent-soft);
}

.cb-online-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
}

.cb-online-pill:empty { display: none; }

.cb-reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.cb-reply-bar i { font-size: 12px; }

.cb-reply-bar span { flex: 1; min-width: 0; }

.cb-reply-cancel {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--accent-glow);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: background .2s ease;
}

.cb-reply-cancel:hover { background: var(--accent); color: #000; }

.cb-inputwrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.cb-inputwrap .input {
  width: 100%;
  padding-right: 44px;
}

.cb-counter {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
  transition: color .2s ease;
}

.cb-counter-warn { color: rgba(255,200,80,.8); }
.cb-counter-err  { color: rgba(255,100,100,.9); }

.cb-avatar {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  flex: 0 0 34px !important;
  background-size: cover !important;
  background-position: center !important;
  border: 1px solid var(--border) !important;
}

.cb-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity .2s ease;
}

.cb-row:hover .cb-actions { opacity: 1; }

.cb-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all .2s ease;
}

.cb-action-btn:hover {
  color: var(--accent);
  border-color: var(--accent-glow);
  background: var(--accent-soft);
}

.cb-send-label { display: inline; }

.cb-guest-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 4px;
  font-size: 14px;
  color: var(--text-dim);
}

.cb-fullscreen {
  position: fixed !important;
  inset: var(--nav-offset, 80px) 0 0 !important;
  z-index: 9998 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.cb-fullscreen .cb-body {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

.cb-fullscreen .chatbox-log {
  flex: 1 !important;
  height: auto !important;
  max-height: none !important;
}

.forum-meta { margin-top: 14px; }
.forum-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.forum-meta-box { border: 1px solid var(--border); background: var(--bg-glass); border-radius: var(--radius-md); padding: 14px; }
.forum-meta-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.forum-meta-title { font-weight: 800; letter-spacing: -.2px; font-family: 'Archivo', sans-serif; }
.forum-users { display: flex; flex-wrap: wrap; gap: 8px; }
.forum-user { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-glass); transition: border-color .2s ease, background .2s ease; }
.forum-user:hover { border-color: var(--accent-glow); background: var(--accent-soft); }
.forum-user .avatar { width: 22px; height: 22px; border-radius: 8px; background-size: cover; background-position: center; border: 1px solid var(--border); }
.forum-user-nick { font-weight: 700; font-size: 13px; }

.forum-legend { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.forum-legend-title { font-weight: 800; margin-bottom: 10px; font-family: 'Archivo', sans-serif; }
.forum-legend-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.legend-tag { display: inline-flex; align-items: center; justify-content: center; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-glass); font-weight: 700; font-size: 12px; }

.role-zarzad { color: #f90000; text-shadow: 0 0 18px rgba(249,0,0,.28); }
.role-admin   { color: #cc3636; text-shadow: 0 0 18px rgba(204,54,54,.22); }
.role-mod     { color: #1f8b4c; text-shadow: 0 0 18px rgba(31,139,76,.22); }
.role-sup     { color: #3eaa94; text-shadow: 0 0 18px rgba(62,170,148,.22); }
.role-cm      { color: #206694; text-shadow: 0 0 18px rgba(32,102,148,.22); }
.role-dev     { color: #71368a; text-shadow: 0 0 18px rgba(113,54,138,.22); }
.role-prem    { color: #d6b25e; text-shadow: 0 0 18px rgba(214,178,94,.20); }
.role-player  { color: rgba(255,255,255,.85); }

.role-redaktor {
  color: #E7A93F;
  text-shadow: 0 0 18px rgba(231,169,63,.28);
}

.rank-redaktor {
  --rank-color: 231,169,63;
}

.legend-tag {
  gap: 7px;
}

.legend-tag i {
  font-size: 11px;
  opacity: .9;
}

.forum-side-more {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  opacity: .7;
  transition: opacity .2s ease;
}

.forum-side-more:hover { opacity: 1; }

.forum-ann-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}

.forum-ann-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background .15s ease;
}

.forum-ann-item:hover { background: var(--accent-soft); }

.forum-ann-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.forum-ann-title {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-ann-arrow {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s ease;
}

.forum-ann-item:hover .forum-ann-arrow { opacity: 1; }

.forum-status-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}

.forum-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border);
}

.forum-status-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.forum-status-icon-ok      { background: rgba(70,220,140,.1); border-color: rgba(70,220,140,.2); color: rgba(70,220,140,.9); }
.forum-status-icon-err     { background: rgba(249,0,0,.1);    border-color: rgba(249,0,0,.2);    color: rgba(255,130,130,.9); }
.forum-status-icon-discord { background: rgba(88,101,242,.1); border-color: rgba(88,101,242,.2); color: rgba(170,180,255,.9); }

.forum-status-body { flex: 1; min-width: 0; }

.forum-status-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
}

.forum-status-val {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.forum-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.forum-status-dot-ok   { background: rgba(70,220,140,.9); box-shadow: 0 0 0 2px rgba(70,220,140,.2); animation: pulse-dot 2s ease-in-out infinite; }
.forum-status-dot-err  { background: rgba(249,0,0,.9);    box-shadow: 0 0 0 2px rgba(249,0,0,.2); }
.forum-status-dot-warn { background: rgba(255,170,0,.9);  box-shadow: 0 0 0 2px rgba(255,170,0,.2); }

.forum-status-record { color: var(--text-muted); font-size: 11px; }
.forum-status-offline { color: var(--text-muted); }

.forum-status-join {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(88,101,242,.12);
  border: 1px solid rgba(88,101,242,.2);
  color: rgba(170,180,255,.9);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .2s ease;
}

.forum-status-join:hover { background: rgba(88,101,242,.25); }

@media (max-width: 980px) {
  .forum-meta-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .cb-send-label { display: none; }
  #cbSend { padding: 0 14px; }
}

.forum-inline-slot { display: none; }

.forum-layout {
  transition: grid-template-columns .35s cubic-bezier(.4,0,.2,1);
}

.forum-layout.sidebar-hidden {
  grid-template-columns: minmax(0,1fr) 0px;
  gap: 0;
}

.forum-sidebar {
  transition: opacity .3s ease, transform .3s cubic-bezier(.4,0,.2,1), width .35s ease;
  overflow: hidden;
}

.forum-layout.sidebar-hidden .forum-sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  width: 0 !important;
  min-width: 0 !important;
  padding: 0;
}

.forum-sidebar-toggle {
  height: 42px;
  padding: 0 16px;
  gap: 8px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--accent-soft);
  border-color: var(--accent-glow);
  color: var(--accent);
}

.forum-sidebar-toggle:hover {
  background: rgba(166,206,57,.18);
  border-color: var(--accent);
  color: var(--accent);
}

.forum-sidebar-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.forum-sidebar-toggle-label {
  font-weight: 700;
}

@media (max-width: 980px) {
  .forum-sidebar-toggle { display: none; }
}


/* TU: Kafelki działów - statystyki + ostatni post
 * Dodane: 25.07.26
 * Poprawione: 25.07.26 - ostatni post siedzi w kafelku, a nie obok niego.
 */
.forum-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
  align-items:stretch;
}

.forum-sub-tile{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:14px;
  min-width:0;
  min-height:142px;
  padding:16px;
  overflow:hidden;
}

.forum-sub-top{
  display:flex;
  align-items:flex-start;
  gap:12px;
  min-width:0;
}

.forum-sub-icon{
  flex:0 0 auto;
}

.forum-sub-info{
  min-width:0;
  flex:1;
}

.forum-sub-name{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  max-width:100%;
}

.forum-sub-desc{
  max-width:100%;
  margin-top:6px;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.forum-sub-bottom{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  min-width:0;
  margin-top:auto;
}

.forum-sub-stats{
  display:flex;
  align-items:center;
  gap:12px;
  flex:0 0 auto;
  min-width:max-content;
}

.forum-sub-last-ips{
  flex:1;
  min-width:0;
  max-width:58%;
  margin:0;
  padding:0;
  border:0;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:3px;
  overflow:hidden;
  text-align:right;
}

.forum-sub-last-line{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
  max-width:100%;
  min-width:0;
  color:var(--text-muted);
  font-size:11px;
  font-weight:800;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
}

.forum-sub-last-line i{
  color:var(--accent);
  font-size:10px;
  flex:0 0 auto;
}

.forum-sub-last-label{
  color:var(--text-muted);
  flex:0 0 auto;
}

.forum-sub-last-author{
  color:var(--accent);
  text-decoration:none;
  font-weight:900;
  cursor:pointer;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.forum-sub-last-author:hover{
  color:var(--text);
}

.forum-sub-last-time{
  color:var(--text-muted);
  flex:0 0 auto;
}

.forum-sub-last-time::before{
  content:"·";
  margin-right:5px;
  color:var(--text-muted);
}

.forum-sub-last-topic{
  display:block;
  max-width:100%;
  color:var(--text);
  text-decoration:none;
  font-size:12px;
  font-weight:900;
  line-height:1.25;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  cursor:pointer;
}

.forum-sub-last-topic:hover{
  color:var(--accent);
}

@media(max-width:1180px){
  .forum-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media(max-width:760px){
  .forum-grid{
    grid-template-columns:1fr;
  }

  .forum-sub-bottom{
    align-items:flex-start;
    flex-direction:column;
  }

  .forum-sub-last-ips{
    max-width:100%;
    align-items:flex-start;
    text-align:left;
  }

  .forum-sub-last-line{
    justify-content:flex-start;
    flex-wrap:wrap;
    white-space:normal;
  }
}

/* Sidebar widgets exist only in #forumSidebar. Hidden means removed from layout. */
.forum-layout.sidebar-hidden { grid-template-columns: minmax(0,1fr) !important; gap: 0 !important; }
.forum-layout.sidebar-hidden > .forum-sidebar { display: none !important; }
.forum-layout:not(.sidebar-hidden) > .forum-sidebar { min-width: 0; width: auto; animation: vmtaSidebarIn .28s ease both; }
@keyframes vmtaSidebarIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@media (max-width: 980px) { .forum-sidebar-toggle { display: inline-flex !important; } }

/* Smooth collapses without DOM moving or display toggling. */
.forum-cat-body { display: grid !important; grid-template-rows: 1fr; opacity: 1; min-height: 0; overflow: hidden; transition: grid-template-rows .34s cubic-bezier(.2,.7,.2,1), opacity .25s ease, margin .34s ease; }
.forum-cat-body > .forum-grid { min-height: 0; overflow: hidden; }
.forum-cat-body.is-collapsed { grid-template-rows: 0fr; opacity: 0; margin-top: 0; visibility: hidden; transition: grid-template-rows .34s cubic-bezier(.2,.7,.2,1), opacity .25s ease, margin .34s ease, visibility 0s linear .34s; }
.forum-cat-toggle i { transition: transform .24s ease; }
.forum-cat-toggle[aria-expanded="false"] i { transform: rotate(180deg); }

/* Legend is controlled from its original heading, not a separate details bar. */
.vmta-ranks-panel .vmta-ranks-toggle { width: 100%; text-align: left; appearance: none; color: inherit; cursor: pointer; border: 0; background: transparent; padding: 0; font: inherit; }
.vmta-ranks-panel .vmta-ranks-toggle:hover .forum-ranks-title { color: var(--accent); }
.vmta-ranks-panel .vmta-ranks-heading { flex: 1; min-width: 0; display: block; }
.vmta-ranks-panel .forum-ranks-title, .vmta-ranks-panel .forum-ranks-desc { display: block; }
.vmta-ranks-panel .vmta-ranks-action { margin-left: auto; flex-shrink: 0; display: inline-flex; align-items: center; gap: 9px; color: var(--text-muted); font-size: 12px; font-weight: 700; }
.vmta-ranks-panel .vmta-ranks-action i { transition: transform .3s ease; }
.vmta-ranks-panel.is-collapsed .vmta-ranks-action i { transform: rotate(180deg); }
.vmta-ranks-panel .vmta-ranks-content { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .34s cubic-bezier(.2,.7,.2,1), opacity .24s ease; }
.vmta-ranks-panel .vmta-ranks-content > .forum-rank-groups { min-height: 0; overflow: hidden; }
.vmta-ranks-panel.is-collapsed .vmta-ranks-content { grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows .34s cubic-bezier(.2,.7,.2,1), opacity .24s ease, visibility 0s linear .34s; }
.vmta-ranks-panel .forum-rank-group, .vmta-ranks-panel .forum-rank-item, .vmta-ranks-panel .forum-rank-content { min-width: 0; max-width: 100%; }
.vmta-ranks-panel .forum-rank-item { height: auto; min-height: 45px; overflow: visible; border-radius: 11px; }
.vmta-ranks-panel .forum-rank-content { flex-wrap: wrap; }
.vmta-ranks-panel .forum-rank-name { flex: 1 1 auto; min-width: 0; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; }
.vmta-ranks-panel .forum-rank-meta { max-width: 100%; white-space: normal; }
.vmta-ranks-panel .forum-rank-groups { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1300px) { .vmta-ranks-panel .forum-rank-groups { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 720px) { .vmta-ranks-panel .forum-rank-groups { grid-template-columns: 1fr; } .vmta-ranks-panel .vmta-ranks-action span { display: none; } }

/* Keep the original VILLAGE green chatbox scrollbar even after previous CSS updates. */
.forum-chatbox-card.chatbox-modern #cbLog { overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(166,206,57,.55) rgba(255,255,255,.035); }
.forum-chatbox-card.chatbox-modern #cbLog::-webkit-scrollbar { width: 7px; }
.forum-chatbox-card.chatbox-modern #cbLog::-webkit-scrollbar-track { background: rgba(255,255,255,.035); border-radius: 20px; }
.forum-chatbox-card.chatbox-modern #cbLog::-webkit-scrollbar-thumb { background: rgba(166,206,57,.52); border-radius: 20px; }
.forum-chatbox-card.chatbox-modern #cbLog::-webkit-scrollbar-thumb:hover { background: rgba(166,206,57,.85); }

@media (prefers-reduced-motion: reduce) {
  .forum-layout:not(.sidebar-hidden) > .forum-sidebar { animation: none; }
  .forum-cat-body, .forum-cat-body.is-collapsed, .vmta-ranks-panel .vmta-ranks-content, .vmta-ranks-panel.is-collapsed .vmta-ranks-content, .vmta-ranks-panel .vmta-ranks-action i { transition: none !important; }
}

/* --- VILLAGE MTA: responsive forum toolbar and sidebar (only forum.php) --- */
.forum-pagehead { min-width:0; }
.forum-pagehead .forum-toolbar { display:flex; align-items:center; gap:10px; min-width:0; max-width:100%; }
.forum-pagehead .forum-search-toolbar { display:flex; flex-wrap:nowrap; align-items:center; gap:8px; min-width:0; }
.forum-pagehead .forum-search-toolbar .input { min-width:0; width:min(280px, 23vw); }
.forum-pagehead .forum-search-toolbar .btn { display:inline-flex; align-items:center; gap:8px; width:auto; white-space:nowrap; }
.forum-pagehead .forum-sidebar-toggle { display:inline-flex; align-items:center; justify-content:center; gap:8px; flex:0 0 auto; width:auto; min-width:44px; }
.forum-pagehead .forum-sidebar-toggle.active { background:var(--accent); border-color:var(--accent); color:#10120b; }
.forum-sidebar-mobile-head, .forum-sidebar-backdrop { display:none; }
.forum-layout.sidebar-hidden { grid-template-columns:minmax(0,1fr) !important; gap:0 !important; }
.forum-layout.sidebar-hidden > #forumSidebar { display:none !important; }
.forum-layout:not(.sidebar-hidden) > #forumSidebar { width:auto; min-width:0; overflow-y:auto; overflow-x:hidden; }
@media (min-width: 981px) and (max-width: 1180px) {
  .forum-layout:not(.sidebar-hidden) { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:14px; }
  .forum-layout:not(.sidebar-hidden) > #forumSidebar { position:sticky; top:calc(var(--nav-offset, 80px) + 14px); }
}
html.vmta-forum-sidebar-off .forum-layout > #forumSidebar { display:none !important; }
.forum-pagehead .forum-toolbar > *, .forum-pagehead .forum-search-toolbar > * { min-width:0; }

@media (max-width: 980px) {
  .forum-pagehead { display:flex; flex-direction:column; align-items:stretch; gap:14px; }
  .forum-pagehead .forum-toolbar { display:grid; grid-template-columns:minmax(0,1fr) 46px; align-items:stretch; gap:8px; width:100%; }
  .forum-pagehead .forum-search-toolbar { display:flex; flex-wrap:nowrap !important; min-width:0; width:100%; gap:8px; }
  .forum-pagehead .forum-search-toolbar .input { flex:1 1 auto; width:0 !important; min-width:0; height:46px; }
  .forum-pagehead .forum-search-toolbar .btn { flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; gap:8px; width:auto !important; min-width:46px; height:46px; padding:0 14px; }
  .forum-pagehead .forum-sidebar-toggle { display:inline-flex !important; width:46px !important; min-width:46px; height:46px; padding:0 !important; border-radius:12px; }
  .forum-pagehead .forum-sidebar-toggle-label { display:none !important; }
  .forum-pagehead .forum-sidebar-toggle i { font-size:17px; }
  .forum-layout { display:block; }
  .forum-layout > #forumSidebar { position:fixed; inset:calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)) auto; top:calc(12px + env(safe-area-inset-top)); right:12px; bottom:calc(12px + env(safe-area-inset-bottom)); left:auto; z-index:10021; display:flex; flex-direction:column; width:min(400px, calc(100vw - 24px)) !important; max-width:calc(100vw - 24px); max-height:none; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; padding:12px; border:1px solid rgba(166,206,57,.22); border-radius:19px; background:#121411; box-shadow:0 18px 80px rgba(0,0,0,.78); scrollbar-width:thin; scrollbar-color:rgba(166,206,57,.55) transparent; animation:vmtaMobileDrawerIn .26s cubic-bezier(.2,.8,.2,1) both; }
  .forum-layout:not(.sidebar-hidden) > #forumSidebar { width:min(400px, calc(100vw - 24px)) !important; }
  .forum-layout > #forumSidebar::-webkit-scrollbar { width:5px; }
  .forum-layout > #forumSidebar::-webkit-scrollbar-thumb { background:rgba(166,206,57,.55); border-radius:12px; }
  .forum-sidebar-mobile-head { position:sticky; top:-12px; z-index:2; display:flex; flex:0 0 auto; align-items:center; justify-content:space-between; gap:8px; margin:-12px -12px 2px; padding:12px 14px; min-height:62px; background:#161914; border-bottom:1px solid rgba(166,206,57,.13); }
  .forum-sidebar-mobile-head > div { display:flex; align-items:center; gap:10px; font-size:14px; font-weight:800; color:var(--text); }
  .forum-sidebar-mobile-head > div i { color:var(--accent); font-size:16px; }
  .forum-sidebar-close { display:inline-flex; align-items:center; justify-content:center; flex:0 0 40px; height:40px; border:1px solid var(--border); border-radius:11px; background:rgba(255,255,255,.04); color:var(--text); cursor:pointer; }
  .forum-sidebar-close:hover { color:var(--accent); border-color:rgba(166,206,57,.35); }
  .forum-layout > .forum-sidebar-backdrop { display:block; position:fixed; inset:0; z-index:10020; border:0; margin:0; padding:0; background:rgba(0,0,0,.74); cursor:pointer; opacity:1; animation:vmtaMobileBackdropIn .2s ease both; }
  .forum-layout.sidebar-hidden > .forum-sidebar-backdrop { display:none; }
  html.vmta-forum-sidebar-off .forum-layout > .forum-sidebar-backdrop { display:none; }
  body.vmta-forum-drawer-open { overflow:hidden; }
  @keyframes vmtaMobileBackdropIn { from { opacity:0; } to { opacity:1; } }
  @keyframes vmtaMobileDrawerIn { from { opacity:0; transform:translateX(18px) scale(.99); } to { opacity:1; transform:translateX(0) scale(1); } }
}
@media (max-width: 330px) {
  .forum-pagehead .forum-search-label { display:none; }
  .forum-pagehead .forum-search-toolbar .btn { padding:0 13px; }
  .forum-pagehead .h1 { font-size:clamp(26px,8vw,34px); }
}
@media (prefers-reduced-motion: reduce) {
  .forum-layout > #forumSidebar, .forum-layout > .forum-sidebar-backdrop { animation:none !important; }
}
