/* Games42 Rusty design. Loaded last so this compact design layer owns the platform chrome. */
:root,
html[data-g42-theme="rusty-light"]{
  --g42-header-height:4.6rem;
  --skin-bg:#d6bc8c;
  --skin-panel:#efd9ae;
  --skin-panel-2:#e2c795;
  --skin-card:#f4deb4;
  --skin-line:#211d18;
  --skin-ink:#171512;
  --skin-muted:#655442;
  --skin-action:#d41459;
  --skin-action-text:#fff8e8;
  --skin-accent:#087f9a;
  --skin-danger:#a51f2d;
  --skin-rule:rgb(255 248 232/.22);
  --skin-check:rgb(23 21 18/.16);
  color-scheme:light;
}
html[data-g42-theme="rusty-dark"]{
  --skin-bg:#211d18;
  --skin-panel:#342c23;
  --skin-panel-2:#463a2d;
  --skin-card:#3c3126;
  --skin-line:#e4c991;
  --skin-ink:#fff0d0;
  --skin-muted:#c7ad80;
  --skin-action:#e42b6d;
  --skin-action-text:#fff8e8;
  --skin-accent:#30aec5;
  --skin-danger:#e45d61;
  color-scheme:dark;
}

html{background:var(--skin-bg);color:var(--skin-ink);font-family:"Franklin Gothic Medium","Arial Narrow",Arial,sans-serif}
html[data-g42-theme] body{position:relative;isolation:isolate;padding-top:var(--g42-header-height);background:var(--skin-bg);color:var(--skin-ink)}
html[data-g42-theme] body::before{content:"";position:fixed;z-index:-1;inset:0;pointer-events:none;background-color:var(--skin-bg);background-image:linear-gradient(rgb(214 188 140/.1),rgb(214 188 140/.1)),url("theme/spielkarten-plakat.webp");background-position:center;background-size:100% 100%;background-repeat:no-repeat}
html[data-g42-theme="rusty-dark"] body::before{background-image:linear-gradient(rgb(17 14 11/.72),rgb(17 14 11/.72)),url("theme/spielkarten-plakat.webp")}
button,input,select,textarea{font-family:inherit}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--skin-accent);outline-offset:2px}

/* Permanent platform header */
#shellbar.shellbar{position:fixed;z-index:100;inset:0 0 auto 0;width:100%;height:var(--g42-header-height);min-height:var(--g42-header-height);max-height:var(--g42-header-height);padding:0 max(.6rem,env(safe-area-inset-right)) 0 max(.55rem,env(safe-area-inset-left));display:flex;align-items:center;gap:.65rem;overflow:visible;border:0;border-bottom:3px solid #070706;border-radius:0;background:#171512;color:#fff2d3;box-shadow:0 3px 0 #d41459,0 7px 18px #0004;isolation:isolate;transition:none}
#shellbar.shellbar::before{content:"";position:absolute;z-index:-1;inset:0;background:repeating-linear-gradient(135deg,transparent 0 8px,#fff1 9px 10px),#171512;opacity:1;transform:none;border:0;border-radius:0;box-shadow:none}
#shellbar .shell-logo{position:relative;align-self:center;flex:0 0 4.25rem;width:4.25rem;height:4.25rem;padding:0;display:grid;place-items:center;border:0;border-radius:0;background:transparent;color:#fff;box-shadow:none;transform:translateY(.1rem) rotate(-4deg);transform-origin:center;overflow:visible}
#shellbar .shell-logo img{position:relative;z-index:1;display:block;width:100%;height:100%;object-fit:contain}
#shellbar #shellMenu,#shellbar.open #shellMenu{position:static;display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-rows:calc(var(--g42-header-height) - .4rem);align-items:center;flex:1 1 auto;width:auto;height:auto;min-width:0;min-height:0;padding:0;gap:.7rem;overflow:visible;opacity:1;visibility:visible;transform:none;pointer-events:auto;background:transparent;white-space:nowrap;transition:none}
#shellbar .shell-room{grid-column:1;grid-row:1;display:flex;align-items:center;min-width:0;min-height:0}
#shellbar #shellRoomChat{display:flex;align-items:center;max-width:13rem;padding:.35rem .5rem;border:0;background:transparent;color:inherit;text-align:left}
#shellbar #shellRoomChat:not(:disabled):hover{background:#fff1}
#shellbar #shellRoomName{display:block;max-width:12rem;overflow:hidden;text-overflow:ellipsis;font:900 .78rem/1 Impact,"Arial Black",sans-serif;letter-spacing:.045em;text-transform:uppercase}
#shellbar #shellStatus{margin:0;color:#9fd39a;font:700 .66rem Arial,sans-serif}
#shellbar .shell-players{grid-column:2;grid-row:1;display:flex;align-items:center;flex-wrap:nowrap;min-width:0;max-width:100%;margin:0;padding:0;gap:.28rem;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
#shellbar .shell-player{flex:0 0 auto;height:1.9rem;min-height:1.9rem;max-width:9rem;padding:0;border:2px solid #080706;border-left:.42rem solid var(--player-color,#655442);border-radius:0;background:#28231d;color:#fff2d3;box-shadow:2px 2px 0 #0008}
#shellbar .shell-player-contact{height:100%;max-width:100%;padding:.25rem .45rem;border:0;background:transparent;color:inherit;font:800 .68rem/1 Arial,sans-serif}
#shellbar .shell-player-contact:hover,#shellbar .shell-player-contact:focus-visible{background:#fff2d322;outline:0}
#shellbar .presence-dot{width:.42rem;height:.42rem;flex-basis:.42rem;box-shadow:0 0 0 1px #171512}
#shellbar .host-crown{color:#f4c14d}
#shellbar .shell-settings{grid-column:3;grid-row:1;position:relative;display:block;align-self:center;margin:0}
#shellbar #shellMenu .shell-settings-toggle{display:grid;place-items:center;width:2.15rem;height:2.15rem;min-width:2.15rem;padding:.38rem;border:2px solid #efd9ae;border-radius:0;background:#28231d;color:#efd9ae;box-shadow:2px 2px 0 #087f9a}
#shellbar #shellMenu .shell-settings-toggle:hover,#shellbar #shellMenu .shell-settings-toggle[aria-expanded="true"]{background:#d41459;color:#fff;border-color:#fff}
#shellbar .shell-settings-toggle svg{width:1.15rem;height:1.15rem;filter:none;transform:none}
#shellbar .shell-settings-toggle .comic-gear path{fill:currentColor;stroke:none}
#shellbar .shell-settings-toggle .comic-gear circle{fill:#171512;stroke:currentColor;stroke-width:1.5}
#shellbar .shell-settings-panel{position:absolute;z-index:110;top:calc(100% + .65rem);right:0;width:min(15rem,calc(100vw - 1rem));padding:.55rem;display:grid;grid-template-columns:1fr;gap:.38rem;border:3px solid #171512;border-radius:0;background:var(--skin-panel);color:var(--skin-ink);box-shadow:6px 6px 0 #171512}
#shellbar .shell-settings-panel[hidden]{display:none}
#shellbar #shellMenu .shell-settings-panel .shell-settings-item{display:grid;grid-template-columns:1.15rem minmax(0,1fr);place-items:center start;width:100%;height:auto;min-height:2.35rem;padding:.45rem .55rem;gap:.55rem;border:2px solid var(--skin-line);border-radius:0;background:transparent;color:var(--skin-ink);font:900 .7rem/1.1 Arial,sans-serif;text-align:left;text-transform:uppercase;box-shadow:none}
#shellbar #shellMenu .shell-settings-panel .shell-settings-item:hover{background:var(--skin-action);color:var(--skin-action-text)}
#shellbar #shellMenu .shell-settings-panel .shell-settings-item:disabled{opacity:.35}
#shellbar #shellMenu .shell-settings-panel .shell-exit-button{color:var(--skin-danger)}
#shellbar .shell-resize-handle,#shellbar .shell-pin-toggle{display:none!important}

