/* Strategy matrix demo: a drawn grid, no art files. */
.matrix-scene {
  aspect-ratio: 16/11;
  background: radial-gradient(ellipse at 30% 20%, #1f2230, #12141b 70%);
}

.matrix-scene .scene-chapter,
.matrix-scene .scene-story {
  z-index: 4;
}

.mx-board {
  position: absolute;
  top: 15%;
  bottom: 14%;
  left: 4%;
  right: 4%;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr));
  grid-template-rows: auto repeat(4, minmax(0, 1fr)) minmax(0, .8fr);
  gap: 5px;
  font: 600 clamp(8px, .8vw, 11px)/1.2 ui-monospace, monospace;
  letter-spacing: .04em;
  color: #edeae3;
}

.mx-corner,
.mx-head {
  align-self: end;
  padding-bottom: 3px;
  text-align: center;
  color: #b2b6c2;
}

.mx-corner {
  text-align: left;
  color: #ffb454;
}

.mx-head.is-partner {
  color: #e6d2ff;
}

.mx-segment {
  align-self: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #c9ccd6;
}

.mx-roll-label {
  color: #ffb454;
}

.mx-cell {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid #2c2f3a;
  border-radius: 5px;
  background: #171920;
  transition: background .25s, border-color .25s;
}

.mx-cell b {
  font-size: clamp(11px, 1.15vw, 16px);
  opacity: 0;
}

.mx-cell i {
  position: absolute;
  top: 2px;
  right: 4px;
  font-style: normal;
  font-size: clamp(7px, .62vw, 9px);
  opacity: 0;
}

.mx-cell:not([data-state=empty]) b,
.mx-cell:not([data-state=empty]) i {
  opacity: 1;
}

.mx-cell[data-heat="1"] { background: #2a2119; }
.mx-cell[data-heat="2"] { background: #4a3218; }
.mx-cell[data-heat="3"] { background: #7a4f1c; }
.mx-cell[data-heat="4"] { background: #c27d2a; color: #160f06; }
.mx-cell[data-heat="5"] { background: #ffb454; color: #160f06; }

.mx-cell[data-state=proposed] {
  background: repeating-linear-gradient(135deg, #2b2338 0 5px, #221c2d 5px 10px);
  border: 1px dashed #b996e0;
  color: #f0e4ff;
}

.mx-cell[data-state=proposed]::after {
  content: "PROPOSED";
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: clamp(5px, .5vw, 7px);
  letter-spacing: .06em;
  color: #d9c2f5;
}

.mx-roll {
  position: relative;
  align-self: center;
  height: 70%;
  border: 1px solid #2c2f3a;
  border-radius: 4px;
  overflow: hidden;
  background: #121318;
  display: grid;
  place-items: center;
}

.mx-roll i {
  position: absolute;
  inset: 0 auto 0 0;
  background: #5c6074;
}

.mx-roll b {
  position: relative;
  display: block;
  text-align: center;
  line-height: 1;
  font-size: clamp(8px, .8vw, 11px);
}

.mx-roll.is-best {
  border-color: #ffb454;
}

.mx-roll.is-best i {
  background: #ffb454;
}

.mx-roll.is-best b {
  color: #160f06;
}

[data-game-demo=strategy] .scene-sprite {
  position: absolute;
  bottom: auto;
  aspect-ratio: auto;
  transform: none;
  background: none;
  border: 2px solid #f6f1e8;
  border-radius: 6px;
  box-shadow: 0 0 10px #ffb45488;
  pointer-events: none;
  filter: none;
  z-index: 3;
  transition: left .18s, top .18s, width .18s, height .18s;
}

.mx-decision {
  position: absolute;
  left: 50%;
  top: 40%;
  z-index: 5;
  width: min(86%, 380px);
  padding: 10px 14px;
  border: 1px solid #ffb454;
  border-radius: 8px;
  background: #15120ef2;
  box-shadow: 0 12px 30px #000a;
  text-align: center;
  opacity: 0;
  font: 600 clamp(8px, .8vw, 11px)/1.6 ui-monospace, monospace;
  letter-spacing: .04em;
  color: #f4e9d6;
}

.mx-decision b {
  display: block;
  color: #ffb454;
  font-size: clamp(11px, 1.1vw, 15px);
}

@media(max-width:700px) {
  .mx-board {
    gap: 3px;
    top: 16%;
  }

  .mx-cell i {
    right: 2px;
    top: 1px;
  }
}

@media(prefers-reduced-motion:reduce) {
  .mx-cell,
  [data-game-demo=strategy] .scene-sprite {
    transition: none;
  }
}
