.hero.playmat {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: clamp(16rem, 30vw, 27rem);
  border-color: #74684a;
  background-color: #0b1b13;
  background-image: linear-gradient(90deg, #06110ee6, #06110e86 29%, transparent 52%, #06110e8a 100%), url("playmat.webp");
  background-size: cover;
  background-position: center, center;
}
.hero.playmat .hero-history { max-width: 14ch; }
.playmat [hidden] { display: none !important; }

.playmat-crest {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 42% auto auto 67.5%;
  transform: translate(-50%, -50%);
  width: clamp(4.3rem, 11vw, 10rem);
  aspect-ratio: 1;
  padding: 0 .06em .06em 0;
  border: 1px solid #bfa87d;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 27%, #345643, #10271e 72%);
  color: #f2deb8;
  box-shadow: inset 0 0 0 4px #10221c, inset 0 0 0 5px #a88b5dc4, 0 0 24px #a1efb241;
  cursor: pointer;
  font: 800 clamp(2rem, 5.15vw, 4.7rem)/1 Georgia, serif;
  letter-spacing: -.09em;
  text-shadow: 0 2px 2px #000;
}
.playmat-crest:hover { color: #fff0c5; box-shadow: inset 0 0 0 4px #10221c, inset 0 0 0 5px #d7be89, 0 0 36px #9affad69; }
.playmat-crest:disabled { cursor: default; }

.hero.playmat.is-playing {
  display: block;
  padding: clamp(.75rem, 2vw, 1.9rem);
  background-image: linear-gradient(90deg, #081910c4, #08191023 55%, #081910ce), url("playmat.webp");
}

.playmat-game {
  display: grid;
  grid-template-columns: minmax(9rem, .62fr) minmax(0, 31rem) minmax(9rem, .68fr);
  justify-content: center;
  align-items: center;
  gap: clamp(.65rem, 2vw, 1.5rem);
  color: #f4e7c9;
}

.playmat-rules, .playmat-controls {
  padding: clamp(.7rem, 1.3vw, 1.2rem);
  border: 1px solid #ab8b57a8;
  border-radius: .35rem;
  background: #0b1b15e8;
  box-shadow: inset 0 0 0 3px #07130d, 0 .25rem 1rem #04090788;
}
.playmat-rules h2 { margin-bottom: .55rem; color: #f6deb0; font: 700 clamp(1.65rem, 3vw, 2.6rem)/1.05 Georgia, serif; }
.playmat-rules p, #playmat-help { font-size: .9rem; }
.playmat-score { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin: .8rem 0; }
.playmat-score dt { color: #d6c8a9; font: .78rem/1.4 var(--mono); }
.playmat-score dd { margin: .1rem 0 0; color: #f7d78f; font: 750 1.15rem/1.2 var(--mono); }
.playmat-status { min-height: 1.5rem; color: #bde3a9; font-weight: 700; }
#playmat-help { margin-top: .65rem; color: #dfd4bb; }

.playmat-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.delve-movement {
  display: grid;
  width: min(100%, 9rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .25rem;
  margin-bottom: .55rem;
}
.playmat-controls button {
  min-height: 2.75rem;
  padding: .35rem .65rem;
  border: 1px solid #ae9469;
  border-radius: .3rem;
  background: #243b2d;
  color: #f8e6bd;
  font: 700 .88rem/1 var(--sans);
  cursor: pointer;
  touch-action: none;
}
.delve-movement button { padding: .2rem; font-size: 1.15rem; }
.delve-spells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; margin: 0 0 .5rem; }
.playmat-controls .delve-spells button { display: grid; text-align: left; gap: .25rem; background: #43251e; padding: .4rem .5rem; }
.playmat-controls .delve-spells [data-spell="frost"] { background: #183746; }
.delve-spells span { color: #eddbc1; font: .76rem/1.15 var(--sans); }
.playmat-controls .delve-spells [aria-pressed="true"] { box-shadow: inset 0 0 0 1px #edce91; border-color: #edce91; }
.playmat-controls button:hover { background: #395840; }
.playmat-controls button:disabled { cursor: default; opacity: .55; }
.playmat-controls #delve-cast { background: #e5c58b; color: #182019; }
.playmat-controls #delve-cast:hover { background: #ffe1aa; }
.playmat button:focus-visible, .board:focus-visible { outline: 2px solid #e8d098; outline-offset: 3px; }

.delve-view {
  position: relative;
  overflow: hidden;
  aspect-ratio: 8 / 5;
  border: 1px solid #c9a468;
  border-radius: .4rem;
  background: #10261d;
  box-shadow: 0 0 0 4px #0a1711a0, 0 .4rem 1.15rem #020704b3;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}
.delve-view canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.delve-crest {
  position: absolute;
  left: .55rem;
  bottom: .35rem;
  color: #f3d391;
  font: 800 1.2rem/1 Georgia, serif;
  text-shadow: 0 1px 4px #000;
  pointer-events: none;
}

@media (max-width: 850px) {
  .hero.playmat .hero-history { display: none; }
  .playmat-game { grid-template-columns: minmax(0, 1fr); width: min(100%, 28rem); margin-inline: auto; }
  .playmat-controls { display: grid; grid-template-columns: auto 1fr; gap: .45rem .55rem; align-items: end; }
  .playmat-controls .delve-spells, .playmat-controls #playmat-help { grid-column: 1 / -1; margin: .12rem 0 0; }
  .delve-movement { width: 8.3rem; margin: 0; }
  .delve-spells { grid-row: 1; }
}
@media (max-width: 470px) {
  .hero.playmat { align-items: end; background-position: center, 67% center; }
  .hero.playmat:not(.is-playing) { min-height: 18rem; }
  .playmat-crest { inset: 43% auto auto 65%; }
}
