:root { --bg: #070a16; --ink: #f3e2bd; --font: 'Jersey 15', monospace; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); overflow: hidden; user-select: none; }
#stage { position: absolute; inset: 0; touch-action: none; }
.px-canvas { display: block; image-rendering: pixelated; }
#title {
  position: absolute; left: 0; right: 0; top: 18%;
  text-align: center; font-size: 56px; letter-spacing: 2px;
  text-shadow: 0 0 18px rgba(255, 190, 110, 0.45);
  pointer-events: none; transition: opacity 2.5s;
}
.gone { opacity: 0 !important; }
#pause {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(7, 8, 14, 0.62); text-align: center; padding: 16px;
}
#pause[hidden] { display: none; }
#pause .paused { font-size: 64px; text-shadow: 0 0 18px rgba(255, 190, 110, 0.45); }
#pause .resume { font-size: 20px; opacity: 0.8; margin-top: 6px; }
#pause .credits { position: absolute; bottom: 18px; left: 16px; right: 16px; font-size: 15px; line-height: 19px; opacity: 0.6; }
#title .sub { font-size: 22px; letter-spacing: 1px; opacity: 0.75; margin-top: 4px; text-shadow: none; }

/* The phone: always in hand at the bottom right. */
#phone {
  position: absolute; right: 24px; bottom: 0; width: 280px; height: 440px; max-height: calc(100% - 40px);
  background: #0e0f14; border: 3px solid #2a2c34; border-bottom: none; border-radius: 22px 22px 0 0;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; overflow: hidden;
}
.ph-bar { display: flex; justify-content: space-between; padding: 10px 16px 4px; font-size: 18px; color: #e8e0cc; }
.ph-who { opacity: 0.7; }
.ph-tabs { display: flex; gap: 4px; padding: 4px 12px 8px; }
.ph-tabs button { flex: 1; background: #1c1e26; border: none; color: #a8a49a; font: inherit; font-size: 17px; padding: 4px; border-radius: 8px; cursor: pointer; }
.ph-tabs button.on { background: #3a3e4c; color: #f3e2bd; }
.ph-tabs button.new { color: #ffd890; box-shadow: inset 0 -2px 0 #ffb860; }
@keyframes phlit { from { box-shadow: 0 0 40px rgba(255, 210, 140, 0.55); border-color: #6a5a40; } to { box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); border-color: #2a2c34; } }
#phone.lit { animation: phlit 1.6s ease-out; }
.ph-messages { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.ph-msg { background: #262a36; border-radius: 12px 12px 12px 3px; padding: 7px 10px; margin: 8px 30px 0 0; font-size: 17px; line-height: 19px; color: #ece6d6; }
.ph-when { font-size: 13px; opacity: 0.5; margin-top: 3px; }
.ph-map { flex: 1; width: 100%; min-height: 0; object-fit: contain; background: #1c1e26; }
.ph-map[hidden], .ph-messages[hidden] { display: none; }


#end {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(30, 34, 46, 0.85); text-align: center;
}
#end[hidden] { display: none; }
#end .paused { font-size: 72px; }
#end .resume { font-size: 24px; margin-top: 6px; }
#end .sub { font-size: 18px; opacity: 0.6; margin: 6px 0 18px; }
#end button { font: inherit; font-size: 22px; color: #f3e2bd; background: #2a2e3c; border: 2px solid #4a4e5c; border-radius: 10px; padding: 6px 18px; cursor: pointer; }

/* Messages: a list of conversations, and a conversation. */
.ph-messages { display: flex; flex-direction: column; padding: 0; }
.ph-list { flex: 1; overflow-y: auto; }
.ph-list[hidden], .ph-convo[hidden] { display: none; }
.ph-empty { text-align: center; opacity: 0.4; margin-top: 40px; font-size: 17px; }
.ph-row { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid #1e2028; cursor: pointer; }
.ph-row:hover { background: #181a22; }
.ph-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; color: #f3ead8; }
.ph-mid { flex: 1; min-width: 0; }
.ph-top { display: flex; align-items: center; gap: 6px; }
.ph-rname { flex: 1; font-size: 17px; color: #ece6d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-rtime { font-size: 13px; opacity: 0.5; }
.ph-badge { background: #e8a040; color: #1a1410; font-size: 13px; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.ph-prev { font-size: 14px; line-height: 17px; color: #a8a49a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-row.unread .ph-rname, .ph-row.unread .ph-prev { color: #fff4dc; }
.ph-convo { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ph-head { display: flex; align-items: center; gap: 8px; padding: 4px 10px 8px; border-bottom: 1px solid #1e2028; }
.ph-head .ph-avatar { width: 26px; height: 26px; font-size: 15px; }
.ph-back { background: none; border: none; color: #e8c890; font: inherit; font-size: 28px; line-height: 20px; cursor: pointer; padding: 0 4px; }
.ph-name { font-size: 18px; color: #ece6d6; }
.ph-bubbles { flex: 1; overflow-y: auto; padding: 4px 12px 14px; }
.ph-stamp { text-align: center; font-size: 13px; opacity: 0.45; margin: 10px 0 2px; }
.ph-bubbles .ph-msg { margin: 5px 34px 0 0; width: fit-content; max-width: 100%; }
.ph-bubbles .ph-msg.me { margin: 5px 0 0 auto; background: #3a4a6a; border-radius: 12px 12px 3px 12px; color: #eef0f6; }
.ph-replies { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px 10px; border-top: 1px solid #1e2028; }
.ph-replies[hidden] { display: none; }
.ph-replies button { text-align: left; background: #2a3450; border: none; color: #eef0f6; font: inherit; font-size: 15px; padding: 5px 9px; border-radius: 10px; cursor: pointer; }
.ph-replies button b { color: #ffd890; font-weight: normal; margin-right: 4px; }
.ph-replies button:hover { background: #34406a; }

/* Talk in the street: bubbles over heads, the prompt, the choices. */
#bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bubble {
  position: absolute; left: 0; top: 0; max-width: 260px; padding: 5px 10px 6px; margin-top: -10px;
  background: rgba(240, 232, 214, 0.94); color: #1a1614; border-radius: 12px; font-size: 18px; line-height: 19px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); transition: opacity 0.2s;
}
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: rgba(240, 232, 214, 0.94); }
.bubble.me { background: rgba(200, 214, 240, 0.95); }
.bubble.me::after { border-top-color: rgba(200, 214, 240, 0.95); }
#prompt { position: absolute; left: 0; top: 0; pointer-events: none; font-size: 17px; color: #ffe9b0; background: rgba(14, 15, 20, 0.75); padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
#prompt[hidden], #choices[hidden] { display: none; }
#choices { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; min-width: 320px; max-width: 520px; }
#choices button { text-align: left; font: inherit; font-size: 19px; color: #f3e2bd; background: rgba(20, 22, 30, 0.92); border: 2px solid #3a3e4c; border-radius: 10px; padding: 6px 12px; cursor: pointer; }
#choices button:hover { border-color: #8a7a5a; }
#choices button b { color: #ffd890; font-weight: normal; margin-right: 6px; }
