/* OCT29 responsive pass — additive, loaded LAST in <head>. Stops overlaps/cutoffs; keeps the gothic/halloween decor. */
html,body{max-width:100%;overflow-x:clip}
img,video,iframe{max-width:100%;height:auto}
h1,h2,h3,p,li,a,td{overflow-wrap:anywhere}
h1{font-size:clamp(1.7rem,6vw,3.4rem);line-height:1.12}
h2{font-size:clamp(1.2rem,4.2vw,2rem);line-height:1.2}
.win,.pbox,.imwin,.ob-win,.card,.panel,.box,.module{max-width:100%;min-width:0}
.win-body,.pbox-b{overflow-wrap:anywhere}
.pane{overflow:hidden}
table{display:block;max-width:100%;overflow-x:auto}
/* decor sits under nav/text: drip below sticky bar, bats behind content */
body::before{z-index:25}
.bat-float{z-index:20;opacity:.7}
.win::after,.pbox::after,.imwin::after{right:0;bottom:0;z-index:0}
/* hero collage: scale with width instead of fixed height so panes never spill into next section */
@media (max-width:820px){
 .hero{gap:20px;padding-block:32px 20px}
 .collage{height:auto!important;aspect-ratio:1/1.02;width:100%;max-width:520px;margin:0 auto}
 .p3{bottom:0}
 .nav{gap:4px 12px;max-width:100%}
 .nav a{white-space:nowrap}
}
@media (max-width:700px){
 body::before{height:34px;background-size:520px 34px;opacity:.85}
 .ad97-bats{display:none}
 .bat-float{display:none}
 .goth-blinkies img,.ad97-strip img{width:118px;height:auto}
 .ad97-candles{height:70px;background-size:auto 70px}
 .win::after,.pbox::after,.imwin::after{width:44px;height:44px;opacity:.4}
 .oct-board{grid-template-columns:1fr}
 .shelf-grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}
 .hw-marquee{font-size:.72rem}
 .btn{letter-spacing:.03em;white-space:normal}
}
@media (max-width:420px){
 .nav a,.me{font-size:1rem}
 .shelf-grid{grid-template-columns:1fr 1fr}
}

