/* Compact wrapper for this site's iframe. Full-console pages keep the original layout. */
html.embed .console-deck,html.embed .controller-link,html.embed .controller-top,html.embed .connection,html.embed .controller::before{display:none!important}
html.embed .room{padding:0 16px}
html.embed .controller-area{padding:9px 0 12px}
html.embed #desktop-controller{transform:none;width:290px;max-width:100%;padding:4px;box-shadow:0 3px 0 #7c6650;border-radius:5px}
html.embed .controller-face{padding:6px 10px;gap:12px}
html.embed .dpad{width:66px;height:66px;grid-template-columns:repeat(3,22px);grid-template-rows:repeat(3,22px)}
html.embed .system-buttons{gap:8px}
html.embed .system-buttons button{width:28px;height:12px}
html.embed .system-buttons span{font-size:6px}
html.embed .action-buttons{gap:9px}
html.embed .action-buttons button{width:33px;height:33px;font-size:13px}
html.embed .action-buttons span{font-size:6px}
html.embed .controller-area .connection{display:none}
html.embed .transport{padding:7px 0;margin:0;gap:5px;flex-wrap:wrap}
html.embed .transport button{font-size:9px;padding:4px 5px}
html.embed .transport-divider{display:none}
html.embed .engine-choice-row{font-size:9px;padding:4px 0}
html.embed .input-diagnostics{display:none}
html.embed .status{font-size:9px;margin:4px 0;padding:5px}
html.embed body{overflow-x:hidden}
html.embed .compatibility-controls{display:flex;flex-wrap:wrap;gap:6px;font-size:9px;padding:4px 0}
html.embed .compatibility-controls select{max-width:100%;min-width:0;font-size:10px}
html.embed .library{max-height:565px;overflow:auto}
html.embed .cartridge-shelf{max-height:400px;overflow:auto}
html.embed .cartridge{width:100%;min-height:220px;flex-basis:auto}
@media(max-width:759px){
 html.embed .room{padding:0 12px}
 html.embed .compatibility-controls{display:none}
 html.embed .playroom{display:block;padding-top:8px}
 html.embed .television{max-width:450px;margin:auto}
 html.embed .library{margin-top:14px;padding-top:14px;max-height:270px;border-top:1px solid #6b503b}
 html.embed .library-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
 html.embed .library-heading h2{font-size:21px;margin:3px 0}
 html.embed .library-heading .eyebrow{font-size:7px}
 html.embed .library-heading>p{font-size:8px}
 html.embed .cartridge-shelf{display:flex;flex-direction:row;gap:10px;height:200px;max-height:200px;overflow-x:auto;overflow-y:hidden}
 html.embed .cartridge{width:140px;min-width:140px;flex-basis:140px;min-height:190px}
 html.embed .game-notes,html.embed .sideload,html.embed .engine-choice-row{display:none}
 html.embed .transport button{font-size:8px;padding:5px 3px}
}

/* The drawer is the only scrolling area; the surrounding frame grows with its contents. */
html.embed body{min-height:0}
html.embed .masthead,html.embed footer{display:none}
html.embed .playroom{gap:20px;padding-top:10px}
html.embed .library{contain:none;display:flex;flex-direction:column;gap:12px;max-height:none;overflow:visible;margin-top:0}
html.embed .cartridge-drawer{flex:none;height:390px;max-height:none}
html.embed .cartridge-shelf{max-height:none;height:auto;overflow-y:auto;overflow-x:hidden}
html.embed .game-notes{display:none}
@media(min-width:760px){html.embed .playroom{grid-template-columns:minmax(0,1fr) 205px}}
@media(max-width:759px){
 html.embed .library{margin-top:14px;padding:14px;border:1px solid #46583f;border-radius:6px}
 html.embed .cartridge-drawer{height:300px}
 html.embed .cartridge-shelf{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 html.embed .cartridge{width:100%;min-width:0;min-height:0}
 html.embed .sideload{display:flex}
}

html.embed.site-sized{overflow-y:hidden}

/* Keep the embedded collection tidy even when a title or subtitle is long. */
html.embed .cartridge-shelf .cartridge{
  height:255px; min-height:255px; max-height:255px;
  display:flex; flex-direction:column; overflow:hidden;
}
html.embed .cartridge-shelf .cartridge-label{
  display:flex; flex-direction:column; flex:1 1 auto; min-height:0; overflow:hidden;
}
html.embed .cartridge-shelf .cart-series{flex:0 0 auto}
html.embed .cartridge-shelf .cart-picture{flex:0 0 70px; height:70px; aspect-ratio:auto}
html.embed .cartridge-shelf .cart-copy{flex:1 1 auto; min-height:0; overflow:hidden; padding:7px 7px 8px}
html.embed .cartridge-shelf .cartridge .cart-title{
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3;
  overflow:hidden; overflow-wrap:anywhere; font-size:18px; line-height:1.05; letter-spacing:-.4px;
}
html.embed .cartridge-shelf .cart-subtitle{
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
  overflow:hidden; overflow-wrap:anywhere; margin-top:4px;
}
html.embed .cartridge-shelf .cart-bottom{flex:0 0 auto; min-height:17px}

html.embed .cartridge-shelf .cartridge.long-title .cart-title{font-size:15px;letter-spacing:-.3px}

/* Give the game the full width on small screens. The larger layout keeps the cabinet. */
@media(max-width:540px){
  html.embed .room{padding:0 6px}
  html.embed .playroom{padding-top:6px}
  html.embed .television{width:100%;max-width:none;aspect-ratio:4 / 3;background:#1b281f;border:5px solid #506c50;border-radius:12px;box-shadow:0 3px 0 #304a35,inset 0 0 0 2px #b7cba3;overflow:hidden}
  html.embed .cabinet,html.embed .dial-hit{display:none}
  html.embed .glass{inset:0;width:100%;height:100%;border-radius:7px;outline-offset:-3px!important}
}

/* Shared spacing keeps the drawer the same width in either theme. */
@media(min-width:760px){html.embed .library{padding:4px 0 0 16px}}

/* Wider, cartridge-shaped cards on smaller screens. */
@media(max-width:759px){
  html.embed .cartridge-shelf{grid-template-columns:minmax(0,1fr);justify-items:center}
  html.embed .cartridge-shelf .cartridge{width:100%;max-width:220px}
  html.embed .cartridge-shelf .cart-picture{flex-basis:82px;height:82px}
  html.embed .cartridge-shelf .cartridge.long-title .cart-title{font-size:18px}
}

/* Make the embedded phone controller generous enough for thumbs. */
@media(max-width:540px){
  html.embed #desktop-controller{width:100%;max-width:none;--pad-unit:clamp(27px,10vw,42px);--action-size:clamp(38px,12vw,48px)}
  html.embed .controller-face{min-height:140px;padding:10px 8px;gap:5px}
  html.embed .dpad{width:calc(var(--pad-unit)*3);height:calc(var(--pad-unit)*3);grid-template-columns:repeat(3,var(--pad-unit));grid-template-rows:repeat(3,var(--pad-unit))}
  html.embed .system-buttons{gap:4px;padding-top:14px}
  html.embed .system-buttons button{width:clamp(24px,7vw,34px);height:21px}
  html.embed .action-buttons{gap:5px}
  html.embed .action-buttons button{width:var(--action-size);height:var(--action-size);font-size:16px}
}
@media(max-width:300px){
  html.embed #desktop-controller{--pad-unit:clamp(22px,9vw,27px);--action-size:clamp(32px,11.5vw,38px)}
  html.embed .controller-face{padding:10px 4px;gap:3px}
  html.embed .system-buttons{gap:2px}
  html.embed .system-buttons button{width:clamp(20px,7vw,26px)}
  html.embed .action-buttons{gap:3px}
}
