/* login-screen default: flex (login page shows it always) */

/* ── Discord hint banner — login page (giống game page) ── */
#discord-hint-banner-login {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9000;
  background: linear-gradient(135deg, #3b4bcc 0%, #5865f2 100%);
  border: 1.5px solid rgba(255,255,255,.15);
  
  padding: clamp(10px,2.5vw,14px) clamp(12px,3vw,18px);
  display: flex; align-items: flex-start; gap: 10px;
  box-shadow: 0 4px 24px rgba(88,101,242,.35);
  animation: bannerFadeIn .3s ease;
  
  width: 100%;
}
@keyframes bannerFadeIn {
  from { opacity: 0; transform: translateY(-6px) }
  to   { opacity: 1; transform: translateY(0) }
}
#discord-hint-banner-login .dhb-icon {
  font-size: 22px; flex-shrink: 0; margin-top: 1px;
}
#discord-hint-banner-login .dhb-body { flex: 1; min-width: 0 }
#discord-hint-banner-login .dhb-title {
  font-family: var(--fh); font-size: clamp(13px,3vw,15px);
  color: #fff; margin-bottom: 4px; letter-spacing: .3px;
}
#discord-hint-banner-login .dhb-desc {
  font-size: clamp(11px,2.5vw,13px); color: rgba(255,255,255,.85);
  line-height: 1.5;
}
#discord-hint-banner-login .dhb-desc code {
  background: rgba(0,0,0,.3); padding: 1px 6px; border-radius: 4px;
  font-family: var(--fm); color: #fff; font-size: 12px;
}
#discord-hint-banner-login .dhb-close {
  flex-shrink: 0; background: rgba(255,255,255,.15); border: none;
  color: #fff; font-size: 15px; cursor: pointer; border-radius: 6px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  transition: background .15s; margin-top: 1px;
}
#discord-hint-banner-login .dhb-close:hover { background: rgba(255,255,255,.28) }

#login-screen { display: flex !important }
#game-screen  { display: none  !important }

/* ── Compact phones (width < 380px hoặc height < 680px portrait) ── */
@media (max-width: 380px), (max-height: 680px) and (orientation: portrait) {
  :root {
    --topbar-h: 40px;
    --chip-s:   clamp(34px, 8vmin, 44px);
    --center-w: clamp(100px, 20vw, 140px);
    --panel-fs: clamp(22px, 5vmin, 36px);
  }
  .panel-range   { font-size: clamp(9px, 2vmin, 12px) }
  .panel-deco    { display: none }
  .chip-lbl      { font-size: clamp(9px, 2.2vmin, 12px) }
  .act-btn       { height: clamp(38px, 7vw, 46px); font-size: clamp(12px, 3vw, 15px) }
  .bottom-bar    { /* tighter */ }
}

/* ── Rất nhỏ (< 360px) ── */
@media (max-width: 360px) {
  :root {
    --chip-s:   32px;
    --center-w: 90px;
    --panel-fs: 20px;
  }
  .logo .txt { display: none }
  .topbar { gap: 4px; padding: 0 8px }
}

/* ── Màn thấp portrait (height < 600px) ── */
@media (max-height: 600px) and (orientation: portrait) {
  :root {
    --chip-s:   clamp(30px, 7.5vmin, 40px);
    --center-w: clamp(90px, 18vw, 130px);
    --panel-fs: clamp(18px, 4.5vmin, 28px);
    --topbar-h: 38px;
  }
  .panel-deco { display: none }
  .panel-range { font-size: 10px }
  .chip-area  { padding: 4px 0 2px }
  .act-btn    { height: 38px; font-size: 12px }
}


