/* Subspace web: LCARS panels around the MPC screen. Colours come from tokens.css (plugin/make_skin.py). */
@font-face { font-family: "Titillium Web"; font-weight: 600; src: url("fonts/TitilliumWeb-SemiBold.ttf") format("truetype"); font-display: block; }
@font-face { font-family: "Titillium Web"; font-weight: 700; src: url("fonts/TitilliumWeb-Bold.ttf") format("truetype"); font-display: block; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: var(--ice); }
body { font: 600 17px/1.3 "Titillium Web", "Arial Narrow", sans-serif; overscroll-behavior: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* LCARS pills */
.pill { border: 0; border-radius: 999px; padding: 0 18px; min-height: 40px; color: #000; background: var(--sky);
  letter-spacing: .5px; text-transform: uppercase; font-weight: 700; }
.pill:active { filter: brightness(1.25); }
.pill.small { min-height: 30px; padding: 0 14px; font-size: 14px; }
.pill.big { min-height: 64px; padding: 0 34px; font-size: 22px; }
.pill.sky { background: var(--sky); } .pill.azure { background: var(--azure); } .pill.pale { background: var(--pale); }
.pill.gray { background: var(--gray); color: var(--ice); } .pill.orange { background: var(--orange); }

/* app frame */
.app { height: 100%; display: flex; flex-direction: column; }
.tabs { display: flex; align-items: stretch; gap: 4px; padding: 8px 8px 6px; flex: none; }
.tabs .cap-l, .tabs .cap-r { width: 28px; background: var(--azure); }
.tabs .cap-l { border-radius: 999px 0 0 999px; } .tabs .cap-r { border-radius: 0 999px 999px 0; }
.tab { border: 0; background: var(--sky); color: #000; font-weight: 700; padding: 0 14px; min-height: 40px; letter-spacing: .6px; }
.tab:nth-of-type(2) { background: var(--pale); } .tab:nth-of-type(3) { background: var(--sky); } .tab:nth-of-type(4) { background: var(--gray); color: var(--ice); }
.tab.on { background: var(--orange) !important; color: #000 !important; }
.tab-fill { flex: 1; background: var(--azure); display: flex; align-items: center; justify-content: flex-end; padding: 0 12px;
  color: #000; font-size: 14px; letter-spacing: .5px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
main { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }

/* the MPC screen */
.screen { margin: 0 auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.slice-row { display: flex; justify-content: center; }
.slice { position: relative; overflow: hidden; flex: none; }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.c { position: absolute; background-repeat: no-repeat; }
.c-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.c-image, .c-strip { pointer-events: none; }
.c.hit { cursor: pointer; touch-action: none; }
.c-button.down { filter: brightness(1.3); }
.c-patch { background: #000; }
.patch-note { color: var(--pale); font: 600 20px/30px "Titillium Web", sans-serif; }
.patch-hit { background: transparent; cursor: pointer; }
.starfield { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; background: #000; cursor: pointer; touch-action: none; }
.patch-queue { background: transparent; overflow-y: auto; font-size: 24px; }

/* web-only panels */
.panel { padding: 8px 12px 24px; max-width: 900px; margin: 0 auto; }
.ribbon { display: flex; align-items: center; gap: 10px; margin: 10px 0 8px; height: 34px; border-radius: 999px 0 0 999px;
  padding: 0 6px 0 22px; color: #000; font-weight: 700; letter-spacing: 1px; background: var(--sky); }
.ribbon span { flex: 1; text-align: right; padding-right: 6px; }
.ribbon.pale { background: var(--pale); } .ribbon.azure { background: var(--azure); } .ribbon.gray { background: var(--gray); color: var(--ice); }
.list { display: flex; flex-direction: column; gap: 4px; }
.row { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 5px 6px; cursor: pointer;
  border-left: 10px solid var(--gray); border-radius: 12px 0 0 12px; background: #070b14; }
.row:hover, .row:active { border-left-color: var(--sky); background: #0d1424; }
.row .th { width: 54px; height: 54px; border-radius: 6px; background: var(--dark) center/cover no-repeat; }
.row .txt { min-width: 0; }
.row .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 18px; color: var(--ice); }
.row .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; color: var(--dimtxt); }
.row .acts { display: flex; gap: 6px; }
.row .acts .pill { min-width: 44px; min-height: 40px; padding: 0 12px; font-size: 15px; }
.empty { color: var(--dimtxt); padding: 12px 8px; letter-spacing: .5px; }
.sbox { display: flex; gap: 8px; margin-top: 6px; }
.sbox input { flex: 1; min-width: 0; font: inherit; font-size: 18px; color: var(--ice); background: #0b1020;
  border: 2px solid var(--gray); border-radius: 999px; padding: 8px 18px; outline: none; }
.sbox input:focus { border-color: var(--sky); }
.seg { display: flex; gap: 6px; margin: 10px 0; align-items: center; overflow: hidden; }
.seg > .pill { background: var(--gray); color: var(--ice); flex: none; }
.seg > .pill.on { background: var(--sky); color: #000; }
.recent { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.recent::-webkit-scrollbar { display: none; }
.recent .pill { background: #0d1424; color: var(--pale); flex: none; font-weight: 600; text-transform: none; }
.pref { display: flex; align-items: center; gap: 14px; padding: 10px 4px 10px 10px; border-bottom: 1px solid #1d2638; cursor: pointer; }
.pref .pt { flex: 1; min-width: 0; }
.pref .pn { font-size: 18px; color: var(--ice); }
.pref .pd { font-size: 14px; color: var(--dimtxt); }
.pref .pill { min-width: 76px; background: var(--dark); color: var(--dimtxt); }
.pref .pill.on { background: var(--sky); color: #000; }
.spin { width: 16px; height: 16px; border: 3px solid var(--gray); border-top-color: var(--sky); border-radius: 50%;
  animation: r .8s linear infinite; display: inline-block; vertical-align: -2px; margin-right: 8px; }
@keyframes r { to { transform: rotate(360deg); } }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 18px); transform: translateX(-50%) translateY(30px);
  background: var(--orange); color: #000; padding: 8px 18px; border-radius: 999px; font-weight: 700; opacity: 0; transition: .25s;
  pointer-events: none; max-width: calc(100% - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 20; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* phone, upright: narrower tabs */
@media (max-width: 600px) {
  .tabs { gap: 3px; padding: 6px 4px 4px; }
  .tabs .cap-l, .tabs .cap-r { width: 14px; }
  .tab { padding: 0 8px; font-size: 14px; min-height: 36px; }
  .tab-fill { padding: 0 6px; font-size: 12px; }
  .panel { padding: 4px 8px 24px; }
  .row .acts .pill { min-width: 40px; padding: 0 10px; }
}

/* welcome screen (on every visit; ENTER is also the touch that lets the page play sound). The picture is a box
   with its own shape (1280x1024), so ENTER can sit at a fixed spot on it: low on the helmet's visor. */
.welcome { position: fixed; inset: 0; z-index: 40; background: #000; overflow: hidden; animation: wl-in .6s ease-out; }
.wl-art { position: absolute; left: 50%; top: 0; height: calc(100% - 120px); aspect-ratio: 1280 / 1024; transform: translateX(-50%);
  background: url("welcome.jpg") center / 100% 100% no-repeat;   /* room below for the text; the suit fades into black */
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); }
.wl-enter { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%);
  font: 700 clamp(15px, 2.4vh, 22px)/1 "Titillium Web", sans-serif; letter-spacing: .3em; padding: .9em 1.9em .9em 2.2em;
  color: #e4f1ff; background: rgba(0, 0, 0, .45); border: 1.5px solid rgba(228, 241, 255, .55); border-radius: 999px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); transition: background .2s, border-color .2s, box-shadow .2s; }
.wl-enter:hover, .wl-enter:focus-visible { outline: none; background: rgba(0, 0, 0, .6); border-color: #e4f1ff;
  box-shadow: 0 0 18px rgba(169, 212, 255, .45); }
.wl-enter:active { transform: translate(-50%, -50%) scale(.97); }
.wl-text { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 3vh); transform: translateX(-50%);
  width: min(640px, calc(100% - 40px)); margin: 0; text-align: center; color: #8a93a6;
  font: 600 clamp(15px, 2.1vh, 18px)/1.45 "Titillium Web", sans-serif; text-shadow: 0 1px 6px #000; }
/* sign-in: the same screen, with the password field centred just above ENTER (same font size, so the em
   offsets line up with the button's half height, 1.4em) and any error just below it */
.wl-pw { position: absolute; left: 50%; top: 58%; transform: translate(-50%, calc(-100% - 2.2em));
  width: 13em; font: 600 clamp(15px, 2.4vh, 22px)/1 "Titillium Web", sans-serif; letter-spacing: .12em; text-align: center;
  padding: .75em 1em; color: #e4f1ff; background: rgba(0, 0, 0, .55); border: 1.5px solid rgba(228, 241, 255, .4);
  border-radius: 999px; outline: none; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.wl-pw::placeholder { color: #8a93a6; letter-spacing: .3em; }
.wl-pw:focus { border-color: #e4f1ff; box-shadow: 0 0 18px rgba(169, 212, 255, .35); }
.wl-err { position: absolute; left: 50%; top: 58%; transform: translate(-50%, 2.4em); white-space: nowrap;
  font: 700 clamp(14px, 2vh, 18px)/1 "Titillium Web", sans-serif; letter-spacing: .15em; color: var(--red); text-shadow: 0 1px 6px #000; }
@keyframes wl-in { from { opacity: 0; } to { opacity: 1; } }
.welcome.out { opacity: 0; transition: opacity .35s; }
@media (max-aspect-ratio: 5/4) {   /* narrower than the picture (phones): full width and a bit more, from the top */
  .wl-art { height: auto; width: 150%; top: 2%; }
  .wl-enter, .wl-pw { font-size: 15px; }
}
