/* Sender identity fills the phone; reply colors keep their gameplay meaning. */
.decision-panel:has(.message-phone) {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.decision-panel:has(.message-phone) > .panel-top {
  display: none;
}
.message-phone.quick-card {
  --phone-dark: #142429;
  margin: 0 3px 5px;
  border: 5px solid #354449;
  border-radius: 27px;
  background: linear-gradient(
    150deg,
    color-mix(in srgb, var(--faction) 25%, #15282b),
    color-mix(in srgb, var(--faction) 12%, #102024)
  );
  box-shadow:
    0 8px 22px #0004,
    inset 0 0 0 1px #ffffff18;
  overflow: hidden;
  animation: message-arrives 0.25s ease-out;
}
.phone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px 9px;
  font:
    600 8px 'Segoe UI',
    sans-serif;
  letter-spacing: 1px;
  color: color-mix(in srgb, var(--faction) 55%, white);
}
.message-phone.quick-card .role-heading {
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: var(--faction);
  border: 0;
  color: #142929;
}
.message-phone .role-heading > b {
  background: #10272720;
  color: #10272b;
  width: 33px;
  height: 33px;
  font-size: 22px;
}
.message-phone .role-heading > div {
  flex: 1;
  min-width: 0;
}
.message-phone .role-heading strong {
  color: #13282b;
  font-size: 13px;
}
.message-phone .role-heading small {
  color: #263d3c;
  font-size: 9px;
  margin-top: 3px;
}
.sender-group {
  width: 100%;
  font:
    700 8px 'Segoe UI',
    sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.8;
  padding-left: 41px;
}
.chat-date {
  text-align: center;
  color: #c9d3ca;
  font-size: 8px;
  padding: 12px 5px 8px;
}
.message-phone.quick-card .incoming-message {
  position: relative;
  margin: 0 20px 12px 10px;
  padding: 12px;
  border-radius: 3px 14px 14px 14px;
  background: color-mix(in srgb, var(--faction) 19%, #203337);
  border: 1px solid color-mix(in srgb, var(--faction) 48%, transparent);
  box-shadow: 0 3px 5px #0001;
}
.message-phone.quick-card .card-content h3 {
  font:
    600 14px/1.35 'Segoe UI',
    sans-serif;
  color: #faf1db;
  margin: 0 0 7px;
}
.message-phone.quick-card .card-content p {
  font-size: 12px;
  line-height: 1.5;
  color: #ecede2;
}
.message-stamp {
  display: block;
  text-align: right;
  font-size: 8px;
  color: color-mix(in srgb, var(--faction) 60%, white);
  margin-top: 9px;
}
.reply-caption {
  display: flex;
  justify-content: space-between;
  margin: 0 14px 6px 24px;
  color: #dae3d5;
  font-size: 9px;
}
.reply-caption span {
  color: var(--faction);
}
.message-phone.quick-card .choices {
  margin: 0 10px 7px 24px;
  gap: 6px;
}
.message-phone.quick-card .choices button {
  border-radius: 12px 3px 12px 12px;
  padding: 9px 11px;
  font-size: 11px;
  min-height: 44px;
}
.message-phone.quick-card > .ignore-choice {
  width: calc(100% - 34px);
  margin: 0 10px 0 24px;
  border-radius: 12px 3px 12px 12px;
  border: 1px solid #83999c;
  background: #294045;
  color: #e1e4dc;
  min-height: 40px;
}
.message-phone .decision-key {
  font-size: 8px;
  text-align: center;
  padding: 9px 4px;
  color: #d0d9cd;
}
.neutral-dot {
  color: #a7bdc0;
  margin-left: 8px;
}
.phone-home {
  width: 72px;
  height: 3px;
  background: #e0e7d97a;
  border-radius: 5px;
  margin: 2px auto 9px;
}
.message-phone .bribe-inline {
  margin-left: 12px;
}
.message-phone .bribe-inline button {
  border-radius: 10px;
  min-height: 44px;
}
#drawer-content .decision-panel:has(.message-phone) {
  max-width: 355px;
}
#drawer:has(.message-phone) {
  max-height: 70dvh;
}
@keyframes message-arrives {
  from {
    opacity: 0.6;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .message-phone.quick-card {
    animation: none;
  }
}
@media (max-height: 780px) and (min-width: 701px) {
  .phone-status {
    padding: 8px 13px 5px;
  }
  .chat-date {
    padding: 7px 4px;
  }
  .message-phone.quick-card .incoming-message {
    padding: 9px;
    margin-bottom: 8px;
  }
  .message-phone.quick-card .choices button {
    padding: 7px 9px;
  }
  .message-stamp {
    margin-top: 5px;
  }
  .message-phone .decision-key {
    padding: 6px 3px;
  }
}

.message-phone .sender-group {
  display: none;
}
@media (max-height: 780px) and (min-width: 701px) {
  .message-phone.quick-card .role-heading {
    padding: 8px 10px;
  }
  .message-phone.quick-card .card-content p {
    font-size: 11px;
    line-height: 1.4;
  }
  .message-phone.quick-card .card-content h3 {
    font-size: 13px;
    margin-bottom: 5px;
  }
  .message-phone.quick-card .choices button {
    min-height: 38px;
    padding: 6px 9px;
  }
  .message-phone.quick-card > .ignore-choice {
    min-height: 35px;
    padding: 5px 9px;
  }
  .message-phone .choices small {
    margin-top: 3px;
  }
  .chat-date {
    padding: 5px 3px;
  }
  .phone-home {
    margin-bottom: 6px;
  }
}

#drawer .message-phone .choices {
  grid-template-columns: 1fr;
}
#drawer .message-phone .card-content h3 {
  font:
    600 14px/1.35 Segoe UI,
    sans-serif;
}
#drawer .message-phone .card-content p {
  font-size: 12px;
  line-height: 1.45;
}
/* A persistent phone chassis aligned with the full map panel. */
@media (min-width: 701px) {
  .workspace > .decision-panel:has(.message-phone) {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    overflow: hidden;
  }
  .workspace > .decision-panel > #decision {
    height: 100%;
    min-height: 0;
  }
  .workspace .message-phone.quick-card {
    height: 100%;
    box-sizing: border-box;
    margin: 0;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}