/* ── Discord hint banner (ngoài Discord) ── */
#discord-hint-banner {
  position: fixed; top: var(--topbar-h); left: 0; right: 0; z-index: 200;
  background: linear-gradient(135deg, #3b4bcc 0%, #5865f2 100%);
  border-bottom: 1.5px solid rgba(255,255,255,.15);
  padding: clamp(8px,2vw,12px) clamp(12px,3vw,20px);
  display: flex; align-items: flex-start; gap: 10px;
  box-shadow: 0 4px 24px rgba(88,101,242,.35);
  animation: bannerSlideIn .3s ease;
}
@keyframes bannerSlideIn {
  from { transform: translateY(-100%); opacity: 0 }
  to   { transform: translateY(0);     opacity: 1 }
}
#discord-hint-banner .dhb-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px }
#discord-hint-banner .dhb-body { flex: 1; min-width: 0 }
#discord-hint-banner .dhb-title {
  font-family: var(--fh); font-size: clamp(13px,3vw,15px);
  color: #fff; margin-bottom: 4px; letter-spacing: .3px;
}
#discord-hint-banner .dhb-desc {
  font-size: clamp(11px,2.5vw,13px); color: rgba(255,255,255,.85);
  line-height: 1.5;
}
#discord-hint-banner .dhb-desc code {
  background: rgba(0,0,0,.3); padding: 1px 6px; border-radius: 4px;
  font-family: var(--fm); color: #fff; font-size: 12px;
}
#discord-hint-banner .dhb-close {
  flex-shrink: 0; background: rgba(255,255,255,.15); border: none;
  color: #fff; font-size: 15px; cursor: pointer; border-radius: 6px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  transition: background .15s; margin-top: 1px;
}
#discord-hint-banner .dhb-close:hover { background: rgba(255,255,255,.28) }

/* ── upopup responsive ── */
@media (max-width: 400px) {
  .upopup {
    right: max(6px, var(--sai-right));
    left:  max(6px, var(--sai-left));
    min-width: unset;
    width: calc(100vw - 12px - var(--sai-left) - var(--sai-right));
    padding: 12px;
    border-radius: 10px;
  }
  .upopup-name { font-size: 15px }
  .upopup-code .val { font-size: clamp(10px, 2.2vw, 12px) }
  .upopup-code .code-val { font-size: clamp(9px, 2vw, 11px); letter-spacing: 1px }
  .upopup-label { font-size: 9px }
}

@media (max-height: 600px) {
  .upopup {
    top: calc(var(--topbar-h) + var(--sai-top) + 2px);
    padding: 10px 12px;
    max-height: calc(100dvh - var(--topbar-h) - var(--sai-top) - var(--sai-bottom) - 8px);
    overflow-y: auto;
  }
  .upopup-header { margin-bottom: 10px; padding-bottom: 8px }
  .upopup-row    { margin-bottom: 8px }
}


/* ── Login & Register screen ── */
@media (max-width: 320px) {
  #login-screen {
    padding: 4px;
    align-items: flex-start;
    overflow-y: auto;
  }
  .login-card {
    padding: 12px 10px;
    border-radius: 10px;
    max-width: 100%;
  }
  .login-icon  { font-size: 28px; margin-bottom: 4px }
  .login-card h2 { font-size: 16px; margin-bottom: 2px }
  .login-sub   { font-size: 10px; margin-bottom: 10px }
  .login-tabs  { margin-bottom: 10px }
  .ltab        { font-size: 10px; padding: 5px 2px }
  .login-input {
    padding: 8px 10px;
    font-size: 14px !important; /* iOS no-zoom */
    margin-bottom: 4px;
    border-radius: 8px;
  }
  .login-hint  { font-size: 9px }
  .btn         { padding: 9px 12px; font-size: 12px; min-height: 38px }
  .btn-recover-row { padding: 7px; font-size: 10px }
  .field-msg   { font-size: 9px }
  #search-results { max-height: 120px; overflow-y: auto }
  .confirm-card { padding: 8px }
  .confirm-card .cc-name { font-size: 12px }
}

/* ── Dialog / Popup chung ── */
@media (max-width: 320px), (max-height: 480px) {
  .dialog-overlay.on { display: flex; animation: fadeIn .15s ease; }
.dialog-overlay {
    padding: 6px;
    padding-bottom: max(6px, var(--sai-bottom));
    align-items: flex-end; /* bottom sheet style trên màn nhỏ */
  }
  .dialog-box {
    padding: 14px 12px;
    border-radius: 12px;
    max-width: 100%;
    max-height: calc(96dvh - var(--sai-top) - var(--sai-bottom));
    overflow-y: auto;
  }
  .dialog-icon   { font-size: 28px; margin-bottom: 6px }
  .dialog-title  { font-size: 15px; margin-bottom: 5px }
  .dialog-msg    { font-size: 11px }
  .dialog-actions{ gap: 6px; margin-top: 10px }
  .dialog-btn    { padding: 9px 12px; font-size: 12px; min-height: 38px }
  .dialog-countdown { font-size: 18px }
}

