:root{color-scheme:dark;font:16px system-ui,-apple-system,BlinkMacSystemFont,sans-serif;color:#fff0db;background:#140e0c;--game-w:100vw;--game-h:75vw;--game-top:0px;--game-left:0px;--left-panel:0px;--right-panel:0px;--safe-l:env(safe-area-inset-left,0px);--safe-r:env(safe-area-inset-right,0px);--safe-t:env(safe-area-inset-top,0px);--safe-b:env(safe-area-inset-bottom,0px)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}body{position:fixed;inset:0}button,input,a{font:inherit}button{cursor:pointer;touch-action:manipulation;color:inherit;border:1px solid #84634a;background:#2c211c;border-radius:10px;min-height:48px;padding:10px 18px;font-weight:700}button:focus-visible,a:focus-visible{outline:3px solid #f4ce7d;outline-offset:3px}button:disabled{opacity:.55}button.primary{background:#a62a1e;border-color:#d85735;box-shadow:inset 0 1px #ffb88c44}button:active{filter:brightness(1.25)}[hidden]{display:none!important}
#stage{position:absolute;inset:0;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;background:#170e0b}#screen{position:absolute;left:var(--game-left);top:var(--game-top);width:var(--game-w);height:var(--game-h);image-rendering:pixelated;background:#000;touch-action:none}.panel{position:absolute;top:0;bottom:0;background-image:url('./player-panels.png');background-size:200% 100%;background-repeat:no-repeat}.left-panel{left:0;width:var(--left-panel);background-position:left center}.right-panel{right:0;width:var(--right-panel);background-position:right center}.side-brand{position:absolute;bottom:max(12px,var(--safe-b));left:max(12px,var(--safe-l));font-size:10px;letter-spacing:2px;color:#d6b690;pointer-events:none;opacity:.7}
#controls{position:absolute;inset:0;pointer-events:none}.control{position:absolute;pointer-events:auto;transform:translate(-50%,-50%);padding:0;min-height:0;min-width:0;border-radius:50%;border:2px solid #d7a86f;box-shadow:inset 0 0 0 4px #1b1111,inset 0 5px 11px #ffc17c44,0 3px 0 #080504;background:radial-gradient(circle at 35% 25%,#a63521,#41150f 70%);font-size:clamp(18px,4vh,27px);font-weight:850;opacity:.5;touch-action:none;line-height:1}.control[data-control="y"],.control[data-control="b"],.control[data-control="z"]{background:radial-gradient(circle at 35% 25%,#a17b42,#3d2814 70%)}.control.pressed{filter:brightness(1.7);box-shadow:inset 0 0 0 3px #2b1409,0 0 18px #ffaf4a80}.control.utility{border-radius:8px;background:linear-gradient(#523b2e,#201512);border-width:1px;font-size:11px;letter-spacing:.5px;box-shadow:inset 0 1px #f2c28b66,0 2px 0 #000}.control[data-control="menu"],.control[data-control="layout"]{font-size:23px}.control.dpad{border:0;background:none;box-shadow:none;padding:0;border-radius:12px}.dpad svg{width:100%;height:100%;overflow:visible;filter:drop-shadow(0 3px 0 #000)}.dpad .cross{fill:#211a17;stroke:#d7ac76;stroke-width:2}.dpad .arrow{fill:#a98c66}.dpad circle{fill:#413124;stroke:#876443;stroke-width:1}.dpad[data-directions~="up"] .up,.dpad[data-directions~="down"] .down,.dpad[data-directions~="left"] .left,.dpad[data-directions~="right"] .right{fill:#ffe8a9}
.veil{position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;padding:max(16px,var(--safe-t)) max(18px,var(--safe-r)) max(16px,var(--safe-b)) max(18px,var(--safe-l));background:#090604dd;overflow:auto;touch-action:pan-y;user-select:text}.card{width:min(570px,100%);max-height:100%;overflow:auto;padding:26px;border:1px solid #79563b;border-radius:14px;background:linear-gradient(145deg,#38251a,#100c0a 72%);box-shadow:0 20px 90px #0008;touch-action:pan-y}.welcome{position:relative;background:linear-gradient(90deg,#140b08f5,#140b08c7),url('./player-artwork.png') center/cover}.eyebrow{font-size:11px;letter-spacing:3px;color:#d5a56b;font-weight:750}h1{font-size:clamp(36px,8vh,68px);line-height:.95;letter-spacing:-2px;margin:19px 0;color:#fff0d5;font-weight:900}h1 span{color:#ce3f23}h2{margin:10px 0;font-size:29px}.welcome p{color:#e1cbb7;line-height:1.45}.launch-actions{display:grid;gap:9px;margin:20px 0}.fine{font-size:12px;line-height:1.5;color:#bda791}.brand-links{display:flex;gap:14px;flex-wrap:wrap;margin-top:18px}.brand-links a{color:#c5a781;font-size:11px;text-decoration:none;min-height:30px;display:flex;align-items:center}.menu-card{width:min(650px,100%)}.menu-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.menu-actions button:first-child{grid-column:1/-1}
#editor{position:absolute;z-index:8;top:max(8px,var(--safe-t));left:50%;transform:translateX(-50%);width:min(520px,60vw);padding:10px 12px;background:#1b100ef2;border:1px solid #bc8150;border-radius:10px;box-shadow:0 3px 20px #0008;touch-action:pan-y;font-size:12px;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:7px}#editor strong{flex-basis:100%;text-align:center}#editor label{display:flex;align-items:center;gap:6px}#editor input[type="range"]{width:94px;accent-color:#bd4930}#editor button{min-height:36px;padding:5px 10px;font-size:11px}.editing .control{outline:1px dashed #ffdf9b;outline-offset:5px}.editing .control.selected{outline:3px solid #ffcf78}.editing .control.hidden-control{opacity:.2!important}#diagnostics{position:absolute;z-index:4;left:50%;transform:translateX(-50%);top:max(7px,var(--safe-t));max-width:55vw;background:#000c;border-radius:6px;color:#fff;padding:5px 8px;font:10px ui-monospace,monospace;pointer-events:none}#notice{position:absolute;z-index:9;left:50%;bottom:max(14px,var(--safe-b));transform:translateX(-50%);max-width:90vw;padding:10px 16px;border:1px solid #8c6443;border-radius:9px;background:#1b100eef;color:#f5d9b4;font-size:12px;text-align:center;pointer-events:none}
@media(orientation:portrait){.panel.left-panel{width:100%;top:var(--game-h);background-size:200% auto}.panel.right-panel{display:none}.side-brand{bottom:max(8px,var(--safe-b));font-size:9px}#editor{width:calc(100% - 20px);top:calc(var(--game-h) + 8px);max-height:calc(100% - var(--game-h) - 16px);overflow:auto}.card{padding:24px 20px}h1{font-size:clamp(44px,12vw,68px)}#diagnostics{max-width:90vw}.menu-actions{grid-template-columns:1fr 1fr}}
@media(max-height:420px) and (orientation:landscape){.welcome{width:min(690px,100%);display:grid;grid-template-columns:1fr 1fr;gap:0 25px;padding:17px 24px}.welcome .eyebrow,.welcome h1{grid-column:1;grid-row:auto}.welcome h1{font-size:43px;margin:12px 0}.welcome #status{grid-column:1;font-size:13px;margin:0}.welcome .launch-actions{grid-column:2;grid-row:1/4;margin:8px 0;align-self:center}.welcome #install-hint,.welcome nav{grid-column:1/-1;margin:5px 0}.welcome nav{justify-content:space-between}.menu-card{padding:15px 22px}.menu-card h2{font-size:23px;margin:5px 0}.menu-card p{margin:6px 0}.menu-actions button{min-height:42px;padding:7px 12px;font-size:13px}}

.room-return{display:block;color:#f0ce9b;min-height:48px;padding:14px 0}#room-start{width:100%;min-height:48px}#room-lobby h2{font-size:19px}

#install-game{width:100%;margin:8px 0}.install-dialog{color:inherit;max-width:520px;max-height:calc(100dvh - 32px);touch-action:pan-y}.install-dialog::backdrop{background:#090604dd}.install-dialog p{line-height:1.5;white-space:pre-line}.install-dialog button{margin:8px 8px 0 0}
@media(max-height:420px) and (orientation:landscape){.welcome #install-game{grid-column:2;min-height:42px;margin:5px 0}.install-dialog{padding:16px 22px}.install-dialog h2{font-size:23px}}

.gamepad-focus{outline:3px solid #f4ce7d!important;outline-offset:3px}

.controller-settings{max-width:800px;overflow:auto}.controller-bindings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.controller-bindings button{font-size:14px;padding:8px;min-height:48px}.controller-settings select{max-width:100%;min-height:48px}.controller-settings p{white-space:normal}@media(max-width:500px){.controller-bindings{grid-template-columns:repeat(2,minmax(0,1fr))}}

:root{color:#f5f4df;background:#101b16;--game-h:87.5vw}#stage{background:#101b16}.control{border-color:#b6e34d;background:radial-gradient(circle at 35% 25%,#6a933f,#1c3926 70%);box-shadow:inset 0 0 0 4px #15261c,0 3px #080e09}.control[data-control="b"],.control[data-control="c"]{background:radial-gradient(circle at 35% 25%,#57905a,#1c3926 70%)}.control.utility{background:linear-gradient(#354e31,#15261c);border-color:#b6e34d}.dpad .cross{fill:#15261c;stroke:#b6e34d}.dpad .arrow{fill:#b6e34d}.dpad circle{fill:#2d4432;stroke:#b6e34d}button.primary{background:#b6e34d;border-color:#b6e34d;color:#142015}.card{background:linear-gradient(145deg,#2d4432,#101b16 72%);border-color:#5b7150}.welcome{background:linear-gradient(90deg,#101b16f5,#101b16c7),url('./player-artwork.png') center/cover}h1 span,.eyebrow{color:#b6e34d}h1{font-size:clamp(28px,7vh,56px)}h1 span{font-size:.52em;letter-spacing:0}.brand-links a{color:#c8d4b5}

.launch-identity { display: flex; align-items: center; gap: 16px; }
.launch-icon { border-radius: 15px; }
.launch-identity h1 { margin: 4px 0 0; font-size: clamp(36px, 8vw, 61px); letter-spacing: -.06em; }
.launch-identity h1 span { display: block; margin-top: 7px; font-size: .34em; line-height: 1.16; }
.launch-identity .eyebrow { color: #f4f0dd; letter-spacing: .04em; }
.launch-identity .eyebrow strong { color: #c7e968; }
.launch-secondary, .launch-join {
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 9px 12px; color: #c7e968; font-weight: 750; text-align: center;
}
.launch-secondary { border-radius: 7px; background: #f4f0dd; color: #172014; text-decoration: none; }
.launch-join { text-underline-offset: 4px; }
#resume-room { justify-content: flex-start; padding-inline: 0; }
.launch-actions [aria-disabled="true"] { opacity: .62; cursor: default; }
.player-home #status:empty { display: none; }
.player-home #solo { background: #c7e968; border-color: #c7e968; border-radius: 7px; }
.player-home #online-note, .player-home #offline-ready { margin: 5px 0; }
.player-home #offline-ready { color: #c7e968; }
.player-home .welcome { background-color: #191e16; }
.installed-home .welcome { width: min(680px, 100%); }

@media (orientation: portrait) and (max-width: 630px) {
  .installed-home { align-items: start; padding: 0; background: #191e16; }
  .installed-home .welcome {
    max-height: none; min-height: 100%; border: 0; border-radius: 0; box-shadow: none;
    padding: max(185px, calc(45vw + var(--safe-t))) max(20px, var(--safe-r)) max(21px, var(--safe-b)) max(20px, var(--safe-l));
    background: linear-gradient(0deg, #191e16 2%, transparent 70%) top / 100% 56.25vw no-repeat,
      url('./launch-cover.webp') center top / 100% auto no-repeat #191e16;
  }
  .installed-home .launch-identity h1 { font-size: clamp(43px, 15vw, 72px); }
}
@media (max-height: 420px) and (orientation: landscape) {
  .welcome .launch-identity { grid-column: 1; }
  .welcome #online-note, .welcome #offline-ready, .welcome #resume-room { grid-column: 1; }
  .welcome .launch-actions { grid-row: 1 / span 4; }
  .welcome .launch-secondary, .welcome .launch-join { min-height: 40px; }
}

.catalog-brand{color:inherit;text-decoration:none}
.catalog-brand:hover,.catalog-brand:focus-visible{text-decoration:underline}
.player-navigation{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin:.75rem 0}
.catalog-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:.4rem 1rem;color:#d7efab;border:1px solid #657851;border-radius:.55rem;font-weight:700;text-decoration:underline;text-underline-offset:.2em}

/* Subway station menus. The emulator surface and touch layout have their own sizing. */
#gate, #menu {
  --ink: #0c162a;
  --paper: #faf3e4;
  --signal: #13e4ca;
  background: #080f1d;
  color: var(--paper);
  padding: max(12px,var(--safe-t)) max(14px,var(--safe-r)) max(12px,var(--safe-b)) max(14px,var(--safe-l));
}
#gate .welcome, #menu .menu-card {
  display: block;
  width: min(29rem,100%);
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--ink);
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: #39485e transparent;
}
.station-head {display:flex;align-items:center;gap:14px;padding:12px 5%;min-height:54px}
.station-head .catalog-brand {font-weight:900;white-space:nowrap;font-size:clamp(12px,3vw,17px)}
.station-head .catalog-brand strong {color:var(--signal)}
#stage :is(.station-head,.menu-actions) .catalog-link {border:0;border-radius:0;color:inherit;padding:0;text-decoration:none;justify-content:start;gap:.25em;white-space:nowrap}
.station-head .catalog-link {font-size:.86rem}
.metro-line {display:flex;position:relative;isolation:isolate;align-items:center;justify-content:center;flex:1;gap:3px;min-width:0}
.metro-line::before {content:"";position:absolute;inset:calc(50% - 1.5px) 0 auto;height:3px;background:#13e4ca;z-index:-1}
.metro-line i {width:1.42em;height:1.42em;display:grid;place-items:center;border-radius:50%;background:#84c660;color:#07101d;font:900 normal 14px/1 system-ui;font-style:normal}
.metro-line i:nth-child(2){background:#ff963e}.metro-line i:nth-child(3){background:#f9c43d}.metro-line i:nth-child(4){background:#bb79dc}
.station-art {display:block;width:100%;height:auto;image-rendering:pixelated}
.station-body {padding:clamp(12px,2vh,20px) 5% 20px}
#gate h1,#menu h2 {font-family:system-ui,sans-serif;font-weight:950;letter-spacing:-.065em;line-height:.92;color:var(--paper);margin:0}
#gate h1 {font-size:clamp(3.8rem,9.8vh,5.8rem)}
#gate h1 span {display:block;color:var(--signal);font-size:clamp(19px,3.8vh,30px);letter-spacing:-.045em;line-height:1.15}
#menu h2 {font-size:clamp(3rem,8vh,4.5rem);margin-bottom:18px}
#gate .station-body p,#menu-message {color:#bdc8d5;line-height:1.4}
#menu-message:empty {display:none}
#stage .station-modes {display:grid;grid-template-columns:1fr 1fr;margin:16px 0 6px}
.station-modes :is(a,button){display:grid;justify-items:center;align-content:center;gap:4px;min-height:58px;background:transparent;border:0;border-radius:0;color:#c5cede;font:750 1rem/1.2 system-ui;text-decoration:none;cursor:pointer;padding:4px}
.station-modes a {border-left:1px solid #334057}
.station-modes svg {height:23px;width:42px}
.station-modes [aria-pressed=true]{color:var(--signal)}
.station-modes [aria-disabled=true]{opacity:.5}
#stage .launch-actions,#stage .menu-actions {display:grid;grid-template-columns:1fr;gap:3px;margin:12px 0 0}
#stage :is(.station-body,.menu-actions) button,#stage .menu-actions summary {border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--paper);font-weight:700;min-height:44px;text-align:left;padding:8px 0;cursor:pointer}
#stage .station-body .primary {display:flex;justify-content:center;align-items:center;gap:.4em;background:var(--signal);color:#071525;border:0;border-radius:7px;font-size:clamp(20px,3vh,26px);min-height:54px;font-weight:850;letter-spacing:-.025em}
#solo::after,#resume::after {content:"→" / ""}
#stage .launch-join {color:var(--paper);text-decoration:none}
#stage .station-tools {display:flex;flex-wrap:wrap;justify-content:space-between;gap:0 12px}
#stage .station-tools button,#stage .station-body #install-game {width:auto;margin:0;font-size:.87rem;color:#c5d1df}
#gate .brand-links {margin:4px 0 0}
#gate .brand-links a,#gate .fine {color:#a4b6ca}
#gate .room-return {color:var(--signal)}
#stage .menu-actions > :is(button:not(.primary),tmnt-keyboard,a,details) {font-size:1.18rem}
#stage .menu-actions > a {min-height:44px}
#stage .menu-actions details button {display:block;width:100%;font-size:1rem}
#stage .menu-actions summary {font-size:.93rem;color:#bac8d9}
#stage :is(.station-modes,.station-body,.station-head) :is(a,button,summary):focus-visible {outline:2px solid var(--signal);outline-offset:-2px}
@media (orientation:portrait) and (max-width:540px) {
  #gate,#menu {padding:0;background:var(--ink)}
  #gate .welcome,#menu .menu-card {width:100%;height:100%;padding:max(0px,var(--safe-t)) max(0px,var(--safe-r)) max(8px,var(--safe-b)) max(0px,var(--safe-l))}
}
@media (max-height:480px) and (orientation:landscape) {
  #gate .welcome,#menu .menu-card {display:grid;grid-template-columns:38% 1fr;width:min(820px,100%);align-items:start}
  .station-head {grid-column:1/-1;min-height:44px;padding:0 3%}
  .station-art {position:sticky;top:0}
  .station-body {padding:4px 6% 14px}
  #gate h1 {font-size:2.6rem}#gate h1 span {font-size:18px}
  #stage .station-modes {margin-top:8px}
  #gate .station-body .launch-actions {margin:4px 0;grid-row:auto;grid-column:auto}
}
#stage .station-modes button[aria-pressed=true]{color:var(--signal)}
#stage .station-modes button {text-align:center}

.station-visual { display: contents; }
.station-visual tmnt-keyboard { display: none; }

/* A single station scene fills the desktop menu below the platform header. */
@media (min-width: 960px) and (min-height: 481px) {
  #gate, #menu {
    display: block;
    isolation: isolate;
    overflow: hidden;
    padding: 0;
    background: #0b1423;
  }
  #gate::before, #menu::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
      linear-gradient(90deg, #08121df5 0%, #08121deb 24%, #08121db8 43%, #08121d45 65%, #08121d0d 85%),
      linear-gradient(0deg, #08121dde, transparent 35%, transparent 76%, #08121dad);
  }
  #gate .welcome, #menu .menu-card {
    display: grid;
    width: 100%;
    height: 100%;
    max-height: none;
    grid-template-columns: minmax(0, 27rem) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    align-items: start;
    padding: 0 max(28px, calc((100vw - 1200px) / 2)) 24px;
    background: transparent;
  }
  .station-head {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: clamp(48px, 7vh, 76px);
    padding: 0;
    gap: 24px;
  }
  .station-head .metro-line { justify-content: start; padding-left: 1.5rem; }
  .station-visual .station-art {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 65% center;
    pointer-events: none;
  }
  .station-visual tmnt-keyboard {
    grid-column: 1;
    grid-row: 3;
    display: block;
    margin-top: 8px;
  }
  .station-visual .tmnt-key-legend {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px 24px;
    margin: 0;
    padding: 10px 0;
  }
  .station-visual .tmnt-key-legend > div {
    border: 0;
    flex-direction: row-reverse;
    gap: 8px;
    padding: 0;
    font-size: .9rem;
    font-weight: 650;
  }
  .station-visual .tmnt-key-legend kbd {
    display: inline-block;
    text-align: center;
    min-width: 28px;
    padding: 4px 7px;
    background: var(--paper);
    color: var(--ink);
    border: 0;
    border-radius: 4px;
  }
  .station-body {
    min-width: 0;
    grid-column: 1;
    grid-row: 2;
    padding: clamp(12px, 3.5vh, 42px) 0 0;
  }
  #gate h1 { font-size: clamp(74px, 7vw, 108px); }
  #gate h1 span { font-size: clamp(22px, 2.1vw, 34px); }
  #menu h2 { font-size: clamp(56px, 5.4vw, 84px); }
  #stage .station-modes { margin-top: clamp(14px, 2vh, 24px); }
  #stage .station-tools { gap: 0 18px; }
  #stage :is(.station-tools, .menu-actions, .station-modes) :is(a,button,summary):not(.primary):hover {
    color: var(--signal);
  }
}

.platform-header { display: none; }
@media (min-width: 761px) and (min-height: 501px) {
  body { --platform-header-height: 88px; }
  body:has(#gate:not([hidden]), #menu:not([hidden])) .platform-header {
    display: flex;
    position: fixed;
    z-index: 10;
    inset: 0 0 auto;
    height: var(--platform-header-height);
    overflow-y: hidden;
    scrollbar-gutter: stable;
    align-items: center;
    gap: 42px;
    padding-inline: max(28px, calc((100vw - 1200px) / 2));
    background: #101516;
    border-bottom: 1px solid #263034;
    color: #f2f4f5;
    font: 400 16px/normal Inter, Arial, sans-serif;
    font-synthesis: none;
  }
  .platform-header a { color: inherit; text-decoration: none; }
  .platform-header .brand { flex: none; font-weight: 900; font-size: 26px; letter-spacing: -.8px; white-space: nowrap; }
  .platform-header strong { font-weight: inherit; color: #c6ee67; }
  .platform-header nav { display: flex; height: 100%; gap: 32px; }
  .platform-header nav a { display: flex; align-items: center; white-space: nowrap; color: #a9b3b8; border-bottom: 3px solid transparent; }
  .platform-header nav a.active { color: #f2f4f5; border-color: #c6ee67; }
  .platform-header nav a:hover { color: #f2f4f5; }
  .platform-header .languages { display: flex; gap: 2px; margin-left: auto; }
  .platform-header .languages a { display: grid; place-items: center; width: 40px; height: 44px; color: #a9b3b8; font-size: 13px; font-weight: 700; }
  .platform-header .languages [aria-current=page] { border-radius: 6px; color: #c6ee67; background: #202a20; }
  #gate, #menu { top: var(--platform-header-height); }
  .station-head .catalog-brand { display: none; }
  body:has(.platform-header) .tmnt-key-dialog,
  body:has(.platform-header) .install-dialog:not(.console-settings) {
    top: var(--platform-header-height);
    max-height: calc(100dvh - var(--platform-header-height) - 16px);
  }
  body:has(.platform-header) dialog.console-settings {
    top: var(--platform-header-height);
    height: calc(100dvh - var(--platform-header-height));
  }
  body:has(.platform-header) dialog::backdrop { clip-path: inset(var(--platform-header-height) 0 0); }
}
@media (min-width: 761px) and (max-width: 1000px) and (min-height: 501px) {
  body:has(#gate:not([hidden]), #menu:not([hidden])) .platform-header { gap: 24px; }
  .platform-header nav { gap: 20px; }
}