/* ===== OCT29b — browser-QA fixes ===== */
/* 1. titlebars: window-frame-chrome.png has "Afterdark Archives" baked in, overprinting each box title. Drop the image, keep the red bar. */
.win-title,.imt,.ob-t,.tb,.pane .tb{background-image:linear-gradient(90deg,#a50e14,#5a0508 60%,#1a0002)!important;overflow:hidden;min-width:0}
.win-title>span:first-child,.imt>span:first-child,.pane .tb>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
/* 2+3. drips: behind ALL content (incl. sticky bar, ticker, logo), never over text */
body::before{z-index:-1!important}
.bar{z-index:40!important;isolation:isolate}
.ticker,.hw-marquee{position:relative;z-index:41;font-family:"Montserrat","Proxima Nova",Arial,sans-serif!important;font-weight:700;letter-spacing:.02em!important;font-size:.9rem!important;line-height:1.5}
.ticker .run{will-change:transform}
/* 4. collage: panes kept inside their quadrants; desktop panes no longer clipped */
.collage{overflow:visible}
.p1{width:54%;left:0;top:4%}
.p2{width:44%;right:0;top:0}
.p3{width:40%;right:6%;bottom:0;top:auto}
@media (max-width:820px){
 .collage{aspect-ratio:auto!important;height:auto!important;display:grid;grid-template-columns:1fr 1fr;gap:12px;max-width:560px}
 .pane{position:relative!important;inset:auto!important;width:auto!important;transform:none!important}
 .p1{grid-column:1/-1}
}
/* 5. lounge pinned séance: clear sticky header, no clipping */
.s3-lounge-top{position:relative;z-index:1;overflow:visible;padding-top:8px;scroll-margin-top:120px}
.s3-lounge-top *{overflow-wrap:anywhere;white-space:normal}
/* 6. splatters never over text: decorative only on wide screens, behind content */
.win::after,.pbox::after,.imwin::after{z-index:-1}
@media (max-width:900px){.win::after,.pbox::after,.imwin::after{display:none}}
.ada-race-rules{position:relative;z-index:1}
/* 7. shelf cards: price/BUY row pinned to card bottom so all align */
.card{grid-template-rows:auto 1fr}
.card .info{display:flex!important;flex-direction:column;gap:8px}
.card .info .row{margin-top:auto;align-items:center}

/* ===== OCT29c — recheck fixes ===== */
/* 3. hero h1: no mid-word break ("Afterdar/k") — undo the global anywhere-wrap here */
.hero h1,h1{overflow-wrap:normal!important;word-break:keep-all;hyphens:none}
.hero h1{font-size:clamp(2.6rem,7.2vw,6.2rem)}
/* 1. desktop collage: pull panes inside the column so rotation never clips at .hero edge */
@media (min-width:821px){
 .p1{width:52%;left:2%;top:6%}
 .p2{width:42%;right:4%;top:2%}
 .p3{width:38%;right:10%;bottom:2%}
}
/* 2. shelf: price+BUY pinned to the bottom of every item (Mystery Box has a 1-line name) */
.shelf-item{display:flex;flex-direction:column;height:100%}
.shelf-item b{min-height:2.6em}
.shelf-item .price{margin-top:auto}

/* ===== OCT30 flaw hunt ===== */
/* keep-all/normal only on the hero logo; other h1s (long usernames on profiles) may break rather than overflow */
h1{overflow-wrap:break-word!important;word-break:normal}
.hero h1{overflow-wrap:normal!important;word-break:keep-all}
.founding-seal{vertical-align:middle}

/* ===== OCT30b — browser-QA flaws ===== */
/* 1. compact sticky header on phones: logo + one swipeable nav row (~100px instead of ~225px) */
@media (max-width:820px){
 .bar .wrap{gap:4px 10px!important;padding-block:6px!important;row-gap:4px!important}
 .bar .brand img{height:34px!important}
 .nav{flex-wrap:nowrap!important;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none;gap:0 12px!important;margin-left:0!important;width:100%;padding-bottom:2px}
 .nav::-webkit-scrollbar{display:none}
 .nav a,.nav .me,.me{font-size:.95rem!important;white-space:nowrap;flex:0 0 auto}
 .me{width:auto!important}
}
/* 2. decor never covers text on phones: drop corner blood/gravestone layers + splatters, fade top drip */
@media (max-width:820px){
 body{background-image:radial-gradient(rgba(196,18,24,.07) 1px,transparent 1px),repeating-linear-gradient(0deg,rgba(255,255,255,.015) 0 1px,transparent 1px 3px)!important;background-repeat:repeat,repeat!important;background-position:0 0,0 0!important;background-size:4px 4px,auto!important}
 body::before{opacity:.35!important;height:24px!important}
 .win::after,.pbox::after,.imwin::after,.bat-float,.ad97-bats{display:none!important;visibility:hidden}
}
/* 3. blinkie strips: wrap inside the viewport, never clipped mid-blinkie */
.ad97-strip,.goth-blinkies{display:flex!important;flex-wrap:wrap!important;justify-content:center;gap:4px;max-width:100%!important;overflow:hidden;box-sizing:border-box}
.ad97-strip img,.goth-blinkies img{flex:0 0 auto;max-width:100%}
@media (max-width:700px){.ad97-strip img[width="150"],.goth-blinkies img{width:150px!important;height:20px!important}}
/* pages with both strips: keep the content one, drop the duplicate dense97 strip */
.goth-blinkies~.ad97-div,.goth-blinkies~.ad97-strip{display:none!important}
/* 4. banners: on phones stop the marquee and wrap it so no word is cut */
@media (max-width:820px){
 .hw-marquee{white-space:normal!important;text-align:center}
 .hw-marquee span{animation:none!important;display:block;padding:.4rem .6rem!important}
}
/* 6. founding pack in badges */
.badges .founding-blinkie{width:150px;height:20px;image-rendering:pixelated}
.badges .founding-seal{width:64px;height:64px}

/* Oct 30c: red ticker never clips on phones (wraps, fully readable) */
@media (max-width:820px){
.ticker{white-space:normal!important;overflow:visible!important;height:auto!important}
.ticker .run,.ticker .run.one{animation:none!important;transform:none!important;display:block!important;white-space:normal!important;text-align:center;padding:4px 10px!important;width:auto!important}
.ticker span{padding-inline:0!important;white-space:normal!important;display:inline!important}
}
/* founding pack: never hidden */
.founding-hdr{display:inline-flex!important;align-items:center;gap:6px;flex-wrap:wrap}
.founding-blinkie,.founding-seal{display:inline-block!important;visibility:visible!important;opacity:1!important;max-width:none}
.founding-blinkie{width:150px!important;height:20px!important}
.founding-hdr .founding-seal{width:48px!important;height:48px!important}
.badges .founding-seal{width:64px!important;height:64px!important}

/* Oct 30d: inner nav — join/log in (and my space) pinned right, always visible */
@media (max-width:820px){
 .bar .nav{position:relative}
 .bar .nav .me{position:sticky!important;right:0;z-index:2;margin-left:auto;padding-left:14px;background:linear-gradient(90deg,transparent,#0b0708 12px)!important;display:flex;align-items:center;gap:8px}
 .bar .nav .me .btn.sm{padding:3px 8px!important;font-size:.85rem!important}
}
/* lounge locked rooms */
.locked-rooms ul{list-style:none;padding:0;margin:.4rem 0}
.locked-rooms li{padding:6px 0;border-bottom:1px dashed rgba(196,18,24,.35);line-height:1.4}
.locked-rooms .lk{font-size:.85rem;white-space:nowrap}
/* join pulse: one fact per line, founder line separated */
#g-live .g-pulse{display:flex;flex-direction:column;gap:4px;margin:0 0 10px}
#g-live .g-pulse .sep{display:none}
#g-live .g-pulse-wrap>*+*{margin-top:10px!important;display:block}
#g-live .g-lounge-teaser{margin-top:12px}
#g-live .g-lounge-teaser~.g-lounge-teaser{display:none}
/* arcade footer ad strip breathing room */
.ad97-strip{padding:10px 8px!important;gap:8px!important}

/* ===== OCT30f — home shelf 2-col on phones ===== */
@media (max-width:820px){
 #shelf .win-body{min-width:0}
 #shelf-grid.shelf-grid,body .shelf-grid,#shelf ~ * .grid,main .grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
 .shelf-item{min-width:0;padding:5px}
 .shelf-item b{font-size:.78rem;line-height:1.2;overflow-wrap:anywhere;min-height:2.4em}
 .shelf-item .btn,.shelf-item button,.shelf-item a.btn{width:100%;min-width:0;padding:8px 4px;font-size:.78rem;white-space:normal}
 .grid .card{min-width:0}
 .grid .card .info{padding:10px}
}

/* ===== OCT30g — shelf titles wrap on word boundaries only ===== */
@media (max-width:820px){
 .shelf-item b,.shelf-item b *,.shelf-item h3,.shelf-item h4,.grid .card h3,.grid .card .info h3,.grid .card .info b{overflow-wrap:break-word!important;word-break:normal!important;hyphens:manual!important;-webkit-hyphens:manual!important;white-space:normal}
 .shelf-item b{font-size:.7rem!important;letter-spacing:0!important;line-height:1.2}
 .grid .card h3,.grid .card .info h3{font-size:.85rem!important;letter-spacing:0!important}
}
