/* LCARS (TNG) look. Class names are shared by the phone page (index.html) and the TV page (tv.html). */
:root {
  --bg: #000; --panel: #0c0b12; --panel2: #17151f; --line: #3a3550; --text: #f3e2cc; --dim: #c9a6c9;
  --orange: #ff9900; --peach: #ffcc99; --lilac: #cc99cc; --blue: #9999ff; --sky: #99ccff; --gold: #ffcc66; --rust: #ff9966;
  --amber: var(--orange); --green: #99dd99; --red: #cc6666; --violet: var(--lilac);
  --font: "Antonio", "Arial Narrow", "Roboto Condensed", "Helvetica Neue Condensed", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 18px/1.35 var(--font); letter-spacing: .02em; }
body { min-height: 100dvh; }
button, select { font: inherit; color: inherit; border: 0; cursor: pointer; }
b { font-weight: 700; color: var(--peach); }
.hidden { display: none !important; }
.dim { color: var(--dim); }
.small { font-size: 15px; }
.wrap { max-width: 520px; margin: 0 auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 14px; min-height: 100dvh; }
h1, h2 { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
h1 { font-size: 26px; color: var(--orange); white-space: nowrap; }
h2 { font-size: 19px; color: var(--lilac); }

/* LCARS header bar: rounded cap, title, then a bar that runs to the edge. */
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand .dot { flex: none; width: 44px; height: 30px; border-radius: 15px 0 0 15px; background: var(--orange); }
.brand h1 { overflow: hidden; text-overflow: ellipsis; }
.brand::after { content: ""; flex: 1; min-width: 24px; height: 30px; border-radius: 0 15px 15px 0;
  background: linear-gradient(90deg, var(--lilac) 0 38%, #000 38% calc(38% + 6px), var(--blue) calc(38% + 6px)); }

.card { background: var(--panel); border-left: 14px solid var(--lilac); border-radius: 24px 8px 8px 24px; padding: 16px; }
input[type=text], select { width: 100%; font: inherit; font-size: 20px; padding: 12px 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--panel2); color: var(--peach); }
input[type=text]:focus, select:focus { outline: none; border-color: var(--orange); }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--orange) 50%), linear-gradient(135deg, var(--orange) 50%, transparent 50%);
  background-position: calc(100% - 26px) 52%, calc(100% - 19px) 52%; background-size: 7px 7px; background-repeat: no-repeat; }
label.check { display: flex; gap: 12px; align-items: center; margin-top: 12px; text-transform: uppercase; letter-spacing: .06em; }
label.check input { width: 24px; height: 24px; accent-color: var(--orange); }

/* Pill buttons. Text is black on colour, like LCARS panels. */
.btn { display: block; width: 100%; padding: 16px 22px; border-radius: 999px; background: var(--orange); color: #000; font-weight: 700; font-size: 21px;
  text-transform: uppercase; letter-spacing: .1em; text-align: center; transition: filter 80ms, transform 80ms; }
