/* The page's five places (launch.js, ui.js, join.js, chat.js): top left what to do next, top right
   the players, bottom left the chat, bottom centre what you are and the one thing to do, bottom
   right the map. The same for a visitor and a player; nothing else on screen. Loaded last: it
   places what style.css styles. */

:root { --bc-h: 64px; }
#state-dot { display: none; }
.head { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- top left: the checklist ---------- */
#top-left { width: 320px; top: calc(var(--gap) + var(--sat)); bottom: auto; left: calc(var(--gap) + var(--sal)); right: auto; flex-direction: column; }
#checklist {
  width: 100%; padding: 8px; background: var(--card);
 text-shadow: none;
}
#check-sum { display: none; }
#check-list { display: grid; gap: 4px; }
#check-list button {
  position: relative; width: 100%; display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 10px;
 background: none; font-size: 13px; line-height: 1.25; color: var(--text);
}
#check-list button:hover { background: none; }
#check-list button:hover .t { text-decoration: underline; text-underline-offset: 2px; }
#check-list button:disabled { cursor: default; }
#check-list .tick { flex: none; width: 16px; height: 16px; border: 1.5px solid rgba(255, 255, 255, 0.5); display: grid; place-items: center; }
#check-list .done .tick { background: #7bd88f; border-color: #7bd88f; }
#check-list .done .tick::after { content: ""; width: 4px; height: 8px; border: solid #0d1015; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
#check-list .done .t { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.35); }

#check-list .later { opacity: 0.55; }
#check-list .apps { display: inline-flex; gap: 4px; flex: none; }
#check-list .logo { width: 16px; height: 16px; display: block; }
#check-list .soon { color: var(--dim); font-size: 11px; }
#check-list .reward { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
#check-list .flash { position: absolute; right: 8px; padding: 2px 8px; background: #fff; color: #0d1015; font-size: 12px; }

/* ---------- bottom centre: what you are, and the one thing to do ---------- */
#bottom-center { left: 50%; bottom: calc(var(--gap) + var(--sab)); transform: translateX(-50%); align-items: center; gap: 6px; pointer-events: none; width: max-content; max-width: calc(100vw - 2 * var(--gap) - 760px); min-width: 380px; }
#bottom-center > * { pointer-events: auto; }
#bottom-center #bar { display: flex; align-items: center; gap: 14px; width: auto; padding: 10px 10px 10px 14px; }
#bottom-center #state { display: flex; align-items: center; gap: 8px; min-width: 0; }
#bottom-center #state > span:not(#state-sub) { flex: none; }
#state-head:empty { display: none; }
#state-head .head { width: 28px; height: 28px; display: block; }
#bottom-center #state-text { font-size: 15px; }
#bottom-center #state-sub { display: none; }
#bottom-center #state-sub:not(:empty) { display: block; max-width: 260px; font-size: 12px; line-height: 1.3; }
#bottom-center #state { flex-wrap: wrap; row-gap: 0; }
#bottom-center #bigs { display: flex; margin: 0; gap: 8px; }
#bottom-center .cta { height: 42px; padding: 0 18px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
#bottom-center .cta .logo { width: 18px; height: 18px; }
#bottom-center .cta.primary .logo.gpt { color: #0d1015; }
.cta.quiet-cta { background: none; border-color: transparent; color: var(--muted); font-weight: 500; padding: 0 8px; }


/* ---------- bottom left: the chat (plain lines on the world, each on a faint dark strip) ---------- */
#bottom-left { width: 380px; bottom: calc(var(--gap) + var(--sab)); left: calc(var(--gap) + var(--sal)); }



/* ---------- bottom right: the map ---------- */
#bottom-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
#minimap-wrap { overflow: hidden; }
#minimap { width: 280px; height: 140px; }
#minimap-size {
  display: grid !important; place-items: center; position: absolute; right: 4px; top: 4px; width: 26px; height: 26px;
 background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0; text-shadow: none;
}
#minimap-size::before { content: ""; width: 10px; height: 10px; border: solid #fff; border-width: 2px 2px 0 0; transform: translate(1px, -1px); }
#minimap-size::after { content: ""; position: absolute; width: 10px; height: 10px; border: solid #fff; border-width: 0 0 2px 2px; transform: translate(-1px, 1px); }

.map-big #minimap-size::before { transform: translate(-1px, 1px) rotate(180deg); }
.map-big #minimap-size::after { transform: translate(1px, -1px) rotate(180deg); }
#q-help { font-size: 12px; padding: 0 2px; }
/* the big map: over the view, the world still round it */
.map-big #minimap-wrap {
  position: fixed; z-index: 25; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(calc(100vw - 2 * var(--gap) - var(--sal) - var(--sar)), 1200px, calc((100vh - 2 * var(--gap) - 40px) * 2));
  aspect-ratio: 2 / 1;
}
.map-big #minimap { width: 100% !important; height: 100% !important; cursor: grab; }
.map-big #minimap:active { cursor: grabbing; }
.map-big #minimap-size { width: 34px; height: 34px; right: 8px; top: 8px; }

/* the players: as they are; their heads crisp */
#lobby .head { image-rendering: pixelated; }

/* what is no longer on screen */

/* ---------- not so wide: the chat rides over the bar ---------- */
@media (max-width: 1240px) {
  #bottom-center { max-width: calc(100vw - 2 * var(--gap) - 320px); min-width: 0; left: calc(var(--gap) + var(--sal)); transform: none; align-items: flex-start; }
  #bottom-left { bottom: calc(var(--gap) + var(--sab) + 72px); width: min(380px, calc(100vw - 340px)); }
}

