.cafe-frame {
  --cafe-paper: #f5f0e3;
  --cafe-ink: #243329;
  --cafe-secondary: #526053;
  --cafe-line: #c7c9b9;
  --cafe-wine: #6e3541;
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom) + var(--cafe-keyboard, 0px));
  width: min(500px, calc(100% - 32px));
  max-height: calc(var(--cafe-visible-height, 100dvh) - 24px);
  transform: translateX(-50%);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #677264;
  border-radius: 5px;
  box-shadow: 0 4px 18px #11221940;
  background: var(--cafe-paper);
  color: var(--cafe-ink);
  color-scheme: light;
  font: 14px/1.35 var(--sans);
  text-align: left;
  scrollbar-width: thin;
}
body:has(#dialog[open]) .cafe-frame {
  visibility: hidden;
}
.cafe-content {
  padding: 17px 20px 13px;
}
.cafe-topline,
.cafe-actions,
.cafe-turn-row,
.cafe-wallet,
.cafe-history summary,
.merch-catalog li {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cafe-topline,
.cafe-turn-row,
.cafe-wallet {
  justify-content: space-between;
}
.cafe-topline {
  align-items: flex-start;
}
.cafe-heading,
.merch-copy,
.cafe-door-copy {
  min-width: 0;
}
.cafe-place {
  color: var(--cafe-wine);
  font-weight: 700;
  font-size: 12px;
}
.cafe-title,
.cafe-door-title {
  font: 400 32px/1.04 var(--serif);
  overflow-wrap: anywhere;
}
.cafe-title {
  margin-top: 3px;
}
.cafe-copy {
  margin-top: 10px;
}
.cafe-pay-rule {
  margin-top: 6px;
  color: var(--cafe-secondary);
  font-size: 12px;
}
.cafe-live-scores {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.cafe-live-score {
  white-space: nowrap;
}
.cafe-live-score b {
  color: var(--cafe-ink);
  font-weight: 650;
}
.cafe-history summary:has(.cafe-live-scores)::after {
  margin-left: 0;
}
.cafe-earnings {
  margin-top: 13px;
  width: 100%;
  border-collapse: collapse;
  color: var(--cafe-ink);
  font: 400 13px/1.3 var(--sans);
}
.cafe-earnings caption {
  text-align: left;
  padding-bottom: 5px;
  font-weight: 700;
}
.cafe-earnings th,
.cafe-earnings td {
  text-align: right;
  padding: 5px 2px;
  font-variant-numeric: tabular-nums;
}
.cafe-earnings thead th {
  color: var(--cafe-secondary);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--cafe-line);
}
.cafe-earnings th:first-child {
  text-align: left;
}
.cafe-earnings tbody th {
  font-weight: 550;
}
.cafe-earnings tbody td:last-child {
  font-weight: 700;
  color: #254832;
}
.cafe-earnings tbody tr + tr {
  border-top: 1px solid var(--cafe-line);
}
.cafe-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid #7e8978;
  border-radius: 4px;
  background: transparent;
  color: var(--cafe-ink);
  font: 650 14px/1.18 var(--sans);
  text-align: center;
  white-space: nowrap;
}
.cafe-button:hover:not(:disabled),
.cafe-history summary:hover {
  background: #e6e7d8;
}
.cafe-button.cafe-primary {
  background: #274435;
  border-color: #274435;
  color: #fff9e9;
}
.cafe-button.cafe-primary:hover:not(:disabled) {
  background: #193729;
}
.cafe-button:disabled {
  opacity: 1;
  color: #5a6256;
  background: #e3e5d8;
  border-color: #b0b5a6;
  cursor: default;
}
.cafe-frame :is(button, input, summary):focus-visible {
  outline: 2px solid #346b56;
  outline-offset: 2px;
}
.cafe-button.cafe-link {
  min-height: 36px;
  padding: 3px 2px 3px 8px;
  border: 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cafe-actions {
  margin-top: 13px;
  flex-wrap: wrap;
}
.cafe-actions .cafe-clock {
  margin-left: auto;
}
.cafe-clock {
  flex: none;
  color: #334a3a;
  font: 650 17px/1.1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.cafe-clock.cafe-time-short {
  color: #913f32;
}
.cafe-turn-row {
  margin: 12px 0 7px;
}
.cafe-turn {
  color: #344c3d;
  font-size: 14px;
}
[data-turn='self'] .cafe-turn strong {
  color: #1d533a;
}
.cafe-answer {
  display: flex;
  gap: 7px;
}
.cafe-answer input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  background: #fffdf6;
  color: var(--cafe-ink);
  border: 1px solid #879380;
  border-radius: 4px;
  font: 400 16px/1.2 var(--sans);
}
.cafe-answer input::placeholder {
  color: #626a60;
  opacity: 1;
}
.cafe-answer input:disabled {
  background: #e9eadf;
  border-color: #b0b5a7;
}
.cafe-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.cafe-history {
  margin-top: 11px;
  border-top: 1px solid var(--cafe-line);
}
.cafe-history summary {
  min-height: 36px;
  padding: 6px 2px;
  cursor: pointer;
  list-style: none;
  color: var(--cafe-secondary);
  font-size: 13px;
}
.cafe-history summary::-webkit-details-marker {
  display: none;
}
.cafe-history summary::after {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: rotate(45deg);
  margin: -3px 4px 0 auto;
}
.cafe-history[open] summary::after {
  transform: rotate(225deg);
  margin-top: 3px;
}
.cafe-history summary strong {
  flex: none;
  font-weight: 650;
}
.cafe-last-word {
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.cafe-words {
  max-height: min(125px, 17vh);
  overflow-y: auto;
  margin: 0;
  padding: 0 3px 0 0;
}
.cafe-words li {
  display: flex;
  justify-content: space-between;
  column-gap: 12px;
  padding: 4px 0;
}
.cafe-word {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cafe-author,
.cafe-no-answers {
  font-size: 12px;
  color: var(--cafe-secondary);
}
.cafe-author {
  flex: none;
}
.cafe-no-answers {
  padding-bottom: 5px;
}
.cafe-feedback {
  border-top: 1px solid #ceb49d;
  background: #f1e3d3;
  padding: 9px 20px;
  color: #703922;
  font-size: 14px;
  font-weight: 600;
}
.cafe-frame:is([data-cafe-view='incoming'], [data-cafe-view='outgoing'], [data-cafe-view='result']) {
  bottom: calc(78px + env(safe-area-inset-bottom));
  width: min(420px, calc(100% - 32px));
}
.cafe-frame:is([data-cafe-view='cafe-door'], [data-cafe-view='shop-door']) {
  bottom: calc(78px + env(safe-area-inset-bottom));
  width: fit-content;
  max-width: min(550px, calc(100% - 24px));
}
.cafe-frame:is([data-cafe-view='cafe-door'], [data-cafe-view='shop-door']) .cafe-content {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 13px 10px 16px;
}
.cafe-door-title {
  font-size: 24px;
}
.cafe-door-copy p {
  font-size: 13px;
  line-height: 1.25;
  color: var(--cafe-secondary);
  margin-top: 3px;
}
.cafe-button kbd {
  padding: 1px 4px;
  border: 1px solid #c5d2b9;
  border-radius: 2px;
  color: #f4efdf;
  font: 600 11px/1.2 var(--sans);
}
.cafe-frame[data-cafe-view='shop'] {
  display: flex;
  flex-direction: column;
  max-height: min(580px, calc(var(--cafe-visible-height, 100dvh) * 0.72));
  overflow: hidden;
  width: min(365px, calc(100% - 32px));
  left: auto;
  right: max(20px, env(safe-area-inset-right));
  transform: none;
}
.cafe-frame[data-cafe-view='shop'] .cafe-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cafe-frame[data-cafe-view='shop'] :is(.cafe-topline, .cafe-wallet, .cafe-shop-note, .cafe-feedback) {
  flex: none;
}
.cafe-wallet {
  padding: 12px 0;
  margin-top: 4px;
  border-bottom: 1px solid var(--cafe-line);
}
.cafe-wallet span,
.merch-copy span {
  color: var(--cafe-secondary);
  font-size: 13px;
}
.cafe-wallet strong {
  font-variant-numeric: tabular-nums;
}
.merch-catalog {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: #849180 #e3e3d5;
  scrollbar-gutter: stable;
  scroll-padding-block: 5px;
  padding: 0 5px 0 0;
  margin: 0;
  list-style: none;
}
.merch-catalog:focus-visible {
  outline: 2px solid #346b56;
  outline-offset: -2px;
}
.merch-catalog [aria-disabled='true'] {
  opacity: 0.65;
  cursor: wait;
}
.merch-catalog li {
  padding-block: 5px;
  border-bottom: 1px solid var(--cafe-line);
  min-height: 62px;
}
.merch-copy {
  display: grid;
  flex: 1;
  gap: 2px;
}
.merch-price {
  white-space: nowrap;
}
.merch-copy strong {
  line-height: 1.22;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 650;
}
.merch-worn .merch-copy span {
  color: #265638;
  font-weight: 650;
}
.merch-catalog .cafe-button {
  min-width: 64px;
}
.merch-sample {
  position: relative;
  flex: none;
  width: 43px;
  height: 42px;
}
.merch-art {
  display: block;
  width: 43px;
  height: 43px;
}
.merch-sample > i,
.merch-sample > b,
.merch-sample ::before,
.merch-sample ::after {
  position: absolute;
  display: block;
}
.merch-sample[data-merch='phoenix-cap'] i {
  left: 3px;
  top: 10px;
  width: 29px;
  height: 18px;
  background: #763543;
  border: 1px solid #582936;
  border-radius: 17px 16px 2px 3px;
  transform: rotate(-6deg);
}
.merch-sample[data-merch='phoenix-cap'] i::before {
  content: '';
  left: 16px;
  top: 5px;
  width: 4px;
  height: 6px;
  border: solid #efdfbb;
  border-width: 0 1.7px 1.6px;
  border-radius: 0 0 2px 2px;
}
.merch-sample[data-merch='phoenix-cap'] b {
  left: 20px;
  top: 23px;
  width: 20px;
  height: 6px;
  border: 1px solid #522c35;
  background: #65343e;
  border-radius: 3px 80% 50% 50%;
  transform: rotate(6deg);
}
.merch-sample[data-merch='maroon-scarf'] i,
.merch-sample[data-merch='maroon-scarf'] b {
  background: #843843;
  width: 12px;
  height: 23px;
  border: 1px solid #652c35;
  border-bottom: 2px dotted #cfbc92;
}
.merch-sample[data-merch='maroon-scarf'] i {
  left: 11px;
  top: 6px;
  transform: rotate(25deg);
}
.merch-sample[data-merch='maroon-scarf'] b {
  left: 20px;
  top: 10px;
  transform: rotate(-27deg);
  height: 26px;
}
.merch-sample[data-merch='maroon-scarf'] :is(i, b)::after {
  content: '';
  top: 11px;
  left: 0;
  right: 0;
  height: 3px;
  background: #e9d7b0;
  box-shadow: 0 5px #e9d7b0;
}
.merch-sample[data-merch='campus-satchel'] i {
  width: 20px;
  height: 18px;
  border: 2px solid #554535;
  border-radius: 50% 50% 3px 3px;
  left: 12px;
  top: 4px;
  transform: rotate(8deg);
}
.merch-sample[data-merch='campus-satchel'] b {
  width: 32px;
  height: 20px;
  border: 1px solid #765332;
  border-radius: 3px;
  background: #b48a55;
  left: 5px;
  top: 16px;
  transform: rotate(-3deg);
}
.merch-sample[data-merch='campus-satchel'] b::after {
  content: '';
  left: 2px;
  right: 2px;
  top: 0;
  height: 8px;
  background: #c39c65;
  border-bottom: 1px solid #85633d;
  border-radius: 0 0 4px 4px;
}
/* Front views of the four bookstore wearables, in their in-world materials. */
.merch-sample[data-merch='maroon-beanie'] i {
  top: 10px;
  left: 6px;
  width: 31px;
  height: 23px;
  border: 1px solid #592a38;
  border-radius: 19px 19px 3px 3px;
  background: #823a49;
}
.merch-sample[data-merch='maroon-beanie'] i::before {
  content: '';
  top: 2px;
  left: 10px;
  width: 8px;
  height: 13px;
  border: solid #a35260;
  border-width: 0 1px;
  border-radius: 45%;
}
.merch-sample[data-merch='maroon-beanie'] i::after {
  content: '';
  left: -1px;
  right: -1px;
  bottom: -1px;
  height: 8px;
  border-block: 2px solid #efdfbd;
  background: #703341;
  border-radius: 2px;
}
.merch-sample[data-merch='maroon-beanie'] b {
  top: 3px;
  left: 17px;
  width: 10px;
  height: 9px;
  background: #ead9b7;
  border: 2px dotted #874656;
  border-radius: 48%;
}
.merch-sample[data-merch='bookstore-tote'] i {
  left: 13px;
  top: 3px;
  width: 17px;
  height: 20px;
  border: 2px solid #782f40;
  border-radius: 45% 45% 0 0;
}
.merch-sample[data-merch='bookstore-tote'] b {
  top: 15px;
  left: 7px;
  width: 29px;
  height: 22px;
  border: 1px solid #9b8869;
  border-top: 2px solid #a48f70;
  border-radius: 1px 1px 3px 3px;
  background: #dfcdab;
}
.merch-sample[data-merch='bookstore-tote'] b::before,
.merch-sample[data-merch='bookstore-tote'] b::after {
  content: '';
  top: 6px;
  width: 5px;
  height: 6px;
  border: 1px solid #763144;
  background: #e8d9bb;
}
.merch-sample[data-merch='bookstore-tote'] b::before {
  left: 8px;
  transform: skewY(15deg);
}
.merch-sample[data-merch='bookstore-tote'] b::after {
  left: 13px;
  transform: skewY(-15deg);
}
.merch-sample[data-merch='chicago-pennant'] i {
  top: 4px;
  left: 7px;
  width: 3px;
  height: 34px;
  border-radius: 2px;
  background: #966b41;
}
.merch-sample[data-merch='chicago-pennant'] b {
  top: 7px;
  left: 10px;
  width: 29px;
  height: 19px;
  background: #7a3443;
  border-left: 2px solid #e1cda7;
  clip-path: polygon(0 0, 100% 46%, 0 100%);
}
.merch-sample[data-merch='chicago-pennant'] b::after {
  content: 'C';
  top: 3px;
  left: 3px;
  color: #f0deba;
  font:
    900 11px/1 Georgia,
    serif;
}
.merch-sample[data-merch='letter-jacket'] i {
  top: 6px;
  left: 2px;
  width: 39px;
  height: 30px;
  background: #ddc9a5;
  clip-path: polygon(
    28% 7%,
    40% 0,
    60% 0,
    72% 7%,
    90% 19%,
    100% 83%,
    84% 91%,
    74% 49%,
    75% 100%,
    25% 100%,
    26% 49%,
    16% 91%,
    0 83%,
    10% 19%
  );
}
.merch-sample[data-merch='letter-jacket'] i::before,
.merch-sample[data-merch='letter-jacket'] i::after {
  content: '';
  top: 23px;
  width: 7px;
  height: 3px;
  background: #733343;
  border-bottom: 1px solid #eedcbc;
}
.merch-sample[data-merch='letter-jacket'] i::before {
  left: 0;
  transform: rotate(17deg);
}
.merch-sample[data-merch='letter-jacket'] i::after {
  right: 0;
  transform: rotate(-17deg);
}
.merch-sample[data-merch='letter-jacket'] b {
  top: 6px;
  left: 11px;
  width: 21px;
  height: 30px;
  background: #773441;
  border-bottom: 3px double #ddc9a5;
  clip-path: polygon(0 9%, 27% 0, 50% 13%, 73% 0, 100% 9%, 99% 100%, 1% 100%);
}
.merch-sample[data-merch='letter-jacket'] b::before {
  content: '';
  left: 10px;
  top: 2px;
  bottom: 0;
  border-left: 1px solid #b57d7f;
}
.merch-sample[data-merch='letter-jacket'] b::after {
  content: 'C';
  top: 6px;
  right: 2px;
  color: #f3e4c4;
  font:
    900 7px/1 Georgia,
    serif;
}
.cafe-shop-note {
  margin-top: 11px;
  color: var(--cafe-secondary);
  font-size: 13px;
}
#playScreen:has(.cafe-frame:is([data-cafe-view='table'], [data-cafe-view='shop']))
  :is(.play-bottom, .mini-wrap, #nearTower, #nearVia, #nearPhone, #nearScooter, #targetChip, #coffeeHud, .sim-touch-controls) {
  display: none;
}
@media (any-pointer: coarse), (max-width: 580px) {
  .cafe-frame {
    width: min(480px, calc(100% - 20px));
    bottom: calc(8px + env(safe-area-inset-bottom) + var(--cafe-keyboard, 0px));
  }
  .cafe-content {
    padding: 13px 14px 9px;
  }
  .cafe-title {
    font-size: 28px;
  }
  .cafe-button,
  .cafe-button.cafe-link,
  .cafe-history summary {
    min-height: 44px;
  }
  .cafe-button kbd {
    display: none;
  }
  .cafe-actions {
    gap: 8px;
  }
  .cafe-frame:is(
    [data-cafe-view='cafe-door'],
    [data-cafe-view='shop-door'],
    [data-cafe-view='outgoing'],
    [data-cafe-view='incoming'],
    [data-cafe-view='result']
  ) {
    top: calc(91px + env(safe-area-inset-top));
    bottom: auto;
    width: min(420px, calc(100% - 20px));
  }
  .cafe-frame:is([data-cafe-view='cafe-door'], [data-cafe-view='shop-door']) .cafe-content {
    gap: 10px;
    padding: 8px 10px 8px 12px;
  }
  .cafe-door-copy {
    flex: 1;
  }
  .cafe-door-title {
    font-size: 22px;
  }
  .cafe-frame[data-cafe-view='shop'] {
    max-height: clamp(345px, calc(var(--cafe-visible-height, 100dvh) * 0.56), 490px);
    width: min(420px, calc(100% - 20px));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  .cafe-wallet {
    padding: 9px 0;
  }
  .merch-catalog li {
    min-height: 57px;
  }
  .cafe-feedback {
    padding: 8px 14px;
  }
}
@media (max-height: 520px) {
  .cafe-frame[data-cafe-view='shop'] {
    max-height: calc(var(--cafe-visible-height, 100dvh) - 16px - env(safe-area-inset-bottom));
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .cafe-frame[data-cafe-view='table'],
  .cafe-frame[data-cafe-view='shop'] {
    left: auto;
    right: max(8px, env(safe-area-inset-right));
    transform: none;
    bottom: calc(6px + var(--cafe-keyboard, 0px));
    width: min(380px, 53vw);
  }
  .cafe-frame:is(
    [data-cafe-view='cafe-door'],
    [data-cafe-view='shop-door'],
    [data-cafe-view='incoming'],
    [data-cafe-view='outgoing'],
    [data-cafe-view='result']
  ) {
    top: 7px;
    left: 50%;
    bottom: auto;
    width: min(330px, 45vw);
  }
  .cafe-content {
    padding: 9px 12px;
  }
  .cafe-turn-row,
  .cafe-history {
    margin-top: 6px;
  }
  .cafe-wallet {
    padding: 6px 0;
  }
  .merch-catalog li {
    min-height: 47px;
  }
  .cafe-shop-note {
    font-size: 12px;
  }
}
/* Leave the face, cups and center of the tabletop in view, even with history open. */
@media (min-width: 760px) and (min-height: 521px) {
  .cafe-frame[data-cafe-view='table'] {
    left: auto;
    right: max(20px, env(safe-area-inset-right));
    width: min(430px, 43vw);
    transform: none;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .cafe-frame[data-cafe-view='table'] {
    width: min(365px, 46vw);
  }
}
.cafe-feedback[data-tone='success'] {
  background: #e0e8d8;
  border-color: #b9c9b4;
  color: #294e35;
}
