/* Shiftship: a tall play field (portrait), the menus as pages over the moving sky. */
html, body.ss { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.ss { background: #0d0a2a; }
.ss #app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.ss-top { position: absolute; top: 0; left: 0; right: 0; z-index: 20; padding: max(8px, env(safe-area-inset-top)) 10px 6px; min-height: 0; gap: 8px; pointer-events: none; }
.ss-top > * { pointer-events: auto; }
.ss-top button.small { min-height: 44px; min-width: 44px; padding: 6px 10px; }
#back-slot:empty { display: none; }
.dust-chip { margin-left: auto; background: #00000055; border: 2px solid #ffffff33; border-radius: 999px; padding: 6px 12px; font-weight: 700; color: var(--hi); white-space: nowrap; }
.dust-chip b { color: var(--text); }
.playing .dust-chip { display: none; }
.hud { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.hp { display: flex; gap: 3px; font-size: 20px; line-height: 1; }
.hp i { font-style: normal; color: #ff5d8f; text-shadow: 0 2px 0 #1a1630; }
.hp i.gone { color: #ffffff30; text-shadow: none; }
.hud-mid { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; }
.hud-mid .trip { grid-column: 1 / -1; }
.meters { justify-self: end; grid-row: 1; grid-column: 2; }
.score { grid-row: 1; grid-column: 1; }
/* TVs and computers: the bar sits over the play column */
@media (min-aspect-ratio: 1/1) { .playing .ss-top { left: 50%; right: auto; transform: translateX(-50%); width: min(100%, 600px); } }
.playing button.back { font-size: 0; gap: 0; padding: 6px; justify-content: center; }
.playing button.back span { font-size: 22px; }
.playing #sound { display: none; }
.score { font-size: 22px; font-weight: 700; text-shadow: 0 2px 0 #1a1630; font-variant-numeric: tabular-nums; }
.meters { font-size: 14px; color: var(--soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.trip { position: relative; height: 10px; margin-top: 4px; border-radius: 99px; background: #ffffff22; border: 2px solid #1a1630; }
.trip i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, #2ec4b6, var(--hi)); }
.trip b { position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%) rotate(90deg); font-size: 12px; color: #fff; }
.trip.daily { visibility: hidden; }
.trip.boss { visibility: visible; height: 12px; }
.trip.boss i { background: linear-gradient(90deg, #ff3c5c, #ff8a9e); transition: width .15s; }
.trip.boss b { display: none; }
.meters.open { color: #fff36a; font-weight: 700; }
.meters { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }

#stage { position: relative; flex: 1; min-height: 0; }
#sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.combo { position: absolute; z-index: 5; right: 12px; top: calc(max(8px, env(safe-area-inset-top)) + 58px); background: var(--hi); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; padding: 2px 10px; font-weight: 700; transform: rotate(4deg); box-shadow: 0 3px 0 var(--ink); }
.combo b { font-size: 20px; }
.combo.bump { animation: g-pop .25s cubic-bezier(.2,1.6,.4,1); }
.power-bar { position: absolute; z-index: 5; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(260px, calc(100% - 200px)); background: #00000066; border: 2px solid #1a1630; border-radius: 99px; height: 26px; overflow: hidden; }
.power-bar span { position: relative; z-index: 1; display: block; text-align: center; font-size: 14px; font-weight: 700; line-height: 22px; text-shadow: 0 1px 0 #1a1630; }
.power-bar i { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--pc, var(--hi)); opacity: .8; }
.toast { position: absolute; z-index: 6; left: 50%; top: calc(max(8px, env(safe-area-inset-top)) + 58px); transform: translateX(-50%); background: #1a1630dd; border: 2px solid #ffffff33; border-radius: 99px; padding: 6px 14px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.race { position: absolute; z-index: 5; left: 10px; top: calc(max(8px, env(safe-area-inset-top)) + 66px); margin: 0; padding: 6px 10px 6px 26px; background: #00000055; border-radius: 12px; font-size: 13px; line-height: 1.35; color: var(--soft); }
.race li.me { color: var(--hi); font-weight: 700; }
.race li.out { text-decoration: line-through; opacity: .6; }

/* weapons (arms.js): the switcher, small in the bottom left, and the Fire button, big in the bottom right */
.arms { position: absolute; left: 0; right: 0; bottom: 0; height: 0; z-index: 6; }
.arms button { position: absolute; box-shadow: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.arm-btn { left: max(10px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); width: 72px; min-height: 64px; padding: 4px 2px 10px; border-radius: 16px; display: grid; justify-items: center; align-content: center; gap: 1px; background: #1a1630cc; color: #fff8ec; border: 2px solid #7ff0ff88; line-height: 1.05; }
.arm-icon { font-size: 20px; color: #7ff0ff; line-height: 1; }
.arm-name { font-weight: 700; font-size: 10px; letter-spacing: .04em; }
.arm-ammo { font-size: 12px; font-weight: 700; color: var(--hi); }
.arm-dots { position: absolute; bottom: 4px; display: flex; gap: 3px; }
.arm-dots u { width: 5px; height: 5px; border-radius: 50%; background: #ffffff44; }
.arm-dots u.on { background: #7ff0ff; }
.fire-btn { right: max(12px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: 84px; height: 84px; min-height: 0; border-radius: 50%; padding: 0; background: radial-gradient(circle at 35% 30%, #ff9aac, #ff3c5c 55%, #b3123a); border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink) !important; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: .04em; text-shadow: 0 2px 0 var(--ink); }
.fire-btn.down, .fire-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink) !important; }
.fire-btn.auto { background: #2a2440dd; color: #cfc4f2; border-color: #7b6cff; font-size: 15px; text-shadow: none; box-shadow: 0 3px 0 var(--ink) !important; }
.fire-btn.off { opacity: .45; }
.arm-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.arm-list li { font-size: 14px; color: var(--soft); }
.arm-list b { color: var(--text); }
@media (min-width: 900px) { .arm-btn { left: calc(50% - 300px); } .fire-btn { right: calc(50% - 300px); } }

/* pages over the sky */
.page { position: absolute; inset: 0; z-index: 10; overflow-y: auto; padding: calc(max(8px, env(safe-area-inset-top)) + 64px) 16px max(16px, env(safe-area-inset-bottom)); background: #0d0a2acc; }
.page h2 { font-size: 26px; text-align: center; }
.page h3 { margin: 18px 0 8px; font-size: 18px; }
.small-line { text-align: center; margin: 6px auto 14px; max-width: 420px; font-size: 15px; }
.page > * { max-width: 520px; margin-left: auto; margin-right: auto; }

.home { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: linear-gradient(180deg, #0d0a2a99, #0d0a2aee 70%); overflow: hidden; }
.ss-logo { display: flex; flex-direction: column; align-items: center; gap: 0; margin: 0; }
.ss-logo canvas { width: 120px; height: 120px; }
.ss-logo .word { font-size: 44px; line-height: 1; letter-spacing: .02em; color: #fff8ec; -webkit-text-stroke: 2px #1a1630; text-shadow: 0 4px 0 #1a1630, 0 0 24px #59a8ff66; transform: rotate(-3deg); }
.ss-logo .word em { font-style: normal; color: #ff9a1f; }
.tag { margin: 0; text-align: center; color: var(--soft); font-size: 15.5px; max-width: 340px; }
.streak { font-weight: 700; color: var(--hi); min-height: 1.2em; font-size: 15px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 420px; }
.tile-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; min-height: 108px; }
.tile-btn .ic { font-size: 30px; line-height: 1; }
.tile-btn b { font-size: 19px; }
.tile-btn small { font-weight: 600; font-size: 13px; opacity: .85; }
.tile-btn.pink { background: var(--pink); color: #fff; }
.today { width: 100%; max-width: 420px; padding: 10px 14px; }
.today h3 { margin: 0 0 6px; font-size: 15px; display: flex; justify-content: space-between; }
.today h3 span { color: var(--soft); font-weight: 600; }
.mission { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 14px; margin-top: 6px; }
.mission .bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: #ffffff1c; overflow: hidden; }
.mission .bar i { display: block; height: 100%; background: #2ec4b6; border-radius: 99px; }
.mission.done { color: #58d66f; }
.mission.done .bar i { background: #58d66f; }
.row-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: center; }
.quiet-link { color: var(--soft); font-weight: 600; padding: 10px 6px; }

.planets { list-style: none; padding: 0; margin: 0 auto; display: grid; gap: 10px; }
.planet { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 14px; min-height: 84px; background: var(--panel); color: var(--text); }
.planet .orb { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--ink); box-shadow: inset -8px -8px 0 #00000040; }
.planet b { display: block; font-size: 18px; }
.planet small { display: block; font-weight: 500; color: var(--soft); font-size: 13.5px; }
.planet .st { color: var(--hi); font-size: 16px; letter-spacing: 1px; white-space: nowrap; }
.planet.locked { opacity: .55; }
.planet.next { border-color: var(--hi); }

.hangar canvas { display: block; width: 140px; height: 140px; margin: 0 auto; }
.paints, .gear { display: grid; gap: 8px; }
.paints { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.paint, .gear-btn { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: var(--panel); color: var(--text); font-size: 15px; padding: 8px 12px; text-align: left; }
.paint i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.paint.on, .gear-btn.max { border-color: #58d66f; }
.gear-btn span { flex: 1; }
.gear-btn small { display: block; color: var(--soft); font-weight: 500; }
.price { color: var(--hi); white-space: nowrap; font-weight: 700; }
.powers { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14.5px; }
.powers b { color: var(--c); }

.rows { list-style: none; padding: 0; margin: 0 auto; counter-reset: r; }
.rows li { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; padding: 8px 10px; border-bottom: 1px solid #ffffff1a; counter-increment: r; }
.rows li::before { content: counter(r); color: var(--soft); font-weight: 700; }
.rows li.me { color: var(--hi); font-weight: 700; }

.acct-card { padding: 18px; }
.acct-card > * + * { margin-top: 12px; }

.end { display: grid; place-items: center; }
.end-card { width: min(440px, 100%); padding: 18px; text-align: center; }
.end-card h2 { font-size: 30px; }
.end-sub { margin: 4px 0 0; color: var(--soft); }
.big-score b { display: block; font-size: 48px; line-height: 1.1; color: var(--hi); text-shadow: 0 3px 0 var(--ink); font-variant-numeric: tabular-nums; }
.big-score span { color: var(--soft); font-size: 14px; }
.end-stars { font-size: 30px; color: var(--hi); letter-spacing: 4px; min-height: 0; }
.end-stars .off { color: #ffffff2a; }
.end-parts, .earned { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14.5px; display: grid; gap: 2px; }
.end-parts li, .earned li { display: flex; justify-content: space-between; gap: 10px; }
.earned li { color: var(--hi); }
.end-race { margin: 10px auto 0; padding-left: 24px; text-align: left; font-size: 14.5px; max-width: 260px; }
.end-race li.me { color: var(--hi); font-weight: 700; }
.end-board { margin-top: 12px; text-align: left; }
.end-board label { font-size: 14px; color: var(--soft); }
.name-row { display: flex; gap: 8px; margin-top: 4px; }
.name-row input { flex: 1; min-width: 0; min-height: 46px; border-radius: 14px; border: 3px solid var(--ink); background: #fff8ec; color: var(--ink); padding: 6px 12px; font-weight: 600; -webkit-user-select: text; user-select: text; }
.end-btns { display: grid; gap: 10px; margin-top: 16px; }

.paused { display: grid; place-items: center; }
.paused .card { width: min(360px, 100%); padding: 20px; display: grid; gap: 12px; text-align: center; }

.tip { position: absolute; z-index: 30; left: 12px; right: 12px; top: calc(max(8px, env(safe-area-inset-top)) + 58px); max-width: 420px; margin: 0 auto; display: flex; align-items: center; gap: 10px; background: #fff8ec; color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 8px 8px 14px; font-weight: 600; font-size: 15px; box-shadow: 0 4px 0 var(--ink); animation: g-pop .3s cubic-bezier(.2,1.5,.4,1) both; }
.tip p { margin: 0; flex: 1; }
.tip button { min-width: 40px; min-height: 40px; padding: 0; }

.party-tile { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 420px; padding: 8px 14px; min-height: 58px; text-align: left; }
.party-tile .ic { font-size: 26px; }
.party-tile b { display: block; font-size: 18px; }
.party-tile small { display: block; font-weight: 600; font-size: 13px; opacity: .85; }
.party-btns { display: grid; gap: 12px; }
.party-btns button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 76px; font-size: 20px; }
.party-btns small { font-size: 13.5px; font-weight: 600; opacity: .85; }
.party-join { margin-top: 18px; padding: 14px; }
.party-join label { font-weight: 600; }
.party-join input { letter-spacing: .2em; text-transform: uppercase; font-size: 20px; }
.party-join .err { min-height: 1.2em; margin: 6px 0 0; color: #ff8fb0; font-weight: 600; }

/* short screens (a sideways phone): tighter home */
@media (max-height: 640px) {
  .ss-logo canvas { width: 72px; height: 72px; }
  .ss-logo .word { font-size: 34px; }
  .tag { display: none; }
  .tile-btn { min-height: 86px; }
  .home { gap: 8px; }
  .party-tile { min-height: 46px; padding: 4px 14px; }
  .party-tile small { display: none; }
  .tile-btn { min-height: 78px; padding: 8px; }
  .today { padding: 8px 12px; }
  .mission { margin-top: 3px; font-size: 13px; }
  .row-btns { gap: 6px; }
  .row-btns button.small { min-height: 40px; padding: 4px 10px; }
  .quiet-link { padding: 6px; }
}
@media (max-height: 760px) { .tag { display: none; } }
@media (max-height: 520px) {
  .home { flex-direction: row; flex-wrap: wrap; align-content: center; gap: 6px; }
  .today { display: none; }
  .tile-btn { min-height: 64px; padding: 6px; }
  .tile-btn .ic { font-size: 20px; }
  .tile-btn b { font-size: 17px; }
  .party-tile { min-height: 40px; padding: 2px 14px; }
  .party-tile .ic { font-size: 20px; }
}

/* Difficulty: a small three-way switch on the home and the planet map */
.level-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.level-row .lbl { font-size: 13px; color: var(--soft); margin-right: 2px; }
.level-row .lvl { min-height: 34px; padding: 4px 12px; font-size: 14px; border-radius: 999px; }
.level-row .lvl.on { border-color: var(--hi); background: var(--hi-soft); }
@media (max-height: 760px) and (min-height: 521px) {
  /* room for the level switch on short upright screens */
  .level-row .lvl { min-height: 30px; padding: 2px 10px; font-size: 13px; }
  .tile-btn { min-height: 64px; padding: 6px; }
}
@media (max-height: 520px) {
  /* sideways: the Party race button and the level switch share one row */
  .tiles { order: 1; }
  .party-tile { order: 2; width: auto; flex: 0 0 210px; }
  .level-row { order: 2; flex: 0 0 auto; }
  .row-btns { order: 3; }
}
@media (max-height: 660px) and (min-height: 521px) {
  .tile-btn small { line-height: 1.1; }
  .row-btns button.small { min-height: 38px; }
  .today h3 { margin: 0; }
}