/* Homepage and room surfaces */
.masthead{min-height:clamp(13rem,28vw,23rem);padding:clamp(2rem,6vw,5rem);display:flex;align-items:center;justify-content:center;border-bottom:4px solid #171512;background:transparent;color:#171512;text-align:center;box-shadow:0 5px 0 #087f9a;overflow:hidden}
.masthead::before{content:"SPIELABEND";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotate(-3deg);font:900 clamp(4rem,16vw,13rem)/.8 Impact,"Arial Black",sans-serif;letter-spacing:-.04em;color:#efd9ae88;-webkit-text-stroke:2px #17151233;white-space:nowrap}
.masthead::after{content:"42";right:4%;bottom:-.25em;color:#d4145930;font-size:clamp(12rem,31vw,29rem)}
.masthead h1{padding:.15em .24em .08em;border:clamp(.15rem,.4vw,.3rem) solid #171512;background:#d41459;color:#fff5df;font:900 clamp(3rem,9vw,7.5rem)/.82 Impact,"Arial Black",sans-serif;letter-spacing:-.055em;text-transform:uppercase;box-shadow:.1em .1em 0 #087f9a;text-shadow:.04em .04em 0 #171512;transform:rotate(-2deg)}
.masthead-collage{display:none}
.desk-v2{max-width:82rem;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(1rem,2.2vw,2rem);margin:-2.4rem auto 0;padding:0 clamp(1rem,3vw,2rem) 3rem}
.desk-v2 .card{min-height:22rem;aspect-ratio:auto;padding:clamp(1.3rem,2.5vw,2rem);border:3px solid var(--skin-line);border-radius:.2rem;background:rgb(239 217 174/.96);color:var(--skin-ink);box-shadow:8px 8px 0 #171512;transform:none}
.desk-v2 .card:nth-child(2){background:rgb(226 199 149/.97);transform:rotate(.4deg)}
.desk-v2 .card:nth-child(3){background:rgb(212 20 89/.95);color:#fff5df;transform:rotate(-.35deg)}
.card h2,.section-head h2,.room-view h1,.room-view h2{font-family:Impact,"Arial Black",Arial,sans-serif;letter-spacing:.015em;text-transform:uppercase}
.card-no{color:currentColor;font-family:Impact,"Arial Black",sans-serif;opacity:.18}
.card input,.card select{border-bottom:3px solid currentColor;color:inherit}
.card input:focus,.card select:focus{box-shadow:0 4px 0 var(--skin-accent)}
.primary,.ink,.room-tile button,.private-chat form button{border:3px solid #171512;border-radius:0;background-color:var(--skin-action);background-image:repeating-linear-gradient(0deg,transparent 0 7px,var(--skin-rule) 8px 9px);color:var(--skin-action-text);box-shadow:4px 4px 0 #171512;clip-path:polygon(0 2%,99% 0,100% 96%,98% 100%,1% 98%);font-weight:900;letter-spacing:.045em;text-transform:uppercase;transition:transform .12s,box-shadow .12s}
.primary:hover,.ink:hover,.room-tile button:hover,.private-chat form button:hover{transform:translate(-1px,-1px);box-shadow:6px 6px 0 #171512}
.primary:active,.ink:active,.room-tile button:active{transform:translate(3px,3px);box-shadow:1px 1px 0 #171512}
.random-room-name{border-width:3px;border-radius:0;background-color:rgb(239 217 174/.72);background-image:linear-gradient(90deg,var(--skin-check) 1px,transparent 1px),linear-gradient(var(--skin-check) 1px,transparent 1px);background-size:8px 8px;box-shadow:3px 3px 0 #171512}
.mobile-home-tabs,.mobile-room-tabs{border:3px solid var(--skin-line);border-radius:0;background:var(--skin-panel);box-shadow:4px 4px 0 #171512}
.mobile-home-tabs button,.mobile-room-tabs button{background-image:repeating-linear-gradient(0deg,transparent 0 8px,rgb(23 21 18/.09) 9px 10px)}
.mobile-home-tabs button[aria-selected="true"],.mobile-room-tabs button[aria-selected="true"]{background-color:var(--skin-action);background-image:linear-gradient(45deg,rgb(23 21 18/.13) 25%,transparent 25%,transparent 75%,rgb(23 21 18/.13) 75%),linear-gradient(45deg,rgb(23 21 18/.13) 25%,transparent 25%,transparent 75%,rgb(23 21 18/.13) 75%);background-position:0 0,6px 6px;background-size:12px 12px;color:#fff;box-shadow:2px 2px 0 #171512}
.catalog-section{background:rgb(214 188 140/.82);border-top:4px solid #171512}
.catalog{max-width:82rem;margin:auto}
.game-card,.vote-card{border:3px solid #171512;border-radius:.25rem;box-shadow:7px 7px 0 #171512;transform:none}
.game-card:nth-child(even){transform:none}
.game-card-front::after{background:linear-gradient(180deg,transparent 22%,rgba(10,8,6,.25) 58%,rgba(10,8,6,.92))}
.game-card-back{background-color:#f4deb4;background-image:repeating-linear-gradient(0deg,transparent 0 27px,#087f9a44 28px 29px);color:#171512}
.card-info{border:3px solid #171512!important;border-radius:.15rem!important;background:#efd9ae!important;color:#171512!important;box-shadow:3px 3px 0 #171512!important}
html[data-g42-theme] .room-view{position:fixed;z-index:20;inset:var(--g42-header-height) 0 0;isolation:isolate;padding:clamp(1rem,4vw,3.5rem);background-color:transparent;background-image:none;color:var(--skin-ink)}
html[data-g42-theme] .room-view::before{content:"";position:fixed;z-index:-1;inset:0;pointer-events:none;background-color:var(--skin-bg);background-image:linear-gradient(rgb(214 188 140/.1),rgb(214 188 140/.1)),url("theme/spielkarten-plakat.webp");background-position:center;background-size:100% 100%;background-repeat:no-repeat}
html[data-g42-theme="rusty-dark"] .room-view::before{background-image:linear-gradient(rgb(17 14 11/.72),rgb(17 14 11/.72)),url("theme/spielkarten-plakat.webp")}
.room-view .room-top{max-width:88rem;padding:1.25rem 1.5rem;border:3px solid var(--skin-line);border-radius:1rem;background:color-mix(in srgb,var(--skin-panel) 96%,transparent);color:var(--skin-ink);box-shadow:7px 7px 0 #171512}
.room-view .room-title{margin:.15rem 0;font-size:clamp(2.2rem,6vw,5.4rem);color:var(--skin-ink)}
.room-view .room-grid>aside{border:3px solid var(--skin-line);border-radius:1rem;background:color-mix(in srgb,var(--skin-panel) 96%,transparent);color:var(--skin-ink);box-shadow:7px 7px 0 #171512}
.room-view .member{border-bottom:2px solid color-mix(in srgb,var(--skin-line) 30%,transparent)}
.room-view .member button{color:var(--skin-ink)}
.room-view .room-actions button{border:2px solid var(--skin-line);border-radius:.65rem;background-color:var(--skin-panel-2);background-image:repeating-linear-gradient(0deg,transparent 0 8px,rgb(8 127 154/.18) 9px 10px);color:var(--skin-ink);box-shadow:3px 3px 0 #171512}
.room-view .room-actions .primary{border:3px solid #171512;background:var(--skin-action);color:#fff}
.room-view [data-room-panel="games"]>.eyebrow{display:inline-block;padding:.35rem .55rem;background:#171512;color:#efd9ae}
/* The old theme layer treated the room heading like a player badge; it has no player color. */
html[data-g42-theme^="rusty"] .room-view .room-top{border-left-color:var(--skin-line)}
html[data-g42-theme^="rusty"] .room-view .room-title{color:var(--skin-ink)}
html[data-g42-theme^="rusty"] .vote-card .start-game{border-radius:.6rem;background-color:var(--skin-action);background-image:repeating-linear-gradient(0deg,transparent 0 6px,#fff2 7px 8px);color:var(--skin-action-text);box-shadow:4px 4px 0 #171512;transform:rotate(-3deg)}
html[data-g42-theme^="rusty"] .vote-card.my-vote:not(.is-flipped) .start-game{transform:rotate(-3deg)}
html[data-g42-theme^="rusty"] .poker-chip{filter:drop-shadow(4px 5px 0 #171512)}

/* Dialogs, private chat and notices share the same poster-card language. */
.join-dialog,.shell-dialog,.private-chat{border:3px solid #171512;border-radius:0;background:var(--skin-panel);color:var(--skin-ink);box-shadow:8px 8px 0 #171512}
.join-dialog::backdrop,.shell-dialog::backdrop{background:rgb(15 12 9/.78)}
.private-chat{z-index:105;left:auto;right:max(.7rem,env(safe-area-inset-right));background:#211d18;color:#fff0d0}
.private-chat textarea{border:2px solid #efd9ae;background:#171512;color:#fff0d0}
.chat-message{border-left:4px solid var(--skin-accent);background:#342c23}
.chat-message.mine{border-color:var(--skin-action);background:#493327}
.message-notice{z-index:106;top:calc(var(--g42-header-height) + .65rem);left:auto;right:max(.7rem,env(safe-area-inset-right));border:3px solid #171512;border-left:7px solid var(--skin-action);border-radius:0;background:#efd9ae;color:#171512;box-shadow:6px 6px 0 #171512}
.theme-grid-base{grid-template-columns:repeat(3,minmax(0,1fr))}
.theme-choice{border:2px solid var(--skin-line);border-radius:0;background-color:rgb(239 217 174/.62);background-image:linear-gradient(90deg,var(--skin-check) 1px,transparent 1px),linear-gradient(var(--skin-check) 1px,transparent 1px);background-size:9px 9px;color:var(--skin-ink);box-shadow:3px 3px 0 #171512}
.theme-choice[aria-pressed="true"]{background-color:var(--skin-action);color:#fff}
.theme-preview{background:repeating-linear-gradient(135deg,var(--skin-panel-2) 0 8px,var(--skin-card) 8px 16px)!important}

.shell iframe,.shell.collapsed iframe{position:fixed;inset:var(--g42-header-height) 0 0;width:100%;height:calc(100dvh - var(--g42-header-height));border:0;background:#fff}

@media(max-width:720px){
  html[data-g42-theme]{--g42-header-height:calc(3.65rem + env(safe-area-inset-top))}
  html[data-g42-theme] body::before{background-image:linear-gradient(rgb(214 188 140/.12),rgb(214 188 140/.12)),url("theme/spielkarten-plakat-mobile.webp")}
  html[data-g42-theme="rusty-dark"] body::before{background-image:linear-gradient(rgb(17 14 11/.72),rgb(17 14 11/.72)),url("theme/spielkarten-plakat-mobile.webp")}
  #shellbar.shellbar,#shellbar.shellbar.open{top:0;left:0;width:100%;height:var(--g42-header-height);min-height:var(--g42-header-height);max-height:var(--g42-header-height);padding-top:env(safe-area-inset-top);padding-right:max(.35rem,env(safe-area-inset-right));padding-left:max(.35rem,env(safe-area-inset-left));align-items:center;border-radius:0}
  #shellbar .shell-logo{flex-basis:3.45rem;width:3.45rem;height:3.45rem;transform:none}
  #shellbar #shellMenu,#shellbar.open #shellMenu{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:calc(var(--g42-header-height) - env(safe-area-inset-top) - .3rem);width:auto;height:auto;min-width:0;padding:0;gap:.25rem}
  #shellbar .shell-room{display:none}
  #shellbar .shell-players{grid-column:1;grid-row:1;padding:0}
  #shellbar .shell-settings{grid-column:2;grid-row:1}
  #shellbar .shell-player{max-width:6.5rem;height:1.75rem;min-height:1.75rem}
  #shellbar .shell-player-contact{padding:.2rem .35rem;font-size:.62rem}
  #shellbar #shellMenu .shell-settings-toggle{width:2rem;height:2rem;min-width:2rem}
  #shellbar .shell-settings-panel{top:calc(100% + .55rem)}
  .masthead{min-height:13.5rem;padding:2rem 1rem}
  .masthead h1{font-size:clamp(2.75rem,16vw,4.6rem)}
  .desk-v2{margin:-1.15rem auto 0}
  .mobile-home-tabs{top:calc(var(--g42-header-height) + .45rem)}
  html[data-g42-theme] .room-view{inset:var(--g42-header-height) 0 0;background-color:transparent;background-image:none}
  html[data-g42-theme] .room-view::before{background-image:linear-gradient(rgb(214 188 140/.12),rgb(214 188 140/.12)),url("theme/spielkarten-plakat-mobile.webp")}
  html[data-g42-theme="rusty-dark"] .room-view::before{background-image:linear-gradient(rgb(17 14 11/.72),rgb(17 14 11/.72)),url("theme/spielkarten-plakat-mobile.webp")}
  .room-view .room-top{padding:1rem}
  .room-view .room-title{font-size:clamp(2rem,12vw,3.4rem)}
  .theme-grid-base{grid-template-columns:1fr}
  .private-chat{right:.5rem;width:calc(100vw - 1rem)}
  .primary,.ink,.room-tile button,.private-chat form button{min-height:2.75rem;clip-path:none;transform:none}
  .primary:hover,.ink:hover,.room-tile button:hover,.private-chat form button:hover{transform:none;box-shadow:4px 4px 0 #171512}
}

@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

/* Beat the former skin layer's ID selectors; this is the single final header authority. */
html[data-g42-theme] #shellbar.shellbar{background:#171512;border:0;border-bottom:3px solid #070706;border-radius:0;box-shadow:0 3px 0 #d41459,0 7px 18px #0004}
html[data-g42-theme] #shellbar.shellbar::before{inset:0;border:0;border-radius:0;background:repeating-linear-gradient(135deg,transparent 0 8px,#fff1 9px 10px),#171512;box-shadow:none;opacity:1;transform:none}
html[data-g42-theme] #shellbar.shellbar .shell-logo{width:4.25rem;height:4.25rem;padding:0;border:0;border-radius:0;background:transparent;color:#fff;box-shadow:none;transform:translateY(.1rem) rotate(-4deg);overflow:visible}
html[data-g42-theme] #shellbar.shellbar #shellMenu,html[data-g42-theme] #shellbar.shellbar.open #shellMenu{display:grid;opacity:1;visibility:visible;transform:none;pointer-events:auto;background:transparent}
html[data-g42-theme] #shellbar.shellbar #shellMenu .shell-settings-toggle{width:2.15rem;height:2.15rem;min-width:2.15rem;padding:.38rem;border:2px solid #efd9ae;border-radius:0;background:#28231d;color:#efd9ae;box-shadow:2px 2px 0 #087f9a;opacity:1;pointer-events:auto;transform:none}
html[data-g42-theme] #shellbar.shellbar #shellMenu .shell-settings-toggle:is(:hover,:focus-visible,[aria-expanded="true"]){border:2px solid #fff;background:#d41459;color:#fff}
html[data-g42-theme] #shellbar.shellbar .shell-settings-toggle .comic-gear path{fill:currentColor;stroke:none}
html[data-g42-theme] #shellbar.shellbar .shell-settings-toggle .comic-gear circle{fill:#171512;stroke:currentColor;stroke-width:1.5}
html[data-g42-theme] #shellbar.shellbar .shell-player{border:2px solid #080706;border-left:.42rem solid var(--player-color,#655442);border-radius:0;background:#28231d;color:#fff2d3;box-shadow:2px 2px 0 #0008}
html[data-g42-theme] #shellbar.shellbar #shellMenu .shell-player-contact{color:#fff2d3;font-weight:800}
html[data-g42-theme] #shellbar.shellbar .presence-dot{box-shadow:0 0 0 1px #171512}
@media(max-width:720px){
  html[data-g42-theme] #shellbar.shellbar .shell-logo{width:3.45rem;height:3.45rem;transform:none}
  html[data-g42-theme] #shellbar.shellbar:not(.has-room) #shellMenu{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:calc(var(--g42-header-height) - env(safe-area-inset-top) - .3rem)}
  html[data-g42-theme] #shellbar.shellbar:not(.has-room) .shell-room{display:none}
  html[data-g42-theme] #shellbar.shellbar:not(.has-room) .shell-players{grid-column:1;grid-row:1}
  html[data-g42-theme] #shellbar.shellbar:not(.has-room) .shell-settings{grid-column:2;grid-row:1}
}

/* Focused entry flow: identity first, tables second, games only inside a room. */
.entry-stage,.lobby-stage{width:100%;min-height:calc(100dvh - var(--g42-header-height));padding:clamp(1.25rem,5vw,4.5rem)}
.entry-stage{display:grid;place-items:center}
.entry-stage[hidden],.lobby-stage[hidden]{display:none!important}
.entry-card{position:relative;width:min(35rem,100%);padding:clamp(1.4rem,4vw,2.7rem);border:3px solid var(--skin-line);background:color-mix(in srgb,var(--skin-panel) 96%,transparent);color:var(--skin-ink);box-shadow:9px 9px 0 #171512}
.entry-card .card-no{top:1rem;right:1.2rem;font-size:clamp(2.8rem,8vw,5.4rem);opacity:.1}
.entry-card h1,.lobby-stage h1,.create-room-dialog h2{margin:.2rem 0 1.6rem;font:900 clamp(2.25rem,6vw,4.8rem)/.88 Impact,"Arial Black",Arial,sans-serif;letter-spacing:.01em;text-transform:uppercase;text-wrap:balance}
.entry-card label,.entry-card legend,.create-room-dialog label{display:block;margin:1rem 0;font:800 .78rem/1.25 Arial,sans-serif;letter-spacing:.07em;text-transform:uppercase}
.entry-card input,.create-room-dialog input{width:100%;padding:.75rem .15rem;border:0;border-bottom:3px solid currentColor;border-radius:0;background:transparent;color:inherit;outline:0}
.entry-card input:focus,.create-room-dialog input:focus{box-shadow:0 4px 0 var(--skin-accent)}
.entry-card .player-color-picker{margin:1.3rem 0}
.entry-card .primary{margin-top:1.5rem}
.lobby-stage{max-width:76rem;margin:0 auto}
.lobby-stage-head{display:flex;align-items:flex-end;justify-content:space-between;gap:2rem;margin-bottom:clamp(1.5rem,4vw,3.5rem);padding:clamp(1.2rem,3vw,2rem);border:3px solid var(--skin-line);background:color-mix(in srgb,var(--skin-panel) 94%,transparent);box-shadow:8px 8px 0 #171512}
.lobby-stage-head h1{margin:0}
.lobby-stage-head .eyebrow{margin-bottom:.55rem}
.lobby-stage-head .primary{flex:0 0 auto;width:auto;min-width:13rem;margin:0}
.lobby-room-list{grid-template-columns:repeat(auto-fit,minmax(min(22rem,100%),1fr));gap:1.2rem}
.lobby-room-list .room-tile{padding:1.1rem;border:3px solid var(--skin-line);background:color-mix(in srgb,var(--skin-panel-2) 95%,transparent);box-shadow:5px 5px 0 #171512}
.lobby-room-list .room-tile h3{font-family:Impact,"Arial Black",Arial,sans-serif;text-transform:uppercase}
.lobby-room-list .empty{grid-column:1/-1;margin:0;padding:clamp(2rem,8vw,6rem);border:3px dashed var(--skin-line);background:color-mix(in srgb,var(--skin-panel) 84%,transparent);font-size:1rem;font-weight:800;text-transform:uppercase}
.create-room-dialog{width:min(31rem,calc(100% - 2rem))}
.create-room-dialog h2{font-size:clamp(2rem,7vw,3.4rem)}
.create-room-dialog .primary{margin-top:1.5rem}
.create-room-dialog .random-room-name{margin-bottom:.1rem}

@media(min-width:721px) and (max-height:800px){
  .entry-stage{align-items:start;padding-top:2.5rem;padding-bottom:2rem}
  .entry-card{padding:1.45rem 2rem}
  .entry-card h1{font-size:3.35rem;margin-bottom:1rem}
  .entry-card label{margin:.65rem 0}
  .entry-card .player-color-picker{margin:.85rem 0}
  .entry-card .player-colors{margin-top:.45rem}
  .entry-card .player-color-picker output{margin-top:.4rem}
  .entry-card .primary{margin-top:.85rem}
}

@media(max-width:720px){
  .entry-stage,.lobby-stage{min-height:calc(100dvh - var(--g42-header-height));padding:1rem .75rem calc(1.25rem + env(safe-area-inset-bottom))}
  .entry-stage{align-items:start;padding-top:1.2rem}
  .entry-card{padding:1.25rem;box-shadow:5px 5px 0 #171512}
  .entry-card h1{max-width:80%;margin-bottom:1.3rem;font-size:clamp(2.2rem,12vw,3.4rem)}
  .entry-card .player-colors{grid-template-columns:repeat(8,minmax(0,1fr));gap:.38rem}
  .entry-card .player-color span{min-width:0}
  .lobby-stage-head{align-items:stretch;flex-direction:column;padding:1.15rem;gap:1.2rem;box-shadow:5px 5px 0 #171512}
  .lobby-stage-head h1{font-size:clamp(2.35rem,13vw,3.7rem)}
  .lobby-stage-head .primary{width:100%;min-width:0}
  .lobby-room-list{display:block}
  .lobby-room-list .room-tile{margin-bottom:1rem;padding:.9rem;grid-template-columns:minmax(0,1fr) auto}
  .join-dialog form,.join-dialog>div{padding:1.35rem}
  .create-room-dialog{width:calc(100% - 1rem);max-height:calc(100dvh - 1rem)}
}

/* Final platform-menu geometry: readable stacked actions beside full-height audio. */
html[data-g42-theme] #shellbar.shellbar .shell-player[data-player-color]{height:2.15rem;min-height:2.15rem;border:3px solid var(--player-color,#68737D);border-radius:.55rem;background:#211d18;color:#fff;box-shadow:3px 3px 0 #050504,5px 5px 0 color-mix(in srgb,var(--player-color,#68737D) 72%,#050504);overflow:hidden}
html[data-g42-theme] #shellbar.shellbar .shell-player[data-player-color] .shell-player-contact{width:100%;padding:.3rem .55rem;background:#211d18;color:#fff;line-height:1;white-space:nowrap}
html[data-g42-theme] #shellbar.shellbar .shell-player[data-player-color] .shell-player-contact:is(:hover,:focus-visible){background:#302a23;color:#fff}
html[data-g42-theme] #shellbar.shellbar .shell-player[data-player-color] .self-mark{color:var(--player-color,#68737D);font-size:.9rem}

html[data-g42-theme] #shellbar.shellbar .shell-settings-panel{grid-template-columns:minmax(8.75rem,.9fr) minmax(10.5rem,1.1fr);grid-template-rows:repeat(5,2.65rem);align-items:stretch;width:min(23rem,calc(100vw - 1rem));max-height:calc(100dvh - var(--g42-header-height) - 1rem);padding:.65rem;gap:.48rem;border:3px solid #171512;border-radius:.85rem;background:#211d18;color:#fff0d0;box-shadow:8px 8px 0 #050504;overflow:auto}
html[data-g42-theme] #shellbar.shellbar #shellMenu .shell-settings-panel .shell-settings-item{grid-column:2!important;display:grid;grid-template-columns:1.25rem minmax(0,1fr);place-items:center start;width:100%;height:100%;min-height:2.65rem;padding:.55rem .65rem;gap:.55rem;border:2px solid #655442;border-radius:.55rem;background:#2c261f;color:#fff0d0;font:900 .7rem/1.15 Arial,sans-serif;letter-spacing:.035em;text-transform:uppercase;box-shadow:3px 3px 0 #050504;overflow:hidden}
html[data-g42-theme] #shellbar.shellbar #shellMenu .shell-settings-panel .shell-settings-item .shell-control-label{display:block;max-width:100%;overflow-wrap:anywhere;white-space:normal}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel #choosePlayerColor{grid-row:1}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel #chooseTheme{grid-row:2}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel #openAdminPanel{display:none!important}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel #fullscreen{grid-row:3;margin:0;border-top-width:2px}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel #platformExit{grid-row:4}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel #platformEndGame{grid-row:5}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel .shell-audio-control{display:block!important;grid-column:1;grid-row:1/6;min-width:0;height:100%}
html[data-g42-access-mode="admin"][data-g42-theme] #shellbar.shellbar .shell-settings-panel{grid-template-rows:repeat(6,2.65rem)}
html[data-g42-access-mode="admin"][data-g42-theme] #shellbar.shellbar .shell-settings-panel #openAdminPanel{display:grid!important;grid-row:3}
html[data-g42-access-mode="admin"][data-g42-theme] #shellbar.shellbar .shell-settings-panel #fullscreen{grid-row:4}
html[data-g42-access-mode="admin"][data-g42-theme] #shellbar.shellbar .shell-settings-panel #platformExit{grid-row:5}
html[data-g42-access-mode="admin"][data-g42-theme] #shellbar.shellbar .shell-settings-panel #platformEndGame{grid-row:6}
html[data-g42-access-mode="admin"][data-g42-theme] #shellbar.shellbar .shell-settings-panel .shell-audio-control{grid-row:1/7}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel .volume-popover{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;min-height:0;padding:.65rem .35rem;gap:.3rem;border:2px solid #655442;border-radius:.55rem;background:#171512;color:#fff0d0;box-shadow:3px 3px 0 #050504;opacity:1;visibility:visible;transform:none!important;pointer-events:auto}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel .volume-popover>p{grid-column:1/-1;margin:0 0 .2rem;color:#efd9ae;font:900 .68rem/1 Arial,sans-serif;letter-spacing:.1em;text-transform:uppercase}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel .volume-row{display:grid;grid-template-rows:2rem minmax(0,1fr) 1rem;height:100%;min-width:0;padding:.1rem .22rem;gap:.35rem}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel .volume-row>button{width:2rem;height:2rem;padding:.35rem;border:2px solid #655442;border-radius:.45rem;background:#2c261f;color:#fff0d0;box-shadow:2px 2px 0 #050504}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel .volume-row label{display:grid;grid-template-rows:auto minmax(0,1fr);justify-items:center;height:100%;min-height:0;gap:.3rem;color:#fff0d0;font-size:.59rem;white-space:nowrap}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel .volume-row input{width:1.1rem;height:100%;min-height:0}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel .volume-row output{color:#efd9ae;font-size:.58rem}

html[data-g42-theme] .private-chat{top:var(--chat-top);left:var(--chat-left,.7rem)!important;right:auto!important}
html[data-g42-theme] .private-chat{grid-template-rows:auto minmax(5rem,1fr) auto;border-radius:.85rem;background:#211d18!important;color:#fff0d0;box-shadow:7px 7px 0 #050504}
html[data-g42-theme] .private-chat.is-player-chat{border:4px solid var(--chat-player-color,#68737D);box-shadow:0 0 0 2px #050504,7px 7px 0 #050504}
html[data-g42-theme] .private-chat>header{padding:.62rem .75rem;background:#211d18;border-color:#655442}
html[data-g42-theme] .private-chat>header p{margin-bottom:.12rem}
html[data-g42-theme] .private-chat>header h2{font-size:.9rem}
html[data-g42-theme] .chat-messages{align-items:flex-start;gap:.3rem;padding:.55rem;background:#211d18}
html[data-g42-theme] .chat-message,html[data-g42-theme] .chat-message.mine{align-self:flex-start;width:fit-content;max-width:100%;padding:.34rem .48rem;border:0;border-left:4px solid var(--skin-accent);border-radius:.45rem;background:#342c23;color:#fff0d0;font:500 .78rem/1.28 "Arial Narrow",Arial,sans-serif;white-space:normal;box-shadow:2px 2px 0 #050504}
html[data-g42-theme] .chat-message.mine{border-left-color:var(--skin-action);background:#3d3027}
html[data-g42-theme] .chat-message>strong{display:inline;margin:0;color:#efd9ae;font:900 .76rem/1.28 Arial,sans-serif;text-transform:none}
html[data-g42-theme] .chat-message .chat-message-body{white-space:pre-wrap}
html[data-g42-theme] .chat-message time{display:inline-block;margin:0 0 0 .45rem;color:#c7ad80;font-size:.54rem;white-space:nowrap}
html[data-g42-theme] .chat-message.note{border-left-color:var(--skin-accent);background:#302d27}
html[data-g42-theme] .private-chat form{padding:.55rem;gap:.35rem;background:#211d18;border-color:#655442}
html[data-g42-theme] .private-chat textarea{min-height:2.7rem;padding:.48rem .55rem;background:#171512;color:#fff0d0}

@media(max-width:720px){
  html[data-g42-theme] #shellbar.shellbar .shell-player[data-player-color]{height:1.95rem;min-height:1.95rem;box-shadow:2px 2px 0 #050504,4px 4px 0 color-mix(in srgb,var(--player-color,#68737D) 72%,#050504)}
  html[data-g42-theme] #shellbar.shellbar .shell-settings-panel{right:.25rem;grid-template-columns:minmax(7.8rem,.85fr) minmax(9.2rem,1.15fr);width:calc(100vw - 1rem);padding:.5rem;gap:.38rem}
  html[data-g42-theme] #shellbar.shellbar #shellMenu .shell-settings-panel .shell-settings-item{min-height:2.5rem;padding:.45rem .5rem;font-size:.64rem}
  html[data-g42-theme] #shellbar.shellbar .shell-settings-panel .volume-popover{padding:.5rem .25rem}
  html[data-g42-theme] .private-chat{left:.5rem!important;right:auto!important;width:calc(100vw - 1rem)}
  html[data-g42-theme] .private-chat form{grid-template-columns:minmax(0,1fr) auto}
  html[data-g42-theme] .private-chat form button{align-self:stretch;justify-self:stretch;min-height:2.7rem;margin:0}
}

/* One mobile header geometry for home, lobby and game. */
#shellbar .shell-player-initial{display:none}
@media(max-width:720px){
  html[data-g42-theme]{--g42-header-height:calc(5.1rem + env(safe-area-inset-top))}
  html[data-g42-theme] #shellbar.shellbar,
  html[data-g42-theme] #shellbar.shellbar.open{align-items:stretch;gap:.35rem;padding:env(safe-area-inset-top) max(.35rem,env(safe-area-inset-right)) 0 max(.25rem,env(safe-area-inset-left))}
  html[data-g42-theme] #shellbar.shellbar .shell-logo{align-self:stretch;flex:0 0 5rem;width:5rem;height:5rem;transform:none}
  html[data-g42-theme] #shellbar.shellbar #shellMenu,
  html[data-g42-theme] #shellbar.shellbar.open #shellMenu{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:2.25rem 2.35rem;align-content:center;align-items:center;justify-items:stretch;flex:1 1 0;width:auto;height:5rem;min-width:0;min-height:0;padding:.1rem 0;gap:.15rem .25rem;white-space:nowrap}
  html[data-g42-theme] #shellbar.shellbar .shell-room{display:flex;grid-column:1;grid-row:1;align-self:center;min-width:0;min-height:0}
  html[data-g42-theme] #shellbar.shellbar #shellRoomChat{min-width:0;max-width:100%;padding:.25rem .2rem}
  html[data-g42-theme] #shellbar.shellbar #shellRoomName{max-width:100%;font-size:.85rem;line-height:1.2}
  html[data-g42-theme] #shellbar.shellbar .shell-settings{grid-column:2;grid-row:1;align-self:center;justify-self:end;min-width:0;margin:0}
  html[data-g42-theme] #shellbar.shellbar #shellMenu .shell-settings-toggle{width:2.15rem;height:2.15rem;min-width:2.15rem}
  html[data-g42-theme] #shellbar.shellbar .shell-players{display:flex;grid-column:1/-1;grid-row:2;align-self:center;align-items:center;flex:1 1 auto;width:100%;min-width:0;max-width:100%;height:2.25rem;margin:0;padding:.12rem .15rem;gap:.35rem;overflow-x:auto;overflow-y:hidden}
  html[data-g42-theme] #shellbar.shellbar .shell-player[data-player-color]{flex:0 0 auto;height:1.9rem;min-height:1.9rem;max-width:8rem}
  html[data-g42-theme] #shellbar.shellbar .presence-dot{display:none}
  html[data-g42-theme] #shellbar.shellbar.compact-names .shell-player-name{display:none}
  html[data-g42-theme] #shellbar.shellbar .shell-player-initial{display:none}
  html[data-g42-theme] #shellbar.shellbar.compact-names .shell-player-initial{display:inline}
  html[data-g42-theme] #shellbar.shellbar.compact-names .shell-player[data-player-color]{min-width:2.15rem;max-width:2.6rem}
  html[data-g42-theme] #shellbar.shellbar.compact-names .shell-player-contact{display:flex;align-items:center;justify-content:center;padding:.2rem .3rem}
  html[data-g42-theme] #shellbar.shellbar.compact-names .self-mark{display:none}
  html[data-g42-theme] #shellbar.shellbar:not(.has-room) .shell-room{display:none}
  html[data-g42-theme] #shellbar.shellbar:not(.has-room) .shell-settings{grid-column:2;grid-row:1}
  html[data-g42-theme] #shellbar.shellbar:not(.has-room) .shell-players{grid-column:1/-1;grid-row:2}
}

/* Incoming messages belong beside the opened chat, not on the opposite corner. */
html[data-g42-theme] .message-notice{top:calc(var(--g42-header-height) + .6rem);left:max(.5rem,env(safe-area-inset-left));right:auto;width:min(23rem,calc(100vw - 1rem));border-color:#171512;border-left-color:var(--skin-action);border-radius:.65rem;background:#efd9ae;color:#171512;opacity:1;box-shadow:5px 5px 0 #050504}

/* One clear color outline per player, without a clipped second color shadow. */
html[data-g42-theme] #shellbar.shellbar .shell-player[data-player-color]{box-shadow:none}
html[data-g42-theme] #shellbar.shellbar .shell-player[data-player-color] .shell-player-contact{border-radius:.35rem}

/* The logo is the settings control; room, location and players are the only header content. */
html[data-g42-theme] #shellbar.shellbar .shell-logo{
  appearance:none;
  cursor:pointer;
}
html[data-g42-theme] #shellbar.shellbar .shell-logo:is(:hover,[aria-expanded="true"]){filter:brightness(1.08)}
html[data-g42-theme] #shellbar.shellbar .shell-logo:focus-visible{outline:3px solid #fff2d3;outline-offset:2px}
html[data-g42-theme] #shellbar.shellbar #shellMenu{grid-template-columns:auto minmax(0,1fr)}
html[data-g42-theme] #shellbar.shellbar #shellRoomChat{gap:.38rem}
html[data-g42-theme] #shellbar.shellbar #shellLocation{display:flex;align-items:center;min-width:0;max-width:12rem;overflow:hidden;color:#efd9ae;font:800 .72rem/1 Arial,sans-serif;text-overflow:ellipsis;white-space:nowrap}
html[data-g42-theme] #shellbar.shellbar #shellLocation::before{content:"·";margin-right:.38rem;color:#d41459;font-weight:900}
html[data-g42-theme] #shellbar.shellbar .shell-settings{position:static;display:block;grid-column:auto;grid-row:auto;width:0;height:0;min-width:0;margin:0}
html[data-g42-theme] #shellbar.shellbar .shell-settings-panel{position:fixed;top:calc(var(--g42-header-height) + .55rem);right:auto;left:max(.55rem,env(safe-area-inset-left))}

@media(max-width:720px){
  html[data-g42-theme]{--g42-header-height:calc(4.5rem + env(safe-area-inset-top))}
  html[data-g42-theme] #shellbar.shellbar,
  html[data-g42-theme] #shellbar.shellbar.open{
    align-items:center;
    gap:.4rem;
    padding:env(safe-area-inset-top) max(.4rem,env(safe-area-inset-right)) 0 max(.4rem,env(safe-area-inset-left));
  }
  html[data-g42-theme] #shellbar.shellbar .shell-logo{
    align-self:center;
    flex:0 0 3.5rem;
    width:3.5rem;
    height:3.5rem;
    transform:none;
  }
  html[data-g42-theme] #shellbar.shellbar #shellMenu,
  html[data-g42-theme] #shellbar.shellbar.open #shellMenu{
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:1.65rem 1.75rem;
    align-content:center;
    width:auto;
    height:3.5rem;
    padding:0;
    gap:.1rem;
  }
  html[data-g42-theme] #shellbar.shellbar .shell-room{
    display:flex;
    grid-column:1;
    grid-row:1;
  }
  html[data-g42-theme] #shellbar.shellbar #shellRoomChat{width:100%;padding:.15rem .2rem;gap:.25rem}
  html[data-g42-theme] #shellbar.shellbar #shellRoomName{flex:0 1 auto;max-width:48%;font-size:.76rem}
  html[data-g42-theme] #shellbar.shellbar #shellLocation{flex:1 1 auto;max-width:none;font-size:.68rem}
  html[data-g42-theme] #shellbar.shellbar #shellLocation::before{margin-right:.25rem}
  html[data-g42-theme] #shellbar.shellbar .shell-players{
    grid-column:1;
    grid-row:2;
    width:100%;
    height:2rem;
    padding:.05rem .15rem;
  }
  html[data-g42-theme] #shellbar.shellbar .shell-settings{grid-column:auto;grid-row:auto;width:0;height:0}
  html[data-g42-theme] #shellbar.shellbar .shell-settings-panel{top:calc(var(--g42-header-height) + .45rem);right:auto;left:.5rem}
  html[data-g42-theme] #shellbar.shellbar:not(.has-room) #shellMenu{grid-template-rows:1fr}
  html[data-g42-theme] #shellbar.shellbar:not(.has-room) .shell-room{display:none}
  html[data-g42-theme] #shellbar.shellbar:not(.has-room) .shell-players{grid-column:1;grid-row:1}
}
