/* CommonPopUp and InGameResultPopUp scale from a 1080 × 780 canvas panel. */
.classic-round-panel,
.classic-role-reveal {
  --ru: min(.052083333vw, .112820513dvh);
  --round-blue: #4faec7;
  --round-red: #c83237;
}
#pauseDialog.classic-round-panel,
#resultDialog.classic-round-panel,
.classic-role-reveal > .classic-round-panel {
  box-sizing: border-box;
  width: min(calc(1080 * var(--ru)), 95vw);
  max-width: 95vw;
  height: min(calc(780 * var(--ru)), 88dvh);
  max-height: 88dvh;
  padding: 0;
  border: 0;
  border-radius: calc(36 * var(--ru));
  background: #fff;
  color: #323232;
  font-family: 'ClassicMaru', 'Kosugi Maru', 'Hiragino Maru Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  box-shadow: none;
  text-shadow: none;
  overflow: auto;
}
#pauseDialog[open].classic-round-panel,
#resultDialog[open].classic-round-panel,
.classic-role-reveal > .classic-round-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#pauseDialog.classic-round-panel::backdrop { background: rgb(0 0 0 / .5); }
#resultDialog.classic-round-panel::backdrop { background: rgb(0 0 0 / .392); }
.classic-round-panel > h2,
#pauseDialog.classic-round-panel > h2,
#resultDialog.classic-round-panel > h2 {
  display: grid;
  place-items: center;
  flex: 0 0 calc(120 * var(--ru));
  margin: 0;
  padding: 0 calc(30 * var(--ru));
  background: var(--round-blue);
  color: #fff;
  font-size: clamp(15px, calc(52 * var(--ru)), 54px);
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
}
.classic-round-panel > p,
#pauseDialog.classic-round-panel > p,
#resultDialog.classic-round-panel > p {
  margin: calc(32 * var(--ru)) calc(44 * var(--ru)) 0;
  color: #323232;
  font-size: clamp(12px, calc(43 * var(--ru)), 43px);
  font-weight: 500;
  line-height: 1.32;
  text-align: left;
}
#pauseDialog.classic-round-panel > p { margin-top: calc(52 * var(--ru)); }
.classic-round-panel > .dialog-actions {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: calc(60 * var(--ru));
  margin: auto 0 calc(46 * var(--ru));
  padding: calc(18 * var(--ru)) calc(20 * var(--ru)) 0;
}
.classic-round-panel .classic-round-action {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 1;
  width: calc(420 * var(--ru));
  height: calc(120 * var(--ru));
  min-height: 28px;
  margin: 0;
  padding: 0 calc(90 * var(--ru)) 0 calc(16 * var(--ru));
  border: 0;
  border-radius: calc(32 * var(--ru));
  background: var(--round-blue);
  color: #fff;
  font: 700 clamp(11px, calc(42 * var(--ru)), 42px)/1.12 'ClassicMaru', 'Kosugi Maru', 'Yu Gothic', Meiryo, sans-serif;
  text-align: center;
  text-shadow: none;
  white-space: normal;
  box-shadow: none;
  cursor: pointer;
}
.classic-round-panel .classic-round-action::after {
  content: '';
  position: absolute;
  right: calc(21 * var(--ru));
  top: 15%;
  height: 70%;
  aspect-ratio: 1;
  background: url('/classic/round/ok.png') center / contain no-repeat;
}
.classic-round-panel .classic-round-negative { background: var(--round-red); }
.classic-round-panel .classic-round-negative::after { background-image: url('/classic/round/cross.png'); }
.classic-round-panel .classic-round-action:disabled { opacity: .55; }
.classic-round-panel .classic-round-action:active:not(:disabled) { transform: scale(.97); }
.classic-round-panel .classic-round-action:focus-visible { outline: 2px solid #185e77; outline-offset: 2px; }
.classic-round-panel [hidden],
.classic-role-reveal[hidden] { display: none !important; }

.classic-role-reveal {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / .5);
  pointer-events: none;
}
.classic-role-reveal .classic-role-items {
  margin-top: calc(34 * var(--ru));
  color: #d23636;
  font-size: clamp(11px, calc(40 * var(--ru)), 40px);
  white-space: pre-line;
}
.classic-role-reveal .classic-round-action {
  align-self: center;
  margin: auto 0 calc(52 * var(--ru));
  pointer-events: auto;
}

#resultDialog.classic-round-panel > #resultText {
  margin-top: calc(21 * var(--ru));
  font-size: clamp(12px, calc(39 * var(--ru)), 39px);
}
.classic-round-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  column-gap: calc(24 * var(--ru));
  row-gap: calc(10 * var(--ru));
  margin: calc(24 * var(--ru)) calc(42 * var(--ru));
  color: #323232;
  font-size: clamp(12px, calc(40 * var(--ru)), 40px);
  line-height: 1.2;
  text-align: left;
}
.classic-round-stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
#resultDialog.classic-round-panel > .classic-round-total {
  margin: 0 calc(20 * var(--ru));
  padding: calc(12 * var(--ru)) calc(22 * var(--ru));
  background: #ffea8f;
  align-content: center;
  min-height: calc(76 * var(--ru));
  text-align: center;
}
#resultDialog.classic-round-panel > #resultWait {
  margin: auto calc(24 * var(--ru)) 0;
  font-size: clamp(10px, calc(30 * var(--ru)), 29px);
  text-align: center;
}
#resultDialog.classic-round-panel > #resultWait:not([hidden]) ~ .dialog-actions { margin-top: 0; }
.classic-final-word { display: none; }
#resultDialog.classic-ending[open] {
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  border-radius: 0;
  background: transparent;
}
#resultDialog.classic-ending::backdrop { background: transparent; }
#resultDialog.classic-ending > :not(.classic-final-word) { display: none; }
#resultDialog.classic-ending > .classic-final-word {
  display: grid;
  place-items: center;
  align-self: stretch;
  justify-self: stretch;
  border: 0;
  outline-offset: -5px;
  background: transparent;
  color: #fff22e;
  font-size: min(27dvh, 17vw);
  font-family: 'ClassicMaru', 'Kosugi Maru', 'Yu Gothic', Meiryo, sans-serif;
  font-weight: 900;
  line-height: 1;
  text-shadow: .025em .042em 0 #251f11, -.012em -.012em 0 #251f11;
}

#loading.overlay {
  z-index: 6;
  padding: 0;
  background: #394553;
  color: #fff;
}
#loading .loading-box {
  width: min(90%, 48em);
  gap: .5em;
  font-family: 'ClassicMaru', 'Kosugi Maru', 'Yu Gothic', Meiryo, sans-serif;
}
#loading .loading-box img,
#loading .loading-box progress { display: none; }
#loading .loading-box b { font-size: clamp(12px, 2.1dvh, 22px); font-weight: 600; }
#loading.classic-loading-normal .loading-box b { font-size: 0; }
#loading.classic-loading-normal .loading-box b::after { content: 'ロード中…'; font-size: clamp(12px, 2.1dvh, 22px); }
#loading #cancelLoad {
  position: absolute;
  left: max(2vw, env(safe-area-inset-left));
  bottom: max(2vh, env(safe-area-inset-bottom));
  padding: .45em 1em;
  border: 1px solid #ffffff75;
  border-radius: 6px;
  background: #283646;
  color: #fff;
  font-size: clamp(12px, 2dvh, 18px);
}
@media (orientation: portrait) {
  .classic-round-panel,
  .classic-role-reveal { --ru: min(.08333333vw, .092592593dvh); }
}