/* ---------- a phone held upright ---------- */
.m-compact:not(.m-land) #top-left { top: calc(var(--sat) + var(--gap)); bottom: auto; left: calc(var(--gap) + var(--sal)); right: auto; width: auto; max-width: calc(100vw - 2 * var(--gap) - 120px); flex-direction: column; align-items: flex-start; }
.m-compact #checklist { padding: 4px; width: auto; }
.m-compact #check-sum { display: flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 8px; font-size: 13px; font-weight: 600; text-shadow: none; }
.m-compact #check-sum > span:first-child { margin-right: 6px; }
.m-compact #check-sum .caret { margin-left: 6px; color: var(--muted); }
.m-compact #check-list { display: none; }
.m-compact #checklist.open { width: calc(100vw - 2 * var(--gap) - var(--sal) - var(--sar)); }
.m-compact #checklist.open #check-list { display: grid; margin-top: 4px; }
.m-compact #check-list button { min-height: 44px; }
.m-compact:not(.m-land) #top-right { top: calc(var(--sat) + var(--gap)); bottom: auto; right: calc(var(--gap) + var(--sar)); max-width: 150px; }
.m-compact:not(.m-land) #bottom-center {
  left: calc(var(--gap) + var(--sal)); right: calc(var(--gap) + var(--sar)); transform: none; width: auto; max-width: none; min-width: 0;
  bottom: calc(var(--gap) + max(var(--sab), var(--sheet-h))); align-items: stretch;
}
.m-compact:not(.m-land) #bottom-center #bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
.m-compact:not(.m-land) #bottom-center #bigs { display: grid; grid-template-columns: 1fr auto; }
.cta-reserved.m-compact:not(.m-land) #bottom-center #bigs { grid-template-columns: 1fr 1fr; }
.m-compact:not(.m-land) #bottom-center .cta { height: 48px; justify-content: center; font-size: 15px; }
.cta-visitor.m-compact:not(.m-land) #bottom-center #b-main { white-space: normal; line-height: 1.2; }
.m-compact:not(.m-land) #bottom-left { left: calc(var(--gap) + var(--sal)); right: calc(var(--gap) + var(--sar)); width: auto; bottom: calc(var(--gap) + max(var(--sab), var(--sheet-h)) + var(--bc-h) + 10px); }
.m-compact #chat li:nth-last-child(n+5) { display: none; }
.m-compact:not(.m-land) #bottom-right { top: calc(var(--sat) + var(--gap) + 44px); bottom: auto; right: calc(var(--gap) + var(--sar)); left: auto; }
.m-compact:not(.m-land) #minimap { width: 120px; height: 60px; }
.m-compact #q-help { display: none; }
.m-compact.map-big #minimap-wrap { width: calc(100vw - 2 * var(--gap)); }
.m-compact.map-big #minimap-size { width: 44px; height: 44px; }
.m-compact:not(.m-land).map-big #top-right, .m-compact.map-big #bottom-left { visibility: visible; }

.m-compact:not(.map-big) #minimap-size { display: none !important; }
/* (one thing open at a time at the top of a phone) */
.m-compact.check-open #top-right, .m-compact.check-open #bottom-right, .m-compact.players-open #bottom-right { visibility: hidden; }
.m-compact #top-left { z-index: 3; }
/* done rows: quiet, at the bottom */
#check-list .done button { background: none; min-height: 30px; color: var(--dim); }
#check-list .done .t { color: var(--dim); text-decoration: none; }
#check-list .done .tick { transform: scale(0.85); }
#check-list .post-form form { display: flex; gap: 6px; padding: 2px 4px 4px 35px; }
#check-list .post-form input { flex: 1; min-width: 0; height: 30px; padding: 0 8px; background: rgba(0, 0, 0, 0.35); color: #fff; font-size: 12px; outline: none; -webkit-user-select: text; user-select: text; }
#check-list .post-form button { height: 30px; padding: 0 10px; background: #fff; color: #0d1015; font-weight: 600; font-size: 12px; min-height: 0; }
#check-list .post-form button { width: auto; }
/* toasts above the bottom bar, clear of it */
#toasts { bottom: calc(var(--gap) + var(--sab) + var(--bc-h, 64px) + 12px) !important; }

/* the rewards: the agent's head itself, large enough to read as one, in its own colours */
.head.r { width: 20px !important; height: 20px !important; margin-left: 2px; opacity: 1 !important; filter: none !important; }
#check-list .reward { gap: 3px; font-weight: 600; color: var(--text); }
#check-list li.later .reward, #check-list li:not(.next):not(.done) .t { color: var(--muted); }
#check-list .later { opacity: 1 !important; }
#check-list .later .t, #check-list .later .soon { color: var(--dim); }
#check-list .done .head.r { opacity: 0.8 !important; }
#check-sum .head.r { width: 16px !important; height: 16px !important; }
/* a phone held upright: the players' list whole on the right, the map tile on the left under the checklist */
.m-compact:not(.m-land) #bottom-right { left: calc(var(--gap) + var(--sal)); right: auto; top: calc(var(--sat) + var(--gap) + 48px); align-items: flex-start; }
.m-compact:not(.m-land).check-open #bottom-right { visibility: hidden; }
/* the one question, and the sentence to send: plain text on the bar's rectangle */
#b-first { width: 100%; min-width: 280px; height: 38px; padding: 0 10px; border: 0; background: rgba(0, 0, 0, 0.55); color: #fff; font: 14px var(--font); outline: none; -webkit-user-select: text; user-select: text; }
#b-first::placeholder { color: var(--muted); }
#b-said { color: var(--text); font-size: 13px; max-width: 360px; overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; }
#bottom-center #bar { flex-wrap: wrap; }
#check-list .photo label { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 10px; font-size: 13px; cursor: pointer; }
#check-list .photo label:hover .t { text-decoration: underline; text-underline-offset: 2px; }
