/* BLF v1.0.0 DESKTOP – Google Chrome desktop compatibility layer */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html,body{width:100%;min-height:100%;margin:0;padding:0}
body{min-height:100vh;overflow-x:hidden}
img,svg,video,canvas{max-width:100%;height:auto}
input,select,textarea{max-width:100%}

/* BLF v1.0.7 MOBILE / RESPONSIVE – iOS Chrome + Android Chrome */
:root{--blf-safe-top:env(safe-area-inset-top,0px);--blf-safe-right:env(safe-area-inset-right,0px);--blf-safe-bottom:env(safe-area-inset-bottom,0px);--blf-safe-left:env(safe-area-inset-left,0px)}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;overflow-x:hidden}
body{max-width:100vw;overflow-x:hidden;padding-left:var(--blf-safe-left);padding-right:var(--blf-safe-right)}
button,a,input,select,textarea{max-width:100%}button,a,[role="button"]{touch-action:manipulation}input,select,textarea{font-size:16px}img{max-width:100%;height:auto}
@supports (height:100dvh){body{min-height:100dvh}.picker,.confirm,.modal-bg,.logout-modal,.pack-opening,.v37-confirm,.v24-card-viewer{min-height:100dvh}}

@media (max-width:900px){
  body{background-attachment:scroll!important}
  .page{min-height:100svh!important;padding:calc(14px + var(--blf-safe-top)) max(14px,var(--blf-safe-right)) calc(20px + var(--blf-safe-bottom)) max(14px,var(--blf-safe-left))!important}
  .account{position:relative!important;inset:auto!important;width:100%!important;min-width:0!important;margin:0 0 14px!important;padding:13px 15px!important}
  .account .user,.account .money{justify-content:flex-start!important;overflow-wrap:anywhere}
  .menu{position:relative!important;inset:auto!important;transform:none!important;width:100%!important;margin:0 0 14px!important;gap:10px!important}
  .menu-btn,.album-btn{min-height:46px!important;padding:12px 14px!important;font-size:.84rem!important}
  .message-board{position:relative!important;inset:auto!important;width:100%!important;margin:0 0 14px!important}
  .message-list{max-height:250px!important}.message-input-row{gap:7px!important}.message-send{flex-basis:42px!important;width:42px!important;height:42px!important}
  .new-pack-btn,.admin-btn{position:relative!important;inset:auto!important;width:100%!important;margin:10px 0 0!important;min-height:46px!important}
  .album-panel{width:min(420px,100vw)!important;height:100dvh!important;padding:calc(20px + var(--blf-safe-top)) max(16px,var(--blf-safe-right)) calc(20px + var(--blf-safe-bottom)) 16px!important}
  .logout-box{max-height:calc(100dvh - 32px);overflow:auto}.logout-actions{flex-wrap:wrap}.logout-actions button{min-width:120px;min-height:44px}
  .pack-cards{gap:8px!important;padding:18vh 10px 12vh!important;flex-wrap:nowrap!important}.reveal-card{width:min(18vw,145px)!important;min-width:0!important}.pack-done{bottom:calc(3% + var(--blf-safe-bottom))!important;width:90%;text-align:center}

  .box{width:calc(100% - 20px)!important;max-width:none!important;margin:calc(10px + var(--blf-safe-top)) auto calc(10px + var(--blf-safe-bottom))!important;padding:64px 14px 18px!important;min-height:calc(100svh - 20px)!important}
  .box h1{font-size:clamp(1.35rem,7vw,2rem);overflow-wrap:anywhere}
  button.close,.close{position:fixed!important;top:calc(10px + var(--blf-safe-top))!important;right:calc(10px + var(--blf-safe-right))!important;width:44px!important;height:44px!important;min-width:44px!important;z-index:3000!important}

  .market{grid-template-columns:repeat(auto-fit,minmax(min(155px,100%),1fr))!important;gap:12px!important}.listing{padding:10px!important}.listing img{width:min(100%,220px)!important}.timer{font-size:14px!important}.dialog{width:min(520px,calc(100vw - 24px))!important;max-height:calc(100dvh - 24px - var(--blf-safe-top) - var(--blf-safe-bottom))!important;padding:54px 16px 18px!important}.actions{flex-wrap:wrap}.actions button{flex:1 1 130px;min-height:44px}

  .trade{grid-template-columns:1fr!important;gap:14px!important}.frame{min-height:240px!important;padding:10px!important}.frame img{max-width:125px!important;max-height:175px!important}.plus{height:220px!important;font-size:64px!important}.partner{font-size:16px!important;min-height:46px!important}.accept,.addmore,.withdraw{min-height:46px!important}.offered{gap:7px!important}.offeredCard img{max-width:95px!important;max-height:135px!important}.pickbox{width:calc(100vw - 20px)!important;max-height:calc(100dvh - 20px - var(--blf-safe-top) - var(--blf-safe-bottom))!important;overflow:auto!important}.picker{padding:calc(10px + var(--blf-safe-top)) 10px calc(10px + var(--blf-safe-bottom))!important}.picker .albums{grid-template-columns:repeat(2,minmax(0,1fr))!important}.picker .cards{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))!important}.confirm{padding:calc(12px + var(--blf-safe-top)) 12px calc(12px + var(--blf-safe-bottom))!important}.confirm .dialog{max-height:calc(100dvh - 24px)!important;overflow:auto!important}

  .v24-album-shell{min-height:100dvh!important;padding:calc(54px + var(--blf-safe-top)) 8px calc(10px + var(--blf-safe-bottom))!important;overflow:auto!important}.album-close{position:fixed!important;top:calc(8px + var(--blf-safe-top))!important;right:calc(8px + var(--blf-safe-right))!important;z-index:10020!important}.v24-closed{width:min(86vw,430px)!important;height:min(70dvh,600px)!important}.v24-open{width:98vw!important;height:min(82dvh,720px)!important;min-height:0!important}.v24-book.v74-book{padding:8px 8px 54px!important}.v74-spread{grid-template-columns:minmax(0,1fr) 16px minmax(0,1fr)!important}.v74-spine{width:16px!important}.v74-page{padding:8px!important}.v74-page .v24-page-head{height:32px!important;margin-bottom:5px!important}.v74-page-title,.v24-page-head{font-size:.58rem!important}.v24-page-head small{display:none!important}.v74-pocket-grid{gap:4px!important;height:calc(100% - 38px)!important}.v24-pocket.empty span{font-size:7px!important}.v33-duplicate-badge{min-width:19px!important;height:19px!important;font-size:9px!important;border-width:1px!important}.v74-album-pager{bottom:7px!important}.v70-album-pager .v73-page-arrow{width:38px!important;min-width:38px!important;height:34px!important}.v37-card-options{width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important;overflow:auto!important;flex-direction:column!important;gap:12px!important;padding:54px 12px 14px!important}.v37-card-actions{width:100%!important}.v24-card-viewer-card{max-width:min(76vw,380px)!important;max-height:55dvh!important}.v24-card-viewer-card img{max-height:55dvh!important}.v24-card-viewer-close{top:calc(8px + var(--blf-safe-top))!important;right:calc(8px + var(--blf-safe-right))!important}.v37-dialog{width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important;overflow:auto!important;padding:20px 14px!important}.v37-dialog>div:last-child{flex-wrap:wrap!important}.v37-dialog button{min-width:120px!important}

  .dashboard{grid-template-columns:1fr!important}.panel.full{grid-column:auto!important}.page>.topbar{align-items:flex-start!important;flex-wrap:wrap!important}.panel{padding:14px!important;border-radius:16px!important}.upload-grid,.edit-grid{grid-template-columns:1fr!important}.field.wide,.upload-slots,.upload-cards-grid{grid-column:auto!important}.upload-cards-grid,.upload-slots{grid-template-columns:repeat(2,minmax(0,1fr))!important}.pack-controls,.coin-tools,.album-tools{grid-template-columns:1fr!important}.pack-preview,.album-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}.user-row{grid-template-columns:1fr!important}.user-row .btn{width:100%!important}.log-row{grid-template-columns:1fr!important;gap:5px!important}.log-list,.user-list{max-height:60dvh!important}.modal-bg{padding:calc(8px + var(--blf-safe-top)) 8px calc(8px + var(--blf-safe-bottom))!important}.modal{width:100%!important;max-height:calc(100dvh - 16px - var(--blf-safe-top) - var(--blf-safe-bottom))!important;padding:14px!important;border-radius:16px!important}.modal .close{position:sticky!important;top:0!important;right:0!important;float:right!important}.toolbar>*{flex:1 1 150px!important;min-width:0!important}.cards{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))!important}

  .rules{padding-left:20px!important}.rules ol{padding-left:20px!important}.rules li,.box p{overflow-wrap:anywhere}
}

