.deck-game {
  --deck-gold: #f0cb82;
  --deck-text: #fff0d5;
  --deck-line: #7c695a;
  border: 1px solid #766258;
  overflow: hidden;
  background: radial-gradient(ellipse at 40% 40%, #514039, #26202d 75%);
  color: var(--deck-text);
  border-radius: 4px;
}
.deck-game button {
  cursor: pointer;
  touch-action: manipulation;
  color: inherit;
  font: inherit;
}
.deck-game h3,
.deck-game p {
  margin: 0;
}
.deck-header {
  padding: clamp(13px, 2vw, 24px);
  background:
    linear-gradient(90deg, #2d2536e0, #212737a6, transparent),
    var(--scene, url('./assets/world-panoramas.webp')) center top / 100% 400%;
}
.deck-header p {
  max-width: 52ch;
  margin-top: 6px;
  color: #fff0d5;
  text-shadow: 0 1px 3px #181322;
}
.deck-header h2 {
  font-size: clamp(22px, 3.7vw, 34px);
  margin: 3px 0 0;
  text-shadow: 0 2px 2px #131521;
}
.deck-header small {
  color: var(--deck-gold);
  font-weight: 700;
}
.deck-bar,
.deck-handline {
  display: flex;
  gap: clamp(8px, 1.5vw, 20px);
  align-items: center;
  flex-wrap: wrap;
}
.deck-bar {
  background: #231e26;
  padding: 5px clamp(10px, 2vw, 21px);
  font-size: 0.92rem;
}
.deck-bar strong {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-right: auto;
}
.deck-bar i {
  display: block;
  width: 25px;
  height: 39px;
  background: url('./assets/maze-figures.webp') no-repeat;
  background-size: 500% 200%;
}
.deck-bar b {
  color: #ffbaad;
}
.deck-bar span {
  color: #d9cbbb;
}
.deck-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: clamp(8px, 1.7vw, 18px);
  background:
    linear-gradient(0deg, #152426da 0%, #172e2a40 60%, #1c242d40),
    var(--scene, url('./assets/world-panoramas.webp')) center top / 100% 400%;
  border-block: 2px solid #85765f;
}
.deck-lane {
  padding: 5px;
  display: flex;
  flex-direction: column;
  min-height: 110px;
  min-width: 0;
  border: 1px solid #d8d4ad66;
  border-bottom-width: 4px;
  border-radius: 2px;
  background: linear-gradient(#27313233, #1a202a6e);
}
.deck-lane label {
  align-self: flex-start;
  margin: 0 0 4px 3px;
  font-size: 0.72rem;
  background: #182523d9;
  padding: 2px 5px;
  color: #f1e3bf;
}
.deck-lane > div {
  display: flex;
  justify-content: center;
  align-content: center;
  gap: 3px;
  flex-wrap: wrap;
  flex: 1;
}
.deck-foe {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  min-width: 0;
  max-width: 100%;
  padding: 4px;
  border: 1px solid #8e776251;
  background: #20272beb;
  border-radius: 2px;
}
.deck-foe[aria-pressed='true'] {
  border: 2px solid #fed58d;
  padding: 3px;
  background: #3a342cf0;
}
.deck-foe b {
  font-size: clamp(0.69rem, 1.8vw, 0.91rem);
  line-height: 1.15;
}
.deck-foe small {
  font-size: 0.73rem;
  color: #ffcebd;
}
.deck-beast {
  width: clamp(32px, 5.7vw, 63px);
  height: clamp(32px, 5.7vw, 63px);
  display: block;
  filter: drop-shadow(0 2px 1px #1a1220);
  image-rendering: auto;
}
.dancing .deck-beast {
  animation: deck-jig 0.55s ease-in-out alternate infinite;
}
@keyframes deck-jig {
  from {
    transform: translateY(-1px) rotate(-8deg);
  }
  to {
    transform: translateY(2px) rotate(8deg);
  }
}
.deck-command {
  padding: clamp(10px, 2vw, 20px);
  border-top: 1px solid #69564c;
  background: #2a242b;
}
.deck-command p {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #e4d3bd;
}
.deck-command .deck-note {
  color: #ffdfa5;
  margin-bottom: 8px;
}
.deck-handline {
  margin-bottom: 8px;
}
.deck-handline h3,
.deck-command h3 {
  font-size: 1.05rem;
}
.deck-handline b {
  font-size: 0.88rem;
  color: #f3c77a;
}
.deck-handline button,
.deck-retry {
  margin-left: auto;
  border: 1px solid #e4b978;
  color: #342337;
  background: #e5bf85;
  border-radius: 7px;
  padding: 6px 11px;
  min-height: 36px;
  font-weight: 700;
}
.deck-retry {
  display: block;
  margin: 12px 0;
}
.deck-hand {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(108px, 100%), 1fr));
  gap: 6px;
  margin: 10px 0;
}
.deck-card {
  --light: #c5ddba;
  --shade: #304b48;
  --accent: #9fdcc1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 4px;
  border: 1px solid var(--accent);
  padding: 9px;
  background: linear-gradient(153deg, var(--shade), #28242c 75%);
  box-shadow: inset 0 0 0 3px #e4b96f0d;
  min-height: 115px;
  min-width: 0;
  border-radius: 3px;
  border-bottom: 4px solid var(--accent);
}
.deck-card.blue {
  --shade: #39495e;
  --light: #d7e8fa;
  --accent: #9abbdf;
}
.deck-card.amber {
  --shade: #73503a;
  --light: #ffe1b0;
  --accent: #e4b579;
}
.deck-card.lilac {
  --shade: #5e4669;
  --light: #eedaef;
  --accent: #c3a6ce;
}
.deck-card .deck-cost {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 1.35em;
  text-align: center;
  border-radius: 50%;
  font-size: 0.76rem;
  background: var(--accent);
  color: #232127;
  font-weight: 800;
  z-index: 1;
}
.deck-mark {
  position: absolute;
  top: 6px;
  left: 7px;
  font-size: 0.82rem;
  color: var(--accent);
}
.deck-card strong {
  color: var(--light);
  font-size: 0.94rem;
  line-height: 1.1;
}
.deck-card small {
  font-size: 0.79rem;
  line-height: 1.25;
  color: #ecdfd2;
}
.deck-card:not(:disabled):hover,
.deck-card:not(:disabled):focus-visible {
  background: var(--shade);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.deck-card:disabled {
  opacity: 0.62;
  cursor: default;
}
.deck-command details {
  margin-top: 7px;
  font-size: 0.82rem;
  color: #d4c6b8;
}
.deck-command summary {
  cursor: pointer;
  padding: 5px 0;
}
.deck-command ul {
  columns: 2;
  margin-top: 6px;
  padding-left: 18px;
}
@media (max-width: 600px) {
  .deck-hand {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .deck-card {
    min-height: 95px;
    padding: 7px;
  }
  .deck-card strong {
    font-size: 0.84rem;
  }
  .deck-card small {
    font-size: 0.72rem;
  }
  .deck-lane {
    min-height: 95px;
  }
  .deck-lane label {
    font-size: 0.66rem;
  }
  .deck-beast {
    width: 32px;
    height: 32px;
  }
  .deck-handline {
    gap: 6px;
  }
  .deck-handline button {
    font-size: 0.8rem;
  }
  .deck-lanes {
    gap: 3px;
    padding: 7px;
  }
  .deck-lane {
    padding: 2px;
  }
  .deck-foe {
    padding: 2px;
  }
  .deck-foe[aria-pressed='true'] {
    padding: 1px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dancing .deck-beast {
    animation: none;
    transform: rotate(-7deg);
  }
}
.deck-game.arcade { --scene-position: 33.333%; }
.deck-game.aqua { --scene-position: 66.667%; }
.deck-game.store, .deck-game.end { --scene-position: 100%; }
.deck-game.castle { --scene-position: 50%; }
.deck-game:is(.nether, .castle, .end) {
  --scene: url('./assets/realm-panoramas.webp');
  --scene-height: 300%;
}
.deck-game :is(.deck-header, .deck-lanes) {
  background-position: center, center var(--scene-position, 0%);
  background-size: 100% 100%, 100% var(--scene-height, 400%);
}
.deck-illustration {
  display: block;
  width: 100%;
  height: clamp(28px, 4vw, 50px);
  margin: 0 auto 2px;
  background-repeat: no-repeat;
}
.deck-illustration.landmark {
  background-image: url('./games/block-maze/assets/maze-landmarks.webp');
  background-size: 400% 500%;
  width: clamp(42px, 6vw, 75px);
}
.deck-illustration.family {
  background-image: url('./assets/maze-figures.webp');
  background-size: 500% 200%;
  width: clamp(17px, 2.4vw, 30px);
}

/* Phone held sideways: the lanes on the left, the hand on the right, both on one screen. */
@media (orientation: landscape) and (max-height: 540px) {
  .deck-game {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    height: calc(100svh - 62px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  .deck-game > * { grid-column: 1; }
  /* The hand scrolls on its own, so the lanes and the monsters stay in view. */
  .deck-game > .deck-command { grid-column: 2; grid-row: 1 / -1; min-height: 0; overflow-y: auto; padding: 6px 8px; }
  .deck-header { padding-block: 4px; min-height: 0; }
  .deck-header h2 { font-size: 1rem; }
  .deck-bar { padding-block: 2px; flex-wrap: wrap; }
  .deck-lanes { padding: 4px 6px; }
  .deck-lane { min-height: 76px; }
  .deck-note { margin: 0 0 2px; font-size: 0.76rem; }
  .deck-hand { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 4px 0; }
  .deck-card { min-height: 0; padding: 5px; gap: 2px; }
  .deck-card strong { font-size: 0.8rem; }
  .deck-card small { font-size: 0.68rem; }
}
