@media (max-height:500px) and (min-aspect-ratio:3/2) {
  .stage-canvas {
    grid-template-columns:370px minmax(0,1fr);
    grid-template-rows:68px minmax(0,1fr) 44px;
    gap:7px;
    padding:8px;
  }

  .stage-header {
    grid-column:1;
    grid-row:1;
  }

  .stage-header strong {
    font-size:18px;
    white-space:nowrap;
    line-height:1.1;
  }

  .stage-rail {
    grid-column:2;
    grid-row:1 / 4;
    min-width:0;
  }

  .stage-card {
    height:196px;
  }

  .stage-hint {
    grid-column:1;
    grid-row:2 / 4;
    display:flex;
    align-items:center;
    justify-content:center;
    align-self:stretch;
    margin:0;
    padding:14px 18px;
    border:1px solid var(--line);
    border-radius:15px;
    background:#07172ded;
    font-size:16px;
    line-height:1.45;
  }
}
#resultModal .modal-actions {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#resultModal .modal-actions button {
  min-width: 0;
}

.key-discovery {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 14px 0 0;
  color: #dffcff;
}

.key-discovery kbd {
  min-width: 38px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  border: 1px solid #b9fff8;
  border-bottom-width: 4px;
  border-radius: 9px;
  background: linear-gradient(180deg, #173b67, #0b1c3d);
  box-shadow: 0 4px 12px #07101f66, inset 0 0 12px #62fff02b;
  color: #fff;
  font: 800 17px/1 system-ui, sans-serif;
}

.key-discovery span {
  color: #93c8d8;
  font-weight: 800;
}

@media (max-width: 420px) {
  .key-discovery {
    gap: 6px;
  }

  .key-discovery kbd {
    min-width: 34px;
    height: 34px;
  }
}