@media (max-width:480px){
  .page{padding-left:10px!important;padding-right:10px!important}.account,.message-board{border-radius:14px!important}.message-board-title{padding:11px 12px 7px!important}.message-list{padding-left:12px!important;padding-right:12px!important}.message-item{font-size:.72rem!important}.menu-btn,.album-btn{font-size:.76rem!important;letter-spacing:.02em!important}
  .pack-title{top:7%!important;font-size:20px!important}.pack-cards{padding-left:5px!important;padding-right:5px!important;gap:4px!important}.reveal-card{border-width:1px!important;border-radius:7px!important}.reveal-placeholder{padding:3px!important}.reveal-placeholder span{font-size:7px!important}
  .market{grid-template-columns:1fr 1fr!important}.listing{font-size:.78rem!important}.listing img{max-height:210px;object-fit:contain}.seller,.price{overflow-wrap:anywhere}
  .picker .albums{grid-template-columns:1fr!important}.picker .cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}.offeredCard img{max-width:82px!important;max-height:116px!important}
  .v24-open{height:min(78dvh,620px)!important}.v74-spread{grid-template-columns:minmax(0,1fr) 10px minmax(0,1fr)!important}.v74-spine{width:10px!important}.v74-page{padding:5px!important}.v74-pocket-grid{gap:2px!important}.v24-pocket.filled{padding:2px!important}.v24-pocket.empty:before{inset:2px!important}.v24-pocket.empty span{display:none!important}.v24-cover-name{font-size:clamp(16px,5vw,26px)!important;overflow-wrap:anywhere}.v24-cover-hint{font-size:9px!important}
  .upload-cards-grid,.upload-slots{grid-template-columns:1fr!important}.pack-preview,.album-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}.topbar h1{font-size:24px!important}.topbar a{width:100%;text-align:center}.btn{min-height:44px}.modal-actions .btn{flex:1 1 140px}
}

@media (max-width:900px) and (orientation:landscape){
  .page{padding-top:calc(8px + var(--blf-safe-top))!important}.account{padding:9px 12px!important}.account .money{margin-top:6px!important}.logout-btn{margin-top:8px!important;padding:8px 12px!important}.menu{grid-template-columns:repeat(2,minmax(0,1fr))!important}.message-list{max-height:150px!important}
  .trade{grid-template-columns:minmax(0,1fr) 130px minmax(0,1fr)!important;gap:10px!important}.frame{min-height:190px!important}.plus{height:170px!important;font-size:52px!important}.frame img{max-width:100px!important;max-height:140px!important}.wait{min-height:0!important}.box{padding-top:54px!important}
  .v24-album-shell{padding-top:calc(46px + var(--blf-safe-top))!important}.v24-open{width:96vw!important;height:calc(100dvh - 58px - var(--blf-safe-top) - var(--blf-safe-bottom))!important}.v24-closed{height:calc(100dvh - 64px)!important;width:min(42vw,360px)!important}.v37-card-options{flex-direction:row!important}.v24-card-viewer-card{max-height:72dvh!important;max-width:42vw!important}.v24-card-viewer-card img{max-height:72dvh!important}.v37-card-actions{width:min(300px,42vw)!important}
  .modal{max-height:calc(100dvh - 12px - var(--blf-safe-top) - var(--blf-safe-bottom))!important}.log-list,.user-list{max-height:48dvh!important}
}

