:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --bg: #1b1530; --ink: #fff7e6; --dim: #c9bfd9; --maroon: #7a2338; --cream: #efe3c2; --yellow: #ffd23f; --green: #3bff7a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; }
body.touch { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.touch .key-only, body:not(.touch) .touch-only { display: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
kbd { background: #2e2547; border: 1px solid #4a3f6b; border-radius: 4px; padding: 0 5px; font-size: .9em; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
.h-left { position: absolute; top: calc(8px + var(--sat)); left: calc(12px + var(--sal)); display: flex; gap: 10px; align-items: center; font-weight: 900; font-size: 20px; text-shadow: 0 2px 0 #0008; }
#h-lives { font-size: 18px; letter-spacing: 2px; }
#h-lives .tkt { display: inline-block; width: 22px; height: 14px; margin-right: 4px; vertical-align: -2px; border-radius: 3px; background: linear-gradient(90deg, #ffd23f 0 70%, #f0b81a 70%); box-shadow: inset 0 0 0 1.5px #0005; position: relative; transform: rotate(-6deg); }
#h-lives .tkt::after { content: ''; position: absolute; left: 68%; top: 2px; bottom: 2px; border-left: 1.5px dashed #0006; }
#h-lives .tkt.gone { background: #fff2; box-shadow: inset 0 0 0 1.5px #fff3; transform: rotate(4deg) scale(.85); }
#h-lives .streak { font-style: normal; font-weight: 900; color: #7dff6b; margin-left: 6px; font-size: 14px; letter-spacing: 0; animation: ltbStreak .6s ease-out; }
@keyframes ltbStreak { from { transform: scale(1.8); } to { transform: scale(1); } }
#h-lives .dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; border: 2px solid #0006; }
.h-mid { position: absolute; top: calc(8px + var(--sat)); left: 50%; transform: translateX(-50%); }
#h-station { background: var(--yellow); color: #111; font-weight: 900; padding: 3px 12px; border-radius: 3px; font-size: 14px; letter-spacing: .5px; box-shadow: 0 2px 0 #0006; }
#b-pause { position: absolute; top: calc(6px + var(--sat)); right: calc(10px + var(--sar)); pointer-events: auto; height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 7px; border-radius: 10px; border: 2px solid #fff6; background: #000a; color: #fff; font-family: inherit; font-size: 14px; font-weight: 800; line-height: 1; letter-spacing: .02em; }
#b-pause i { font-style: normal; font-size: 11px; }
#pause .p-end { display: flex; flex-direction: column; align-items: center; gap: 2px; }
#pause .p-end small { font-size: 11px; font-weight: 600; opacity: .7; }
#banner { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%) scale(.6); opacity: 0; transition: transform .25s cubic-bezier(.2,1.6,.4,1), opacity .2s; text-align: center; }
#banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#banner .board { display: inline-block; background: var(--yellow); color: #111; font-weight: 900; font-size: clamp(26px, 6vw, 54px); padding: 6px 26px; border: 4px solid #111; border-radius: 4px; box-shadow: 0 6px 0 #0008; }
#banner .sub { display: block; margin-top: 10px; font-weight: 800; font-size: clamp(13px, 2.4vw, 18px); color: var(--ink); text-shadow: 0 2px 0 #000a; }
#verdict { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-3deg) scale(.5); opacity: 0; transition: transform .22s cubic-bezier(.2,1.8,.4,1), opacity .15s; font-weight: 900; font-size: clamp(34px, 8vw, 80px); text-shadow: 0 5px 0 #000b; white-space: nowrap; }
#verdict.on { opacity: 1; transform: translate(-50%, -50%) rotate(-3deg) scale(1); }
#verdict.win { color: var(--green); }
#verdict.lose { color: #ff6b6b; }
#verdict small { display: block; font-size: .3em; color: var(--ink); text-align: center; transform: rotate(3deg); margin-top: 4px; }
#tip { position: absolute; left: 50%; bottom: calc(16px + var(--sab)); transform: translateX(-50%); background: #000a; padding: 8px 16px; border-radius: 999px; font-weight: 900; font-size: 18px; opacity: 0; transition: opacity .2s; white-space: nowrap; }
#tip.on { opacity: 1; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.08); } }

/* party pads: one per corner */
#pads { position: absolute; inset: 0; pointer-events: none; }
#pads .pad { position: absolute; width: 92px; height: 92px; border-radius: 50%; border: 4px solid #fff8; pointer-events: auto; display: grid; place-items: center; font-weight: 900; font-size: 18px; color: #111; opacity: .85; touch-action: none; }
#pads .pad.down { transform: scale(.92); opacity: 1; box-shadow: 0 0 0 6px #fff4; }
#pads .pad em { font-style: normal; display: block; font-size: 12px; text-align: center; }
#pads .p0 { left: calc(14px + var(--sal)); bottom: calc(14px + var(--sab)); }
#pads .p1 { right: calc(14px + var(--sar)); bottom: calc(14px + var(--sab)); }
#pads .p2 { left: calc(14px + var(--sal)); top: calc(56px + var(--sat)); }
#pads .p3 { right: calc(14px + var(--sar)); top: calc(56px + var(--sat)); }

/* rotate prompt */
#rotate { display: none; position: fixed; inset: 0; background: var(--bg); z-index: 50; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 30px; }
#rotate b { font-size: 60px; }
@media (orientation: portrait) { body.playing #rotate, body.paused #rotate { display: flex; } }

/* screens */
#ui .screen { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: calc(14px + var(--sat)) calc(16px + var(--sar)) calc(14px + var(--sab)) calc(16px + var(--sal)); overflow-y: auto; z-index: 10; }
#ui .screen.on { display: flex; }
#title { background: linear-gradient(90deg, #1b1530ee 0%, #1b1530cc 50%, #1b153055 100%); gap: 28px; }
.t-main { max-width: 470px; width: 100%; }
.t-side { width: 300px; display: flex; flex-direction: column; gap: 10px; }
.logo { font-weight: 900; font-size: clamp(30px, 6.5vw, 58px); line-height: .92; margin: 6px 0 8px; color: var(--cream); text-shadow: 0 4px 0 var(--maroon), 0 8px 0 #0008; letter-spacing: -1px; }
.logo span { color: var(--yellow); font-size: 1.35em; }
.lead { color: var(--dim); font-weight: 700; margin: 0 0 12px; font-size: 15px; }
.challenge:empty { display: none; }
.challenge { background: #ffd23f22; border: 1px solid var(--yellow); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.menu { display: flex; flex-direction: column; gap: 8px; }
.menu .row, .row { display: flex; gap: 8px; }
.menu .row > * { flex: 1; }
.menu button, .buttons button, .row.big button { background: #2e2547; color: var(--ink); border: 0; border-bottom: 4px solid #140f22; border-radius: 12px; padding: 11px 14px; font-weight: 900; font-size: 16px; }
.menu button.primary, .buttons button.primary, .row.big button.on { background: var(--yellow); color: #111; border-bottom-color: #a8851a; font-size: 19px; }
.menu button:active, .buttons button:active { transform: translateY(2px); border-bottom-width: 2px; }
.picker { display: flex; gap: 8px; margin-top: 12px; }
.picker button { flex: 1; background: #2e2547; border: 3px solid transparent; border-radius: 12px; color: var(--ink); padding: 6px 4px 8px; font-size: 12px; font-weight: 800; position: relative; }
.picker button.on { border-color: var(--yellow); }
.picker button[disabled] { opacity: .5; cursor: default; }
.picker canvas { display: block; margin: 0 auto 2px; width: 54px; height: 54px; }
.picker small { display: block; color: var(--dim); font-size: 10px; }
.sheet { background: #241c3d; border-radius: 18px; padding: 18px 20px; width: 100%; box-shadow: 0 10px 40px #0009; max-height: 100%; overflow-y: auto; }
.sheet.narrow { max-width: 380px; }
.sheet.wide { max-width: 760px; }
.sheet header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sheet h2 { margin: 0; font-weight: 900; }
.ghost { background: none; border: 1px solid #fff4; color: var(--ink); border-radius: 8px; padding: 6px 12px; }
.sub { color: var(--dim); font-weight: 700; }
.help { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.help h4 { margin: 0 0 4px; color: var(--yellow); font-size: 18px; }
.help p { margin: 0 0 6px; color: var(--dim); font-size: 14px; }
.check { display: flex; gap: 8px; align-items: center; margin: 12px 0; font-weight: 700; }
.row.big { margin: 10px 0; }
.row.big button { flex: 1; }
.set-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #fff1; font-weight: 800; }
.set-row button { min-width: 70px; background: #2e2547; color: var(--ink); border: 0; border-radius: 8px; padding: 6px 10px; font-weight: 900; }
.set-row button.on { background: var(--yellow); color: #111; }

/* end */
#end { background: #120d22cc; }
.e-top { text-align: center; }
.e-top .kick { color: var(--dim); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; }
.e-top .big { font-size: clamp(48px, 10vw, 84px); font-weight: 900; line-height: 1; color: var(--yellow); text-shadow: 0 5px 0 var(--maroon); }
.e-top .rank { font-size: 20px; font-weight: 900; margin-top: 6px; }
.e-top .line { color: var(--dim); font-weight: 700; margin-top: 4px; }
.buttons { display: flex; gap: 8px; justify-content: center; margin: 14px 0 6px; flex-wrap: wrap; }
.e-board { text-align: center; color: var(--dim); }

@media (max-height: 460px) {
  #title { gap: 14px; align-items: flex-start; }
  .logo { font-size: 34px; margin: 0 0 4px; }
  .lead { font-size: 13px; margin-bottom: 8px; }
  .menu { gap: 6px; }
  .menu button { padding: 7px 10px; font-size: 14px; }
  .menu button.primary { font-size: 16px; }
  .picker { margin-top: 8px; }
  .picker canvas { width: 36px; height: 36px; }
  .t-side { width: 250px; }
  .help { gap: 8px; }
  .help p { font-size: 13px; }
  #pads .pad { width: 74px; height: 74px; font-size: 15px; }
  #pads .p2, #pads .p3 { top: calc(50px + var(--sat)); }
}
@media (max-width: 720px) and (orientation: landscape) { .t-side { width: 220px; } }
@media (orientation: portrait) { #title { flex-direction: column; align-items: stretch; } .t-side { width: 100%; } .help { grid-template-columns: 1fr; } }

/* coins, line map, perks */
#h-coins { color: var(--yellow); font-weight: 900; font-size: 15px; margin-left: 10px; display: inline-block; text-shadow: 0 2px 0 #000a; }
#h-coins.bump { animation: coinbump .35s ease-out; }
@keyframes coinbump { 0% { transform: scale(1.5); color: #fff6c2; } 100% { transform: scale(1); } }
#banner .kick { display: block; margin-bottom: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; font-size: clamp(11px, 2vw, 14px); color: var(--yellow); text-shadow: 0 2px 0 #000a; }
.wallet { margin: 6px 0 0; color: var(--yellow); font-weight: 900; font-size: 14px; text-align: center; }
.map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.map .ln { display: flex; align-items: center; gap: 10px; text-align: left; background: #2e2547; color: var(--ink); border: 2px solid transparent; border-radius: 12px; padding: 8px 10px; font: inherit; cursor: pointer; min-width: 0; }
.map .ln .no { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: #111; font-weight: 900; }
.map .ln .lt { display: flex; flex-direction: column; min-width: 0; }
.map .ln b { font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map .ln small { color: var(--dim); font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map .ln .nr { color: #c8f7ff; }
.map .ln em { margin-left: auto; font-style: normal; font-weight: 900; color: #7dff6b; }
.map .ln.here { border-color: var(--yellow); }
.map .ln.locked { opacity: .45; cursor: default; }
.map .ln.locked .no { background: #555; color: #ccc; }
.perk { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #fff1; }
.perk .pi { font-size: 28px; flex: none; }
.perk .pt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.perk .pt small { color: var(--dim); font-weight: 700; }
.perk .pips { display: flex; gap: 4px; margin-top: 4px; }
.perk .pips i { width: 16px; height: 6px; border-radius: 3px; background: #fff2; }
.perk .pips i.on { background: var(--yellow); }
.perk button { flex: none; min-width: 72px; background: var(--yellow); color: #111; border: 0; border-radius: 10px; padding: 8px 10px; font-weight: 900; font: inherit; font-weight: 900; cursor: pointer; }
.perk button:disabled { background: #3a3155; color: #8a80a6; cursor: default; }
.perk em { font-style: normal; color: #7dff6b; font-weight: 900; }
@media (max-width: 560px) { .map { grid-template-columns: 1fr; } }
.menu .tag { color: var(--yellow); font-size: .85em; }
.menu .row > [data-a="settings"] { flex: 0 0 auto; min-width: 48px; }
#map .sheet header, #perks .sheet header { position: sticky; top: -18px; margin: -18px -20px 10px; padding: 14px 20px 8px; background: #241c3d; z-index: 2; }

/* ---------------------------------------------------------------- title: one platform, one ticket, one job */
#ui #title { flex-direction: column; justify-content: flex-start; gap: 0; background: radial-gradient(110% 90% at 50% 45%, #120d1fd9 0%, #120d1fb8 55%, #120d1f80 100%); }
/* top corner bar: home link left, account and settings right */
.t-bar { position: absolute; top: calc(10px + var(--sat)); left: calc(16px + var(--sal)); right: calc(16px + var(--sar)); display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 3; pointer-events: none; }
.t-bar > * { pointer-events: auto; }
.t-bar [data-bumshi-back] { color: var(--dim); font-weight: 800; font-size: 14px; text-decoration: none; padding: 6px 2px; }
.t-bar [data-bumshi-back]:hover { color: var(--ink); }
.t-bar-r { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.t-icon { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #ffffff26; background: #0007; color: var(--ink); font-size: 19px; line-height: 1; display: grid; place-items: center; padding: 0; }
.t-icon:hover, .t-icon:focus-visible { border-color: var(--yellow); outline: none; }

.t-wrap { display: flex; align-items: center; justify-content: center; gap: clamp(20px, 4vw, 48px); width: 100%; max-width: 900px; margin: auto; padding-top: 40px; }
.t-main { flex: 1 1 520px; max-width: 540px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.t-side { flex: 0 0 270px; width: 270px; display: flex; flex-direction: column; gap: 12px; }

/* the yellow station board, black letters, two posts */
.sign { position: relative; background: #f7c600; color: #111; border: 4px solid #111; border-radius: 3px; padding: 10px 14px 8px; text-align: center; box-shadow: 0 0 0 3px #f7c600, 0 0 0 6px #111, 0 14px 0 -2px #0006; margin: 6px 6px 12px; transform: rotate(-1deg); }
.sign h1 { margin: 0; font-family: 'Titillium Web', 'Nunito', sans-serif; font-weight: 900; font-size: clamp(28px, 5.4vw, 48px); line-height: 1; letter-spacing: .04em; }
.sign p { margin: 2px 0 0; font-weight: 800; font-size: clamp(13px, 2.2vw, 18px); line-height: 1.1; }
.sign .post { position: absolute; bottom: -22px; width: 8px; height: 16px; background: #111; }
.sign .post.l { left: 18%; } .sign .post.r { right: 18%; }

/* the journey card: a punched suburban ticket, the one big thing on screen */
.journey { position: relative; background: #fff4d6; color: #2a1d12; border-radius: 14px; padding: 14px 18px 16px; box-shadow: 0 6px 0 #b9a170, 0 18px 36px #000a;
  background-image: radial-gradient(circle at 0 50%, transparent 10px, #fff4d6 11px), radial-gradient(circle at 100% 50%, transparent 10px, #fff4d6 11px); background-size: 51% 100%; background-position: left, right; background-repeat: no-repeat; }
.j-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.j-kick { font-weight: 900; font-size: 13px; color: #a3341f; }
.j-map { background: #2a1d1214; border: 0; border-radius: 999px; padding: 5px 12px; font: inherit; font-weight: 900; font-size: 13px; color: #2a1d12; cursor: pointer; }
.j-map:hover, .j-map:focus-visible { background: #2a1d1226; outline: none; }
.j-line { font-weight: 900; font-size: 24px; line-height: 1.1; margin: 4px 0 14px; }
.j-line small { display: block; font-weight: 700; font-size: 13px; color: #7a6650; margin-top: 2px; }
.route { list-style: none; margin: 0 2px; padding: 0; display: flex; justify-content: space-between; position: relative; }
.route::before { content: ''; position: absolute; left: 6px; right: 6px; top: 6px; height: 3px; background: repeating-linear-gradient(90deg, #2a1d12 0 8px, transparent 8px 12px); opacity: .35; }
.route li { position: relative; width: 15px; height: 15px; border-radius: 50%; background: #fff4d6; border: 3px solid #b9a170; box-sizing: border-box; }
.route li.done { background: #2a1d12; border-color: #2a1d12; }
.route li.now { background: #f7c600; border-color: #a3341f; transform: scale(1.4); animation: jnow 1.2s ease-in-out infinite; }
.route li.boss { border-radius: 3px; transform: rotate(45deg); }
.route li.boss.now { transform: rotate(45deg) scale(1.4); }
@keyframes jnow { 50% { box-shadow: 0 0 0 6px #f7c60055; } }
.j-ends { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-weight: 900; font-size: 14px; }
.j-ends span:last-child { text-align: right; }
.j-ends small { display: block; font-weight: 700; font-size: 11px; color: #7a6650; }
.j-go { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; background: #a3341f; color: #fff4d6; border: 0; border-bottom: 5px solid #5e1b10; border-radius: 12px; padding: 15px 20px; font: inherit; cursor: pointer; transition: filter .12s; }
.j-go:hover, .j-go:focus-visible { filter: brightness(1.12); outline: none; }
.j-go:focus-visible { box-shadow: 0 0 0 3px #f7c600; }
.j-go:active { transform: translateY(3px); border-bottom-width: 2px; }
.j-go-a { font-weight: 900; font-size: 23px; text-align: left; }
.j-go-a::after { content: ' ›'; }
.j-go-b { font-weight: 800; font-size: 13px; opacity: .8; white-space: nowrap; }

/* other ways to play: three amber platform indicators, side by side */
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.modes button { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 84px; background: #0c0b0a; border: 3px solid #2d2a26; border-radius: 10px; padding: 10px 12px; color: #ffae1a; font-family: inherit; text-align: left; cursor: pointer; box-shadow: inset 0 0 18px #000;
  background-image: radial-gradient(#ffffff08 1px, transparent 1.4px); background-size: 3px 3px; transition: border-color .12s, transform .12s; }
.modes button:hover, .modes button:focus-visible { border-color: #ffae1a; outline: none; transform: translateY(-2px); }
.modes b { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-weight: 800; font-size: 19px; letter-spacing: .06em; text-transform: uppercase; color: #ffc94d; text-shadow: 0 0 8px #ff8c0099; }
.modes span { font-size: 12.5px; font-weight: 700; line-height: 1.25; color: #e8c58a; }
.modes em { position: absolute; top: 9px; right: 10px; font-style: normal; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; font-weight: 800; color: #ff5b3a; text-shadow: 0 0 6px #ff3a1a99; }
.modes em.ok { color: #7dff6b; text-shadow: 0 0 6px #3bff7a88; }

/* the character stage: who you are boarding as */
.stage { background: #241c3dcc; border: 2px solid #ffffff14; border-radius: 16px; padding: 12px 12px 12px; text-align: center; }
.stage-k { display: block; font-size: 12px; font-weight: 800; color: var(--dim); }
#hero { display: block; width: 150px; height: 150px; margin: 2px auto 0; }
.stage-n { display: block; font-weight: 900; font-size: 19px; margin: 2px 0 10px; }
#title .picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; }
#title .picker button { padding: 3px 0 2px; background: #1b1530; border: 2px solid #ffffff14; border-radius: 10px; font-size: 0; }
#title .picker button:not([disabled]):hover { border-color: #ffffff55; }
#title .picker button.on { border-color: var(--yellow); background: #ffd23f22; }
#title .picker canvas { width: 46px; height: 46px; margin: 0 auto; }
#title .picker small { font-size: 10px; font-weight: 800; color: var(--dim); }
#title .picker button[disabled] { opacity: .55; }

.t-links { display: flex; flex-direction: column; gap: 6px; }
.t-links button { display: flex; align-items: center; gap: 6px; width: 100%; background: #ffffff0d; border: 2px solid #ffffff1a; color: var(--ink); border-radius: 12px; padding: 9px 14px; font: inherit; font-weight: 800; font-size: 15px; text-align: left; cursor: pointer; }
.t-links button:hover, .t-links button:focus-visible { border-color: var(--yellow); outline: none; }
.t-links .t-board { background: #ffd23f; color: #111; border-color: #ffd23f; border-bottom: 4px solid #a8851a; }
.t-links .tag { margin-left: auto; color: var(--yellow); }
.gl-like:empty { display: none; }
.t-side .gl-like { display: flex; justify-content: center; }
#boards { background: #120d22cc; }
#boards .sheet.narrow { max-width: 440px; }
#boards .gl-board > h3 { display: none; }

/* phone in portrait: stack, ticket first */
@media (orientation: portrait), (max-width: 640px) {
  .t-wrap { flex-direction: column; align-items: stretch; gap: 16px; padding-top: 48px; margin: 0 auto; }
  .t-main { flex: none; max-width: none; }
  .t-side { flex: none; width: 100%; }
  .stage { display: grid; grid-template-columns: 96px 1fr; grid-template-rows: auto auto 1fr; column-gap: 10px; text-align: left; align-items: start; }
  #hero { grid-row: 1 / 4; width: 96px; height: 96px; margin: 0; }
  .stage-n { margin: 0 0 6px; }
  .modes button { min-height: 76px; }
  .modes span { font-size: 11.5px; }
  .modes em { position: static; order: -1; }
}
/* phone in landscape: everything must fit one short screen */
@media (max-height: 500px) and (orientation: landscape) {
  #title { padding-top: 6px; padding-bottom: 6px; }
  .t-bar { top: calc(6px + var(--sat)); }
  .t-icon { width: 34px; height: 34px; font-size: 16px; }
  .t-wrap { padding-top: 34px; gap: 18px; align-items: flex-start; }
  .t-main { gap: 8px; flex-basis: 440px; }
  .t-side { flex-basis: 220px; width: 220px; gap: 8px; }
  .sign { padding: 4px 10px 3px; margin: 0 6px 10px; box-shadow: 0 0 0 2px #f7c600, 0 0 0 4px #111; } .sign h1 { font-size: 22px; } .sign p { display: none; } .sign .post { bottom: -14px; height: 9px; }
  .journey { padding: 8px 14px 10px; }
  .j-line { font-size: 17px; margin: 0 0 8px; } .j-line small { display: inline; margin-left: 6px; font-size: 12px; }
  .j-ends { margin-top: 4px; font-size: 12px; } .j-ends small { display: none; }
  .j-go { margin-top: 8px; padding: 9px 14px; } .j-go-a { font-size: 18px; }
  .modes { gap: 6px; margin-top: 4px; } .modes button { min-height: 0; padding: 6px 10px; } .modes span { display: none; } .modes b { font-size: 15px; } .modes em { position: static; }
  .stage { display: grid; grid-template-columns: 64px 1fr; column-gap: 8px; text-align: left; padding: 8px; }
  #hero { grid-row: 1 / 4; width: 64px; height: 64px; margin: 0; }
  .stage-k { font-size: 11px; } .stage-n { font-size: 15px; margin: 0 0 4px; }
  #title .picker canvas { width: 30px; height: 30px; }
  .t-links { gap: 4px; } .t-links button { padding: 5px 10px; font-size: 13px; }
  .t-side .gl-like { display: none; }
}
@media (prefers-reduced-motion: reduce) { .route li.now { animation: none; } .modes button:hover { transform: none; } }

/* online room */
.room-pick { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.room-pick > button, .room-join button { background: #2e2547; color: var(--ink); border: 0; border-bottom: 4px solid #140f22; border-radius: 12px; padding: 11px 14px; font-weight: 900; font-size: 16px; }
.room-pick > button.primary { background: var(--yellow); color: #111; border-bottom-color: #a8851a; font-size: 19px; }
.room-join { display: flex; gap: 8px; }
.room-join input { flex: 1; min-width: 0; background: #14110d; color: #ffc94d; border: 3px solid #2d2a26; border-radius: 10px; padding: 8px 12px; font: 800 22px ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.room-join input:focus { outline: none; border-color: #ffae1a; }
.room-code { display: flex; align-items: center; gap: 10px; background: #14110d; border: 3px solid #2d2a26; border-radius: 10px; padding: 8px 12px; margin: 6px 0 10px; }
.room-code small { color: #a99fc4; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.room-code b { flex: 1; color: #ffc94d; font: 800 26px ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .25em; text-shadow: 0 0 8px #ff8c0099; }
.room-code button { background: #2e2547; color: var(--ink); border: 0; border-radius: 8px; padding: 8px 10px; font-weight: 800; font-size: 13px; }
.room-seats { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.room-seats li { display: grid; grid-template-columns: 14px 1fr; column-gap: 8px; align-items: center; background: #2e2547; border-radius: 10px; padding: 7px 9px; }
.room-seats li i { grid-row: span 2; width: 14px; height: 14px; border-radius: 50%; background: var(--c, #555); box-shadow: 0 0 8px var(--c, transparent); }
.room-seats li b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-seats li span { font-size: 11.5px; color: #a99fc4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-seats li.empty { background: transparent; border: 2px dashed #3a3060; }
.room-seats li.empty i { background: #3a3060; }
.room-msg { color: #ff8a3d; font-weight: 800; font-size: 14px; margin: 10px 0 0; }
.menu button:disabled { opacity: .55; }
@media (max-height: 460px) { .room-code { margin: 2px 0 6px; padding: 4px 10px; } .room-code b { font-size: 20px; } .room-seats { grid-template-columns: repeat(4, 1fr); } }
#online .sheet.narrow { max-width: 440px; }
@media (max-height: 460px) { #online .sheet.narrow { max-width: 620px; } }

/* play with a friend: the big invite under the ticket */
.friend { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; background: linear-gradient(100deg, #1fae5b, #14c08a); color: #fff; border: 0; border-bottom: 5px solid #0b6b3c; border-radius: 14px; padding: 11px 16px; text-align: left; cursor: pointer; box-shadow: 0 0 0 3px #111, 0 6px 18px #18c07a55; }
.friend:hover, .friend:focus-visible { filter: brightness(1.08); outline: none; }
.friend:focus-visible { box-shadow: 0 0 0 3px #f7c600; }
.friend:active { transform: translateY(3px); border-bottom-width: 2px; }
.f-ico { font-size: 30px; line-height: 1; animation: f-bob 1.6s ease-in-out infinite; }
.f-t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.f-t b { font-weight: 900; font-size: 21px; }
.f-t small { font-weight: 800; font-size: 12.5px; opacity: .9; }
.f-go { font-size: 30px; font-weight: 900; }
@keyframes f-bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-3px) rotate(6deg); } }
.friend-side { display: none; }
.e-friend { background: #17a65a !important; color: #fff !important; }
/* invite panel in the room */
.invite { background: #14110d; border: 3px solid #2d2a26; border-radius: 12px; padding: 10px; margin: 0 0 10px; }
.inv-h { margin: 0 0 8px; font-weight: 900; font-size: 14px; color: #ffc94d; text-align: center; }
.inv-wa { display: flex; align-items: center; justify-content: center; gap: 8px; background: #25d366; color: #062b14; border-radius: 12px; border-bottom: 4px solid #128c4a; padding: 12px; font-weight: 900; font-size: 18px; text-decoration: none; }
.inv-wa:active { transform: translateY(2px); border-bottom-width: 2px; }
.inv-row { display: flex; gap: 6px; margin-top: 8px; }
.inv-row > * { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; background: #2e2547; color: var(--ink); border: 0; border-bottom: 3px solid #140f22; border-radius: 10px; padding: 9px 4px; font: inherit; font-weight: 800; font-size: 13px; text-decoration: none; white-space: nowrap; cursor: pointer; }
.inv-row > .ok { background: #1f7a45; }
.inv-or { margin: 8px 0 0; text-align: center; font-size: 12.5px; color: #a99fc4; }
.inv-or b { color: #ffc94d; font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .15em; }
.room-seats li.empty { cursor: pointer; }
.room-seats li.empty b { color: #7dff6b; }
/* arrived from an invite link */
.join-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; background: #14110d; border: 3px solid #2d2a26; border-radius: 12px; padding: 14px; margin: 6px 0 10px; text-align: center; }
.jh-k { font-weight: 900; font-size: 14px; color: #e8c58a; }
.jh-code { color: #ffc94d; font: 800 34px ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .25em; text-shadow: 0 0 10px #ff8c0099; }
.join-hero .primary { width: 100%; background: #25d366; color: #062b14; border: 0; border-bottom: 5px solid #128c4a; border-radius: 12px; padding: 13px; font-weight: 900; font-size: 21px; cursor: pointer; }
.jh-as { font-size: 12px; color: #a99fc4; }
@media (max-height: 500px) and (orientation: landscape) {
  .t-main > .friend { display: none; } .t-links .friend-side { display: flex; margin: 0 0 2px; padding: 6px 10px; gap: 6px; border-radius: 12px; border-bottom-width: 4px; color: #fff; background: linear-gradient(100deg, #1fae5b, #14c08a); border-color: #0b6b3c; box-shadow: 0 0 0 2px #111, 0 4px 12px #18c07a55; } .friend-side .f-ico { font-size: 18px; } .friend-side .f-t b { font-size: 15px; } .friend-side .f-go { font-size: 18px; }
  .invite { padding: 6px 8px; margin-bottom: 6px; } .inv-h, .inv-or { display: none; } .inv-wa { padding: 7px; font-size: 15px; } .inv-row { margin-top: 5px; } .inv-row > * { padding: 6px 4px; }
  .join-hero { padding: 8px; gap: 4px; } .jh-code { font-size: 24px; } .join-hero .primary { padding: 8px; font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .f-ico { animation: none; } }
