/* Decorative artwork lives inside the existing 44px or larger game controls. */
.cardstage,
.tilestage {
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 25%, #31454b55, transparent 75%),
    linear-gradient(135deg, #173d3728, #37244944);
  box-shadow: inset 0 0 0 1px #9bcbad22;
}
/* Portrait proportions apply to playing cards and the two card/tile modes. */
.cardstage .playcards button {
  height: 78px;
  min-height: 78px;
  padding: 5px 6px;
}
.cardstage .card-face {
  height: 64px;
}
.cardstage .mapcard {
  width: 25px;
  height: 34px;
  flex-direction: column;
  gap: 0;
}
.cardstage .mapcard b {
  line-height: 13px;
}
.cardstage .mapcard small {
  line-height: 12px;
}
body[data-game="memory"] .tileboard,
body[data-game="mahjong"] .tileboard {
  grid-template-columns: repeat(4, 56px);
}
body[data-game="memory"] .tileboard button,
body[data-game="mahjong"] .tileboard button {
  height: 78px;
}
@media (min-height: 700px) and (min-width: 601px) {
  .cardstage .playcards button {
    height: 90px;
    min-height: 90px;
  }
  .cardstage .card-face {
    height: 76px;
  }
  body[data-game="memory"] .tileboard,
  body[data-game="mahjong"] .tileboard {
    grid-template-columns: repeat(4, 64px);
  }
  body[data-game="memory"] .tileboard button,
  body[data-game="mahjong"] .tileboard button {
    height: 90px;
  }
}
@media (max-height: 620px), (max-width: 360px) {
  .cardstage .playcards {
    grid-template-columns: repeat(6, 44px);
    gap: 5px;
  }
  .cardstage .playcards button {
    height: 62px;
    min-height: 62px;
    padding: 5px 4px;
  }
  .cardstage .card-face {
    height: 48px;
  }
  body[data-game="memory"] .tileboard,
  body[data-game="mahjong"] .tileboard {
    grid-template-columns: repeat(4, 44px);
  }
  body[data-game="memory"] .tileboard button,
  body[data-game="mahjong"] .tileboard button {
    height: 62px;
  }
}
@media (max-height: 440px) and (min-width: 600px) {
  .cardstage {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
  }
  .cardstage .playcards {
    grid-template-columns: repeat(9, 44px);
    gap: 5px;
  }
}
.cardstage .waste-art .card-face {
  height: 30px;
}
.tableau-review .mapcard {
  width: 20px;
  height: 26px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tableau-review .mapcard b {
  font-size: 12px;
  line-height: 12px;
}
.tableau-review .mapcard small {
  font-size: 10px;
  line-height: 10px;
}
.tableau-review .cardmap {
  gap: 1px;
}
.tableau-review .maprow {
  gap: 2px;
}
.cardstage .playcards {
  gap: 8px;
}
.playcards button {
  background: linear-gradient(150deg, #fffdf6, #f3e6cd);
  border: 2px solid #dbcbb0;
  box-shadow:
    0 3px 0 #a48c6c,
    0 5px 9px #0b081733;
  color: #29223d;
}
.playcards button.legal {
  border-color: #eec566;
  box-shadow:
    0 0 0 2px #eec56655,
    0 3px 0 #a48c6c,
    0 5px 9px #0b081744;
}
.playcards button.unplayable {
  opacity: 1;
  background: linear-gradient(150deg, #efe9df, #d6cfca);
  border-color: #b8b0b2;
}
.card-face {
  height: 42px;
}
.card-corner {
  font-size: 15px;
  text-align: center;
}
.card-corner small,
.card-bottom small {
  display: block;
  font-size: 12px;
}
.card-bottom {
  font-size: 13px;
  text-align: center;
}
.card-emblem {
  display: block;
  height: 100%;
  width: 30px;
  margin: auto;
  opacity: 0.88;
}
.card-emblem svg {
  width: 100%;
  height: 100%;
  display: block;
}
.court-card .card-emblem {
  width: 36px;
}
.playable-mark {
  position: absolute;
  right: -5px;
  top: -6px;
  width: 17px;
  height: 17px;
  line-height: 17px;
  border-radius: 50%;
  background: #efc663;
  color: #29223d;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid #29223d;
  pointer-events: none;
}
.playcards button.selected {
  outline: 3px solid #86d6bc;
  outline-offset: 3px;
  box-shadow:
    0 3px 0 #5c9a84,
    0 0 18px #86d6bc55;
}
.mapcard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: #b9aabf;
  color: #29223d;
  border: 1px solid #e9ddcd;
  border-radius: 4px;
  box-shadow: 0 1px 2px #0004;
}
.mapcard b {
  font-size: 12px;
}
.mapcard small {
  font-size: 11px;
}
.mapcard.free {
  background: #fff6e6;
  border-color: #ead8ae;
  color: #29223d;
}
.mapcard.map-red.free {
  color: #a72c48;
}
.mapcard:not(.free):not(.removed) {
  background: repeating-linear-gradient(135deg, #b8a9bd 0 3px, #b0a0b7 3px 6px);
  color: #29223d;
}
.mapcard.removed {
  background: transparent;
  box-shadow: none;
  border-style: dashed;
  opacity: 0.22;
}
[data-stock] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.stock-art {
  display: block;
  width: 24px;
  height: 29px;
}
.stock-art svg {
  width: 100%;
  height: 100%;
}
.tilestage .tileboard button {
  position: relative;
  padding: 3px;
  border: 2px solid #d7c7a7;
  background: linear-gradient(145deg, #fffdf4, #e9ddc8);
  box-shadow:
    0 3px 0 #a49377,
    0 5px 8px #09061533;
  border-radius: 11px;
}
.tile-face {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.tile-face svg {
  display: block;
  width: 100%;
  height: 100%;
}
.tilestage .tileboard button:has(.tile-back) {
  background: linear-gradient(145deg, #6d558b, #302347);
  border-color: #ab91c1;
  box-shadow:
    0 3px 0 #291936,
    0 5px 8px #09061533;
}
.tilestage .tileboard button.selected {
  outline: 3px solid #f1c860;
  outline-offset: 3px;
  box-shadow:
    0 3px 0 #b48d30,
    0 0 16px #f1c86055;
}
.tilestage .tileboard button.miss {
  border-style: dashed;
  background: #d6ceca;
}
.tilestage .tileboard button.hinted {
  outline: 3px solid #82d8b6;
  outline-offset: 3px;
}
@media (min-height: 700px) and (min-width: 601px) {
  .cardstage .playcards {
    grid-template-columns: repeat(7, 64px);
  }
  .cardstage .playcards button {
    min-height: 82px;
  }
  .cardstage .card-face {
    height: 68px;
  }
  .cardstage .card-emblem {
    width: 42px;
  }
  .cardstage .court-card .card-emblem {
    width: 46px;
  }
  .cardstage .card-corner {
    font-size: 19px;
  }
  .cardstage .tileboard {
    grid-template-columns: repeat(4, 70px);
  }
  .tilestage .tileboard {
    grid-template-columns: repeat(4, 70px);
  }
  .tilestage .tileboard button {
    height: 70px;
  }
}
@media (max-height: 620px), (max-width: 360px) {
  .cardstage .playcards {
    gap: 5px;
  }
  .card-face {
    height: 31px;
  }
  .card-corner {
    font-size: 13px;
  }
  .card-corner small {
    font-size: 11px;
  }
  .card-bottom {
    font-size: 11px;
  }
  .card-bottom small {
    display: none;
  }
  .card-emblem {
    width: 23px;
  }
  .court-card .card-emblem {
    width: 27px;
  }
  .stock-art {
    width: 19px;
    height: 25px;
  }
  .playable-mark {
    width: 14px;
    height: 14px;
    line-height: 14px;
    font-size: 10px;
    top: -4px;
    right: -3px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .tilestage .selected .tile-face,
  body[data-game="memory"] .tile-face:not(.tile-back) {
    animation: tile-reveal 0.18s ease-out;
  }
  @keyframes tile-reveal {
    from {
      opacity: 0.65;
      transform: scale(0.94);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
}
[data-waste] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.waste-art {
  width: 24px;
  height: 32px;
  background: #fff8e9;
  border: 1px solid #d7c7a7;
  border-radius: 3px;
  color: #29223d;
  pointer-events: none;
}
.waste-art .card-face {
  height: 30px;
}
.waste-art .card-emblem {
  width: 19px;
}
.waste-art .card-corner,
.waste-art .card-bottom {
  display: none;
}
.number-pips {
  display: block;
  width: 100%;
  height: 100%;
}
.compact-pip {
  display: none;
  width: 100%;
  height: 100%;
}
.waste-art .number-pips {
  display: none;
}
.waste-art .compact-pip {
  display: block;
}
@media (max-height: 620px), (max-width: 600px) {
  .card-emblem .number-pips {
    display: none;
  }
  .card-emblem .compact-pip {
    display: block;
  }
}
@media (max-height: 360px) and (min-width: 500px) {
  body:is(
      [data-game="tripeaks"],
      [data-game="golf"],
      [data-game="pyramid"],
      [data-game="mahjong"],
      [data-game="memory"],
      [data-game="onet"]
    )
    .subtitle {
    display: none;
  }
  .cardstage {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .cardstage .playcards {
    grid-template-columns: repeat(10, 44px);
    gap: 4px;
  }
  .tilestage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    align-content: center;
  }
  .tilestage .tileboard {
    grid-column: 1;
    grid-row: 1/4;
  }
  .tilestage .metric,
  .tilestage .actions {
    grid-column: 2;
  }
  .tilestage .actions {
    max-width: 250px;
  }
}