@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* BLF v1.0.8 MOBILE FINETUNE */
@media (max-width:900px){
  /* Compact ~85% visual density without browser zoom. */
  body{font-size:90%!important}
  .page{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-areas:"account" "menu" "cards" "messages" "admin"!important;align-content:start!important;gap:10px!important;min-height:100dvh!important;overflow:visible!important}
  .account{grid-area:account!important;margin:0!important;padding:10px 12px!important}
  .menu{grid-area:menu!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;margin:0!important}
  .menu-btn,.album-btn{min-height:38px!important;padding:8px 9px!important;font-size:.70rem!important;line-height:1.15!important;letter-spacing:.015em!important;white-space:normal!important;overflow-wrap:anywhere!important}
  .admin-btn{grid-area:admin!important;position:relative!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;width:100%!important;margin:0!important;min-height:38px!important;padding:8px 10px!important;font-size:.70rem!important;align-self:start!important}
  .message-board{grid-area:messages!important;margin:0!important}
  .message-list{max-height:150px!important}

  /* Pending/opened cards live below the menu and are never hidden behind it. */
  .won-cards{grid-area:cards!important;position:relative!important;left:auto!important;top:auto!important;transform:none!important;width:100%!important;height:auto!important;min-height:0!important;display:block!important;margin:0!important;padding:4px 0 6px!important;overflow:visible!important;z-index:4!important}
  .won-cards:empty{display:none!important}
  .opened-pack-layer{position:relative!important;left:auto!important;top:auto!important;width:100%!important;height:auto!important;min-height:0!important;transform:none!important;margin:0 0 8px!important;pointer-events:none!important}
  .opened-pack-cards{height:auto!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;align-items:start!important;justify-items:center!important;gap:5px!important;pointer-events:none!important}
  .opened-pack-layer .won-card{width:100%!important;max-width:92px!important;flex:none!important;aspect-ratio:.70!important;pointer-events:auto!important}
  .opened-pack-layer .won-card.selected{transform:translateY(-4px) scale(1.04)!important}
  .won-hint{position:relative!important;left:auto!important;top:auto!important;transform:none!important;margin:4px 0 0!important;font-size:.62rem!important;line-height:1.25!important;text-align:center!important}

  /* Pack opening: cards always get a visible area below the title. */
  .pack-window{width:calc(100vw - 16px)!important;height:calc(100dvh - 16px - var(--blf-safe-top) - var(--blf-safe-bottom))!important;max-height:none!important;overflow:auto!important;border-radius:16px!important}
  .pack-window .pack-title{position:relative!important;left:auto!important;top:auto!important;transform:none!important;margin:46px 8px 8px!important;text-align:center!important;font-size:16px!important;line-height:1.2!important}
  .pack-window .pack-cards,.pack-cards{position:relative!important;inset:auto!important;width:100%!important;min-height:0!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;align-items:start!important;justify-items:center!important;gap:5px!important;padding:8px!important;opacity:1!important;transform:none!important;overflow:visible!important}
  .pack-window .reveal-card,.reveal-card{width:100%!important;max-width:105px!important;min-width:0!important;transform:none!important}
  .pack-done{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;width:auto!important;margin:8px 12px 14px!important;text-align:center!important;font-size:.68rem!important;line-height:1.25!important}
  .pack-ready{padding:50px 12px 16px!important}.pack-ready h2{font-size:1rem!important;line-height:1.25!important}.pack-image{width:min(380px,74vw)!important;max-height:58dvh!important}

  /* Login/opening pages: prevent text/control collisions. */
  .login-box{padding:25px 18px!important;border-radius:18px!important}.fields,.buttons{gap:12px!important}.fields{margin-bottom:16px!important}
  .login-box input{padding:13px 15px!important}.gold-btn{padding:12px 18px!important;font-size:.88rem!important;line-height:1.2!important;white-space:normal!important}
  .box p,.box li,.modal p,.rules li{line-height:1.45!important;overflow-wrap:anywhere!important;word-break:normal!important}
  .release-version{font-size:.52rem!important;bottom:3px!important}
}

@media (max-width:480px){
  .page{gap:8px!important;padding:calc(8px + var(--blf-safe-top)) 8px calc(14px + var(--blf-safe-bottom))!important}
  .account{padding:8px 10px!important}.account .user{font-size:.78rem!important}.account .money{font-size:.80rem!important;margin-top:6px!important}.logout-btn{margin-top:7px!important;padding:7px 10px!important;font-size:.68rem!important}
  .menu{gap:5px!important}.menu-btn,.album-btn,.admin-btn{min-height:35px!important;padding:7px 6px!important;font-size:.64rem!important}
  .message-board-title{font-size:.72rem!important;padding:8px 10px 5px!important}.message-list{max-height:125px!important}.message-input-row{padding:7px!important}.message-input{padding:8px 9px!important;font-size:16px!important}.message-send{width:36px!important;height:36px!important;flex-basis:36px!important}
  .opened-pack-cards,.pack-window .pack-cards,.pack-cards{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:3px!important}.opened-pack-layer .won-card{max-width:72px!important}.pack-window .reveal-card,.reveal-card{max-width:76px!important}
}

@media (max-width:900px) and (orientation:landscape){
  body{font-size:86%!important}
  .page{grid-template-columns:minmax(145px,22vw) minmax(0,1fr) minmax(180px,28vw)!important;grid-template-areas:"account menu messages" "admin cards messages"!important;align-items:start!important;gap:7px!important;padding:calc(6px + var(--blf-safe-top)) max(8px,var(--blf-safe-right)) calc(8px + var(--blf-safe-bottom)) max(8px,var(--blf-safe-left))!important}
  .account{padding:7px 8px!important}.account .user{font-size:.66rem!important}.account .money{font-size:.68rem!important;margin-top:4px!important}.logout-btn{margin-top:5px!important;padding:6px 7px!important;font-size:.58rem!important}
  .menu{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important}.menu-btn,.album-btn,.admin-btn{min-height:31px!important;padding:5px 6px!important;font-size:.56rem!important}
  .admin-btn{width:100%!important}
  .message-board{width:100%!important}.message-board-title{padding:7px 8px 4px!important;font-size:.62rem!important}.message-list{max-height:calc(100dvh - 120px)!important;padding:2px 8px 6px!important}.message-item{font-size:.60rem!important;padding:4px 0!important;min-height:0!important}.message-input-row{padding:5px!important}.message-input{padding:6px 7px!important}.message-send{width:31px!important;height:31px!important;flex-basis:31px!important}
  .won-cards{padding:0!important}.opened-pack-layer{margin-bottom:4px!important}.opened-pack-cards{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:3px!important}.opened-pack-layer .won-card{max-width:58px!important}.won-hint{font-size:.52rem!important;margin-top:2px!important}
  .pack-window{width:calc(100vw - 18px)!important;height:calc(100dvh - 12px - var(--blf-safe-top) - var(--blf-safe-bottom))!important}.pack-window .pack-title{margin-top:40px!important;font-size:13px!important}.pack-window .pack-cards,.pack-cards{grid-template-columns:repeat(5,minmax(0,1fr))!important;padding:5px 10vw!important;gap:5px!important}.pack-window .reveal-card,.reveal-card{max-width:82px!important}.pack-done{margin:4px 8px 8px!important;font-size:.58rem!important}.pack-ready{padding:38px 10px 8px!important}.pack-image{width:min(300px,45vw)!important;max-height:62dvh!important}
  .login-box{width:min(380px,70vw)!important;padding:16px 18px!important}.fields{margin-bottom:10px!important}.fields,.buttons{gap:8px!important}.login-box input{padding:10px 13px!important}.gold-btn{padding:9px 15px!important;font-size:.76rem!important}
}

