/* Arena V6 final compatibility layer. Keeps core GameCMS behaviour; overrides presentation only. */
:root{--arena-radius:16px;--arena-radius-sm:12px;--arena-control-h:44px}
body.n-next{font-size:15px;line-height:1.55}
body.n-next .block,body.n-next .modal-content,body.n-next .noty-block{border-radius:var(--arena-radius)}
body.n-next .block_head{font-size:18px;line-height:1.35;font-weight:800}

/* Mouse/touch keeps scrolling while decorative scrollbars stay hidden. */
body.n-next .n-community-scroll,
body.n-next #chat_messages,
body.n-next .table-responsive,
body.n-next .n-record-scroll,
body.n-next .modal-body,
body.n-next .n-site-nav,
body.n-next .arena-scroll,
body.n-next [data-arena-scroll]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
body.n-next .n-community-scroll::-webkit-scrollbar,
body.n-next #chat_messages::-webkit-scrollbar,
body.n-next .table-responsive::-webkit-scrollbar,
body.n-next .n-record-scroll::-webkit-scrollbar,
body.n-next .modal-body::-webkit-scrollbar,
body.n-next .n-site-nav::-webkit-scrollbar,
body.n-next .arena-scroll::-webkit-scrollbar,
body.n-next [data-arena-scroll]::-webkit-scrollbar{width:0;height:0;display:none}

/* Pointer focus must not leave a permanent ring; keyboard focus remains visible. */
body.n-next :where(a,button,.btn,input,select,textarea,[tabindex]):focus:not(:focus-visible){outline:0!important;box-shadow:none!important}
body.n-next :where(a,button,.btn,input,select,textarea,[tabindex]):focus-visible{outline:2px solid var(--n-link)!important;outline-offset:2px}

/* Stable control metrics: fixes cropped text in mobile selects. */
body.n-next .form-control,body.n-next select.form-control,body.n-next input.form-control,body.n-next textarea.form-control{font-size:15px;line-height:1.45}
body.n-next select.form-control{min-height:var(--arena-control-h);height:auto!important;padding:10px 38px 10px 12px!important;white-space:normal;text-overflow:ellipsis}
body.n-next input.form-control{min-height:var(--arena-control-h);height:auto}
body.n-next .input-group-sm>.form-control,body.n-next .input-group-sm>.input-group-prepend>.btn{min-height:40px;height:auto;font-size:14px}
body.n-next .input-group{align-items:stretch;min-width:0}
body.n-next .input-group>.form-control{min-width:0}
body.n-next .input-group-prepend .btn{white-space:nowrap}

