/* The shop and inventory use the original keychain display. */
.phone-portrait{height:100%;width:100%;position:relative;overflow:hidden}
.phone-portrait img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none;clip-path:polygon(47% .4%,62% .5%,70% 2.1%,76% 5.2%,80% 9.2%,83.6% 16%,86.2% 28%,87% 40%,86% 65%,84.8% 81%,82.4% 91%,79% 96%,74% 98.2%,65% 98.8%,39% 98.9%,26% 98.2%,20% 95.5%,16.5% 90%,14% 79%,13% 65%,12% 43%,12% 35%,13.7% 23%,17% 13.8%,21% 7.4%,27% 3.5%,36% 1%)}
#status-phone {
  position:relative; display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px;
  margin:0 auto; padding:0; border:0; border-radius:6px; background:transparent; color:inherit; cursor:pointer; touch-action:manipulation;
}
#status-phone[hidden]{display:none}
#status-phone:focus-visible{outline:2px solid #405e4b;outline-offset:-2px}
#status-phone:active{background:#50624e20}
#status-phone:not([hidden])+#weapon-summary{margin-left:0;min-width:0}
#status-phone[data-phone-unread]::after{
  content:attr(data-phone-unread);position:absolute;right:0;top:1px;min-width:15px;border-radius:12px;
  padding:1px 3px;background:#375c4c;color:#fbfce0;font:bold 10px/14px Arial,sans-serif;text-align:center;
}
.pocket-list{display:grid;grid-template-columns:38% 1fr;align-items:center;gap:12px;padding:8px;min-height:150px}
.pocket-list .phone-portrait{width:min(100%,142px);aspect-ratio:2/3;justify-self:center;align-self:center}
#modal .pocket-list h3{font:bold clamp(19px,3vw,28px)/1.04 Georgia,serif;letter-spacing:-.8px;margin:5px 0 8px;color:#273728}
#modal .pocket-list p{font:13px/1.4 Arial,sans-serif;margin:0 0 12px}
.phone-note{margin:0;padding:5px 3px;font:12px/1.3 Arial,sans-serif;background:#dce9bc;border-bottom:1px solid #9fac81}
.phone-test-select{max-width:142px;min-height:32px;font:bold 12px/1.3 'Courier New',monospace;color:#233c2c;background:#e6e5c9;border:1px solid #52644d;border-radius:4px;padding:3px}
@media(max-width:520px){.phone-test-select{max-width:105px;min-height:29px;font-size:10px}}

/* The open phone takes the browser's top layer. All coordinates follow the original 1024 × 1536 artwork. */
html:has(#phone-handset[open]) { overflow: hidden; }
body:has(> #phone-handset[open]) > :is(.topbar, .layout, footer) { visibility: hidden; }
#phone-handset {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: radial-gradient(ellipse at 50% 44%, #344237, #1d2a23 55%, #101a16 100%);
  color: #f2eddc;
  color-scheme: dark;
  font: 600 1rem/1.25 ui-monospace, 'Courier New', monospace;
}
#phone-handset::backdrop { background: #131d18; }
.handset-stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  overflow-x: clip;
}
.handset-bar {
  width: min(100%, 29rem);
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3px;
}
#phone-handset button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.handset-bar button {
  min-height: 44px;
  padding: .45rem .6rem;
  border: 0;
  background: transparent;
  color: #e2e5d3;
  font: 600 .875rem/1.25 system-ui, sans-serif;
}
.handset-bar button:first-child { display: inline-flex; gap: .4rem; align-items: center; }
.handset-bar button span { font: 1.65rem/.7 system-ui, sans-serif; }
.handset-bar strong { color: #e2ca79; font-family: ui-monospace, monospace; }
.handset-body {
  /* Crop the unused side margins while keeping the handset's aspect ratio. */
  width: min(100%, 27rem, max(276px, calc((100vh - 108px) / 2)));
  width: min(100%, 27rem, max(276px, calc((100dvh - 108px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) / 2)));
  aspect-ratio: 1 / 2;
  position: relative;
  flex: none;
}
.handset-face {
  position: absolute;
  top: 0;
  left: -16.6667%;
  width: 133.3334%;
  height: 100%;
  container-type: inline-size;
}
.handset-art { position: absolute; inset: 0; pointer-events: none; filter: drop-shadow(0 6px 7px #07100bd6); }
.handset-art img {
  user-select: none;
  -webkit-user-drag: none;
  clip-path: polygon(48.97% 0.36%, 42.92% 0.55%, 38.13% 0.94%, 33.84% 1.53%, 30.13% 2.38%, 27.49% 3.29%, 24.56% 4.72%, 22.41% 6.15%, 19.97% 8.43%, 18.21% 10.77%, 16.85% 13.31%, 14.89% 18.98%, 13.13% 28.16%, 12.06% 39.88%, 12.16% 43.98%, 13.04% 47.30%, 13.33% 50.81%, 13.13% 67.81%, 13.62% 78.16%, 14.79% 85.19%, 15.67% 88.12%, 16.65% 90.27%, 18.31% 92.74%, 20.17% 94.56%, 22.51% 96.06%, 25.73% 97.30%, 23.00% 97.43%, 23.10% 97.56%, 27.39% 97.69%, 29.93% 98.08%, 35.30% 98.54%, 43.99% 98.86%, 53.86% 98.86%, 67.33% 98.21%, 71.44% 97.69%, 73.58% 97.17%, 76.22% 96.13%, 78.17% 94.95%, 79.83% 93.52%, 81.59% 91.18%, 82.76% 88.70%, 83.84% 85.51%, 85.21% 77.57%, 85.60% 71.58%, 85.60% 63.05%, 85.21% 53.81%, 85.69% 47.75%, 86.77% 43.65%, 86.77% 38.64%, 85.89% 26.79%, 84.42% 18.78%, 82.57% 13.31%, 80.91% 10.25%, 78.96% 7.78%, 76.81% 5.83%, 74.76% 4.46%, 72.41% 3.29%, 69.68% 2.31%, 65.97% 1.46%, 62.26% 0.94%, 57.47% 0.55%, 51.90% 0.36%);
}
.handset-lcd {
  position: absolute;
  left: 26.28%;
  top: 20.28%;
  width: 47.15%;
  height: 16.94%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.2% 1.8%;
  overflow: hidden;
  border-radius: 6%;
  color: #20300e;
  color-scheme: light;
  background: repeating-linear-gradient(0deg, #465d1d0c 0 1px, transparent 1px 3px), radial-gradient(ellipse at 42% 35%,#b3ca64,#98b34d 75%,#849e41);
  box-shadow: inset 0 0 5px #40592e;
  font: 700 clamp(15px, 4cqw, 22px)/1.16 'Courier New', monospace;
  text-align: left;
}
.handset-lcd button, .handset-lcd select {
  background: transparent;
  color: inherit;
  border: 0;
  padding: 0;
  border-radius: 0;
  font: inherit;
}
.handset-title, .handset-to {
  flex: none;
  display: flex;
  align-items: center;
  gap: .3em;
  min-width: 0;
  border-bottom: 1px solid #5f7635;
}
.handset-title { padding-bottom: .12em; font-size: .83em; }
.handset-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-signal { margin-left: auto; font-style: normal; font-size: .8em; letter-spacing: -1px; }
.phone-battery { display: inline-block; width: 1.1em; height: .6em; border: 1px solid; background: repeating-linear-gradient(90deg, #34471a 0 2px,transparent 2px 3px); }
.handset-home { flex: 1; min-height: 0; display: grid; grid-template-rows: 1fr 1fr; }
.handset-home > button { text-align: left; }
.handset-home > div { display: flex; border-top: 1px dotted #677f38; }
.handset-home > div button { width: 50%; text-align: left; font-size: .84em; }
.handset-home > div button + button { border-left: 1px dotted #677f38; padding-left: .5em; }
.handset-refills small { align-self:center; font-size:.8em; }
.handset-refills button:disabled { opacity:.5; }
.handset-to label { font-size: .84em; }
.handset-to select { flex: 1; min-width: 0; height: 1.6em; font-size: max(16px, .88em); }
#phone-draft, .handset-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #5a7234 transparent;
}
#phone-draft { padding: .14em 0; white-space: pre-wrap; overflow-wrap: anywhere; }
#phone-draft u { text-underline-offset: 2px; }
.lcd-cursor { display: inline-block; height: .9em; border-left: 2px solid; vertical-align: -.09em; }
.handset-status { display: flex; justify-content: space-between; gap: .3em; border-top: 1px solid #687b38; padding-top: .12em; font-size: clamp(10px, 2.6cqw, 14px); }
.handset-scroll p, .handset-scroll small { margin: .25em 0; }
.handset-scroll p { white-space: pre-wrap; overflow-wrap: anywhere; }
.handset-scroll small { display: block; font-size: .7em; }
.handset-scroll > button { display: block; width: 100%; min-height: 36px; text-align: left; }
.handset-scroll .phone-mail-row { font-size: .86em; padding: .23em 0; border-bottom: 1px dotted #677f38; }
.phone-mail-row strong, .phone-mail-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-mail-row em { font: 700 .76em/1 'Courier New',monospace; }
.phone-mail-row span { font-size: .85em; }
.handset-softkeys, .handset-pad { position: absolute; display: grid; }
.handset-softkeys {
  left: 18.25%; right: 18.25%; top: 42.7%; bottom: 42.5%;
  grid-template-columns: repeat(4,minmax(0,1fr));
}
.handset-pad {
  left: 18.3%; right: 18.5%; top: 57.9%; bottom: 10.1%;
  grid-template-columns: repeat(3,minmax(0,1fr));
  grid-template-rows: repeat(4,minmax(0,1fr));
}
.handset-pad button, .handset-softkeys button {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 36%;
  background: transparent;
  box-shadow: none;
  user-select: none;
  -webkit-user-select: none;
}
.handset-softkeys button { display: flex; justify-content: center; align-items: flex-start; padding-top: .2em; color: #fff4cd; }
.handset-softkeys button span {
  border-radius: 3px;
  padding: 1px 3px;
  color: #f6e9c6;
  text-shadow: 0 1px 2px #0c1320, 0 0 3px #0c1320;
  font: 700 clamp(11px, 2.9cqw, 15px)/1.2 'Courier New', monospace;
  white-space: nowrap;
}
.handset-softkeys button:disabled { opacity: .68; }
.handset-pad button:active, .handset-softkeys button:active:enabled { background: #0b1a2438; }
#phone-handset button:focus-visible, #phone-handset select:focus-visible { outline: 2px solid #f4cd70; outline-offset: -2px; }
.handset-lcd:focus { outline: none; }
#phone-handset .handset-lcd :focus-visible { outline-color: #2c4616; }
.handset-hint { width: min(100%, 27rem); min-height: 2em; margin: 8px 0 0; text-align: center; color: #d5dbc8; font: 500 .85rem/1.35 system-ui, sans-serif; }

.handset-pad[hidden] { display:none; }
.handset-status button { min-width:2.6em; text-align:left; text-decoration:underline; text-underline-offset:2px; }
.handset-title .lcd-back { min-width:1.6em; align-self:stretch; border-right:1px solid #687b38; font-size:1.18em; }
