:is(.game-balloon, .game-train) .game-header > div:not(.game-header-actions) {
  background: #fffaf0f2;
}
:is(.game-balloon, .game-train) .game-header h2 {
  color: #7b7762;
}
:is(.game-balloon, .game-train) .game-bottom {
  width: min(520px, calc(100% - 570px));
  left: 45%;
  height: 65px;
  bottom: 24px;
  background: #fffbeaef;
}
:is(.game-balloon, .game-train) .game-bottom > p {
  color: #727b60;
  font-size: 12px;
}
:is(.game-balloon, .game-train) .read-help {
  width: 32px;
  flex: 0 0 32px;
  font-size: 0;
  padding: 0;
}
.vehicle-hud {
  position: absolute;
  top: 112px;
  left: 30px;
  right: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  pointer-events: none;
}
.vehicle-chapter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 17px;
  color: #637d77;
  background: linear-gradient(90deg, #fff8e8e8, #fff8e830);
  border-left: 3px solid #b3bf97;
}
.vehicle-chapter small {
  font-size: 9px;
  letter-spacing: 1.8px;
}
.vehicle-chapter b {
  font-size: 22px;
}
.vehicle-chapter span {
  font-size: 12px;
}
.vehicle-chapter em {
  font-size: 10px;
  font-style: normal;
  color: #a18d6a;
}
.vehicle-journal {
  color: #75674e;
  background: #fff8e9f0;
  border-radius: 5px 16px 16px 5px;
  padding: 12px 16px;
  box-shadow:
    -4px 0 #c6b48c,
    0 4px 0 #5e74651c;
}
.vehicle-journal > span {
  font-size: 12px;
}
.vehicle-journal b {
  margin-left: 9px;
}
.vehicle-journal > :is(div, #balloon-stamps) {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.vehicle-journal [data-photo] {
  width: 32px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px dashed #c5c8b1;
  border-radius: 5px;
  background: #f0ecde;
  color: #beb5a0;
  font-size: 21px;
}
.vehicle-journal [data-photo].found {
  color: #6c916f;
  background: #e2ebc5;
  border-color: #a3ba8b;
  transform: rotate(-5deg);
}
.vehicle-route {
  position: absolute;
  top: 123px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  display: flex;
  gap: 9px;
  align-items: center;
  color: #7c9c8d;
  font-size: 10px;
  pointer-events: none;
}
.vehicle-route > div {
  position: relative;
  flex: 1;
  height: 5px;
  border-radius: 4px;
  background: #fff4d5;
}
.vehicle-route i {
  position: absolute;
  top: 12px;
  font-size: 9px;
  font-style: normal;
  transform: translateX(-50%);
}
.vehicle-route i::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #bdac81;
  top: -12px;
  left: 0;
}
.vehicle-route b {
  position: absolute;
  width: 12px;
  height: 12px;
  top: -4px;
  border: 2px solid #fff9e9;
  background: #df9ca9;
  border-radius: 50%;
  transform: translateX(-50%);
}
.balloon-flight-panel {
  position: absolute;
  top: 256px;
  left: 32px;
  background: #fff9e8e0;
  border: 1px solid #fffdf6;
  border-radius: 17px;
  padding: 15px;
  width: 158px;
  color: #616b50;
  display: flex;
  flex-direction: column;
  gap: 15px;
  pointer-events: none;
}
.balloon-flight-panel > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.balloon-flight-panel span {
  font-size: 10px;
}
.balloon-flight-panel b {
  font-size: 24px;
  color: #507578;
}
.balloon-flight-panel small {
  font-size: 10px;
}
.balloon-flight-panel meter {
  width: 100%;
  height: 12px;
  accent-color: #e6ad75;
}
.balloon-winds small {
  border-radius: 5px;
  padding: 3px 7px;
  color: #716f59;
}
.balloon-winds .active {
  background: #dfebcf;
  color: #426a4d;
  font-weight: 800;
}
.vehicle-controls {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.vehicle-controls > div {
  display: flex;
  gap: 10px;
}
.vehicle-controls button {
  min-width: 106px;
  height: 65px;
  padding: 8px 15px;
  border: 3px solid #fff7e4;
  border-radius: 18px;
  box-shadow: 0 5px 0 #67857548;
  background: #f4efd7ed;
  color: #526648;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 16px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.vehicle-controls button small {
  font-size: 9px;
  opacity: 1;
}
.vehicle-controls .vehicle-primary {
  color: #633449;
  background: #e3a0b7;
  border-color: #f7d0d9;
}
.vehicle-controls .vehicle-action {
  min-width: 112px;
  font-size: 13px;
  background: #eaf0dcd9;
}
.vehicle-controls button.held {
  transform: translateY(3px);
  box-shadow: none;
  background: #eed28e;
  color: #685334;
}
.vehicle-controls button:disabled {
  opacity: 0.48;
  cursor: default;
}
.vehicle-controls .available {
  background: #f9de92;
  color: #725b37;
  box-shadow:
    0 5px 0 #ad955a66,
    0 0 0 4px #fff4cf5c;
}
.vehicle-key-hint {
  position: absolute;
  bottom: 84px;
  left: 0;
  color: #748266;
  font-size: 11px;
}
.vehicle-discovery {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translate(-50%, 7px);
  padding: 10px 20px;
  background: #fff3d3f2;
  border: 2px solid #fff8e5;
  border-radius: 30px;
  font-size: 15px;
  color: #77613e;
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
  pointer-events: none;
  max-width: calc(100% - 30px);
  text-align: center;
  width: max-content;
}
.vehicle-discovery.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.balloon-scene > svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vehicle-card-badge {
  position: absolute;
  top: 17px;
  left: 18px;
  background: #fff5dcd9;
  border: 2px solid #fff9e6;
  border-radius: 24px;
  color: #8b7b61;
  padding: 7px 12px;
  font-size: 10px;
}
.sky .card-tag {
  color: #6d8f9c;
  background: #e0f0f1;
}
.sky .card-arrow {
  color: #76929a;
  background: #e8f2ee;
}
.train-scene > svg {
  width: 100%;
  height: 100%;
}
.sage .card-tag {
  color: #73825e;
  background: #e8efd9;
}
.sage .card-arrow {
  color: #84916d;
  background: #edf0df;
}

.train-route-choice {
  position: absolute;
  pointer-events: none;
  left: 50%;
  transform: translateX(-50%);
  bottom: 105px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: center;
  padding: 8px 12px;
  color: #6e624b;
  background: transparent;
}
.train-route-choice > span {
  align-self: center;
  padding: 5px 12px;
  border: 2px solid #fff9e4;
  border-radius: 18px 15px 17px 12px;
  background: #fff1cdef;
  box-shadow: 0 2px 0 #947c5524;
  font-size: 10px;
}
.train-route-choice > span::before {
  content: "⚑";
  margin-right: 5px;
  color: #c18b59;
}
.train-route-choice > div {
  display: flex;
  gap: 9px;
}
.train-route-choice button {
  position: relative;
  pointer-events: auto;
  min-height: 44px;
  padding: 8px 27px 8px 12px;
  min-width: 128px;
  border-radius: 9px 15px 11px 13px;
  border: 2px solid #bc9768;
  background: linear-gradient(175deg, #fff0c1, #e7c28a);
  color: #795a3d;
  font-size: 12px;
  font-weight: 750;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  touch-action: none;
  transform: rotate(-1.5deg);
  box-shadow:
    0 4px 0 #a4825866,
    inset 0 2px 0 #fff7d7;
  transition:
    transform 140ms,
    background 140ms,
    box-shadow 140ms;
}
.train-route-choice button + button {
  transform: rotate(1.5deg);
}
.train-route-choice button::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b68c5c;
  box-shadow: inset 0 1px 0 #947347;
}
.train-route-choice button[aria-pressed="true"] {
  background: linear-gradient(175deg, #eff2c9, #c7dda1);
  border-color: #8eac71;
  color: #4c6b43;
  box-shadow:
    0 4px 0 #78966277,
    inset 0 2px 0 #fff7d7;
}
.train-route-choice button[aria-pressed="true"]::after {
  content: "✓";
  right: 5px;
  top: -6px;
  width: 19px;
  height: 19px;
  line-height: 17px;
  color: #fffbea;
  border: 2px solid #fff5d7;
  background: #7da272;
  box-shadow: 0 2px 0 #6e875a44;
  font-size: 12px;
}
.train-route-choice button:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #a4825866;
}
.train-route-choice button:focus-visible {
  outline: 3px solid #d28b71;
  outline-offset: 4px;
}
.train-route-choice button:disabled {
  opacity: 0.72;
}
.train-route-choice small {
  display: grid;
  place-items: center;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fff8dfb3;
  font-size: 17px;
}
@media (prefers-reduced-motion: reduce) {
  .train-route-choice button {
    transition: none;
  }
}
.vehicle-controls .train-whistle {
  min-width: 62px;
  font-size: 13px;
}
.game-train .vehicle-key-hint {
  bottom: 169px;
}
.train-map-overlay {
  margin: 0;
  inset: 0;
  padding: 24px;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  border: none;
  background: #63807660;
  color: #7f765f;
}
.train-map-overlay[open] {
  display: grid;
  place-items: center;
}
.train-map-overlay::backdrop {
  background: #6d827449;
  backdrop-filter: blur(6px);
}
.train-map-card {
  width: min(740px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 22px;
  background: #fffae9;
  border: 4px solid #fffdf5;
  border-radius: 25px;
  text-align: center;
  box-shadow: 0 8px 0 #586d5030;
}
.train-map-card h3 {
  font-size: 23px;
  margin: 0 0 10px;
}
.train-map-card p {
  font-size: 12px;
  margin: 0 0 8px;
}
.train-map-card svg {
  width: min(100%, 570px);
  height: min(53vh, 430px);
}
#train-itinerary {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 16px;
}
.train-map-card .button {
  font-size: 13px;
  padding: 12px 19px;
}

@media (max-width: 1100px) {
  .game-train.is-runner .game-bottom {
    bottom: 165px;
  }
  .train-route-choice {
    bottom: 92px;
  }
  .vehicle-route {
    top: 242px;
    width: 230px;
  }
  :is(.game-balloon, .game-train) .game-bottom {
    bottom: 105px;
    left: 50%;
    width: min(560px, calc(100% - 54px));
    height: 58px;
  }
  .vehicle-key-hint {
    display: none;
  }
  .balloon-flight-panel {
    top: 300px;
  }
}
@media (max-width: 600px) {
  .train-route-choice {
    bottom: 90px;
    width: calc(100% - 30px);
    padding: 7px 9px;
    gap: 5px;
  }
  .train-route-choice > div {
    gap: 7px;
  }
  .train-route-choice button {
    min-width: 0;
    flex: 1;
    padding: 7px 9px;
    font-size: 11px;
  }
  .game-train.is-runner .game-bottom {
    bottom: 190px;
  }
  .game-train .vehicle-controls button {
    min-width: 64px;
    padding: 5px 8px;
  }
  .game-train .vehicle-controls .vehicle-action {
    min-width: 83px;
  }
  .game-train .vehicle-controls .train-whistle {
    min-width: 46px;
    font-size: 11px;
  }
  .train-map-overlay {
    padding: 14px;
  }
  .train-map-card {
    padding: 18px 10px;
    border-radius: 22px;
  }
  .train-map-card h3 {
    font-size: 19px;
  }
  .train-map-card p,
  #train-itinerary {
    font-size: 10px;
  }
  .vehicle-hud {
    top: 88px;
    left: 17px;
    right: 17px;
    gap: 10px;
  }
  .vehicle-chapter {
    padding: 8px 0 8px 10px;
    gap: 5px;
    flex: 1;
    min-width: 0;
  }
  .vehicle-chapter small {
    display: none;
  }
  .vehicle-chapter b {
    font-size: 14px;
  }
  .vehicle-chapter span {
    font-size: 10px;
    line-height: 1.6;
  }
  .vehicle-chapter em {
    font-size: 9px;
  }
  .vehicle-journal {
    padding: 9px;
  }
  .vehicle-journal > span {
    font-size: 10px;
  }
  .vehicle-journal b {
    margin-left: 3px;
  }
  .vehicle-journal > :is(div, #balloon-stamps) {
    gap: 5px;
    margin-top: 7px;
  }
  .vehicle-journal [data-photo] {
    width: 22px;
    height: 24px;
    font-size: 15px;
  }
  .vehicle-route {
    top: 198px;
    width: calc(100% - 60px);
  }
  .balloon-flight-panel {
    top: 231px;
    left: 17px;
    right: 17px;
    width: auto;
    flex-direction: row;
    gap: 15px;
    padding: 10px 12px;
    border-radius: 12px;
    align-items: center;
  }
  .balloon-flight-panel > div {
    flex: 1;
    min-width: 0;
    gap: 3px;
  }
  .balloon-flight-panel b {
    font-size: 18px;
  }
  .balloon-flight-panel span,
  .balloon-flight-panel small {
    font-size: 11px;
  }
  .balloon-winds small {
    padding: 2px 4px;
  }
  .balloon-winds > span {
    display: none;
  }
  .vehicle-controls {
    left: 15px;
    right: 15px;
    bottom: max(20px, env(safe-area-inset-bottom));
    gap: 7px;
  }
  .vehicle-controls > div {
    gap: 7px;
  }
  .vehicle-controls button {
    min-width: 82px;
    height: 55px;
    border-width: 2px;
    border-radius: 15px;
    padding: 5px 10px;
    font-size: 14px;
  }
  .vehicle-controls .vehicle-action {
    min-width: 88px;
    font-size: 11px;
  }
  .vehicle-controls button small {
    font-size: 8px;
  }
  :is(.game-balloon, .game-train) .game-bottom {
    bottom: 94px;
    height: 58px;
    left: 50%;
    width: calc(100% - 30px);
    padding: 7px 12px 7px 54px;
  }
  :is(.game-balloon, .game-train) .game-bottom p {
    font-size: 10px;
  }
  :is(.game-balloon, .game-train) .dialogue-avatar {
    width: 40px;
    height: 52px;
  }
  :is(.game-balloon, .game-train) .dialogue-avatar svg {
    width: 43px;
    height: 52px;
  }
  :is(.game-balloon, .game-train) .read-help {
    width: 24px;
    flex-basis: 24px;
  }
  .vehicle-discovery {
    top: 39%;
    font-size: 12px;
  }
  .vehicle-card-badge {
    left: 8px;
    top: 12px;
    font-size: 8px;
    padding: 6px 7px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .train-route-choice {
    bottom: 75px;
    left: auto;
    right: 22px;
    transform: none;
    width: 128px;
    padding: 5px 9px;
    gap: 3px;
  }
  .train-route-choice > div {
    flex-direction: column;
    gap: 5px;
  }
  .train-route-choice > span {
    font-size: 9px;
  }
  .train-route-choice button {
    padding: 5px 9px;
    min-width: 0;
    font-size: 11px;
  }
  .game-train.is-runner .game-bottom {
    bottom: 14px;
    width: calc(100% - 460px);
    left: 47%;
  }
  .game-train .vehicle-controls .train-whistle {
    min-width: 46px;
  }
  .train-map-card {
    padding: 12px;
  }
  .train-map-card h3 {
    font-size: 17px;
    margin-bottom: 4px;
  }
  .train-map-card p {
    font-size: 10px;
  }
  .train-map-card svg {
    height: 45vh;
  }
  #train-itinerary {
    font-size: 10px;
    margin-bottom: 8px;
  }
  .train-map-card .button {
    padding: 8px 14px;
    font-size: 10px;
  }
  .vehicle-hud {
    top: 72px;
    left: 22px;
    right: 22px;
  }
  .vehicle-chapter {
    padding: 7px 10px;
    gap: 4px;
  }
  .vehicle-chapter b {
    font-size: 16px;
  }
  .vehicle-chapter small,
  .vehicle-chapter em {
    display: none;
  }
  .vehicle-chapter span {
    font-size: 10px;
  }
  .vehicle-journal {
    padding: 7px 10px;
  }
  .vehicle-journal > span {
    font-size: 10px;
  }
  .vehicle-journal > :is(div, #balloon-stamps) {
    gap: 5px;
    margin-top: 4px;
  }
  .vehicle-journal [data-photo] {
    width: 21px;
    height: 21px;
    font-size: 14px;
  }
  .vehicle-route {
    top: 81px;
    width: 210px;
  }
  .balloon-flight-panel {
    top: 146px;
    left: 22px;
    right: auto;
    width: 196px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 8px;
  }
  .balloon-flight-panel b {
    font-size: 17px;
  }
  .balloon-flight-panel .balloon-thermometer {
    display: flex;
  }
  .balloon-flight-panel span,
  .balloon-flight-panel small {
    font-size: 10px;
  }
  .balloon-flight-panel > .balloon-winds {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 3px;
  }
  .balloon-winds small {
    flex: 1;
    padding: 2px;
    white-space: nowrap;
  }
  .balloon-winds > span {
    display: none;
  }
  .vehicle-controls {
    bottom: 14px;
    left: 22px;
    right: 22px;
  }
  .vehicle-controls button {
    height: 46px;
    min-width: 80px;
    font-size: 13px;
    padding: 4px 10px;
  }
  .vehicle-controls .vehicle-action {
    min-width: 93px;
    font-size: 11px;
  }
  :is(.game-balloon, .game-train) .game-bottom {
    left: 44%;
    bottom: 14px;
    height: 46px;
    width: calc(100% - 395px);
    padding: 5px 9px 5px 45px;
  }
  :is(.game-balloon, .game-train) .game-bottom p {
    font-size: 10px;
  }
  :is(.game-balloon, .game-train) .dialogue-avatar {
    width: 35px;
    height: 44px;
  }
  :is(.game-balloon, .game-train) .dialogue-avatar svg {
    width: 37px;
    height: 46px;
  }
  .vehicle-discovery {
    top: 12px;
    max-width: calc(100% - 520px);
    padding: 8px 12px;
    font-size: 12px;
  }
}