/* BLF v1.0.9 MOBILE CENTERING + HOME NAV ORDER */
@media (max-width:900px){
  /* Welcome screen: compact, readable and truly centered. */
  body:has(.continue-btn) .page{min-height:100dvh!important;display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:center!important;text-align:center!important;padding:calc(22px + var(--blf-safe-top)) max(18px,var(--blf-safe-right)) calc(22px + var(--blf-safe-bottom)) max(18px,var(--blf-safe-left))!important;gap:18px!important}
  body:has(.continue-btn) .page h1{width:min(92vw,620px)!important;max-width:620px!important;margin:0!important;font-size:clamp(20px,6.1vw,27px)!important;line-height:1.28!important;letter-spacing:.02em!important;-webkit-text-stroke:1.35px #f5c84c!important;text-shadow:-2px -2px 0 #000,0 -2px 0 #000,2px -2px 0 #000,-2px 0 0 #000,2px 0 0 #000,-2px 2px 0 #000,0 2px 0 #000,2px 2px 0 #000,0 0 12px rgba(0,0,0,.9)!important;transform:none!important;white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important}
  body:has(.continue-btn) .continue-btn{width:auto!important;min-width:132px!important;max-width:210px!important;margin:0 auto!important;padding:11px 28px!important;font-size:.82rem!important;line-height:1.15!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}

  /* Login stays centered on all mobile orientations. */
  body:has(.login-box) .page{min-height:100dvh!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:calc(18px + var(--blf-safe-top)) max(14px,var(--blf-safe-right)) calc(18px + var(--blf-safe-bottom)) max(14px,var(--blf-safe-left))!important}
  body:has(.login-box) .login-box{margin:auto!important}

  /* Logged-in home: account -> menu -> admin -> opened cards -> message board. */
  body:has(#adminBtn) .page{grid-template-areas:"account" "menu" "admin" "cards" "messages"!important;justify-items:stretch!important;max-width:760px!important;margin:0 auto!important}
  body:has(#adminBtn) .admin-btn{grid-area:admin!important;justify-self:stretch!important;margin:0!important}
  body:has(#adminBtn) .message-board{grid-area:messages!important}
  body:has(#adminBtn) .won-cards{grid-area:cards!important}
}

@media (max-width:900px) and (orientation:landscape){
  body:has(.continue-btn) .page{gap:12px!important;padding-top:calc(10px + var(--blf-safe-top))!important;padding-bottom:calc(10px + var(--blf-safe-bottom))!important}
  body:has(.continue-btn) .page h1{width:min(76vw,650px)!important;font-size:clamp(18px,4vw,24px)!important;line-height:1.18!important}
  body:has(.continue-btn) .continue-btn{min-width:120px!important;padding:9px 24px!important;font-size:.72rem!important}
  body:has(#adminBtn) .page{grid-template-columns:minmax(145px,22vw) minmax(0,1fr) minmax(180px,28vw)!important;grid-template-areas:"account menu messages" "admin cards messages"!important;max-width:none!important;margin:0!important}
}

/* BLF v1.0.10 - robust mobile centering and deterministic home order */
@media (max-width:900px){
  /* Welcome page: target its real classes; no :has() dependency. */
  body .page > h1 + .continue-btn{width:auto!important;min-width:118px!important;max-width:180px!important;align-self:center!important;margin:0 auto!important;padding:9px 24px!important;font-size:.76rem!important;line-height:1.15!important;white-space:nowrap!important}
  body .page > h1:has(+ .continue-btn){width:min(88vw,520px)!important;max-width:520px!important;margin:0 auto 18px!important;font-size:clamp(17px,5vw,22px)!important;line-height:1.34!important;letter-spacing:0!important;-webkit-text-stroke:1px #f5c84c!important;text-shadow:-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000,0 0 9px #000!important;transform:none!important;white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important}
  body .page:has(> h1 + .continue-btn){min-height:100dvh!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;text-align:center!important;gap:0!important;padding:calc(18px + var(--blf-safe-top)) max(16px,var(--blf-safe-right)) calc(18px + var(--blf-safe-bottom)) max(16px,var(--blf-safe-left))!important}

  /* Login remains centered. */
  body .page:has(> .login-box){min-height:100dvh!important;display:flex!important;align-items:center!important;justify-content:center!important}
  .login-box{margin:auto!important}

  /* Logged-in page: explicit flex order overrides source order and old grids. */
  body .page:has(> #adminBtn){display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;grid-template-columns:none!important;grid-template-areas:none!important;width:min(100%,560px)!important;max-width:560px!important;min-height:100dvh!important;margin:0 auto!important;padding:calc(10px + var(--blf-safe-top)) max(10px,var(--blf-safe-right)) calc(18px + var(--blf-safe-bottom)) max(10px,var(--blf-safe-left))!important;gap:8px!important}
  body .page:has(> #adminBtn) > .account{order:1!important;position:relative!important;inset:auto!important;width:100%!important;min-width:0!important;margin:0!important}
  body .page:has(> #adminBtn) > .message-board{order:2!important;position:relative!important;inset:auto!important;width:100%!important;margin:0!important}
  body .page:has(> #adminBtn) > .menu{order:3!important;position:relative!important;inset:auto!important;transform:none!important;width:100%!important;margin:0!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
  body .page:has(> #adminBtn) > #adminBtn{order:4!important;position:relative!important;inset:auto!important;transform:none!important;width:min(220px,70%)!important;margin:0 auto!important;align-self:center!important}
  body .page:has(> #adminBtn) > .won-cards{order:5!important;position:relative!important;inset:auto!important;transform:none!important;width:100%!important;height:auto!important;min-height:100px!important;margin:2px 0 0!important;padding:6px 0 10px!important;overflow:visible!important}
  body .page:has(> #adminBtn) > .release-version{order:6!important;position:relative!important;inset:auto!important;margin-top:auto!important}
  body .page:has(> #adminBtn) .message-list{max-height:150px!important}
}
@media (max-width:480px){
  body .page > h1:has(+ .continue-btn){width:min(86vw,390px)!important;font-size:clamp(16px,4.8vw,20px)!important;line-height:1.36!important;margin-bottom:15px!important}
  body .page > h1 + .continue-btn{min-width:110px!important;max-width:160px!important;padding:8px 21px!important;font-size:.70rem!important}
  body .page:has(> #adminBtn) > .menu{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media (max-width:900px) and (orientation:landscape){
  body .page:has(> #adminBtn){display:flex!important;flex-direction:column!important;width:min(100%,700px)!important;max-width:700px!important;min-height:100dvh!important;margin:0 auto!important;gap:5px!important;padding-top:calc(6px + var(--blf-safe-top))!important;padding-bottom:calc(8px + var(--blf-safe-bottom))!important}
  body .page:has(> #adminBtn) > .account{order:1!important}
  body .page:has(> #adminBtn) > .message-board{order:2!important}
  body .page:has(> #adminBtn) > .menu{order:3!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important}
  body .page:has(> #adminBtn) > #adminBtn{order:4!important;width:min(180px,42%)!important}
  body .page:has(> #adminBtn) > .won-cards{order:5!important;min-height:70px!important}
  body .page:has(> #adminBtn) .message-list{max-height:72px!important}
  body .page > h1:has(+ .continue-btn){font-size:clamp(16px,3.3vw,20px)!important;line-height:1.25!important;margin-bottom:10px!important}
}

/* BLF v1.0.11 - final mobile layout reset; intentionally no :has() dependency */
@media (max-width:900px){
  /* Logged-in home: deterministic document-flow layout. */
  body > main.page{
    width:min(100%,560px)!important;
    max-width:560px!important;
    min-height:100dvh!important;
    margin:0 auto!important;
    padding:calc(10px + var(--blf-safe-top)) max(10px,var(--blf-safe-right)) calc(18px + var(--blf-safe-bottom)) max(10px,var(--blf-safe-left))!important;
  }
  main.page > #adminBtn,
  main.page > .account,
  main.page > .message-board,
  main.page > .menu,
  main.page > .won-cards{position:static!important;inset:auto!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;transform:none!important;float:none!important}

  /* The source order is admin/account/messages/menu/cards; flex order gives requested visual order. */
  main.page:has(> #adminBtn){display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;gap:8px!important}
  main.page:has(> #adminBtn) > .account{order:1!important;width:100%!important;min-width:0!important;margin:0!important}
  main.page:has(> #adminBtn) > .message-board{order:2!important;width:100%!important;margin:0!important}
  main.page:has(> #adminBtn) > .menu{order:3!important;width:100%!important;margin:0!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
  main.page:has(> #adminBtn) > #adminBtn{order:4!important;align-self:center!important;width:min(190px,58%)!important;margin:0 auto!important;min-height:34px!important;padding:7px 12px!important;font-size:.66rem!important}
  main.page:has(> #adminBtn) > .won-cards{order:5!important;width:100%!important;min-height:120px!important;height:auto!important;margin:2px 0 0!important;padding:8px 0 14px!important;overflow:visible!important}
  main.page:has(> #adminBtn) > .release-version{order:6!important}
  main.page:has(> #adminBtn) .message-list{max-height:150px!important}

  /* Keep login centered without changing its successful sizing. */
  body > main.page > .login-box{margin:auto!important}
}
@media (max-width:480px){
  main.page:has(> #adminBtn){width:100%!important;gap:7px!important}
  main.page:has(> #adminBtn) > .menu{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important}
  main.page:has(> #adminBtn) > #adminBtn{width:min(170px,56%)!important}
  main.page:has(> #adminBtn) > .won-cards{min-height:110px!important}
}
@media (max-width:900px) and (orientation:landscape){
  main.page:has(> #adminBtn){width:min(100%,700px)!important;max-width:700px!important;gap:5px!important;padding-top:calc(6px + var(--blf-safe-top))!important;padding-bottom:calc(8px + var(--blf-safe-bottom))!important}
  main.page:has(> #adminBtn) > .menu{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important}
  main.page:has(> #adminBtn) > #adminBtn{width:min(160px,38%)!important}
  main.page:has(> #adminBtn) > .won-cards{min-height:80px!important}
  main.page:has(> #adminBtn) .message-list{max-height:72px!important}
}

/* BLF v1.0.12 - final mobile menu + album viewport sizing */
@media (max-width:900px){
  /* Main actions: always one centered column on phones/tablets. */
  main.page:has(> #adminBtn) > .menu,
  body .page:has(> #adminBtn) > .menu{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    gap:6px!important;
  }
  main.page:has(> #adminBtn) > .menu > *,
  body .page:has(> #adminBtn) > .menu > *{
    width:min(260px,78vw)!important;
    max-width:260px!important;
    margin:0 auto!important;
    flex:0 0 auto!important;
  }

  /* Album: fit the complete book inside the visible mobile viewport. */
  .v24-album-shell{
    box-sizing:border-box!important;
    width:100vw!important;
    max-width:100vw!important;
    min-height:100dvh!important;
    height:100dvh!important;
    padding:calc(54px + var(--blf-safe-top)) calc(8px + var(--blf-safe-right)) calc(10px + var(--blf-safe-bottom)) calc(8px + var(--blf-safe-left))!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
  }
  .v24-open{
    box-sizing:border-box!important;
    width:min(96vw,760px)!important;
    max-width:calc(100vw - 16px - var(--blf-safe-left) - var(--blf-safe-right))!important;
    height:min(76dvh,680px)!important;
    max-height:calc(100dvh - 70px - var(--blf-safe-top) - var(--blf-safe-bottom))!important;
    min-height:0!important;
    margin:auto!important;
  }
  .v24-closed{
    box-sizing:border-box!important;
    width:min(82vw,410px)!important;
    max-width:calc(100vw - 24px - var(--blf-safe-left) - var(--blf-safe-right))!important;
    height:min(68dvh,570px)!important;
    max-height:calc(100dvh - 76px - var(--blf-safe-top) - var(--blf-safe-bottom))!important;
    margin:auto!important;
  }
  .v24-book.v74-book{box-sizing:border-box!important;max-width:100%!important;max-height:100%!important;overflow:hidden!important}
  .v74-spread{box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;overflow:hidden!important}
  .v74-page{box-sizing:border-box!important;min-width:0!important;max-width:100%!important;overflow:hidden!important}
  .v74-pocket-grid{min-width:0!important;min-height:0!important;overflow:hidden!important}
  .v24-pocket{min-width:0!important;min-height:0!important;overflow:hidden!important}
  .v24-pocket img{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important}

  /* Album close control is independent from the book and always visible. */
  .album-close,
  .v24-album-shell .album-close{
    position:fixed!important;
    top:max(8px,calc(var(--blf-safe-top) + 6px))!important;
    right:max(8px,calc(var(--blf-safe-right) + 6px))!important;
    left:auto!important;
    bottom:auto!important;
    transform:none!important;
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    min-height:40px!important;
    margin:0!important;
    z-index:2147483000!important;
  }

  /* Opened-card/options overlays also stay within the visible viewport. */
  .v37-card-options,
  .v37-dialog{
    box-sizing:border-box!important;
    max-width:calc(100vw - 16px - var(--blf-safe-left) - var(--blf-safe-right))!important;
    max-height:calc(100dvh - 16px - var(--blf-safe-top) - var(--blf-safe-bottom))!important;
    overflow:auto!important;
  }
  .v24-card-viewer-card{max-width:min(78vw,380px)!important;max-height:58dvh!important}
  .v24-card-viewer-card img{max-width:100%!important;max-height:58dvh!important;object-fit:contain!important}
  .v24-card-viewer-close{
    position:fixed!important;
    top:max(8px,calc(var(--blf-safe-top) + 6px))!important;
    right:max(8px,calc(var(--blf-safe-right) + 6px))!important;
    z-index:2147483000!important;
  }
}

@media (max-width:480px){
  main.page:has(> #adminBtn) > .menu > *,
  body .page:has(> #adminBtn) > .menu > *{width:min(235px,76vw)!important;max-width:235px!important}
  .v24-open{width:calc(100vw - 12px - var(--blf-safe-left) - var(--blf-safe-right))!important;height:min(72dvh,590px)!important}
  .v24-closed{width:min(80vw,360px)!important;height:min(64dvh,520px)!important}
  .album-close,.v24-album-shell .album-close{width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important}
}

@media (max-width:900px) and (orientation:landscape){
  /* Keep actions vertical even in landscape; never restore the old 5-column rule. */
  main.page:has(> #adminBtn) > .menu,
  body .page:has(> #adminBtn) > .menu{display:flex!important;flex-direction:column!important;align-items:center!important;gap:4px!important}
  main.page:has(> #adminBtn) > .menu > *,
  body .page:has(> #adminBtn) > .menu > *{width:min(230px,42vw)!important;max-width:230px!important}

  .v24-album-shell{padding-top:calc(44px + var(--blf-safe-top))!important;padding-bottom:calc(6px + var(--blf-safe-bottom))!important}
  .v24-open{
    width:min(88vw,760px)!important;
    max-width:calc(100vw - 20px - var(--blf-safe-left) - var(--blf-safe-right))!important;
    height:calc(100dvh - 54px - var(--blf-safe-top) - var(--blf-safe-bottom))!important;
    max-height:calc(100dvh - 54px - var(--blf-safe-top) - var(--blf-safe-bottom))!important;
  }
  .v24-closed{
    width:min(38vw,330px)!important;
    height:calc(100dvh - 58px - var(--blf-safe-top) - var(--blf-safe-bottom))!important;
    max-height:calc(100dvh - 58px - var(--blf-safe-top) - var(--blf-safe-bottom))!important;
  }
  .v37-card-options{flex-direction:row!important;max-height:calc(100dvh - 12px - var(--blf-safe-top) - var(--blf-safe-bottom))!important}
  .v24-card-viewer-card,.v24-card-viewer-card img{max-height:68dvh!important}
}

/* BLF v1.0.13 — album close button mobile visibility fix only. */
@media (max-width:900px) and (orientation:portrait){
  .album-close,
  .v24-album-shell .album-close{
    position:fixed!important;
    top:calc(env(safe-area-inset-top, 0px) + 30px)!important;
    right:calc(env(safe-area-inset-right, 0px) + 14px)!important;
    left:auto!important;
    bottom:auto!important;
    transform:none!important;
    z-index:2147483640!important;
  }
}
@media (max-width:900px) and (orientation:landscape){
  .album-close,
  .v24-album-shell .album-close{
    position:fixed!important;
    top:calc(env(safe-area-inset-top, 0px) + 12px)!important;
    right:calc(env(safe-area-inset-right, 0px) + 14px)!important;
    left:auto!important;
    bottom:auto!important;
    transform:none!important;
    z-index:2147483640!important;
  }
}

/* BLF v1.0.14 — card viewer must fully block the album underneath. */
.v24-card-viewer{
  z-index:2147483646!important;
  pointer-events:auto!important;
  isolation:isolate!important;
}
.v24-card-viewer.open{
  display:flex!important;
  pointer-events:auto!important;
}
.v24-card-viewer.open .v37-card-options{
  position:relative!important;
  z-index:2!important;
  pointer-events:auto!important;
}
.v24-card-viewer.open .v24-card-viewer-close{
  z-index:2147483647!important;
  pointer-events:auto!important;
}
/* While a card is open, the album close control cannot receive clicks/taps. */
.v24-album-shell:has(.v24-card-viewer.open) > .album-close{
  pointer-events:none!important;
  z-index:1!important;
}

/* BLF v1.0.15 — compact card details ONLY on portrait mobile. Landscape remains v1.0.14. */
@media (max-width:900px) and (orientation:portrait){
  .v24-card-viewer.open{
    box-sizing:border-box!important;
    padding:calc(env(safe-area-inset-top,0px) + 10px) 10px calc(env(safe-area-inset-bottom,0px) + 10px)!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
  }
  .v24-card-viewer.open .v37-card-options{
    box-sizing:border-box!important;
    width:min(86vw,340px)!important;
    max-width:calc(100vw - 20px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px))!important;
    max-height:calc(100dvh - 20px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))!important;
    padding:42px 10px 10px!important;
    gap:7px!important;
    flex-direction:column!important;
    align-items:stretch!important;
    overflow:auto!important;
  }
  .v24-card-viewer.open .v24-card-viewer-card{
    width:auto!important;
    max-width:min(62vw,245px)!important;
    max-height:43dvh!important;
    margin:0 auto!important;
  }
  .v24-card-viewer.open .v24-card-viewer-card img{
    display:block!important;
    width:auto!important;
    max-width:100%!important;
    max-height:43dvh!important;
    object-fit:contain!important;
    margin:0 auto!important;
  }
  .v24-card-viewer.open .v37-card-actions{
    width:100%!important;
    gap:6px!important;
  }
  .v24-card-viewer.open .v37-card-value{
    padding:8px 10px!important;
    font-size:.9rem!important;
  }
  .v24-card-viewer.open .v37-card-actions button{
    min-height:38px!important;
    padding:7px 10px!important;
    font-size:.86rem!important;
    line-height:1.15!important;
  }
  .v24-card-viewer.open .v24-card-viewer-close{
    position:absolute!important;
    top:6px!important;
    right:6px!important;
    width:32px!important;
    height:32px!important;
    min-width:32px!important;
    min-height:32px!important;
    font-size:22px!important;
    line-height:28px!important;
  }
}

/* BLF v1.0.16 — portré kártyanéző: értékmező olvashatóság */
@media (max-width:900px) and (orientation:portrait){
  .v24-card-viewer.open .v37-card-value{
    box-sizing:border-box!important;
    margin-top:14px!important;
    padding:10px 12px!important;
    min-height:42px!important;
    display:flex!important;
    align-items:center!important;
    flex-wrap:wrap!important;
    gap:0 .35em!important;
    line-height:1.25!important;
    color:#f2f2f2!important;
    background:#111!important;
  }
  .v24-card-viewer.open .v37-card-value strong{
    color:#ffd66b!important;
    opacity:1!important;
  }
}

/* BLF v1.0.17 — portré kártyanéző: több hely az értéknek, árnyék ne érjen rá */
@media (max-width:900px) and (orientation:portrait){
  .v24-card-viewer.open .v24-card-viewer-card{
    margin:0 auto 28px!important;
    box-shadow:none!important;
    filter:none!important;
  }
  .v24-card-viewer.open .v24-card-viewer-card img{
    box-shadow:none!important;
    filter:none!important;
  }
  .v24-card-viewer.open .v37-card-actions{
    position:relative!important;
    z-index:3!important;
  }
  .v24-card-viewer.open .v37-card-value{
    margin-top:0!important;
    position:relative!important;
    z-index:4!important;
    color:#fff!important;
    text-shadow:none!important;
    box-shadow:none!important;
    background:#111!important;
  }
  .v24-card-viewer.open .v37-card-value strong{
    color:#ffd66b!important;
    text-shadow:none!important;
  }
}

/* BLF v1.0.18 - account content aligned right inside its existing frame */
@media (max-width:900px){
  main.page:has(> #adminBtn) > .account .user,
  main.page:has(> #adminBtn) > .account .money{
    width:100%!important;
    justify-content:flex-end!important;
    text-align:right!important;
  }
}

/* BLF v1.0.19 - mobile account blocks physically aligned to the right of the frame */
@media (max-width:900px){
  .account .user,
  .account .money{
    display:flex!important;
    width:max-content!important;
    max-width:100%!important;
    margin-left:auto!important;
    margin-right:0!important;
    justify-content:flex-end!important;
    align-items:center!important;
    text-align:right!important;
  }
  .account .money{
    margin-top:6px!important;
  }
}


/* BLF v1.0.20 — home account alignment + logout size; final override */
@media (max-width:900px){
  body main.page > section.account .user,
  body main.page > section.account .money{
    box-sizing:border-box!important;
    display:flex!important;
    width:100%!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    justify-content:flex-end!important;
    align-items:center!important;
    text-align:right!important;
  }
  body main.page > section.account .user #fullName,
  body main.page > section.account .money #balance{
    text-align:right!important;
  }
  body main.page > section.account .logout-btn{
    display:block!important;
    box-sizing:border-box!important;
    width:min(260px,78vw)!important;
    max-width:260px!important;
    min-width:0!important;
    min-height:38px!important;
    margin:10px auto 0!important;
    padding:8px 14px!important;
    font-size:.76rem!important;
    line-height:1.15!important;
  }
}
@media (max-width:480px){
  body main.page > section.account .logout-btn{
    width:min(260px,78vw)!important;
    max-width:260px!important;
  }
}

/* UI update 21 — mobile home action buttons: unified size only. */
@media (max-width:900px){
  body main.page > section.account .logout-btn,
  body main.page > nav.menu > .menu-btn{
    box-sizing:border-box!important;
    width:min(260px,78vw)!important;
    max-width:260px!important;
    min-width:0!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    padding:0 16px!important;
    line-height:40px!important;
    font-size:.76rem!important;
  }
  body main.page > nav.menu > .menu-btn{
    margin-left:auto!important;
    margin-right:auto!important;
  }
  body main.page > section.account .logout-btn{
    margin-left:auto!important;
    margin-right:auto!important;
  }
}
@media (max-width:900px) and (orientation:landscape){
  body main.page > section.account .logout-btn,
  body main.page > nav.menu > .menu-btn{
    width:min(260px,42vw)!important;
    max-width:260px!important;
  }
}

/* BLF visual consistency update — visible application version remains 1.0.0. */
@media (max-width:900px){
  :root{--blf-mobile-main-btn-width:min(280px,82vw);--blf-mobile-main-btn-height:42px;}
  body main.page > section.account .logout-btn,
  body main.page > nav.menu > .menu-btn{
    box-sizing:border-box!important;
    width:var(--blf-mobile-main-btn-width)!important;
    min-width:var(--blf-mobile-main-btn-width)!important;
    max-width:var(--blf-mobile-main-btn-width)!important;
    height:var(--blf-mobile-main-btn-height)!important;
    min-height:var(--blf-mobile-main-btn-height)!important;
    max-height:var(--blf-mobile-main-btn-height)!important;
    padding:0 16px!important;
    margin-left:auto!important;
    margin-right:auto!important;
    line-height:normal!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }

  /* Market: same framed visual language as Trade. */
  body:has(#marketClose) > main.box{
    box-sizing:border-box!important;
    width:94vw!important;
    min-height:calc(100dvh - 10vh)!important;
    margin:5vh auto!important;
    padding:64px 14px 22px!important;
    border:1px solid #ffd66b!important;
    background:#080808e8!important;
    box-shadow:0 20px 60px #000!important;
  }

  /* Market and Trade top close buttons stay fully inside the yellow frame. */
  body:has(#marketClose) > #marketClose,
  body:has(#closeTrade) > #closeTrade{
    position:fixed!important;
    top:calc(5vh + 12px + env(safe-area-inset-top,0px))!important;
    right:calc(3vw + 12px + env(safe-area-inset-right,0px))!important;
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    min-height:38px!important;
    padding:0!important;
    border-radius:50%!important;
    clip-path:none!important;
    display:grid!important;
    place-items:center!important;
    line-height:1!important;
    z-index:3000!important;
  }

  /* Trade frame uses the same safe top room for its close button. */
  body:has(#closeTrade) > main.box{
    box-sizing:border-box!important;
    padding-top:64px!important;
  }

  /* Close controls inside yellow dialogs/pickers: inset from the border. */
  .dialog > .balance-close,
  .pickbox .pickhead > button,
  .modal > button.close,
  .v24-card-viewer.open .v24-card-viewer-close{
    margin:0!important;
  }
  .dialog > .balance-close{top:14px!important;right:14px!important;}
  .pickbox .pickhead{padding-right:4px!important;}
  .pickbox .pickhead > button{
    flex:0 0 36px!important;width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;
    display:grid!important;place-items:center!important;padding:0!important;line-height:1!important;
  }
}

@media (max-width:900px) and (orientation:landscape){
  :root{--blf-mobile-main-btn-width:min(280px,44vw);}
  body:has(#marketClose) > main.box,
  body:has(#closeTrade) > main.box{margin:3vh auto!important;}
  body:has(#marketClose) > #marketClose,
  body:has(#closeTrade) > #closeTrade{
    top:calc(3vh + 10px + env(safe-area-inset-top,0px))!important;
  }
}

/* Adaptive two-page album paging. Desktop remains 5x3 per side. */
@media (max-width:900px) and (orientation:portrait){
  .v74-spread{grid-template-columns:minmax(0,1fr) 10px minmax(0,1fr)!important;justify-items:stretch!important;}
  .v74-page-left,.v74-page-right{display:flex!important;flex-direction:column!important;width:100%!important;min-width:0!important;}
  .v74-spine{display:block!important;width:10px!important;}
  .v74-page .v74-pocket-grid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(3,minmax(0,1fr))!important;
    gap:4px!important;
    height:calc(100% - 38px)!important;
    min-height:0!important;
  }
  .v74-album-pager{justify-content:center!important;overflow:visible!important;padding-left:0!important;padding-right:0!important;}
}
@media (max-width:900px) and (orientation:landscape){
  .v74-spread{grid-template-columns:minmax(0,1fr) 8px minmax(0,1fr)!important;justify-items:stretch!important;}
  .v74-page-left,.v74-page-right{display:flex!important;flex-direction:column!important;width:100%!important;min-width:0!important;}
  .v74-spine{display:block!important;width:8px!important;}
  .v74-page .v74-pocket-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    gap:4px!important;
    height:calc(100% - 38px)!important;
    min-height:0!important;
  }
  .v74-album-pager{justify-content:center!important;overflow:visible!important;padding-left:0!important;padding-right:0!important;}
}


/* BLF v1.0.0 — mobile/tablet orientation unification.
   Landscape intentionally reuses the final portrait layout rules so rotating
   the device does not switch to a separate compressed arrangement. */
@media (max-width:900px) and (orientation:landscape){

  .album-close,
  .v24-album-shell .album-close{
    position:fixed!important;
    top:calc(env(safe-area-inset-top, 0px) + 30px)!important;
    right:calc(env(safe-area-inset-right, 0px) + 14px)!important;
    left:auto!important;
    bottom:auto!important;
    transform:none!important;
    z-index:2147483640!important;
  }

}
@media (max-width:900px) and (orientation:landscape){

  .v24-card-viewer.open{
    box-sizing:border-box!important;
    padding:calc(env(safe-area-inset-top,0px) + 10px) 10px calc(env(safe-area-inset-bottom,0px) + 10px)!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
  }
  .v24-card-viewer.open .v37-card-options{
    box-sizing:border-box!important;
    width:min(86vw,340px)!important;
    max-width:calc(100vw - 20px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px))!important;
    max-height:calc(100dvh - 20px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))!important;
    padding:42px 10px 10px!important;
    gap:7px!important;
    flex-direction:column!important;
    align-items:stretch!important;
    overflow:auto!important;
  }
  .v24-card-viewer.open .v24-card-viewer-card{
    width:auto!important;
    max-width:min(62vw,245px)!important;
    max-height:43dvh!important;
    margin:0 auto!important;
  }
  .v24-card-viewer.open .v24-card-viewer-card img{
    display:block!important;
    width:auto!important;
    max-width:100%!important;
    max-height:43dvh!important;
    object-fit:contain!important;
    margin:0 auto!important;
  }
  .v24-card-viewer.open .v37-card-actions{
    width:100%!important;
    gap:6px!important;
  }
  .v24-card-viewer.open .v37-card-value{
    padding:8px 10px!important;
    font-size:.9rem!important;
  }
  .v24-card-viewer.open .v37-card-actions button{
    min-height:38px!important;
    padding:7px 10px!important;
    font-size:.86rem!important;
    line-height:1.15!important;
  }
  .v24-card-viewer.open .v24-card-viewer-close{
    position:absolute!important;
    top:6px!important;
    right:6px!important;
    width:32px!important;
    height:32px!important;
    min-width:32px!important;
    min-height:32px!important;
    font-size:22px!important;
    line-height:28px!important;
  }

}
@media (max-width:900px) and (orientation:landscape){

  .v24-card-viewer.open .v37-card-value{
    box-sizing:border-box!important;
    margin-top:14px!important;
    padding:10px 12px!important;
    min-height:42px!important;
    display:flex!important;
    align-items:center!important;
    flex-wrap:wrap!important;
    gap:0 .35em!important;
    line-height:1.25!important;
    color:#f2f2f2!important;
    background:#111!important;
  }
  .v24-card-viewer.open .v37-card-value strong{
    color:#ffd66b!important;
    opacity:1!important;
  }

}
@media (max-width:900px) and (orientation:landscape){

  .v24-card-viewer.open .v24-card-viewer-card{
    margin:0 auto 28px!important;
    box-shadow:none!important;
    filter:none!important;
  }
  .v24-card-viewer.open .v24-card-viewer-card img{
    box-shadow:none!important;
    filter:none!important;
  }
  .v24-card-viewer.open .v37-card-actions{
    position:relative!important;
    z-index:3!important;
  }
  .v24-card-viewer.open .v37-card-value{
    margin-top:0!important;
    position:relative!important;
    z-index:4!important;
    color:#fff!important;
    text-shadow:none!important;
    box-shadow:none!important;
    background:#111!important;
  }
  .v24-card-viewer.open .v37-card-value strong{
    color:#ffd66b!important;
    text-shadow:none!important;
  }

}
@media (max-width:900px) and (orientation:landscape){

  .v74-spread{grid-template-columns:minmax(0,1fr) 10px minmax(0,1fr)!important;justify-items:stretch!important;}
  .v74-page-left,.v74-page-right{display:flex!important;flex-direction:column!important;width:100%!important;min-width:0!important;}
  .v74-spine{display:block!important;width:10px!important;}
  .v74-page .v74-pocket-grid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(3,minmax(0,1fr))!important;
    gap:4px!important;
    height:calc(100% - 38px)!important;
    min-height:0!important;
  }
  .v74-album-pager{justify-content:center!important;overflow:visible!important;padding-left:0!important;padding-right:0!important;}

}

/* BLF v1.0.0 - mobile landscape open album: exactly 4 pockets/page in a symmetric 2x2 grid */
@media (max-width:900px) and (orientation:landscape){
  .v74-page .v74-pocket-grid,
  .v74-page .v24-pocket-grid,
  .v74-pocket-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    grid-auto-flow:row!important;
    gap:10px 12px!important;
    width:100%!important;
    height:calc(100% - 38px)!important;
    min-height:0!important;
    align-items:stretch!important;
    justify-items:stretch!important;
  }
  .v74-page .v24-pocket,
  .v74-page .v74-pocket-grid .v24-pocket{
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
  }
}

/* Halloween 2026: responsive image only, no changes to layout or site functionality */
@media (max-width: 767px) and (orientation: portrait) {
  html body, html body.album-page-body {
    background-image: linear-gradient(rgba(0,0,0,.40),rgba(0,0,0,.63)),url('blf-background-halloween-2026-mobile.jpeg') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
  }
}
@media (max-width: 900px) and (orientation: landscape) {
  html body, html body.album-page-body {
    background-image: linear-gradient(rgba(0,0,0,.40),rgba(0,0,0,.63)),url('blf-background-halloween-2026.jpeg') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
  }
}