/* ── Recovery + forgot modals ── */
@media (max-width: 320px) {
  .recover-info  { font-size: 10px; padding: 8px 10px }
  .recover-info ol { padding-left: 14px }
}

/* ── 320px height portrait override ── */
@media (max-height: 480px) and (orientation: portrait) {
  #login-screen {
    overflow-y: auto;
    align-items: flex-start;
    padding-top: 4px;
  }
  .login-card {
    max-height: none;
    padding: 10px;
  }
}

/* ═══════════════════════════════════════════════════
   LOGIN SCREEN
═══════════════════════════════════════════════════ */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  flex: 1; padding: clamp(12px,4vw,24px);
  position: relative; z-index: 1;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}

.login-card {
  background: linear-gradient(160deg, rgba(40,10,20,.96), rgba(10,3,7,.96));
  border: 1px solid rgba(245,200,66,.22);
  border-radius: clamp(14px,3vw,22px);
  padding: clamp(22px,5vw,32px);
  width: 100%; max-width: 400px;
  text-align: center;
  box-shadow: 0 0 50px rgba(200,16,46,.18), 0 16px 50px rgba(0,0,0,.5);
}

.login-icon { font-size: clamp(36px,8vw,52px); margin-bottom: 8px }

.login-card h2 {
  font-family: var(--fh); font-size: clamp(22px,5vw,28px);
  color: var(--gold); margin-bottom: 3px; letter-spacing: 1px;
}
.login-sub { color: var(--txm); font-size: clamp(11px,2.5vw,13px); margin-bottom: 16px; line-height: 1.55 }

.discord-notice {
  background: rgba(88,101,242,.1);
  border: 1px solid rgba(88,101,242,.28);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 12px;
  font-size: clamp(11px,2.5vw,12px); color: #7b8ff7; text-align: left; line-height: 1.5;
}