@media (max-width: 620px) and (max-height: 500px) and (orientation: landscape) {
  .vehicle-hud {
    top: 64px;
    left: 14px;
    right: 14px;
  }
  .vehicle-chapter {
    max-width: 220px;
  }
  .vehicle-chapter b {
    font-size: 14px;
  }
  .vehicle-discovery {
    left: 60%;
    max-width: calc(100% - 352px);
    padding: 7px 10px;
  }
  .vehicle-route {
    top: 119px;
    left: 63%;
    width: 135px;
  }
  .balloon-flight-panel {
    top: 139px;
    left: 14px;
    width: 196px;
  }

  .train-route-choice {
    left: auto;
    right: 14px;
    bottom: 74px;
    transform: none;
    width: 114px;
    padding: 5px;
  }
  .train-route-choice > div {
    flex-direction: column;
    gap: 5px;
  }
  .train-route-choice button {
    min-width: 0;
    padding: 5px;
    font-size: 11px;
  }
}
@media (max-width: 600px) and (orientation: portrait) {
  .vehicle-discovery {
    top: 88px;
    left: 17px;
    right: 121px;
    width: auto;
    max-width: none;
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 12px;
    text-align: left;
    transform: translateY(7px);
  }
  .vehicle-discovery.visible {
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .vehicle-discovery {
    transition: none;
  }
}

@media (max-width: 600px) and (max-height: 700px) and (orientation: portrait) {
  .vehicle-hud {
    top: 76px;
  }
  .vehicle-discovery {
    top: 76px;
    min-height: 44px;
  }
  .vehicle-chapter {
    padding-block: 6px;
    gap: 3px;
  }
  .vehicle-chapter b {
    font-size: 13px;
  }
  .vehicle-chapter span {
    line-height: 1.4;
  }
  .vehicle-chapter em {
    display: none;
  }
  .vehicle-route {
    top: 158px;
  }
  .balloon-flight-panel {
    top: 187px;
    padding: 6px 10px;
    gap: 10px;
  }
  .balloon-flight-panel > div {
    gap: 2px;
  }
  .balloon-flight-panel b {
    font-size: 16px;
  }
  .balloon-flight-panel small {
    line-height: 1.3;
  }
  .balloon-winds small {
    padding: 1px 3px;
  }

  .game-train.is-runner .game-bottom {
    bottom: 190px;
    height: 46px;
  }
}

/* The next action is a steady cue, without flashing or taking keyboard focus. */
#train-driving-hint {
  color: #537347;
  font-weight: 700;
}
#train-driving-hint.brake-advice {
  color: #94572f;
}
.vehicle-controls button.recommended:not(.held) {
  border-color: #d6ab6d;
  box-shadow:
    0 5px 0 #ad955a66,
    0 0 0 4px #ffe2a466;
}
.train-map-card h3:focus {
  outline: none;
}