.btn:active { filter: brightness(1.25); transform: scale(.985); }
.btn.secondary { background: var(--blue); color: #000; font-weight: 700; font-size: 17px; padding: 13px 18px; }
.btn.go { background: var(--gold); color: #000; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .btn.secondary:nth-child(2) { background: var(--lilac); }
.warn { background: #2a0e0e; border-left: 14px solid var(--red); border-radius: 22px 8px 8px 22px; color: #ffd6cc; padding: 12px 14px; font-size: 16px; }

/* combadge check */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 12px 14px 12px 0; border-radius: 22px 8px 8px 22px; background: var(--panel); }
.steps li.now { box-shadow: 0 0 0 2px var(--orange) inset; }
.steps li.done .ic { background: var(--gold); }
.steps .ic { width: 34px; height: 100%; min-height: 34px; border-radius: 22px 0 0 22px; background: var(--lilac); color: #000; display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.steps li.now .ic { background: var(--orange); }
.steps .body > * + * { margin-top: 8px; }

/* Hold-to-talk: an LCARS panel with a combadge. */
.ptt { position: relative; width: 100%; aspect-ratio: 1.15; border-radius: 48px; background: radial-gradient(circle at 50% 42%, #22203a, #0c0b14 70%);
  border: 0; box-shadow: inset 18px 0 0 var(--orange), inset -18px 0 0 var(--blue), inset 0 0 0 2px var(--line);
  display: grid; place-items: center; text-align: center; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.ptt > div:not(.cap)::before { content: ""; display: block; width: 96px; height: 76px; margin: 0 auto 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 80'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23fff4b8'/%3E%3Cstop offset='.5' stop-color='%23e2b042'/%3E%3Cstop offset='1' stop-color='%23855c0c'/%3E%3C/linearGradient%3E%3ClinearGradient id='s' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23f4f4f8'/%3E%3Cstop offset='1' stop-color='%23767a86'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cellipse cx='50' cy='47' rx='42' ry='22' fill='url(%23s)' stroke='%23555a66' stroke-width='1.5'/%3E%3Cpath d='M50 3C61 28 71 56 83 77C71 65 61 60 50 60S29 65 17 77C29 56 39 28 50 3Z' fill='url(%23g)' stroke='%235a400a' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 3px 6px #0008); transition: filter 120ms, transform 120ms; }
.ptt .big { font-size: 30px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
.ptt .sub { color: var(--dim); font-size: 17px; margin-top: 4px; text-transform: uppercase; letter-spacing: .1em; }
.ptt.small-ptt { aspect-ratio: auto; padding: 18px 26px 22px; border-radius: 36px; box-shadow: inset 12px 0 0 var(--orange), inset -12px 0 0 var(--blue), inset 0 0 0 2px var(--line); }
.ptt.small-ptt > div:not(.cap)::before { width: 60px; height: 48px; margin-bottom: 6px; }
.ptt.small-ptt .big { font-size: 24px; }
.ptt.talking { background: radial-gradient(circle at 50% 42%, #5a3200, #1a0d00 72%); box-shadow: inset 18px 0 0 var(--gold), inset -18px 0 0 var(--gold), inset 0 0 0 3px var(--orange); }
.ptt.small-ptt.talking { box-shadow: inset 12px 0 0 var(--gold), inset -12px 0 0 var(--gold), inset 0 0 0 3px var(--orange); }
.ptt.talking > div:not(.cap)::before { filter: drop-shadow(0 0 14px #ffcc66) brightness(1.15); transform: scale(1.06); }
.ptt.talking .big { color: var(--gold); }
.ptt.talking .sub { color: var(--peach); }
.ptt.busy { opacity: .5; }
.ptt.busyflash { animation: shake .3s; }
.ptt .ring { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.ptt.talking .ring { box-shadow: 0 0 0 calc(3px + var(--lvl, 0) * 18px) rgba(255, 153, 0, .35); transition: box-shadow 60ms; }
.ptt .cap { position: absolute; left: 34px; right: 34px; bottom: 16px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ptt .cap i { display: block; height: 100%; width: 0; background: var(--orange); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* status bar */
.top { display: flex; align-items: center; gap: 10px; }
.top .who { flex: 1; min-width: 0; }
.top .who b { display: block; font-size: 24px; text-transform: uppercase; letter-spacing: .06em; color: var(--orange); }
.top .who span { text-transform: uppercase; letter-spacing: .1em; }
.bars { display: inline-flex; gap: 3px; align-items: flex-end; height: 20px; }
.bars i { width: 6px; background: var(--line); border-radius: 3px; }
.bars i:nth-child(1) { height: 25%; } .bars i:nth-child(2) { height: 50%; } .bars i:nth-child(3) { height: 75%; } .bars i:nth-child(4) { height: 100%; }
.bars.b1 i:nth-child(-n+1), .bars.b2 i:nth-child(-n+2), .bars.b3 i:nth-child(-n+3), .bars.b4 i:nth-child(-n+4) { background: var(--sky); }
.bars.b1 i:nth-child(-n+1) { background: var(--red); }
.bars.b2 i:nth-child(-n+2) { background: var(--orange); }
.seg { display: inline-flex; gap: 4px; }
.seg button { padding: 9px 16px; border-radius: 999px; background: var(--panel2); font-size: 16px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.seg button.on { background: var(--sky); color: #000; font-weight: 700; }

.channel { padding: 10px 16px; border-radius: 999px; background: var(--panel); font-size: 16px; display: flex; gap: 10px; align-items: center; text-transform: uppercase; letter-spacing: .08em; }
.channel .led { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.channel.open { background: #2a1800; color: var(--peach); }
.channel.open .led { background: var(--orange); box-shadow: 0 0 10px var(--orange); }
.incoming { padding: 14px 18px; border-radius: 999px; background: var(--sky); color: #000; font-weight: 700; display: flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: .06em; animation: pulse .8s infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(153, 204, 255, 0); } to { box-shadow: 0 0 0 7px rgba(153, 204, 255, .3); } }

/* captain roster: each crew member is a big LCARS button */
.roster { display: flex; flex-direction: column; gap: 10px; }
.crew { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 14px 18px 14px 16px; border-radius: 34px 10px 10px 34px; background: var(--panel); border-left: 22px solid var(--blue);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.crew .nm { font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: .06em; color: var(--peach); }
.crew .st { font-size: 14px; color: var(--dim); grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crew .hint { font-size: 14px; color: var(--dim); align-self: center; text-transform: uppercase; letter-spacing: .1em; }
.crew.speaking { border-left-color: var(--sky); background: #0e1a2a; }
.crew.speaking .hint { color: var(--sky); font-weight: 700; }
.crew.talking { border-left-color: var(--gold); background: #2a1800; }
.crew.talking .hint { color: var(--gold); font-weight: 700; }
.crew.off { opacity: .45; }
.chip { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--line); color: var(--text); text-transform: uppercase; letter-spacing: .06em; }
.chip.away { background: var(--lilac); color: #000; }
.chip.ok { background: var(--gold); color: #000; }
.chip.bad { background: var(--red); color: #000; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick button { padding: 10px 16px; border-radius: 999px; background: var(--peach); color: #000; font-size: 16px; text-transform: uppercase; letter-spacing: .05em; }
.quick button:nth-child(3n+2) { background: var(--lilac); }
.quick button:nth-child(3n) { background: var(--sky); }
details summary { cursor: pointer; color: var(--dim); font-size: 16px; text-transform: uppercase; letter-spacing: .1em; }
.banner { position: fixed; left: 0; right: 0; top: 0; z-index: 10; padding: 12px; text-align: center; font-weight: 700; background: var(--red); color: #000; text-transform: uppercase; letter-spacing: .12em; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--peach); color: #000; padding: 10px 18px; border-radius: 999px; font-size: 16px; z-index: 11; max-width: calc(100% - 32px); text-align: center; }
footer { margin-top: auto; font-size: 14px; color: var(--dim); text-align: center; text-transform: uppercase; letter-spacing: .12em; }

/* Mission station on the phone */
.mission { display: flex; flex-direction: column; gap: 10px; }
.mhead { display: flex; justify-content: space-between; align-items: baseline; color: var(--orange); font-size: 20px; text-transform: uppercase; letter-spacing: .08em; }
.mnotice { padding: 10px 14px; border-radius: 14px; background: var(--panel2); border-left: 6px solid var(--gold); font-size: 17px; }
.mnotice.flash { animation: noticeflash 1.2s ease-out; }
@keyframes noticeflash { from { background: var(--gold); color: #000; } to { background: var(--panel2); } }
.mmeters { display: flex; justify-content: space-between; font-size: 15px; color: var(--dim); }
.mmeters b { color: var(--gold); letter-spacing: 2px; } .mmeters b.pain { color: var(--red); }
.mtask { background: var(--panel); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; border-left: 8px solid var(--lilac); }
.mtask.choice { border-left-color: var(--orange); }
.mtitle { font-size: 20px; text-transform: uppercase; letter-spacing: .05em; color: var(--peach); }
.mrole { color: var(--sky); font-size: 13px; margin-right: 8px; letter-spacing: .1em; }
.mopt { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--panel2); color: var(--text); font-size: 17px; text-transform: none; letter-spacing: 0; line-height: 1.3; }
.mopt:active { background: var(--orange); color: #000; }
.mopt .tone { font-size: 20px; }
.mopt small { display: block; color: var(--dim); font-size: 13px; margin-top: 3px; }
.mopt.locked { opacity: .45; }
.mclue { display: flex; gap: 10px; justify-content: space-between; align-items: center; background: var(--panel); border-radius: 14px; padding: 10px 12px; }
.mclue .btn { width: auto; padding: 8px 14px; font-size: 15px; }
.mwait { text-align: center; padding: 8px; }
.mending { background: var(--panel); border-radius: 18px; padding: 14px; border-left: 8px solid var(--gold); }
.mending b { color: var(--gold); font-size: 22px; text-transform: uppercase; display: block; }
.mission.paused #mTasks, .mission.paused #mClues { opacity: .35; pointer-events: none; }
.mission.paused .mhead { color: var(--gold); animation: pulse .8s infinite alternate; }

/* Combadge bar: fixed at the top of the phone, above minigames and full-screen prompts. */
.badgebar { position: fixed; left: 0; right: 0; top: 0; z-index: 60; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: #000; border-bottom: 2px solid var(--line); }
body.badged #main { padding-top: 92px; }
body.badged .mg, body.badged .ls, body.badged .goto { top: 84px !important; }
body.badged .banner { top: 84px; }
.ptt.bar-ptt { aspect-ratio: auto; height: 68px; border-radius: 34px; display: flex; align-items: center; justify-content: flex-start; padding: 0 22px; text-align: left;
  box-shadow: inset 10px 0 0 var(--orange), inset -10px 0 0 var(--blue), inset 0 0 0 2px var(--line); }
.ptt.bar-ptt > div:not(.cap) { display: flex; align-items: center; gap: 12px; }
.ptt.bar-ptt > div:not(.cap)::before { width: 52px; height: 40px; margin: 0; flex: none; }
.ptt.bar-ptt .big { font-size: 22px; }
.ptt.bar-ptt .sub { font-size: 13px; margin-top: 0; }
.ptt.bar-ptt .txt { display: flex; flex-direction: column; } .ptt.bar-ptt .txt span { display: block; }
.ptt.bar-ptt .cap { left: 26px; right: 26px; bottom: 6px; height: 4px; }
.ptt.bar-ptt.talking { box-shadow: inset 10px 0 0 var(--gold), inset -10px 0 0 var(--gold), inset 0 0 0 3px var(--orange); }
.mclue.fresh { border-left: 6px solid var(--gold); flex-wrap: wrap; }
.mtalk { font-size: 14px; color: var(--peach); max-width: 150px; text-align: right; }
.mtalk b { color: var(--gold); }
.msent { background: var(--panel); border-radius: 14px; padding: 8px 12px; }
.msent summary { color: var(--dim); text-transform: uppercase; letter-spacing: .08em; font-size: 14px; cursor: pointer; }
.msent .mclue { background: none; padding: 6px 0; border-top: 1px solid var(--line); border-radius: 0; }
/* Full-screen "go to" prompt for room changes */
.goto { position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 45; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center;
  border-top: 6px solid var(--orange); animation: gotoin .4s ease; }
.goto .gk { font-size: 20px; color: var(--dim); text-transform: uppercase; letter-spacing: .2em; }
.goto .gr { font-size: 52px; line-height: 1; color: var(--orange); text-transform: uppercase; letter-spacing: .04em; animation: pulse 1s infinite alternate; }
.goto .gt { font-size: 18px; color: var(--peach); max-width: 340px; }
.goto .btn { max-width: 340px; margin-top: 12px; }
@keyframes gotoin { from { opacity: 0; transform: scale(1.04); } }
