/* MEDIL v16.7.0 main batch — loaded last. Layout balance, FAB, empty/coming-soon states,
   skeleton, slot paging, maintenance banner, PIN UI. */

/* ---------- C6: desktop width balance (right rail is hidden ≤1460px; don't reserve its column) ---------- */
@media (min-width:1181px) and (max-width:1460px){
  html body .portal-grid{grid-template-columns:206px minmax(0,1fr)!important;column-gap:26px!important}
}
@media (min-width:1181px){
  html body .portal-grid{max-width:1760px!important}
  html body .portal-main{max-width:1320px!important}
}
@media (min-width:1461px){
  html body .portal-grid{grid-template-columns:214px minmax(0,1fr) 236px!important}
}
.rail-summary .rail-soon{font-size:12px!important;color:#7f94ad!important;font-weight:800!important;letter-spacing:0!important}
.home-card .card-count.card-soon{font-size:12px!important;letter-spacing:.5px!important;padding:4px 10px!important;width:auto!important;min-width:0!important;background:rgba(10,20,36,.72)!important;border:1px solid rgba(120,170,230,.35)!important;border-radius:999px!important;color:#cfe3f7!important;line-height:1.2!important;height:auto!important}

/* ---------- C5: floating support buttons ---------- */
.medil-support-fab .fab-toggle{display:none}
@media (max-width:980px){
  html body .portal-shell{padding-bottom:calc(150px + env(safe-area-inset-bottom))}
  html body .portal-main{padding-bottom:12px}
  .medil-support-fab{right:10px!important;bottom:calc(84px + env(safe-area-inset-bottom))!important;gap:8px!important;align-items:flex-end}
  .medil-support-fab .fab-chat,.medil-support-fab .fab-telegram{width:42px!important;height:42px!important;min-width:0!important;padding:0!important;justify-content:center!important;border-radius:50%!important;font-size:17px!important;opacity:.94}
  .medil-support-fab span{display:none!important}
  .medil-support-fab .fab-toggle{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;border:1px solid rgba(110,200,255,.35);background:rgba(9,20,36,.92);color:#8fe3ff;padding:0;cursor:pointer;box-shadow:0 6px 16px rgba(0,0,0,.35)}
  .medil-support-fab .fab-toggle svg{width:16px;height:16px}
  .medil-support-fab.collapsed .fab-chat,.medil-support-fab.collapsed .fab-telegram{display:none!important}
  .medil-support-fab.collapsed .fab-toggle{width:40px;height:40px}
}


/* ---------- C2/C3: empty + coming soon ---------- */
.medil-empty-state{grid-column:1/-1;display:flex;flex-direction:column;align-items:center;gap:8px;padding:42px 18px;border:1px dashed rgba(110,160,220,.28);border-radius:18px;background:rgba(10,22,38,.55);text-align:center}
.medil-empty-state .medil-empty-svg{width:40px;height:40px;color:#6fdcff;opacity:.9}
.medil-empty-state b{font-size:16px;color:#e6f0fb}
.medil-empty-state small{font-size:13px;color:#8ea4bd}
.medil-soon-panel{margin:16px 0 22px;padding:40px 22px 34px;border:1px solid rgba(90,150,220,.25);border-radius:22px;background:radial-gradient(circle at 50% 0,rgba(60,140,255,.16),transparent 60%),linear-gradient(180deg,#0d1b2e,#0a1424);text-align:center;box-shadow:0 18px 50px rgba(0,0,0,.35)}
.medil-soon-ico{width:76px;height:76px;margin:0 auto 14px;border-radius:24px;display:flex;align-items:center;justify-content:center;background:linear-gradient(160deg,#1d4f8f,#122f57);border:1px solid rgba(120,200,255,.35);color:#8fe7ff;box-shadow:0 10px 30px rgba(30,120,255,.25)}
.medil-soon-ico svg{width:38px;height:38px}
.medil-soon-badge{display:inline-block;padding:5px 12px;border-radius:999px;background:rgba(255,196,0,.12);border:1px solid rgba(255,196,0,.45);color:#ffd34d;font-size:12px;font-weight:900;letter-spacing:1px}
.medil-soon-panel h2{margin:12px 0 8px;font-size:22px;letter-spacing:-.5px;color:#f1f6ff}
.medil-soon-panel p{margin:0 auto;max-width:460px;color:#9ab0c8;font-size:14px;line-height:1.7}
.medil-soon-actions{display:flex;gap:10px;justify-content:center;margin-top:20px;flex-wrap:wrap}
.medil-soon-actions .button{min-width:120px;height:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:12px;font-weight:800;font-size:14px;text-decoration:none}
.medil-soon-kinds{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:20px auto 0;max-width:560px}
.medil-soon-kinds span{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:12px;background:rgba(255,255,255,.04);border:1px solid rgba(120,170,230,.18);color:#cfe0f2;font-size:13px}
.medil-soon-kinds svg{width:18px;height:18px;color:#7fdcff}
.medil-soon-kinds em{font-style:normal;font-size:12px;color:#ffd34d;font-weight:800}
.sports-soon .sp-hero{min-height:0}
.cp-split.cp-split-single{grid-template-columns:1fr!important}
.cp-jp-visual .cp-jp-word{display:flex;flex-direction:column;gap:6px;font-size:34px;letter-spacing:4px;background:linear-gradient(180deg,#ffe28a,#ffb800);-webkit-background-clip:text;background-clip:text;color:transparent}
.cp-jp-visual .cp-jp-word em{font-style:normal;font-size:14px;letter-spacing:0;color:#cfe0f2;-webkit-text-fill-color:#cfe0f2}
.cp-jp-tiers-text b svg{width:18px;height:18px;color:#ffd34d}
.cp-jackpot .cp-vip-btn{margin-top:12px}
.board-card .board-empty span{font-size:13px}

/* ---------- D3: skeleton + slot search/paging ---------- */
.medil-skeleton{padding:4px 0 24px}
.medil-skeleton .sk-hero{height:150px;border-radius:20px;padding:28px;display:flex;flex-direction:column;gap:12px;justify-content:center;background:#0d1a2c;border:1px solid rgba(90,140,200,.15)}
.medil-skeleton .sk-label{margin:14px 2px 8px;color:#8fa6c0;font-size:13px}
.medil-skeleton .sk-chips{display:flex;gap:8px;margin:0 0 14px}
.medil-skeleton .sk-chips i{width:78px;height:34px;border-radius:999px}
.medil-skeleton .sk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.medil-skeleton .sk-grid.casino,.medil-skeleton .sk-grid.sports{grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
.medil-skeleton .sk-card{border-radius:16px;padding:10px;background:#0c1828;border:1px solid rgba(90,140,200,.12);display:flex;flex-direction:column;gap:8px}
.medil-skeleton .sk-media{display:block;aspect-ratio:4/3;border-radius:12px}
.medil-skeleton .sk-line{display:block;height:12px;border-radius:6px}
.medil-skeleton .w30{width:30%}.medil-skeleton .w40{width:40%}.medil-skeleton .w60{width:60%}.medil-skeleton .w70{width:70%}
.medil-skeleton .sk-media,.medil-skeleton .sk-line,.medil-skeleton .sk-chips i{background:linear-gradient(90deg,#13233a 0,#1c3352 45%,#13233a 90%);background-size:200% 100%;animation:medilSk 1.2s ease-in-out infinite}
@keyframes medilSk{0%{background-position:100% 0}100%{background-position:-100% 0}}
@media (prefers-reduced-motion:reduce){.medil-skeleton *{animation:none!important}}
.cp-slot-search{margin:12px 0}
.cp-slot-search input{width:100%;max-width:420px;height:44px;border-radius:12px;border:1px solid rgba(110,160,220,.3);background:#0b1828;color:#e9f2fc;padding:0 14px;font-size:14px}
.cp-slot-search input:focus{outline:2px solid rgba(90,200,255,.55);outline-offset:1px}
.cp-slot-more{display:flex;justify-content:center;margin:18px 0 6px}
.cp-slot-more button{height:44px;padding:0 22px;border-radius:12px;border:1px solid rgba(110,180,255,.35);background:#10243c;color:#dff1ff;font-weight:800;font-size:14px;cursor:pointer}
.cp-slot-more small{margin-left:6px;color:#8fb1d0;font-size:12px}
.cp-slot-end{text-align:center;color:#7f94ad;font-size:13px;margin:16px 0}
.cp-slot{content-visibility:auto;contain-intrinsic-size:260px 240px}

/* ---------- maintenance ---------- */
#medil-maint-banner{position:sticky;top:0;z-index:1300;display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;justify-content:center;padding:12px 16px;background:linear-gradient(90deg,#5a3a00,#7a4f00);color:#fff4d6;border-bottom:1px solid rgba(255,200,80,.5);text-align:center;font-size:14px;line-height:1.5}
#medil-maint-banner b{display:inline-flex;align-items:center;gap:6px;color:#ffd34d}
#medil-maint-banner svg{width:18px;height:18px}
body.medil-maintenance [data-api-launch]:not([data-api-launch^="events"]),body.medil-maintenance [data-game],body.medil-maintenance [data-open-cashier],body.medil-maintenance a[href="#deposit"],body.medil-maintenance a[href="#withdraw"]{opacity:.45;filter:grayscale(.6);cursor:not-allowed}

/* ---------- admin hero banner ---------- */
.portal-hero.has-admin-banner{background-size:cover!important;background-position:center!important;cursor:pointer}

/* ---------- D2: PIN ---------- */
.medil-pin-panel .medil-pin-state{margin:0 0 12px;font-size:14px;padding:10px 12px;border-radius:10px}
.medil-pin-state.ok{background:rgba(40,180,120,.1);color:#8ff0c3;border:1px solid rgba(40,180,120,.3)}
.medil-pin-state.warn{background:rgba(255,196,0,.08);color:#ffd970;border:1px solid rgba(255,196,0,.3)}
.medil-pin-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:end}
.medil-pin-form label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#9fb4ca}
.medil-pin-form input{height:44px;border-radius:10px;border:1px solid rgba(110,160,220,.3);background:#0b1828;color:#eef5fd;padding:0 12px;font-size:15px;letter-spacing:2px}
.medil-pin-form button{grid-column:1/-1;height:46px;border-radius:12px;font-weight:800}
.medil-pin-form .auth-error{grid-column:1/-1;color:#ff8ea0;font-size:13px;min-height:1em}
@media (max-width:760px){.medil-pin-form{grid-template-columns:1fr}}
.cashier-pin-help{display:block;margin-top:6px;font-size:12px;color:#8ea4bd}
.cashier-pin-help a{color:#7fdcff}
#cashier-pin.is-invalid{border-color:#ff6b84!important}
.medil-dialog-actions{display:flex;gap:8px;justify-content:flex-end}
/* desktop: keep a gutter for the floating buttons so they never sit on content */
@media (min-width:981px) and (max-width:1700px){
  html body .portal-grid{padding-right:78px!important}
  .medil-support-fab{right:16px!important}
  .medil-support-fab .fab-chat,.medil-support-fab .fab-telegram{width:48px!important;height:48px!important;min-width:0!important;padding:0!important;justify-content:center!important;border-radius:50%!important;font-size:18px!important}
  .medil-support-fab span{display:none!important}
}
.cp-jp-tiers-text{display:none!important}

/* v16.10.3 home cards: new 라이브 카지노 / 이벤트 backgrounds (old files kept) */
.screenshot-home-grid .home-card.casino,.home-card.casino{background-image:url('./home-livecasino-v2.webp')!important;background-size:cover!important;background-position:68% 14%!important}
.screenshot-home-grid .home-card.events,.home-card.events{background-image:url('./home-event-v2.webp')!important;background-size:cover!important;background-position:74% 42%!important}
@media(max-width:700px){
 .screenshot-home-grid .home-card.casino,.home-card.casino{background-position:82% 14%!important}
 .screenshot-home-grid .home-card.events,.home-card.events{background-position:92% 42%!important}
}

/* v16.10.4 home-card count badges: `.screenshot-home-grid .home-card>*{position:relative}` (style-v15-sample.css)
   overrode the absolute badge, so it rendered as a full-width bar pushed above the card edge. Pin it as a pill top-right. */
.screenshot-home-grid .home-card>.card-count,.home-card>.card-count{position:absolute!important;top:14px!important;right:14px!important;bottom:auto!important;left:auto!important;inset:14px 14px auto auto!important;width:auto!important;min-width:0!important;max-width:calc(100% - 28px);height:28px!important;padding:0 12px!important;margin:0!important;border-radius:999px!important;font-size:13px!important;font-weight:800;line-height:1!important;white-space:nowrap;z-index:3!important;transform:none!important}
@media(max-width:700px){.screenshot-home-grid .home-card>.card-count,.home-card>.card-count{inset:8px 8px auto auto!important;top:8px!important;right:8px!important;height:22px!important;padding:0 8px!important;font-size:11px!important}}

/* v16.11 PC right rail '게임 현황' ticker (replaces the unused 베팅카트 while there are no sports games) */
.portal-right [data-bet-panel][hidden],.portal-right [data-live-wins][hidden],.lw-tag[hidden]{display:none!important}
.live-wins-panel .lw-title{display:flex;align-items:center;gap:6px}
.live-wins-panel .lw-title strong{margin-right:auto}
.lw-tag{font-size:10px;font-weight:800;padding:2px 7px;border-radius:999px;background:rgba(255,196,0,.16);color:#ffd666;border:1px solid rgba(255,196,0,.3)}
.lw-live{display:inline-flex;align-items:center;gap:4px;font-size:10px;font-weight:800;color:#5be38f;letter-spacing:.5px}
.lw-live i{width:6px;height:6px;border-radius:50%;background:#2fd47a;box-shadow:0 0 0 0 rgba(47,212,122,.6);animation:lwPulse 1.6s infinite}
@keyframes lwPulse{0%{box-shadow:0 0 0 0 rgba(47,212,122,.55)}70%{box-shadow:0 0 0 6px rgba(47,212,122,0)}100%{box-shadow:0 0 0 0 rgba(47,212,122,0)}}
.lw-viewport{position:relative;height:372px;overflow:hidden;-webkit-mask-image:linear-gradient(180deg,transparent 0,#000 18px,#000 calc(100% - 18px),transparent 100%);mask-image:linear-gradient(180deg,transparent 0,#000 18px,#000 calc(100% - 18px),transparent 100%)}
.lw-track{animation:lwRoll var(--lw-dur,120s) linear infinite;will-change:transform}
.lw-viewport:hover .lw-track,.lw-viewport:focus-within .lw-track{animation-play-state:paused}
@keyframes lwRoll{from{transform:translateY(0)}to{transform:translateY(-50%)}}
.lw-row{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:8px;align-items:center;padding:8px 2px;border-bottom:1px solid rgba(101,164,225,.10);color:inherit;text-decoration:none;font-size:11.5px}
.lw-user{color:#9fb3cc;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lw-game{min-width:0;display:grid}
.lw-game b,.lw-game small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lw-game b{font-weight:700;color:#e8f1ff}
.lw-game small,.lw-amt small{font-size:10px;color:#7f93ad}
.lw-amt{display:grid;justify-items:end;text-align:right}
.lw-amt b{color:#5fe3a6;font-weight:800;white-space:nowrap}
@media(prefers-reduced-motion:reduce){.lw-track{animation:none}.lw-viewport{overflow-y:auto}.lw-dup{display:none}}

/* Game status badge visibility */
[data-live-wins] [data-lw-tag]{display:none!important}
/* v16.11.2 게임 현황: losses in red */
.lw-row.lw-loss .lw-amt b{color:#ff6b6b}