[data-map-station][data-current="true"] > circle,
[data-mini-station][data-current="true"] {
  stroke: #d8969f;
  stroke-width: 13;
}

.balloon-album-button {
  border: 0;
  font: inherit;
  text-align: left;
  pointer-events: auto;
  min-height: 44px;
}
.balloon-album-button:disabled {
  cursor: default;
}
.vehicle-journal [data-photo] {
  padding: 0;
  font: inherit;
  background-size: cover;
  background-position: 35% 55%;
}
.vehicle-journal [data-photo].found {
  color: #446d43;
  text-shadow:
    0 1px 2px #fff9da,
    1px 0 2px #fff9da,
    -1px 0 2px #fff9da;
  border: 2px solid #fff5db;
  box-shadow: 0 2px 0 #9ba984;
}
.balloon-album-overlay {
  margin: 0;
  inset: 0;
  padding: 24px;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  border: 0;
  background: #668a8059;
  color: #817457;
}
.balloon-album-overlay[open] {
  display: grid;
  place-items: center;
}
.balloon-album-overlay::backdrop {
  background: #5d837640;
  backdrop-filter: blur(6px);
}
.balloon-album-card {
  width: min(920px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: #fff9e8;
  border: 4px solid #fffdf4;
  border-radius: 26px;
  box-shadow: 0 8px 0 #60775b30;
  padding: 24px;
  text-align: center;
}
.balloon-album-card h3 {
  font-size: 24px;
  margin: 0 0 9px;
}
.balloon-album-card h3:focus {
  outline: none;
}
.balloon-album-card p {
  font-size: 12px;
  margin: 0 0 18px;
}
.balloon-album-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 5px 3px 14px;
}
.balloon-album-photos figure {
  margin: 0;
  padding: 9px;
  border: 1px solid #e5dbc0;
  background: #fffef5;
  box-shadow: 0 4px 0 #c8b98928;
  border-radius: 5px;
}
.balloon-album-photos figure:nth-child(2) {
  transform: rotate(1.3deg);
}
.balloon-photo-thumb {
  position: relative;
  width: 100%;
  padding: 0;
  aspect-ratio: 3 / 4;
  max-height: 42vh;
  background: #e8eacf;
  border: 1px solid #d4ddbf;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #9c9f81;
  overflow: hidden;
}
.balloon-photo-thumb:not(:disabled)::after {
  content: "看大图 ↗";
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 5px 8px;
  border-radius: 9px;
  color: #685e48;
  background: #fff8e7ed;
  font-size: 11px;
}
.balloon-album-photos img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 35% 55%;
}
.balloon-album-photos figcaption {
  padding: 12px 0 5px;
  display: grid;
  gap: 5px;
}
.balloon-album-photos figcaption b {
  font-size: 14px;
}
.balloon-album-photos figcaption span {
  font-size: 10px;
  color: #a39777;
}
.balloon-album-card > button {
  margin-top: 9px;
  font-size: 13px;
}
.balloon-photo-detail h4 {
  margin: 0 0 12px;
  font-size: 17px;
}
.balloon-album-overlay.is-viewing-photo .balloon-album-card > h3,
.balloon-album-overlay.is-viewing-photo .balloon-album-card > p {
  display: none;
}
.balloon-photo-detail h4:focus {
  outline: none;
}
.balloon-photo-detail > img {
  display: block;
  width: 100%;
  height: min(52vh, 500px, calc(100dvh - 220px));
  object-fit: contain;
  background: #e5ead5;
  border: 5px solid #fffdf5;
  border-radius: 6px;
}
.balloon-photo-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 8px;
}
.balloon-photo-actions .button {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 12px;
  border-radius: 12px;
}
@media (max-width: 600px) {
  .balloon-album-overlay {
    padding: 14px;
  }
  .balloon-album-card {
    padding: 18px 12px;
  }
  .balloon-album-card h3 {
    font-size: 20px;
  }
  .balloon-album-card p {
    font-size: 11px;
    line-height: 1.7;
  }
  .balloon-album-photos {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
  }
  .balloon-album-photos figure {
    flex: 0 0 85%;
    scroll-snap-align: center;
  }
  .balloon-album-photos figure:nth-child(2) {
    transform: none;
  }
  .balloon-album-card > button {
    padding: 12px 16px;
    font-size: 12px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .balloon-album-overlay {
    padding: 12px;
  }
  .balloon-album-card {
    padding: 12px;
  }
  .balloon-album-card h3 {
    font-size: 19px;
    margin-bottom: 5px;
  }
  .balloon-album-card p {
    margin-bottom: 7px;
    font-size: 10px;
  }
  .balloon-album-photos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    overflow-x: visible;
    padding-bottom: 8px;
  }
  .balloon-album-photos figure {
    padding: 6px;
  }
  .balloon-photo-thumb {
    max-height: 32vh;
  }
  .balloon-album-photos img {
    object-fit: contain;
  }
  .balloon-album-photos figcaption {
    padding: 5px 0 0;
  }
  .balloon-album-photos figcaption b {
    font-size: 11px;
  }
  .balloon-album-photos figcaption span {
    font-size: 9px;
  }
  .balloon-album-card > button {
    margin-top: 0;
    padding: 9px 17px;
    font-size: 11px;
  }
}
