:root {
  color-scheme: dark;
  --bg: #100e18;
  --panel: #191522;
  --line: #3c3044;
  --paper: #fff5eb;
  --muted: #bfb0c7;
  --pink: #f98cb6;
  --orange: #ffc084;
  --display: Impact, "Arial Narrow", "Liberation Sans Narrow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; color: var(--paper); background: radial-gradient(ellipse at 93% 5%, #412036, transparent 55%), var(--bg); font: 1rem system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
.bar { border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: .95rem clamp(1rem, 5vw, 5rem); background: #100e18de; }
.brand { font: 900 1.15rem/1 var(--display); letter-spacing: .045em; }
.brand span { color: var(--pink); }
.mode { color: var(--muted); font: .72rem ui-monospace, monospace; letter-spacing: .13em; }
main { max-width: 95rem; margin: auto; padding: clamp(1.3rem, 4vw, 3.5rem) clamp(1rem, 5vw, 5rem) 3rem; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 900; text-transform: uppercase; }
h1 { font-size: clamp(3rem, 8.8vw, 8rem); line-height: .9; letter-spacing: -.04em; margin-bottom: clamp(1.2rem, 3vw, 2.3rem); }
h1 em { color: var(--pink); }
.locker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.13fr); gap: clamp(1rem, 3vw, 2.4rem); align-items: start; }
.roster { background: var(--panel); border: 1px solid var(--line); padding: clamp(.65rem, 1.8vw, 1.35rem); }
.roster-head { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin-bottom: .7rem; }
.roster-head h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
#count { color: var(--muted); font: .73rem ui-monospace, monospace; }
.crew { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .45rem; }
.tile { position: relative; display: block; overflow: hidden; border: 1px solid var(--line); background: #211524; padding: 0; cursor: pointer; color: var(--paper); }
.tile img { width: 100%; height: auto; aspect-ratio: 1; display: block; }
.tile span { position: absolute; inset: auto 0 0; padding: .27rem .15rem; background: #150e1bd9; text-align: center; font: 700 clamp(.58rem, 1vw, .78rem) system-ui, sans-serif; }
.tile:hover { border-color: var(--pink); }
.tile[aria-pressed="true"] { border-color: var(--orange); outline: 1px solid var(--orange); }
.tile[aria-pressed="true"] span { background: var(--orange); color: #27131b; }
.selected { position: relative; min-width: 0; }
.stage { background: #2c1c2d; border: 1px solid var(--line); }
.stage img { width: 100%; max-height: 65vh; height: auto; display: block; object-fit: cover; object-position: center 45%; }
.selection { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; background: var(--panel); padding: .9rem 1rem; border: 1px solid var(--line); border-top: none; }
.selection h2 { font-size: clamp(1.8rem, 4vw, 3.6rem); line-height: 1; }
.selection p { color: var(--muted); font: .72rem ui-monospace, monospace; margin-top: .35rem; }
.save { display: inline-flex; gap: .75rem; min-height: 44px; align-items: center; padding: .55rem .8rem; background: var(--pink); color: #22131e; font-size: .86rem; font-weight: 850; }
.save:hover { background: var(--orange); }
.switches { position: absolute; display: flex; gap: .35rem; inset: .65rem .65rem auto auto; }
.switches button { border: 1px solid #fff5eb80; color: var(--paper); background: #130c19d9; cursor: pointer; width: 44px; height: 44px; font: 700 1.2rem system-ui, sans-serif; }
.switches button:hover { background: #633554; }
@media (max-width: 680px) {
  .locker { grid-template-columns: minmax(0, 1fr); }
  .selected { grid-row: 1; }
  .stage img { max-height: min(74vw, 55vh); }
}
.contract {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .65rem;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: .5rem;
  margin-bottom: 1.25rem;
  color: var(--paper);
  background: var(--panel);
  border: 1px solid var(--line);
}
.contract label { padding-inline: .25rem; color: var(--orange); font: 700 .8rem ui-monospace, monospace; }
.contract input {
  min-width: 0;
  width: min(100%, 45ch);
  flex: 1 1 45ch;
  padding: .4rem .15rem;
  border: 0;
  color: inherit;
  background: transparent;
  font: clamp(.64rem, 2.7vw, .85rem) ui-monospace, monospace;
}
.contract button {
  min-height: 44px;
  padding: .45rem .7rem;
  border: 0;
  color: #22131e;
  background: var(--pink);
  font: 800 .8rem system-ui, sans-serif;
  cursor: pointer;
}
.contract button:hover { background: var(--orange); }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (max-width: 540px) { .contract { width: 100%; } }