.message-phone.quick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 4px solid #697477;
  border-radius: 33px;
  box-shadow:
    0 0 0 1px #bac3bf55,
    inset 0 0 0 2px #080d12,
    0 8px 24px #0005;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-top: 15px;
  padding-bottom: 5px;
}
.message-phone.quick-card:before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 15px;
  border-radius: 20px;
  background: radial-gradient(circle at 85% 50%, #294151 0 2px, #080d12 3px);
  z-index: 2;
  box-shadow: 0 1px 2px #ffffff12;
}
.message-phone.quick-card > * {
  flex-shrink: 0;
}
.message-phone .phone-status {
  padding-top: 11px;
}
.message-phone .reply-caption {
  margin-top: auto;
  padding-top: 10px;
}
.message-phone .phone-home {
  margin-top: 8px;
  flex-shrink: 0;
}
.message-phone .decision-key {
  padding-bottom: 0;
}
.idle-phone.message-phone {
  background: #101c30;
}
.phone-saver {
  position: relative;
  flex: 1 !important;
  min-height: 230px;
  overflow: hidden;
  background: linear-gradient(#0c1729, #223553 70%, #795546);
}
.saver-sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.saver-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 19% 23%, #e5ebef 0 1px, transparent 2px),
    radial-gradient(circle at 74% 38%, #dce7f0 0 1px, transparent 2px),
    radial-gradient(circle at 60% 14%, #e5ebef 0 1px, transparent 2px);
  background-size:
    95px 140px,
    130px 170px,
    170px 200px;
  opacity: 0.65;
}
.saver-planet {
  position: absolute;
  width: 150%;
  height: 42%;
  left: -25%;
  bottom: -22%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 0%, #9c8770, #495267 40%, #172738 70%);
  box-shadow: 0 -4px 30px #739cbc6b;
}
.saver-meteor {
  position: absolute;
  left: 52%;
  top: 25%;
  width: 5px;
  height: 95px;
  border-radius: 80%;
  transform: rotate(34deg);
  background: linear-gradient(transparent, #e6b285 70%, #fff2d4);
  filter: drop-shadow(0 0 5px #ffb86f);
  animation: meteor-fall 9s linear infinite;
}
.saver-impact {
  position: absolute;
  left: calc(50% - 35px);
  bottom: 12%;
  width: 70px;
  height: 70px;
  background: radial-gradient(#fff8dc, #efb471 20%, #b7664166 50%, transparent 72%);
  border-radius: 50%;
  opacity: 0;
  animation: meteor-impact 9s ease-out infinite;
}
.saver-ring {
  position: absolute;
  left: calc(50% - 45px);
  bottom: 15%;
  width: 90px;
  height: 20px;
  border: 2px solid #dfb98a;
  border-radius: 50%;
  opacity: 0;
  animation: meteor-ring 9s ease-out infinite;
}
.saver-caption {
  position: relative;
  z-index: 1;
  padding: 28px 18px;
  text-align: center;
  color: #edf1ee;
}
.saver-caption > span {
  color: #bbd2e6;
  font-size: 20px;
}
.saver-caption h3 {
  font:
    500 18px 'Segoe UI',
    sans-serif;
  margin: 12px 0 8px;
}
.saver-caption p {
  font-size: 11px;
  color: #bfccd8;
}
.saver-caption small {
  display: block;
  font-size: 7px;
  letter-spacing: 1.5px;
  margin-top: 18px;
  color: #a8b6c8;
}
.saver-next {
  margin: 12px 16px 2px;
  border: 1px solid #92acc066;
  background: #273b4d;
  border-radius: 16px;
  min-height: 42px;
  color: #e8eeec;
  font-size: 12px;
}
@keyframes meteor-fall {
  0%,
  20% {
    opacity: 0;
    transform: translate(80px, -130px) rotate(34deg);
  }
  25% {
    opacity: 1;
  }
  64% {
    opacity: 1;
    transform: translate(-35px, 190px) rotate(34deg);
  }
  65%,
  100% {
    opacity: 0;
    transform: translate(-35px, 190px) rotate(34deg);
  }
}
@keyframes meteor-impact {
  0%,
  64% {
    opacity: 0;
    transform: scale(0.1);
  }
  67% {
    opacity: 0.85;
    transform: scale(0.7);
  }
  84%,
  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}
@keyframes meteor-ring {
  0%,
  66% {
    opacity: 0;
    transform: scale(0.2);
  }
  70% {
    opacity: 0.7;
  }
  90%,
  100% {
    opacity: 0;
    transform: scale(3);
  }
}
@media (prefers-reduced-motion: reduce) {
  .saver-meteor,
  .saver-impact,
  .saver-ring {
    animation: none;
  }
  .saver-meteor {
    opacity: 0.6;
  }
}

.message-phone.quick-card {
  overflow-y: auto;
  padding-top: 15px;
  border: 4px solid #697477;
  border-radius: 33px;
}
.message-phone .reply-caption {
  margin-top: auto;
  padding-top: 10px;
}
.message-phone .phone-status {
  padding-top: 11px;
}
.idle-phone.message-phone {
  background: #101c30;
}
.saver-meteor {
  top: auto;
  bottom: 17%;
  left: 50%;
  transform-origin: bottom center;
}
@keyframes meteor-fall {
  0%,
  20% {
    opacity: 0;
    transform: translate(150px, -260px) rotate(34deg);
  }
  25% {
    opacity: 1;
  }
  64% {
    opacity: 1;
    transform: translate(0, 0) rotate(34deg);
  }
  65%,
  100% {
    opacity: 0;
    transform: translate(0, 0) rotate(34deg);
  }
}
