.usdc-world-entry, .usdc-return {
  border: 1px solid var(--hud-line);
  border-radius: 8px;
  background: var(--hud);
  box-shadow: 0 2px 0 #0b213d7a, 0 6px 22px #0a2e495c, inset 0 1px #c1e8ff21;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--hud-ink);
  font: 700 13px/1 var(--text);
  cursor: pointer;
}
.map-entry-points {
  position: absolute;
  z-index: 5;
  top: var(--edge);
  right: var(--edge);
  display: flex;
  gap: 6px;
}
:is(.usdc-world-entry, .usdc-return) span[aria-hidden] { color: var(--hud-gold); }
:is(.usdc-world-entry, .usdc-return):hover { background: #25516d; }
.usdc-return { position: absolute; top: var(--edge); left: var(--edge); }
.usdc-world-entry { border-color: #e4bc6bba; }
.usdc-world-entry span { font-size: 17px; }

.game-shell[data-usdc-mode] :is(.game-header, .game-dock, .map-entry-points, .map-portfolio) { display: none; }
.game-shell[data-usdc-mode] .map-controls { top: var(--edge); bottom: auto; }
.game-shell[data-usdc-mode] .music-error { top: calc(100% + 5px); bottom: auto; }

@media (max-width: 800px) {
  .map-entry-points { top: calc(var(--edge) + 61px); }
}

.usdc-arrival {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid #ffe3a1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #37769d, #164365 70%);
  box-shadow: inset 0 0 0 3px #d6b46b44, 0 0 10px #ffd68280;
  color: #fff0be;
  font: 700 24px/1 var(--text);
}

/* World map payment overlay */
[data-usdc-mode] :is(.board-unit, .marker-city:not([data-usdc-destination], .marker-stop-singapore)) { display: none; }
[data-usdc-mode] .board-terrain .marker-stop-singapore[aria-current] .marker-point { visibility: visible; }
[data-usdc-mode] .marker-city { pointer-events: none; }
[data-usdc-mode] [data-usdc-destination] :is(.marker-name, .marker-point) { pointer-events: auto; }
[data-usdc-mode] .marker-point::after { inset: -7px; }
[data-usdc-mode] .board-marker[aria-pressed="true"] .marker-name {
  border-color: #fff1cb;
  background: var(--hud-gold);
  color: #123148;
}
[data-usdc-mode] .board-marker[aria-pressed="true"] .marker-point { box-shadow: 0 0 0 5px #fff0c673; }
@media (prefers-reduced-motion: no-preference) {
  [data-usdc-mode] .board-marker[aria-pressed="true"] .marker-point { animation: destination-pulse 1.5s ease-out 2; }
  @keyframes destination-pulse {
    from { box-shadow: 0 0 0 3px #fff0c6bb; }
    to { box-shadow: 0 0 0 15px #fff0c600; }
  }
}

.usdc-board { position: absolute; z-index: 5; inset: 0; pointer-events: none; }
.usdc-board > * { pointer-events: auto; }
.usdc-panel {
  position: absolute;
  left: var(--edge);
  bottom: max(var(--edge), env(safe-area-inset-bottom));
  width: min(342px, calc(100% - 2 * var(--edge)));
  padding: 14px;
  border: 1px solid #81c4d180;
  border-top-color: #e4bc6b;
  border-radius: 9px;
  background: linear-gradient(145deg, #183e56, var(--hud-dark));
  box-shadow: 0 3px 18px #0a233baa, inset 0 1px #fff0b529;
}
.usdc-panel h2 { margin: 0; font: 800 20px/1.18 var(--text); }
.usdc-panel h2:focus { outline: none; }
.usdc-panel-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; justify-content: space-between; }
.usdc-payment-count { color: var(--hud-gold); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.usdc-panel p { margin: 4px 0 8px; color: var(--hud-muted); font-size: 12px; line-height: 1.4; }
.usdc-panel .usdc-instructions { color: var(--hud-ink); font-size: 13px; }
.usdc-definition-small { display: none; }
@media (max-width: 550px) and (max-height: 680px) and (orientation: portrait) {
  .usdc-panel { padding: 9px 10px; }
  .usdc-panel .usdc-definition { display: none; }
  .usdc-definition-small { display: block; margin: 4px 0 8px; color: var(--hud-aqua); font-size: 12px; }
  .usdc-definition-small summary { cursor: pointer; }
  .usdc-panel .usdc-status { margin-block: 3px; }
  .usdc-panel .usdc-order { padding-block: 3px; }
  .usdc-panel .usdc-recent { margin-bottom: 2px; }
  .usdc-panel .usdc-recent-links { padding-block: 0; }
}
.usdc-source { color: var(--hud-aqua); white-space: nowrap; }
.usdc-source:hover { text-decoration: underline; }
.usdc-panel .usdc-status { margin: 6px 0; }
.usdc-status:empty { display: none; }
.usdc-order {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 6px 6px 6px 10px;
  border: 1px solid var(--hud-line);
  border-radius: 6px;
  background: #102e43;
}
.usdc-order strong, .usdc-order small { display: block; }
.usdc-order strong { font-size: 13px; }
.usdc-order small { color: var(--hud-muted); font-size: 12px; }
.usdc-order button {
  min-width: 72px;
  min-height: 44px;
  border: 1px solid #f9e9bc;
  border-radius: 5px;
  color: #163347;
  background: var(--hud-gold);
  font: 800 14px/1 var(--text);
  cursor: pointer;
  touch-action: manipulation;
}
.usdc-order button:disabled { opacity: .45; cursor: default; }
.usdc-order button:not(:disabled):hover { background: #fff1cb; }
.usdc-order button:enabled:active { transform: translateY(1px); background: #fbe5a1; }
.usdc-recent {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}
.usdc-recent-links {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 5px;
  margin: 0;
  padding: 3px 2px;
  overflow-x: auto;
  scrollbar-width: thin;
  list-style: none;
  white-space: nowrap;
}
.usdc-recent-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 7px;
  border: 1px solid var(--hud-line);
  border-radius: 5px;
  color: var(--hud-gold);
  font-size: 12px;
  font-weight: 700;
}
.usdc-recent-links a:hover { background: #224f63; }
.usdc-recent button, .usdc-activity button {
  min-height: 44px;
  padding-inline: 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--hud-muted);
  font: 700 13px/1.2 var(--text);
  cursor: pointer;
}
.usdc-recent button { flex-shrink: 0; color: var(--hud-aqua); }
.usdc-board :is(.usdc-recent, .usdc-activity) button:enabled:hover { background: #28516a; color: var(--hud-ink); }
.usdc-board .usdc-activity {
  position: absolute;
  right: var(--edge);
  bottom: max(var(--edge), env(safe-area-inset-bottom));
  display: flex;
  width: min(324px, calc(100% - 2 * var(--edge)));
  border: 1px solid #81c4d180;
  border-top-color: #e4bc6b;
  border-radius: 8px;
  background: var(--hud-dark);
  box-shadow: 0 4px 20px #08223890;
  flex-direction: column;
  max-height: min(445px, calc(100% - 2 * var(--edge) - 65px));
}
.usdc-activity header, .usdc-activity-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.usdc-activity header { padding: 3px 6px 3px 13px; border-bottom: 1px solid var(--hud-line); }
.usdc-activity h2 { margin: 0; font: 800 18px/1.2 var(--text); }
.usdc-activity h2:focus { outline: none; }
.usdc-activity header button { min-width: 44px; font-size: 20px; }
.usdc-activity-body { overflow: auto; overscroll-behavior: contain; padding: 0 12px 8px; }
.usdc-board .bangkok-story { width: min(370px, calc(100% - 2 * var(--edge))); max-height: min(540px, calc(100% - 2 * var(--edge) - 65px)); }
.bangkok-story-body { overflow: auto; overscroll-behavior: contain; padding: 10px 12px; }
.bangkok-story-body p { margin: 0 0 8px; color: var(--hud-muted); font-size: 13px; line-height: 1.35; }
.bangkok-video { display: block; width: 100%; height: clamp(140px, 27dvh, 245px); border-radius: 6px; background: #081d2f; object-fit: contain; }
.bangkok-story-body .bangkok-status { margin-top: 8px; color: var(--hud-gold); }
.bangkok-evidence { display: flex; flex-wrap: wrap; gap: 0 12px; }
.bangkok-story-body a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; color: var(--hud-aqua); font-size: 13px; font-weight: 750; }
.bangkok-story-body a:hover { text-decoration: underline; }
.bangkok-story-body .bangkok-lesson { color: var(--hud-gold); margin-right: 10px; }
.bangkok-story-body .bangkok-source { color: var(--hud-muted); font-size: 12px; }
.usdc-activity-summary p { margin: 0; color: var(--hud-muted); font-size: 12px; }
.usdc-activity-summary button:disabled { opacity: .45; cursor: default; }
.usdc-activity-summary button:enabled { color: var(--hud-aqua); }
.usdc-receipts, .usdc-batches { margin: 0; padding: 0; list-style: none; }
.usdc-receipts li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding-inline: 2px;
  border-top: 1px solid var(--hud-line);
  font-size: 13px;
}
.usdc-receipts a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--hud-aqua);
  font-weight: 750;
}
.usdc-receipts small { color: var(--hud-muted); font-size: 11px; }
.usdc-receipts small[data-settled="true"] { color: #bcf0c4; }
.usdc-batches a {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0 0 6px;
  padding-inline: 8px;
  border: 1px solid var(--hud-line);
  border-radius: 5px;
  color: var(--hud-gold);
  font-size: 13px;
  font-weight: 700;
}
.usdc-receipts a:hover, .usdc-batches a:hover { text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) {
  .usdc-activity:not([hidden]) { animation: usdc-slide-in 180ms ease-out; }
  @keyframes usdc-slide-in {
    from { opacity: 0; translate: 10px 0; }
  }
}
@media (max-width: 550px) and (orientation: portrait) {
  .usdc-board .usdc-activity {
    right: 50%;
    top: auto;
    bottom: max(var(--edge), env(safe-area-inset-bottom));
    width: min(342px, calc(100% - 2 * var(--edge)));
    max-height: min(480px, 55dvh);
    transform: translateX(50%);
  }
  .usdc-board .bangkok-story { max-height: min(485px, 62dvh); }
  .bangkok-video { height: clamp(120px, 23dvh, 210px); }
}
.usdc-flight { position: absolute; z-index: 4; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.usdc-arrival {
  position: absolute;
  z-index: 5;
  width: 25px;
  height: 25px;
  transform: translate(-50%, calc(-100% - 4px));
  color: #513905;
  background: #fff1b4;
  font-size: 14px;
  text-decoration: none;
}
.usdc-arrival::after { content: ''; position: absolute; inset: -18px -9px 0; border-radius: 50%; }
.usdc-arrival[data-state="received"] { background: #193c55; color: #fff1b4; border: 1px solid #fff1b4; }
.usdc-arrival[data-state="batched"] { background: #a6e2f0; color: #173448; }
.usdc-arrival[data-state="settled"] { background: #a9ecc8; color: #163c2d; }
.usdc-arrival[data-state="failed"] { background: #f2c0bc; color: #612420; }
.usdc-arrival:is(:hover, :focus-visible) { box-shadow: 0 0 16px 2px #ffd682; }
@media (prefers-reduced-motion: no-preference) {
  .usdc-arrival { animation: coin-land 360ms ease-out; }
  @keyframes coin-land {
    from { scale: .6; box-shadow: 0 0 14px 6px #ffe5a5; }
    55% { scale: 1.18; }
  }
}
@media (max-width: 550px) {
  .usdc-panel { left: 50%; translate: -50% 0; }
  [data-usdc-mode][data-overview] .marker-stop-bangkok { --label-x: -28px; --label-y: -11px; }
  [data-usdc-mode][data-overview] .marker-stop-da-nang { --label-x: 31px; --label-y: 10px; }
  [data-usdc-mode][data-overview] .marker-stop-kuala-lumpur { --label-x: -33px; }
}

@media (max-height: 550px) and (orientation: landscape) {
  .usdc-panel { width: min(36vw, 280px); padding: 10px; }
  .usdc-board .bangkok-story { width: min(52vw, 390px); }
  .bangkok-story-body {
    display: grid;
    grid-template-columns: minmax(100px, 38%) 1fr;
    align-items: start;
    gap: 0 10px;
  }
  .bangkok-story-body > * { grid-column: 2; }
  .bangkok-story-body .bangkok-video { grid-area: 1 / 1 / span 5; height: 184px; }
  .bangkok-story-body a { min-height: 34px; }
  .bangkok-story-body .bangkok-status { margin-top: 0; }
}