.login-tabs {
  display: flex; gap: 3px;
  background: rgba(0,0,0,.3); border-radius: 10px; padding: 3px; margin-bottom: 14px;
}
.ltab {
  flex: 1; padding: 7px 4px; border-radius: 7px; border: none;
  background: none; color: var(--txm);
  font-family: var(--fb); font-size: clamp(11px,2.5vw,13px); font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.ltab.on {
  background: linear-gradient(135deg, rgba(200,16,46,.38), rgba(100,8,23,.5));
  border: 1px solid rgba(245,200,66,.28); color: var(--gold);
}

.login-input {
  width: 100%;
  padding: clamp(10px,2.5vw,12px) clamp(12px,3vw,16px);
  border-radius: clamp(8px,2vw,12px);
  background: rgba(255,255,255,.04);
  border: 1.5px solid rgba(245,200,66,.18);
  color: var(--tx); font-family: var(--fm); font-size: clamp(13px,3vw,14px);
  outline: none; transition: border-color .15s; margin-bottom: 6px;
  /* Prevent zoom on iOS */
  font-size: max(16px, clamp(13px,3vw,14px));
}
.login-input:focus { border-color: var(--gold) }
.login-input::placeholder { color: var(--txf) }

.login-hint {
  font-size: clamp(10px,2.2vw,11px); color: var(--txf); margin-bottom: 10px; text-align: left;
}

.confirm-card {
  background: var(--sur); border: 1.5px solid rgba(245,200,66,.18);
  border-radius: clamp(8px,2vw,12px); padding: clamp(10px,2.5vw,12px);
  margin-bottom: 8px; text-align: left;
}
.confirm-card .cc-name { font-size: clamp(13px,3vw,15px); font-weight: 800 }
.confirm-card .cc-id   { font-family:var(--fm); font-size:clamp(10px,2.2vw,11px); color:var(--txm) }
.confirm-card .cc-pts  { font-size:clamp(11px,2.5vw,13px); color:var(--gold); margin-top:3px }
.confirm-btns          { display:flex; gap:7px; margin-top:9px }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: clamp(10px,2.5vw,12px) clamp(18px,4vw,24px);
  border-radius: clamp(8px,2vw,12px);
  font-family: var(--fh); font-size: clamp(13px,3vw,15px); font-weight: 700;
  letter-spacing: .3px; cursor: pointer; border: none;
  transition: transform .15s, opacity .15s;
  min-height: 44px;
}
.btn:hover { transform: translateY(-1px) }
.btn-acc {
  background: linear-gradient(135deg,#d4a500,#f5c842);
  color: #1a0800; box-shadow: 0 4px 14px rgba(245,200,66,.28);
}
.btn-ghost { background: var(--sur); border: 1px solid rgba(255,255,255,.1); color: var(--tx) }
.btn-full  { width: 100%; margin-top: 10px }

/* ═══════════════════════════════════════════════════
   RESPONSIVE OVERHAUL
   Breakpoints (device width, portrait unless noted):
   320px  — iPhone SE 1st gen, old Androids
   360px  — Most compact Androids (Galaxy A series)
   375px  — iPhone 6/7/8/SE2, base iPhones
   390px  — iPhone 14/15/16
   428px  — iPhone 14/15/16 Plus/Max
   768px  — iPad mini / iPad portrait / medium tablets
   1024px — iPad landscape / large tablets / small laptops
   1280px — Laptop 13"
   1440px — Desktop standard
═══════════════════════════════════════════════════ */

/* ── Game table fluid vars per breakpoint ── */
/* Default (320-359): tightest */
:root {
  --topbar-h:  clamp(44px, 7vh, 52px);
  --circle-r:  clamp(100px, 26vmin, 180px);
  --die-s:     clamp(32px,  7vmin,  52px);
  --chip-s:    clamp(42px, 9vmin, 58px);
  --center-w: clamp(120px, 17vw, 175px);
  --panel-fs:  clamp(24px,  5.5vmin, 58px);
}

/* ── 360px+ (compact Android) ── */
@media (min-width: 360px) {
  :root {
    --circle-r: clamp(108px, 26vmin, 180px);
    --die-s:    clamp(34px, 7vmin, 54px);
    --chip-s:   clamp(44px, 9.5vmin, 62px);
  }
}

/* ── 480px+ (phablet / large phone landscape) ── */
@media (min-width: 480px) {
  :root {
    --center-w: clamp(130px, 17vw, 175px);
    --panel-fs:  clamp(30px, 5.5vmin, 58px);
  }
}

/* ── 768px+ (tablet portrait) ── */
@media (min-width: 768px) {
  :root {
    --topbar-h: clamp(52px, 6.5vh, 60px);
    --circle-r: clamp(150px, 18vmin, 190px);
    --die-s:    clamp(44px, 6vmin, 58px);
    --chip-s:   clamp(50px, 7.5vmin, 64px);
    --center-w: clamp(150px, 17vw, 185px);
    --panel-fs: clamp(40px, 5vmin, 62px);
  }
  .chip-row { gap: 14px }
  .modal-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) }
  .login-card { padding: 36px 40px }
}

/* ── 1024px+ (tablet landscape / laptop) ── */
@media (min-width: 1024px) {
  :root {
    --topbar-h: 56px;
    --circle-r: 180px;
    --die-s:    58px;
    --chip-s:   62px;
    --center-w: 170px;
    --panel-fs: 58px;
  }
  .chip-row { gap: 16px }
  .action-bar { max-width: 700px; margin: 0 auto; width: 100% }
  .table-main { padding: 12px 20px 8px }
}

/* ── Landscape phone (height ≤ 500px) ── */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --topbar-h: 40px;
    --circle-r: clamp(80px, 20vh, 130px);
    --die-s:    clamp(20px, 4.5vh, 32px);
    --chip-s:   clamp(34px, 6.5vh, 44px);
    --center-w: clamp(100px, 16vh, 145px);
    --panel-fs: clamp(20px, 4.5vh, 36px);
  }
  .panel-deco       { display: none }
  .panel-total-wrap { margin-top: 2px; min-height: 20px }
  .side-panel { min-height: clamp(90px, 22vh, 180px) }
  .table-main       { padding: 4px 6px 2px }
  .chip-row         { padding-bottom: 4px }
  .chip             { width: var(--chip-s) !important; height: var(--chip-s) !important }
  .adv-btn          { padding: 5px 14px; font-size: 12px }
  .act-btn          { height: 42px; font-size: 13px }
  .action-bar       { padding-bottom: calc(4px + var(--sai-bottom)) }
  /* Hide topbar labels in landscape */
  .tbtn-label       { display: none }
  .exit-label       { display: none }
}

