/* L2REHAB V22 — Downloads modal. Only affects .rehab-files-* */
.rehab-files-overlay[hidden]{display:none!important}
.rehab-files-overlay{position:fixed;inset:0;z-index:999999;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(4,8,13,.83);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
body.rehab-files-open{overflow:hidden}
.rehab-files-dialog{position:relative;width:min(820px,100%);max-height:min(90vh,920px);overflow:auto;overscroll-behavior:contain;background:linear-gradient(145deg,#18212a 0%,#0d131b 57%,#111820 100%);border:1px solid #806744;box-shadow:0 25px 95px #000b, inset 0 0 0 3px #111820;color:#d8d2c4;outline:none}
.rehab-files-dialog::before{content:"";position:sticky;top:0;display:block;height:3px;background:linear-gradient(90deg,transparent,#a78a57,#e0bd79,#a78a57,transparent);z-index:1}
.rehab-files-close{position:absolute;right:18px;top:18px;z-index:3;width:35px;height:35px;background:#121920;border:1px solid #69553b;color:#d6b781;font:26px/1 Georgia,serif;cursor:pointer;transition:background .2s}
.rehab-files-close:hover{background:#2d261e;color:#f2d4a0}
.rehab-files-head{padding:34px 54px 24px;text-align:center;border-bottom:1px solid rgba(182,145,88,.25);background:radial-gradient(ellipse at 50% 0%,rgba(169,130,73,.13),transparent 75%)}
.rehab-files-eyebrow{font:600 10px/1.5 Arial,sans-serif;letter-spacing:.32em;color:#a88c5e;margin-bottom:10px}
.rehab-files-head h2{font:normal 29px/1.25 Georgia,'Times New Roman',serif;letter-spacing:.08em;color:#e5c68d;margin:0 0 12px;text-shadow:0 2px 12px #0009}
.rehab-files-head p,.rehab-files-description{font:14px/1.65 Arial,sans-serif;color:#aeb1b0;margin:0}
.rehab-files-content{padding:25px 36px 34px}
.rehab-files-section+.rehab-files-section{margin-top:26px}
.rehab-files-section-title{display:flex;align-items:center;gap:12px;margin:0 0 14px;border-bottom:1px solid rgba(177,144,89,.28);padding-bottom:10px}
.rehab-files-section-title>span{font:normal 22px Georgia,serif;color:#947c54}
.rehab-files-section-title h3{font:normal 17px Georgia,serif;letter-spacing:.08em;color:#e0c08a;margin:0}
.rehab-files-section>.rehab-files-description{margin:-4px 0 15px}
.rehab-files-list{display:grid;gap:8px}
.rehab-file-row{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:58px;padding:10px 12px 10px 17px;background:rgba(255,255,255,.025);border:1px solid rgba(159,131,83,.2);border-left:2px solid #806740}
.rehab-file-label{font:13px/1.5 Arial,sans-serif;color:#d0d0cb}
.rehab-file-label b{font-weight:600;color:#e3d0a8}
.rehab-file-source{display:inline-block;margin-left:9px;font-size:10px;letter-spacing:.08em;color:#a9bbac;border:1px solid rgba(130,157,134,.3);padding:2px 6px}
.rehab-file-download,.rehab-files-register a{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;padding:10px 18px;border:1px solid #a1814e;color:#e6c792!important;background:linear-gradient(#332b22,#1a1b1d);font:600 11px/1 Arial,sans-serif;letter-spacing:.07em;text-decoration:none!important;transition:background .2s,border-color .2s}
.rehab-file-download:hover,.rehab-files-register a:hover{background:#473a2a;border-color:#dfb779;color:#fff1d3!important}
.rehab-files-register{text-align:center;margin:25px 0}
.rehab-files-register a{min-width:180px}
.rehab-files-faq-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.rehab-files-faq-links a{color:#c6bda9!important;text-decoration:none!important;font:13px/1.4 Arial,sans-serif;padding:12px;border:1px solid rgba(164,133,83,.22);background:rgba(255,255,255,.025)}
.rehab-files-faq-links a:hover{color:#f1d49e!important;border-color:#8d7044}
@media(max-width:650px){.rehab-files-overlay{padding:9px}.rehab-files-dialog{max-height:94vh}.rehab-files-head{padding:33px 36px 20px}.rehab-files-head h2{font-size:23px}.rehab-files-content{padding:20px 14px 25px}.rehab-file-row{gap:10px;padding:10px}.rehab-file-label{font-size:12px}.rehab-file-download{padding:10px 12px}.rehab-files-faq-links{grid-template-columns:1fr}}

/* V23: compact downloads popup, no inner scrollbar on ordinary desktop viewports. */
@media (min-width: 761px) and (min-height: 720px) {
 .rehab-files-overlay{padding:12px}
 .rehab-files-dialog{width:min(1060px,calc(100vw - 28px));max-height:calc(100dvh - 24px);overflow:visible}
 .rehab-files-head{padding:14px 52px 11px}
 .rehab-files-eyebrow{margin-bottom:3px;font-size:9px}
 .rehab-files-head h2{font-size:23px;margin-bottom:5px}
 .rehab-files-head p{font-size:12px;line-height:1.35}
 .rehab-files-content{padding:12px 24px 16px;display:grid;grid-template-columns:1fr 1fr;column-gap:20px;row-gap:9px}
 .rehab-files-section+.rehab-files-section{margin-top:0}
 .rehab-files-section-title{margin-bottom:7px;padding-bottom:5px;gap:8px}
 .rehab-files-section-title>span{font-size:15px}
 .rehab-files-section-title h3{font-size:14px}
 .rehab-files-section>.rehab-files-description{margin:0 0 6px;font-size:11px;line-height:1.35}
 .rehab-files-list{gap:5px}
 .rehab-file-row{min-height:44px;padding:5px 8px;gap:8px}
 .rehab-file-label{font-size:11px;line-height:1.3}
 .rehab-file-source{font-size:9px;padding:2px 5px;margin-left:5px}
 .rehab-file-download{font-size:10px;padding:8px 10px}
 .rehab-files-register{grid-column:1/-1;margin:0;text-align:center}
 .rehab-files-register a{padding:7px 15px;min-width:150px}
 .rehab-files-faq{grid-column:1/-1}
 .rehab-files-faq .rehab-files-description{margin:0 0 5px}
 .rehab-files-faq-links{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
 .rehab-files-faq-links a{font-size:11px;padding:8px;line-height:1.25}
 .rehab-files-close{top:10px;right:12px;width:30px;height:30px}
}
/* FTP is the preferred download source: subtle warm gold, distinct from Google. */
.rehab-file-row.rehab-file-preferred{border-color:rgba(204,167,98,.54);border-left:3px solid #cba25e;background:linear-gradient(90deg,rgba(164,117,46,.15),rgba(255,255,255,.018))}
.rehab-file-preferred .rehab-file-source{color:#f2d39b;border-color:rgba(218,179,108,.65);background:rgba(166,118,52,.18);font-weight:700}
.rehab-file-preferred .rehab-file-download{border-color:#c7a36c;background:linear-gradient(#4a3824,#2a241c);color:#f5dbac!important}
.rehab-file-preferred .rehab-file-download:hover{background:#60482c}
/* Keep accessibility: allow scrolling only on short/narrow screens where content cannot physically fit. */
@media (max-height:719px) and (min-width:761px){.rehab-files-dialog{max-height:calc(100dvh - 16px);overflow-y:auto}}

/* V24: both download columns share the same header/description/list rows. */
@media (min-width:761px) and (min-height:720px){
 .rehab-files-section:not(.rehab-files-faq){display:grid;grid-template-rows:auto minmax(32px,auto) 1fr;align-content:start;min-width:0}
 .rehab-files-section:not(.rehab-files-faq)>.rehab-files-description{grid-row:2;align-self:start;margin:0 0 6px;min-height:0}
 .rehab-files-section:not(.rehab-files-faq)>.rehab-files-list{grid-row:3;align-self:start}
 .rehab-files-section:not(.rehab-files-faq):not(:has(>.rehab-files-description))>.rehab-files-section-title::after{content:none}
 .rehab-files-section:not(.rehab-files-faq):not(:has(>.rehab-files-description))::before{content:'';grid-row:2;display:block;min-height:32px}
 .rehab-files-faq>.rehab-files-description{max-width:100%;overflow-wrap:anywhere;line-height:1.45;margin-bottom:9px}
 .rehab-files-faq-links{grid-template-columns:repeat(4,minmax(0,1fr));align-items:stretch}
 .rehab-files-faq-links a{min-width:0;overflow-wrap:anywhere;word-break:normal;display:flex;align-items:center;justify-content:center;text-align:center;hyphens:auto}
}
@media (max-width:760px), (max-height:719px){
 .rehab-files-faq>.rehab-files-description{overflow-wrap:anywhere;max-width:100%}
 .rehab-files-faq-links a{overflow-wrap:anywhere;min-width:0}
}

/* V24 description spacer matches Classic description height on desktop */
@media(min-width:761px) and (min-height:720px){.rehab-files-description-spacer{visibility:hidden}}

/* V25: align the Interlude download rows with Classic, without moving the headings or FAQ. */
@media (min-width:761px) and (min-height:720px) {
  .rehab-files-content > .rehab-files-section:first-child > .rehab-files-list {
    transform: translateY(4px);
  }
}

/* Smooth downloads dialog entrance and exit (V1). */
.rehab-files-overlay:not([hidden]){opacity:0;visibility:visible;pointer-events:none;transition:opacity .30s ease}
.rehab-files-overlay.rehab-files-visible{opacity:1;pointer-events:auto}
.rehab-files-dialog{opacity:0;transform:translateY(16px) scale(.975);transition:transform .32s cubic-bezier(.2,.75,.25,1),opacity .27s ease;will-change:transform,opacity}
.rehab-files-overlay.rehab-files-visible .rehab-files-dialog{opacity:1;transform:translateY(0) scale(1)}
@media (prefers-reduced-motion:reduce){.rehab-files-overlay:not([hidden]),.rehab-files-dialog{transition:none!important;transform:none!important}}

/* Premium Classic — scoped exclusively to the downloads modal; desktop & mobile. */
.rehab-files-dialog{width:min(940px,100%);border-radius:15px;background:#101720;border-color:#9d7b49;box-shadow:0 28px 100px #000d}
.rehab-files-head{border-bottom:0;padding:27px 44px 15px;background:none}
.rehab-files-head h2{font-size:28px;margin:4px 0 8px}
.rehab-files-head p{font-size:12px;line-height:1.6}
.rehab-files-content{padding:12px 20px 24px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.rehab-files-content>.rehab-files-section:not(.rehab-files-faq){min-width:0;display:flex;flex-direction:column;border:1px solid #69543a;border-radius:12px;background:#19222c;padding:15px}
.rehab-files-section+.rehab-files-section{margin-top:0}
.rehab-files-section-title{border:0;margin:0 0 10px;padding:0;gap:9px}
.rehab-files-section-title>span{font-size:19px;color:#b79661}
.rehab-files-section-title h3{font-size:15px;letter-spacing:.03em}
.rehab-files-section>.rehab-files-description{font-size:11px;line-height:1.4;margin:0 0 10px;min-height:28px}
.rehab-files-list{gap:9px;margin-top:auto}
.rehab-file-row.rehab-file-preferred{min-height:73px;padding:11px 12px;gap:10px;border:1px solid #685337;border-radius:7px;border-left:3px solid #caa15d;background:#111921}
.rehab-file-label{font-size:12px;line-height:1.55;flex:1;min-width:0}
.rehab-file-label b{color:#f0c987}
.rehab-file-download,.rehab-file-preferred .rehab-file-download{min-width:116px;min-height:40px;border-radius:5px;font-size:12px;letter-spacing:0;background:#b89960;border-color:#d2b174;color:#141920!important}
.rehab-file-download:hover,.rehab-file-preferred .rehab-file-download:hover{background:#e1bd79;color:#10151a!important}
.rehab-files-register{grid-column:1/-1;margin:2px 0 0;text-align:center}
.rehab-files-register::before{content:"Нет аккаунта? Создайте его перед входом в игру.";display:none}
.rehab-files-register a{min-width:170px;border-radius:5px;padding:11px 20px}
.rehab-files-help{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.rehab-files-help-card{display:flex;align-items:center;gap:14px;min-width:0;min-height:94px;padding:17px;border-radius:10px;text-decoration:none!important;transition:background .2s,border-color .2s,transform .2s}
.rehab-files-help-faq{background:linear-gradient(115deg,#211d19,#171b21);border:1px solid #d6a34f;box-shadow:inset 0 0 0 1px #624b2a}
.rehab-files-help-support{background:linear-gradient(115deg,#101f2e,#121b25);border:1px solid #3888bc;box-shadow:inset 0 0 0 1px #1c4a69}
.rehab-files-help-card:hover{transform:translateY(-2px)}
.rehab-files-help-faq:hover{background:#2d261d;border-color:#ffd17e}
.rehab-files-help-support:hover{background:#142b3e;border-color:#64bbef}
.rehab-files-help-icon{flex:0 0 47px;width:47px;height:47px;display:flex;align-items:center;justify-content:center;border:2px solid currentColor;border-radius:50%;font:bold 28px/1 Arial,sans-serif}
.rehab-files-help-faq .rehab-files-help-icon,.rehab-files-help-faq .rehab-files-help-arrow{color:#e7b35c}
.rehab-files-help-support .rehab-files-help-icon,.rehab-files-help-support .rehab-files-help-arrow{color:#56b6ef}
.rehab-files-help-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:7px}
.rehab-files-help-copy strong{font:normal 20px/1.2 Georgia,serif;color:#efc88a}
.rehab-files-help-copy small{font:12px/1.5 Arial,sans-serif;color:#bdc0c3}
.rehab-files-help-arrow{font:34px/1 Arial,sans-serif}
@media(min-width:761px) and (min-height:720px){
 .rehab-files-dialog{width:min(940px,calc(100vw - 32px));max-height:calc(100dvh - 24px);overflow-y:auto}
 .rehab-files-head{padding:23px 44px 12px}
 .rehab-files-head h2{font-size:26px}
 .rehab-files-content{padding:12px 20px 22px;gap:13px}
 .rehab-files-content>.rehab-files-section:not(.rehab-files-faq){display:flex;grid-template-rows:none;padding:14px}
 .rehab-files-section:not(.rehab-files-faq)>.rehab-files-description{grid-row:auto;margin:0 0 10px;min-height:28px}
 .rehab-files-section:not(.rehab-files-faq)>.rehab-files-list{grid-row:auto;transform:none!important}
 .rehab-file-row{min-height:73px}
 .rehab-files-register{margin:2px 0 0}
 .rehab-files-register a{padding:11px 20px}
 .rehab-files-close{top:14px;right:14px}
}
@media(max-width:760px){
 .rehab-files-overlay{padding:8px}
 .rehab-files-dialog{width:100%;max-height:95dvh;overflow-y:auto;border-radius:11px}
 .rehab-files-head{padding:35px 17px 14px}
 .rehab-files-head h2{font-size:23px}
 .rehab-files-head p{font-size:11px}
 .rehab-files-content{padding:10px 12px 18px;grid-template-columns:minmax(0,1fr);gap:12px}
 .rehab-files-content>.rehab-files-section:not(.rehab-files-faq){padding:13px}
 .rehab-files-section>.rehab-files-description{min-height:0}
 .rehab-file-row.rehab-file-preferred{min-height:66px}
 .rehab-file-download,.rehab-file-preferred .rehab-file-download{min-width:99px;padding:9px}
 .rehab-files-register,.rehab-files-help{grid-column:1}
 .rehab-files-help{grid-template-columns:minmax(0,1fr);gap:10px}
 .rehab-files-help-card{min-height:84px;padding:12px}
 .rehab-files-help-copy strong{font-size:17px}
 .rehab-files-help-icon{flex-basis:40px;width:40px;height:40px;font-size:23px}
}
@media(max-width:370px){.rehab-file-row.rehab-file-preferred{flex-wrap:wrap}.rehab-file-download{width:100%}}

/* Premium Classic alignment correction — final overrides. */
.rehab-files-content>.rehab-files-section:not(.rehab-files-faq){
 display:flex!important;flex-direction:column!important;justify-content:flex-start!important;
 grid-template-rows:none!important;gap:0!important;
}
.rehab-files-section:not(.rehab-files-faq)>.rehab-files-section-title{margin:0 0 10px!important}
.rehab-files-section:not(.rehab-files-faq)>.rehab-files-description{
 display:block!important;visibility:visible!important;
 margin:0 0 13px!important;min-height:56px!important;
 line-height:1.5!important;color:#b9bec5!important;
}
.rehab-files-section:not(.rehab-files-faq)>.rehab-files-list{
 display:grid!important;grid-template-columns:minmax(0,1fr)!important;
 align-self:stretch!important;grid-row:auto!important;
 margin:0!important;transform:none!important;gap:9px!important;
}
.rehab-file-row.rehab-file-preferred{
 display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;
 align-items:center!important;justify-content:space-between!important;
 min-height:70px!important;gap:12px!important;
}
.rehab-file-label{
 display:flex!important;flex:1 1 auto!important;min-width:0!important;
 flex-direction:column!important;align-items:flex-start!important;
 gap:5px!important;line-height:1.35!important;
}
.rehab-file-label-text{display:block!important;overflow-wrap:break-word!important}
.rehab-file-source{
 display:inline-flex!important;align-self:flex-start!important;
 width:max-content!important;margin:0!important;
 padding:2px 6px!important;white-space:nowrap!important;
}
.rehab-file-download,.rehab-file-preferred .rehab-file-download{
 flex:0 0 116px!important;width:116px!important;min-width:0!important;
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
 text-align:center!important;white-space:nowrap!important;
}
@media(max-width:760px){
 .rehab-files-section:not(.rehab-files-faq)>.rehab-files-description{min-height:0!important}
 .rehab-file-download,.rehab-file-preferred .rehab-file-download{flex-basis:105px!important;width:105px!important}
}
@media(max-width:360px){
 .rehab-file-row.rehab-file-preferred{flex-wrap:wrap!important}
 .rehab-file-download,.rehab-file-preferred .rehab-file-download{flex:1 0 100%!important;width:100%!important}
}