/* Slim-compatible consent checkboxes, rebuilt for Arena. */
body.n-next .arena-consent,body.n-next .form-check-checkbox{position:relative;display:grid;grid-template-columns:22px minmax(0,1fr);align-items:start;gap:10px;margin:10px 0;padding:11px 12px;border:1px solid var(--n-line);border-radius:12px;background:var(--n-surface-2);cursor:pointer}
body.n-next .arena-consent .form-check-input,body.n-next .form-check-checkbox .form-check-input{appearance:none;-webkit-appearance:none;width:20px;height:20px;min-width:20px;margin:1px 0 0!important;border:1.5px solid var(--n-muted);border-radius:6px;background:var(--n-surface);display:grid;place-content:center;cursor:pointer}
body.n-next .arena-consent .form-check-input::before,body.n-next .form-check-checkbox .form-check-input::before{content:"";width:10px;height:6px;border:0 solid #fff;border-width:0 0 2px 2px;transform:rotate(-45deg) scale(0);transform-origin:center;transition:transform .12s ease}
body.n-next .arena-consent .form-check-input:checked,body.n-next .form-check-checkbox .form-check-input:checked{background:var(--n-link);border-color:var(--n-link)}
body.n-next .arena-consent .form-check-input:checked::before,body.n-next .form-check-checkbox .form-check-input:checked::before{transform:rotate(-45deg) scale(1)}
body.n-next .arena-consent .form-check-label,body.n-next .form-check-checkbox .form-check-label{margin:0!important;min-width:0;font-size:13px;line-height:1.55;color:var(--n-muted);overflow-wrap:anywhere;cursor:pointer}
body.n-next .arena-consent a{font-weight:700}
body.n-next .arena-refill-consents{display:grid;gap:4px}
body.n-next .arena-refill-submit[disabled]{opacity:.55;pointer-events:none}

/* Header refill CTA. */
body.n-next .n-refill-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:42px;min-width:118px;padding:0 15px;border-radius:11px;border:1px solid color-mix(in srgb,var(--n-link) 40%,transparent);background:linear-gradient(135deg,var(--n-link),color-mix(in srgb,var(--n-link) 72%,#7d8dff));color:#fff!important;font-size:13px;font-weight:850;white-space:nowrap;box-shadow:0 9px 24px color-mix(in srgb,var(--n-link) 20%,transparent)}
body.n-next .n-refill-btn:hover{transform:translateY(-1px);filter:brightness(1.05)}
body.n-next .n-refill-btn>span:first-child{font-size:17px;line-height:1}

/* Social-style messages. */
body.n-next .im_message{display:grid;grid-template-columns:42px minmax(0,1fr);gap:10px;align-items:start;margin:9px 0;padding:0;border:0;background:transparent}
body.n-next .im_message>img{width:42px;height:42px;border-radius:50%;object-fit:cover;margin-top:2px}
body.n-next .im_message>div{min-width:0;max-width:min(78%,680px);padding:10px 13px 11px;border:1px solid var(--n-line);border-radius:15px 15px 15px 5px;background:var(--n-surface-2);box-shadow:0 5px 16px rgba(0,0,0,.04)}
body.n-next .im_message .info{display:flex;align-items:center;gap:8px;margin-bottom:3px}
body.n-next .im_message .info a{font-size:13px;font-weight:800}
body.n-next .im_message .date{margin-left:auto;font-size:11px;color:var(--n-muted)}
body.n-next .im_message .with_code{font-size:14px;line-height:1.5;overflow-wrap:anywhere}
body.n-next #chat_messages .chat_message{padding:8px 4px!important;border:0!important;background:transparent!important}
body.n-next #chat_messages .chat_message>.message{max-width:calc(100% - 2px);padding:10px 13px 11px;border:1px solid var(--n-line);border-radius:15px 15px 15px 5px;background:var(--n-surface-2)}
body.n-next #chat_messages .chat_message .with_code{font-size:14px;line-height:1.5}

/* Equal action levels in support/tickets and generic action stacks. */
body.n-next .n-support-page+.col-lg-3>.block>.btn{display:flex;align-items:center;justify-content:center;width:100%;min-height:44px;margin:0 0 10px!important}
body.n-next .n-support-page+.col-lg-3>.block>.btn:last-child{margin-bottom:0!important}

/* Admin/service tables become readable cards on narrow screens. */
@media (max-width:767.98px){
 body.n-next{font-size:15px}
 body.n-next .block{border-radius:14px}
 body.n-next .block_head{font-size:17px;padding-left:16px;padding-right:16px}
 body.n-next .n-refill-btn{min-width:42px;width:42px;padding:0}
 body.n-next .n-refill-btn>span:last-child{display:none}
 body.n-next .admin-settings,body.n-next #server_admins{display:block;width:100%;border:0!important}
 body.n-next .admin-settings tbody,body.n-next #server_admins tbody{display:grid;gap:10px}
 body.n-next .admin-settings tr,body.n-next #server_admins tbody tr{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:7px;width:100%;padding:12px;border:1px solid var(--n-line)!important;border-radius:13px;background:var(--n-surface-2)}
 body.n-next .admin-settings td,body.n-next #server_admins tbody td{display:block!important;width:100%!important;max-width:100%!important;padding:0!important;border:0!important;white-space:normal!important;overflow-wrap:anywhere;text-align:left!important}
 body.n-next .admin-settings td:first-child{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--n-muted)}
 body.n-next #server_admins thead{display:none}
 body.n-next #server_admins tbody td::before{display:block;margin-bottom:3px;font-size:10px;font-weight:800;text-transform:uppercase;color:var(--n-muted)}
 body.n-next #server_admins tbody td:nth-child(1)::before{content:"#"}body.n-next #server_admins tbody td:nth-child(2)::before{content:"Услуга"}body.n-next #server_admins tbody td:nth-child(3)::before{content:"Права"}body.n-next #server_admins tbody td:nth-last-child(4)::before{content:"Дата покупки"}body.n-next #server_admins tbody td:nth-last-child(3)::before{content:"Дата окончания"}body.n-next #server_admins tbody td:nth-last-child(2)::before{content:"Осталось"}body.n-next #server_admins tbody td:last-child::before{content:"Действие"}
 body.n-next .admin-settings .input-group{display:grid;grid-template-columns:1fr;gap:7px}
 body.n-next .admin-settings .input-group-prepend{display:block}
 body.n-next .admin-settings .input-group-prepend .btn{width:100%;border-radius:10px!important}
 body.n-next .admin-settings .form-control{width:100%;border-radius:10px!important}
 body.n-next .modal .modal-body{padding:16px;max-height:75vh;overflow:auto}
 body.n-next .modal .services-title{font-size:17px;margin-top:16px}
 body.n-next .modal .add-service{width:100%;min-height:42px;margin:10px 0 12px}
 body.n-next .im_message>div{max-width:calc(100% - 4px)}
}

/* Donation widget in main-page sidebar. */
body.n-next .arena-donation-sidebar .block_head{margin-bottom:12px}
body.n-next .arena-donation-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:0 0 12px}
body.n-next .arena-donation-tabs button{min-height:38px;padding:7px 8px;border:1px solid var(--n-line);border-radius:10px;background:var(--n-surface-2);color:var(--n-muted);font-size:12px;font-weight:800}
body.n-next .arena-donation-tabs button.active{background:var(--n-accent-soft);border-color:color-mix(in srgb,var(--n-link) 35%,var(--n-line));color:var(--n-link)}
body.n-next .arena-donation-sidebar .arena-donation{margin:0;border:0!important;background:transparent!important;box-shadow:none!important;padding:0!important}
body.n-next .arena-donation-sidebar .arena-donation-heading .arena-donation-symbol,body.n-next .arena-donation-sidebar .arena-donation-heading .arena-donation-eyebrow,body.n-next .arena-donation-sidebar .arena-donation-heading h2,body.n-next .arena-donation-sidebar .arena-donation-about{display:none!important}
body.n-next .arena-donation-sidebar .arena-donation-grid{display:block!important}
body.n-next .arena-donation-sidebar .arena-donation-main{padding:0!important}
body.n-next .arena-donation-sidebar .arena-donation-form{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
body.n-next .arena-donation-sidebar .arena-donation-comment{display:none}
body.n-next .arena-donation-sidebar .arena-donation-list-toggle{display:none!important}
body.n-next .arena-donation-sidebar [data-arena-dw-view="supporters"] #dw_users,body.n-next .arena-donation-supporters-host #dw_users{display:grid;gap:8px}

/* Rules page stored in DB (Slim rh_* markup), fully restyled for Arena. */
body.n-next .rh_center_block_container{margin:0!important}
body.n-next .rh_toolbar,body.n-next .rh_block{border:1px solid var(--n-line);border-radius:16px;background:var(--n-surface);box-shadow:var(--n-shadow,0 8px 30px rgba(0,0,0,.07));overflow:hidden}
body.n-next .rh_toolbar__wrap{padding:20px 22px}
body.n-next .rh_toolbar__header_wrap{display:flex;align-items:center;gap:14px}
body.n-next .rh_toolbar__icon{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;border-radius:12px;background:var(--n-accent-soft);color:var(--n-link);font-size:22px}
body.n-next .rh_toolbar__title{margin:0;color:var(--n-text);font-size:22px;line-height:1.25;font-weight:850}
body.n-next .rh_toolbar__subtitle{margin-top:4px;color:var(--n-muted);font-size:13px}
body.n-next .rh_head_block_header{padding:16px 18px 4px}.rh_head_block_card_title{font-size:12px;font-weight:850;letter-spacing:.05em;text-transform:uppercase;color:var(--n-muted)}
body.n-next .rh_nav-container{padding:10px 14px 14px;overflow:auto;scrollbar-width:none}body.n-next .rh_nav-container::-webkit-scrollbar{display:none}
body.n-next .rh_nav-list{display:flex;gap:8px;list-style:none;margin:0;padding:0;min-width:max-content}
body.n-next .rh_nav-link{display:flex;align-items:center;min-height:40px;padding:8px 12px;border:1px solid var(--n-line);border-radius:11px;background:var(--n-surface-2);color:var(--n-muted);font-size:12px;font-weight:800;text-decoration:none!important}
body.n-next .rh_nav-link.rh_active{background:var(--n-accent-soft);border-color:color-mix(in srgb,var(--n-link) 35%,var(--n-line));color:var(--n-link)}
body.n-next .rh_tab-content{padding:4px 14px 16px}.rh_tab-pane{display:none}.rh_tab-pane.rh_show.rh_active{display:block}
body.n-next .rh_textglav{margin:8px 0 12px;font-size:18px;font-weight:850;color:var(--n-text)}
body.n-next .rh_block_text{display:grid;gap:9px}.rh_block_text>p{margin:0;padding:12px 13px;border:1px solid var(--n-line);border-radius:12px;background:var(--n-surface-2);color:var(--n-text);font-size:14px;line-height:1.58}
body.n-next .rh_obvodkatexta{display:inline-flex;align-items:center;min-height:24px;margin-right:4px;padding:2px 7px;border-radius:7px;background:var(--n-accent-soft);color:var(--n-link);font-weight:850}
body.n-next .rh_textrules{font-weight:650}.rh_punishment-box{display:block;margin-top:7px;padding:8px 10px;border-left:3px solid var(--n-danger);border-radius:8px;background:color-mix(in srgb,var(--n-danger) 9%,var(--n-surface));color:var(--n-muted);font-size:13px}.rh_punishment-box.rh_info{border-left-color:var(--n-link);background:var(--n-accent-soft)}

/* Generic row cards for list-like tables, without touching dense data tables on desktop. */
@media (min-width:768px){
 body.n-next .n-record-table tbody tr{background:var(--n-surface-2)}
 body.n-next .n-record-table tbody tr+tr td{border-top-color:transparent}
}
@media (max-width:767.98px){
 body.n-next .rh_toolbar__wrap{padding:16px}.rh_toolbar__title{font-size:19px!important}.rh_tab-content{padding:3px 10px 12px!important}.rh_block_text>p{font-size:13px!important}
 body.n-next .n-record-table tbody{display:grid;gap:9px}
 body.n-next .n-record-table tbody tr:not(:has(.loader)){display:grid!important;grid-template-columns:1fr!important;gap:5px;padding:11px 12px;border:1px solid var(--n-line)!important;border-radius:12px;background:var(--n-surface-2)}
 body.n-next .n-record-table tbody tr:not(:has(.loader)) td{display:block!important;width:100%!important;max-width:100%!important;padding:0!important;border:0!important;white-space:normal!important;overflow-wrap:anywhere}
}

/* V6: pinned chat message */
.arena-fixed-message-slot{margin:0 0 12px}.arena-fixed-message{display:flex;gap:10px;align-items:flex-start;position:relative;padding:12px;border:1px solid var(--n-border,#343a40);border-radius:14px;background:color-mix(in srgb,var(--n-accent,#5181b8) 9%,var(--n-card,#22272e));box-shadow:0 8px 22px rgba(0,0,0,.08)}
.arena-fixed-message__pin{flex:0 0 auto;width:28px;height:28px;display:grid;place-items:center;border-radius:9px;background:color-mix(in srgb,var(--n-accent,#5181b8) 16%,transparent)}.arena-fixed-message__body{min-width:0;flex:1}.arena-fixed-message__meta{display:flex;gap:8px;align-items:center;min-width:0}.arena-fixed-message__author{border:0;background:none;padding:0;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;font-weight:700;cursor:pointer}.arena-fixed-message__date{margin-left:auto;font-size:12px;color:var(--n-muted,#8b949e);white-space:nowrap}.arena-fixed-message__text{margin-top:5px;overflow-wrap:anywhere}


/* Arena V6.3: normal wheel scroll chaining and coherent server navigation. */
/* Do not trap the wheel inside an inner list once it reaches the end. */
body.n-next .n-community-scroll,
body.n-next #n-community-panel .n-community-scroll,
body.n-next #n-message-panel .n-message-scroll,
body.n-next #n-notification-panel .n-notification-scroll,
body.n-next #chat_messages,
body.n-next #place_for_messages #messages,
body.n-next .arena-smiles-popover .smiles_box,
body.n-next .n-record-scroll,
body.n-next .table-responsive,
body.n-next .n-site-nav,
body.n-next .n-site-nav .collapsible-menu > li ul,
body.n-next .arena-scroll,
body.n-next .n-promos,
body.n-next [data-arena-scroll] {
    overscroll-behavior-y: auto !important;
}
/* Inner scrollbars stay invisible; native wheel, keyboard and touch scroll stay enabled. */
body.n-next #n-community-panel .n-community-scroll,
body.n-next #n-message-panel .n-message-scroll,
body.n-next #n-notification-panel .n-notification-scroll,
body.n-next #place_for_messages #messages,
body.n-next .arena-smiles-popover .smiles_box,
body.n-next .n-site-nav .collapsible-menu > li ul {
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
body.n-next #n-community-panel .n-community-scroll::-webkit-scrollbar,
body.n-next #n-message-panel .n-message-scroll::-webkit-scrollbar,
body.n-next #n-notification-panel .n-notification-scroll::-webkit-scrollbar,
body.n-next #place_for_messages #messages::-webkit-scrollbar,
body.n-next .arena-smiles-popover .smiles_box::-webkit-scrollbar,
body.n-next .n-site-nav .collapsible-menu > li ul::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
/* Preserve real horizontal wheel or shift+wheel on intentionally horizontal lists. */
body.n-next .n-promos,
body.n-next .table-responsive {
    overscroll-behavior-x: auto !important;
}

/* Statistics and server selector must have the same individual cards as sidebar navigation. */
body.n-next .n-stats-server-nav ul {
    gap: 8px !important;
}
body.n-next .n-stats-server-nav ul > li,
body.n-next .n-stats-server-nav ul > li.active {
    min-width: 0;
    padding: 0;
    margin: 0;
    background: transparent;
}
body.n-next .n-stats-server-nav ul > li > a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 49px;
    padding: 11px 12px;
    border: 1px solid var(--n-line);
    border-radius: 12px;
    background: var(--n-surface-2);
    color: var(--n-text);
    font-weight: 650;
    font-size: 13px;
    line-height: 1.5;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: background .15s ease, border-color .15s ease;
}
body.n-next .n-stats-server-nav ul > li > a:hover {
    border-color: var(--n-link);
    background: var(--n-surface-3, var(--n-accent-soft));
    color: var(--n-text);
}
body.n-next .n-stats-server-nav ul > li > a.active,
body.n-next .n-stats-server-nav ul > li.active > a,
body.n-next .n-stats-server-nav ul > li > a[aria-current="page"] {
    border: 1px solid var(--n-link);
    border-radius: 12px;
    background: var(--n-accent-soft);
    color: var(--n-link);
}
body.n-next .n-stats-server-nav ul > li > a:focus-visible {
    outline: 2px solid var(--n-link) !important;
    outline-offset: 2px;
}

/* Bootstrap .form-check-input is absolutely positioned; that broke grid consent rows. */
body.n-next .arena-consent.form-check,
body.n-next .n-page-content .arena-consent.form-check,
body.n-next .form-check-checkbox.form-check {
    position: relative;
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr) !important;
    align-items: center;
    gap: 12px;
    padding: 12px 14px !important;
    margin: 10px 0;
    min-height: 52px;
    border: 1px solid var(--n-line);
    border-radius: 12px;
    background: var(--n-surface-2);
    cursor: pointer;
}
body.n-next .arena-consent.form-check > input[type="checkbox"],
body.n-next .form-check-checkbox.form-check > input[type="checkbox"],
body.n-next .n-page-content .arena-consent.form-check > input[type="checkbox"] {
    position: relative !important;
    inset: auto !important;
    float: none !important;
    display: block !important;
    grid-column: 1;
    align-self: center;
    justify-self: center;
    box-sizing: border-box !important;
    width: 20px !important;
    min-width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    outline-offset: 3px;
    border: 2px solid var(--n-muted);
    border-radius: 6px;
    background: var(--n-surface);
    cursor: pointer;
}
body.n-next .arena-consent.form-check > input[type="checkbox"]::before,
body.n-next .form-check-checkbox.form-check > input[type="checkbox"]::before {
    content: none !important;
}
body.n-next .arena-consent.form-check > input[type="checkbox"]:checked,
body.n-next .form-check-checkbox.form-check > input[type="checkbox"]:checked {
    border-color: var(--n-link);
    background-color: var(--n-link);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m5 12 5 5L20 7'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 15px 15px;
}
body.n-next .arena-consent.form-check > .form-check-label,
body.n-next .form-check-checkbox.form-check > .form-check-label,
body.n-next .n-page-content .arena-consent.form-check > .form-check-label {
    position: static !important;
    display: block;
    grid-column: 2;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px;
    line-height: 1.55;
    color: var(--n-text);
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
}
body.n-next .arena-consent a {
    color: var(--n-link);
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 2px;
}
@media(max-width:480px) {
  body.n-next .arena-consent.form-check,
  body.n-next .n-page-content .arena-consent.form-check {padding: 12px 10px !important;gap: 9px;}
  body.n-next .arena-consent.form-check > .form-check-label {font-size: 13px;}
}