/* ── Very small screens (320-359px) ── */
@media (max-width: 359px) {
  .tbtn-label     { display: none }
  .exit-label     { display: none }
  .chip-row       { gap: 5px }
  .adv-btn        { font-size: 11px; padding: 5px 12px }
  .login-card     { padding: 18px 16px }
  .ltab           { font-size: 11px; padding: 7px 3px }
}

/* ── 360-374px (compact Android like Galaxy A) ── */
@media (max-width: 374px) {
  .login-card h2  { font-size: 20px }
  .ltab           { font-size: 11px }
}

/* ── Login card on large screens: center with max-width ── */
@media (min-width: 600px) {
  #login-screen { align-items: center }
  .login-card { max-width: 440px }
}

/* ── Tablet: game uses more horizontal space ── */
@media (min-width: 768px) {
  .sheet { max-width: 600px }
  .history-sheet { max-width: 700px }
}

/* ── Desktop: constrain game width ── */
@media (min-width: 1024px) {
  .table-wrap   { max-width: 960px; margin: 0 auto; width: 100% }
}

/* ── Ultra-wide: don't stretch too much ── */
@media (min-width: 1440px) {
  .table-wrap { max-width: 1100px }
}

/* ── Ensure login card scrollable on very short screens ── */
@media (max-height: 600px) and (orientation: portrait) {
  #login-screen { align-items: flex-start; padding-top: 12px }
  .login-card   { max-height: none }
}

/* ── Topbar: compress on small screens ── */
@media (max-width: 430px) {
  .tbtn:not(.tbtn-icon) .tbtn-label { display: none }
  .topbar { padding: 0 10px; gap: 6px }
}

/* ── Modal sizing on tablets+ ── */
@media (min-width: 768px) {
  .dialog-box   { padding: 28px 32px }
  .custom-box   { border-radius: 18px; max-width: 400px; align-self: center }
  .custom-overlay { align-items: center }
}

/* ── Game screen layout ── */
.game-hidden { display: none !important }
#game-screen {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}


/* ── Register field status ── */
.field-wrap {
  position: relative;
}
.field-wrap .field-status {
  position: absolute;
  right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 15px; pointer-events: none;
  display: none;
}
.field-wrap .login-input { padding-right: 38px }

.field-wrap.checking .field-status::before { content: '' }
.field-wrap.checking .field-status {
  display: flex; align-items: center;
}
.field-wrap.checking .field-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(245,200,66,.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.field-wrap.field-ok .field-status { display: flex; align-items: center; color: var(--green) }
.field-wrap.field-ok .field-status::after { content: '✅' }
.field-wrap.field-err .field-status { display: flex; align-items: center; color: var(--red) }
.field-wrap.field-err .field-status::after { content: '❌' }
.field-wrap.field-err .login-input { border-color: rgba(239,68,68,.55) }

.field-msg { display: none }


/* ── iPhone 11/12/13/14/15 (375-430px) ── */
@media (max-width: 430px) and (max-height: 932px) {
  .logo .txt { max-width: clamp(0px, 14vw, 60px) }
  .exit-btn .exit-label { display: none }
  .tbtn-label { display: none }
  .top-pts { max-width: min(180px, 36vw) }
  .top-pts .amt { max-width: 130px; font-size: clamp(14px, 3.5vw, 18px) }
}

/* ── iPhone SE / small Android (≤375px) ── */
@media (max-width: 375px) {
  .logo .txt { display: none }
  .top-pts { max-width: min(160px, 40vw) }
  .top-pts .amt { font-size: 14px; max-width: 105px }
}


/* ── Custom amount suggestions ── */
.custom-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px;
}
.custom-suggest-btn {
  padding: 5px 12px; border-radius: 8px;
  background: rgba(245,200,66,.08); border: 1px solid rgba(245,200,66,.25);
  color: var(--gold); font-family: var(--fb); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.custom-suggest-btn:hover { background: rgba(245,200,66,.18); border-color: var(--gold) }
.custom-suggest-btn:active { transform: scale(.95) }


/* ── Fixed chips layout ── */
.chip-row-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
  padding: 0 clamp(6px, 2vw, 12px);
}
.chip-fixed {
  flex-shrink: 0;
  /* Override chip-track mask on these */
  position: relative;
  z-index: 2;
}
.chip-fixed.chip-allin {
  background: linear-gradient(135deg,#8a0000,#3a0000);
  border-color: #f55; color: #faa;
  box-shadow: 0 4px 12px rgba(255,0,0,.4);
}
.chip-fixed.chip-allin.selected {
  box-shadow: 0 0 0 3px #f55, 0 8px 20px rgba(255,80,80,.4) !important;
}
/* chip-track takes remaining space */
.chip-row-wrapper .chip-track {
  flex: 1;
  min-width: 0;
}


.chip-track.has-selected {
  overflow: visible;
}
/* Chip-row-wrapper cũng cần overflow visible để chip nổi lên */
.chip-row-wrapper {
  overflow: visible;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
  padding: 0 clamp(6px,2vw,10px);
}




/* ── Bottom bar: chip + action trong cùng stacking context ── */
.bottom-bar {
  flex-shrink: 0;
  position: relative;    /* stacking context riêng */
  z-index: 20;
  overflow: visible;     /* chip có thể nổi lên */
}

.chip-area {
  position: relative;
  overflow: visible;
  padding: clamp(8px,2vmin,12px) 0 clamp(10px,2.5vmin,16px);
  z-index: 2;
}

/* ══════════════════════════════════════════════════════════════
   SHOP RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .shop-nav { width: 64px; }
  .shop-nav-title { display: none; }
  .sni-label { display: none; }
  .shop-nav-close { font-size: 9px; padding: 8px 4px; }
  .snb-label { display: none; }
  .shop-main { padding: 12px 10px; }
  .shop-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
}
@media (max-width: 320px) {
  .shop-nav { width: 52px; }
  .shop-nav-logo { font-size: 20px; }
  .sni-icon { font-size: 16px; }
  .shop-cards { grid-template-columns: 1fr; }
}
@media (orientation: landscape) and (max-height: 440px) {
  .shop-nav-header { padding: 8px; }
  .shop-main { padding: 10px; }
  .ssh-icon { font-size: 22px; }
  .ssh-title { font-size: 14px; }
}

/* ══════════════════════════════════════════════════════════════
   LOGIN SCREEN ADS — 2 rìa + bottom
   Chỉ hiện khi #login-screen visible (display:flex)
══════════════════════════════════════════════════════════════ */

/* Login screen phải là relative để ads con định vị */
#login-screen {
  position: relative;
  overflow: hidden;
}

/* Base cho tất cả login ads — ẩn mặc định */
.login-ad {
  display: none;
  position: absolute;
  z-index: 5;
  overflow: hidden;
  background: transparent;
}

/* Chỉ hiện khi login-screen đang active (flex) */
#login-screen.login-ads-ready .login-ad {
  display: block;
}

/* ── Rìa trái ── */
.login-ad-left {
  left: 0;
  top: 0;
  bottom: 90px; /* tránh bottom banner */
  width: clamp(80px, 10vw, 160px);
}

/* ── Rìa phải ── */
.login-ad-right {
  right: 0;
  top: 0;
  bottom: 90px;
  width: clamp(80px, 10vw, 160px);
}

/* ── Bottom banner ── */
.login-ad-bottom {
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(60px, 8vh, 90px);
}

/* Login card tự căn giữa phần còn lại */
#login-screen.login-ads-ready .login-card {
  margin-left: clamp(80px, 10vw, 160px);
  margin-right: clamp(80px, 10vw, 160px);
  margin-bottom: clamp(60px, 8vh, 90px);
}

/* ── Responsive: màn nhỏ < 480px — ẩn rìa, chỉ giữ bottom ── */
@media (max-width: 480px) {
  .login-ad-left,
  .login-ad-right {
    display: none !important;
  }
  .login-ad-bottom {
    display: block;
  }
  #login-screen.login-ads-ready .login-card {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: clamp(60px, 8vh, 90px);
  }
}

/* ── Màn rất nhỏ < 360px — ẩn hết ── */
@media (max-width: 360px) {
  .login-ad { display: none !important; }
  #login-screen.login-ads-ready .login-card {
    margin: 0 auto;
  }
}

/* ── Portrait cao < 700px — thu nhỏ bottom ── */
@media (max-height: 700px) and (orientation: portrait) {
  .login-ad-bottom {
    height: 50px;
  }
  #login-screen.login-ads-ready .login-card {
    margin-bottom: 50px;
  }
}