@font-face {
  font-family: "OneSevenSeg";
  src: url("./7seg.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #000;
  --fg: #fff;
  --digit-off: #111;
  --digit-on: #f3f3f3;
  --frame: #fff;
  --frame-off: #333;
  --page-max: 900px;

  --pad-x: clamp(12px, 4.4vw, 52px);
  --pad-y: clamp(16px, 3.6svh, 52px);
  --gap-a: clamp(12px, 2.6svh, 34px);
  --gap-b: clamp(14px, 3.2svh, 42px);
}

.biz-udpmincho-regular {
  font-family: "BIZ UDPMincho", serif;
  font-weight: 400;
  font-style: normal;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: "BIZ UDPMincho", serif;
}

button {
  color: inherit;
  font: inherit;
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  opacity: 1;
  transition: opacity .85s ease, filter .85s ease;
}

.intro-screen.hide {
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
}

.intro-text {
  font-size: clamp(24px, 7vw, 64px);
  font-weight: 650;
  letter-spacing: .08em;
  text-align: center;
  padding-inline: 24px;
}

.one-app {
  position: relative;
  width: min(100vw, var(--page-max));
  height: 100svh;
  max-height: 100svh;
  margin: 0 auto;
  padding:
    calc(var(--pad-y) + env(safe-area-inset-top))
    var(--pad-x)
    calc(var(--pad-y) + env(safe-area-inset-bottom));
  background: #000;
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: center;
  gap: var(--gap-b);
  overflow: hidden;
}

.top-meters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(10px, 3.6vw, 34px);
  align-items: end;
  min-height: 0;
}

.meter {
  min-width: 0;
}

.meter h2,
.main-meter h1,
.answer-meter h1 {
  margin: 0 0 clamp(6px, 1.4svh, 12px);
  text-align: center;
  font-weight: 650;
  letter-spacing: .03em;
  line-height: 1;
}

.meter h2 {
  font-size: clamp(15px, 4vw, 38px);
  white-space: nowrap;
}

.main-meter h1,
.answer-meter h1 {
  font-family: "BIZ UDPMincho", serif;
  font-size: clamp(30px, 6.6vw, 62px);
  font-weight: 400;
  letter-spacing: .02em;
}

.frame {
  width: 100%;
  border: clamp(3px, .68vw, 5px) solid var(--frame);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  appearance: none;
  border-radius: 0;
  overflow: hidden;
  transition: border-color .14s ease, opacity .14s ease, filter .14s ease;
}

.frame.off {
  border-color: var(--frame-off);
}

.frame.off .digits {
  visibility: hidden;
}

.meter .frame {
  height: clamp(58px, 13.2vw, 126px);
  padding-inline: clamp(4px, 1.1vw, 10px);
}

.time-frame {
  height: clamp(92px, 22vw, 194px);
  padding-inline: clamp(7px, 1.8vw, 20px);
}

.answer-frame {
  height: clamp(86px, 20vw, 174px);
  padding-inline: clamp(7px, 1.8vw, 20px);
}

.digits {
  font-family: "OneSevenSeg", "DSEG7 Classic", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  line-height: .9;
  color: var(--digit-on);
  text-shadow: 0 0 1px #fff;
  user-select: none;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  white-space: nowrap;
  max-width: 100%;
}

.small-digits {
  font-size: clamp(36px, 9.9vw, 96px);
  letter-spacing: -.05em;
  transform: scaleX(.86);
  transform-origin: center;
}

.time-digits {
  width: 100%;
  gap: clamp(10px, 3.2vw, 32px);
  letter-spacing: -.03em;
}

.time-main {
  display: inline-flex;
  gap: clamp(8px, 2.2vw, 26px);
  font-size: clamp(50px, 12.8vw, 118px);
  line-height: .85;
}

.time-sec {
  font-size: clamp(27px, 6.9vw, 62px);
  line-height: .85;
  margin-left: clamp(6px, 1.6vw, 16px);
}

.answer-digits {
  font-size: clamp(54px, 13.8vw, 122px);
  letter-spacing: .02em;
}

.ghost {
  color: var(--digit-off);
  text-shadow: none;
}

.button-area {
  display: flex;
  justify-content: center;
  align-items: center;
}

.button-box {
  width: clamp(86px, 18vw, 124px);
  height: clamp(86px, 18vw, 124px);
  border: clamp(3px, .68vw, 5px) solid var(--frame);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.round-button {
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: clamp(3px, .64vw, 5px) solid #fff;
  background: #fff;
  box-shadow:
    inset 0 -10px 18px rgba(0, 0, 0, .30),
    0 0 0 0 rgba(255, 255, 255, .55);
  cursor: pointer;
  transition: transform .06s ease, filter .12s ease, box-shadow .12s ease;
}

.round-button:active {
  transform: translateY(3px) scale(.94);
  filter: brightness(.78);
}

.round-button:disabled {
  cursor: default;
  opacity: .25;
}

.message {
  z-index: 20;
  position: fixed;
  inset: auto 0 calc(16px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  pointer-events: none;
  font-size: clamp(20px, 4.8vw, 40px);
  font-weight: 700;
  letter-spacing: .12em;
  min-height: 1.4em;
}

.message.clear {
  color: #fff;
  text-shadow: 0 0 16px rgba(255, 255, 255, .65);
}

@media (max-width: 560px) {
  :root {
    --pad-x: clamp(10px, 3.6vw, 18px);
    --pad-y: clamp(12px, 2.6svh, 26px);
    --gap-b: clamp(14px, 3svh, 28px);
  }

  .one-app {
    align-content: center;
  }

  .meter h2 {
    font-size: clamp(14px, 4vw, 22px);
  }

  .meter .frame {
    height: clamp(54px, 16svh, 86px);
  }

  .small-digits {
    font-size: clamp(34px, 11.4vw, 60px);
    transform: scaleX(.80);
  }

  .main-meter h1,
  .answer-meter h1 {
    font-size: clamp(28px, 9vw, 46px);
  }

  .time-frame {
    height: clamp(88px, 20svh, 136px);
  }

  .answer-frame {
    height: clamp(82px, 18svh, 126px);
  }

  .time-main {
    font-size: clamp(43px, 14vw, 70px);
    gap: clamp(7px, 2.6vw, 14px);
  }

  .time-sec {
    font-size: clamp(24px, 7.6vw, 38px);
    margin-left: 5px;
  }

  .answer-digits {
    font-size: clamp(48px, 15vw, 74px);
  }

  .button-box {
    width: min(56vw, 208px);
    min-width: 136px;
    max-height: 82px;
  }
}

@media (max-height: 680px) {
  :root {
    --pad-y: clamp(8px, 1.7svh, 16px);
    --gap-b: clamp(8px, 2svh, 18px);
  }

  .meter h2,
  .main-meter h1,
  .answer-meter h1 {
    margin-bottom: 5px;
  }

  .meter .frame {
    height: clamp(46px, 12svh, 74px);
  }

  .time-frame {
    height: clamp(72px, 20svh, 116px);
  }

  .answer-frame {
    height: clamp(68px, 18svh, 104px);
  }

  .small-digits {
    font-size: clamp(30px, 10vw, 54px);
  }

  .time-main {
    font-size: clamp(38px, 13vw, 72px);
  }

  .time-sec {
    font-size: clamp(22px, 7vw, 40px);
  }

  .answer-digits {
    font-size: clamp(42px, 13vw, 70px);
  }

  .button-box {
    width: min(42vw, 188px);
    min-width: 126px;
    max-height: 68px;
  }

  .round-button {
    width: min(38%, 58px);
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  :root {
    --page-max: 760px;
    --pad-x: clamp(24px, 5vw, 54px);
    --pad-y: clamp(7px, 1.8svh, 14px);
    --gap-b: clamp(7px, 2svh, 16px);
  }

  .meter h2 {
    font-size: clamp(14px, 3.3vh, 22px);
  }

  .main-meter h1,
  .answer-meter h1 {
    font-size: clamp(24px, 6vh, 36px);
  }

  .meter .frame {
    height: clamp(40px, 14vh, 70px);
  }

  .time-frame {
    height: clamp(58px, 22vh, 105px);
  }

  .answer-frame {
    height: clamp(54px, 20vh, 92px);
  }

  .small-digits {
    font-size: clamp(30px, 11vh, 52px);
    transform: scaleX(.86);
  }

  .time-main {
    font-size: clamp(42px, 15vh, 70px);
    gap: clamp(8px, 3vh, 18px);
  }

  .time-sec {
    font-size: clamp(22px, 8vh, 38px);
  }

  .answer-digits {
    font-size: clamp(42px, 14vh, 68px);
  }

  .button-box {
    width: min(24vw, 170px);
    min-width: 118px;
    max-height: 62px;
  }

  .round-button {
    width: min(36%, 50px);
  }

  .message {
    font-size: clamp(18px, 5vh, 32px);
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --page-max: 700px;
    --gap-b: 6px;
  }

  .main-meter h1,
  .answer-meter h1,
  .meter h2 {
    margin-bottom: 3px;
  }

  .meter .frame {
    height: 38px;
  }

  .time-frame {
    height: 54px;
  }

  .answer-frame {
    height: 50px;
  }

  .small-digits {
    font-size: 30px;
  }

  .time-main {
    font-size: 42px;
  }

  .time-sec {
    font-size: 22px;
  }

  .answer-digits {
    font-size: 42px;
  }

  .button-box {
    width: 126px;
    min-width: 126px;
    max-height: 48px;
  }

  .round-button {
    width: 34%;
  }
}


.clear-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(18px, 5vw, 42px);
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, .10), transparent 34%),
    rgba(0, 0, 0, .84);
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s ease;
}

.clear-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.clear-modal__panel {
  width: min(88vw, 520px);
  border: clamp(3px, .7vw, 5px) solid #fff;
  background: #000;
  padding: clamp(22px, 5vw, 44px);
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .22),
    0 0 42px rgba(255, 255, 255, .18),
    inset 0 0 38px rgba(255, 255, 255, .055);
  transform: translateY(12px) scale(.985);
  transition: transform .32s ease;
}

.clear-modal.show .clear-modal__panel {
  transform: translateY(0) scale(1);
}

.clear-modal__label {
  display: inline-block;
  margin-bottom: clamp(10px, 2.2vw, 18px);
  padding: .35em .7em;
  border: 2px solid #fff;
  font-size: clamp(11px, 2.4vw, 14px);
  letter-spacing: .18em;
  line-height: 1;
}

.clear-modal__title {
  margin: 0;
  font-family: "OneSevenSeg", "DSEG7 Classic", "Courier New", monospace;
  font-size: clamp(48px, 12vw, 88px);
  line-height: .82;
  font-weight: 400;
  letter-spacing: .04em;
  text-shadow: 0 0 12px rgba(255, 255, 255, .38);
}

.clear-modal__text {
  margin: clamp(16px, 4vw, 28px) 0 0;
  font-size: clamp(15px, 3.8vw, 21px);
  line-height: 1.7;
  letter-spacing: .04em;
}

.clear-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 3vw, 18px);
  margin-top: clamp(22px, 5vw, 34px);
}

.modal-button {
  min-height: clamp(48px, 10vw, 58px);
  border: 3px solid #fff;
  background: #000;
  color: #fff;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .12em;
  transition: background .14s ease, color .14s ease, transform .08s ease, box-shadow .14s ease;
}

.modal-button--primary,
.modal-button:hover,
.modal-button:focus-visible {
  background: #fff;
  color: #000;
  box-shadow: 0 0 24px rgba(255, 255, 255, .22);
}

.modal-button:active {
  transform: translateY(2px) scale(.985);
}

@media (max-width: 420px) {
  .clear-modal__actions {
    grid-template-columns: 1fr;
  }

  .clear-modal__panel {
    width: min(92vw, 420px);
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .clear-modal__panel {
    width: min(72vw, 520px);
    padding: 18px 28px;
  }

  .clear-modal__label {
    margin-bottom: 8px;
  }

  .clear-modal__title {
    font-size: clamp(42px, 12vh, 64px);
  }

  .clear-modal__text {
    margin-top: 10px;
    font-size: clamp(13px, 3.6vh, 17px);
    line-height: 1.45;
  }

  .clear-modal__actions {
    margin-top: 14px;
  }

  .modal-button {
    min-height: 42px;
  }
}


/* UI update: lower button frame is a compact square around the round button */
.button-box {
  width: clamp(86px, 18vw, 124px);
  height: clamp(86px, 18vw, 124px);
  min-width: 0;
  max-height: none;
  aspect-ratio: 1 / 1;
}

.round-button {
  width: 62%;
}

@media (max-width: 560px) {
  .button-box {
    width: clamp(74px, 24vw, 104px);
    height: clamp(74px, 24vw, 104px);
    min-width: 0;
    max-height: none;
  }
}

@media (max-height: 680px) {
  .button-box {
    width: clamp(62px, 16svh, 86px);
    height: clamp(62px, 16svh, 86px);
    min-width: 0;
    max-height: none;
  }

  .round-button {
    width: 60%;
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  .button-box {
    width: clamp(54px, 18vh, 78px);
    height: clamp(54px, 18vh, 78px);
    min-width: 0;
    max-height: none;
  }

  .round-button {
    width: 58%;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .button-box {
    width: 52px;
    height: 52px;
    min-width: 0;
    max-height: none;
  }

  .round-button {
    width: 56%;
  }
}


.rule-button {
  position: fixed;
  z-index: 80;
  top: calc(14px + env(safe-area-inset-top));
  left: calc(14px + env(safe-area-inset-left));
  width: clamp(38px, 8vw, 52px);
  height: clamp(38px, 8vw, 52px);
  border: 2px solid #fff;
  border-radius: 50%;
  background: #000;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: clamp(22px, 5vw, 31px);
  line-height: 1;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .12),
    0 0 22px rgba(255, 255, 255, .12);
  transition: background .14s ease, color .14s ease, transform .08s ease, box-shadow .14s ease;
}

.rule-button:hover,
.rule-button:focus-visible {
  background: #fff;
  color: #000;
  box-shadow: 0 0 28px rgba(255, 255, 255, .22);
}

.rule-button:active {
  transform: translateY(2px) scale(.96);
}

.rule-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: clamp(18px, 5vw, 42px);
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, .09), transparent 36%),
    rgba(0, 0, 0, .86);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}

.rule-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.rule-modal__panel {
  position: relative;
  width: min(88vw, 560px);
  max-height: min(82svh, 620px);
  overflow: auto;
  border: clamp(3px, .7vw, 5px) solid #fff;
  background: #000;
  padding: clamp(26px, 5vw, 48px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .20),
    0 0 42px rgba(255, 255, 255, .16),
    inset 0 0 38px rgba(255, 255, 255, .055);
  transform: translateY(10px) scale(.985);
  transition: transform .28s ease;
}

.rule-modal.show .rule-modal__panel {
  transform: translateY(0) scale(1);
}

.rule-modal__close {
  position: absolute;
  top: clamp(10px, 2.2vw, 16px);
  right: clamp(10px, 2.2vw, 16px);
  width: clamp(34px, 7vw, 44px);
  height: clamp(34px, 7vw, 44px);
  border: 2px solid #fff;
  background: #000;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: clamp(20px, 4vw, 28px);
  line-height: 1;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, transform .08s ease;
}

.rule-modal__close:hover,
.rule-modal__close:focus-visible {
  background: #fff;
  color: #000;
}

.rule-modal__close:active {
  transform: translateY(2px) scale(.96);
}

.rule-modal__title {
  margin: 0 0 clamp(22px, 5vw, 34px);
  padding-right: 42px;
  font-size: clamp(42px, 11vw, 76px);
  line-height: 1;
  font-weight: 400;
  letter-spacing: .08em;
  text-shadow: 0 0 14px rgba(255, 255, 255, .24);
}

.rule-section {
  margin-top: clamp(18px, 4vw, 28px);
  padding-top: clamp(14px, 3vw, 20px);
  border-top: 1px solid rgba(255, 255, 255, .62);
}

.rule-section__title {
  display: inline-block;
  margin: 0 0 clamp(10px, 2.4vw, 14px);
  padding: .28em .65em;
  border: 2px solid #fff;
  font-size: clamp(16px, 4vw, 22px);
  line-height: 1;
  font-weight: 400;
  letter-spacing: .12em;
  background: #fff;
  color: #000;
}

.rule-section p,
.rule-section li {
  font-size: clamp(15px, 3.8vw, 20px);
  line-height: 1.8;
  letter-spacing: .04em;
}

.rule-section p {
  margin: 0;
}

.rule-section ul {
  margin: 0;
  padding-left: 1.35em;
}

.rule-modal__actions {
  margin-top: clamp(22px, 5vw, 34px);
  display: flex;
  justify-content: center;
}

.rule-modal__actions .modal-button {
  width: min(100%, 320px);
  min-height: 54px;
}

@media (max-width: 420px) {
  .rule-modal__panel {
    width: min(92vw, 420px);
    padding: 24px 20px;
  }

  .rule-modal__title {
    padding-right: 38px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .rule-button {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .rule-modal__panel {
    width: min(74vw, 560px);
    max-height: 88svh;
    padding: 18px 28px;
  }

  .rule-modal__title {
    margin-bottom: 14px;
    font-size: clamp(34px, 10vh, 54px);
  }

  .rule-section {
    margin-top: 12px;
    padding-top: 10px;
  }

  .rule-section__title {
    font-size: clamp(14px, 3.6vh, 18px);
    margin-bottom: 8px;
  }

  .rule-section p,
  .rule-section li {
    font-size: clamp(13px, 3.6vh, 16px);
    line-height: 1.55;
  }
}


/* iPad landscape fix
   1024x768 / 1180x820 / 1366x1024 付近で、縦方向の詰まりと横方向の伸びすぎを抑える */
@media (orientation: landscape) and (min-width: 900px) and (max-width: 1400px) and (min-height: 650px) and (max-height: 1050px) {
  :root {
    --page-max: 760px;
    --pad-x: clamp(30px, 4vw, 48px);
    --pad-y: clamp(18px, 2.4svh, 30px);
    --gap-b: clamp(12px, 2.1svh, 20px);
  }

  .one-app {
    align-content: center;
    height: 100svh;
    max-height: 100svh;
  }

  .top-meters {
    gap: clamp(18px, 3vw, 28px);
  }

  .meter h2 {
    font-size: clamp(22px, 3.1vw, 32px);
    margin-bottom: 8px;
  }

  .main-meter h1,
  .answer-meter h1 {
    font-size: clamp(34px, 4.8vw, 48px);
    margin-bottom: 8px;
  }

  .meter .frame {
    height: clamp(82px, 12.5svh, 112px);
  }

  .small-digits {
    font-size: clamp(58px, 8.8vw, 82px);
    transform: scaleX(.86);
    letter-spacing: -.055em;
  }

  .time-frame {
    height: clamp(126px, 18svh, 154px);
  }

  .time-main {
    font-size: clamp(76px, 10vw, 104px);
    gap: clamp(14px, 2vw, 24px);
  }

  .time-sec {
    font-size: clamp(42px, 5.4vw, 58px);
    margin-left: clamp(8px, 1.2vw, 14px);
  }

  .answer-frame {
    height: clamp(112px, 16svh, 140px);
  }

  .answer-digits {
    font-size: clamp(74px, 9.8vw, 100px);
  }

  .button-area {
    min-height: 0;
  }

  .button-box {
    width: clamp(78px, 9vw, 104px);
    height: clamp(78px, 9vw, 104px);
    min-width: 0;
    max-height: none;
    aspect-ratio: 1 / 1;
  }

  .round-button {
    width: 60%;
  }

  .rule-button {
    width: clamp(40px, 4.2vw, 50px);
    height: clamp(40px, 4.2vw, 50px);
    font-size: clamp(22px, 2.7vw, 28px);
  }

  .intro-text {
    font-size: clamp(36px, 5vw, 56px);
  }
}

/* iPad mini / split view に近い横画面向けの追加圧縮 */
@media (orientation: landscape) and (min-width: 900px) and (max-height: 760px) {
  :root {
    --page-max: 720px;
    --pad-y: clamp(10px, 1.8svh, 18px);
    --gap-b: clamp(8px, 1.6svh, 14px);
  }

  .meter h2,
  .main-meter h1,
  .answer-meter h1 {
    margin-bottom: 5px;
  }

  .meter .frame {
    height: clamp(62px, 10.5svh, 82px);
  }

  .small-digits {
    font-size: clamp(46px, 7.2vw, 64px);
  }

  .time-frame {
    height: clamp(88px, 15svh, 116px);
  }

  .time-main {
    font-size: clamp(58px, 8.5vw, 78px);
  }

  .time-sec {
    font-size: clamp(32px, 4.8vw, 44px);
  }

  .answer-frame {
    height: clamp(82px, 14svh, 104px);
  }

  .answer-digits {
    font-size: clamp(56px, 8vw, 76px);
  }

  .button-box {
    width: clamp(58px, 8vw, 76px);
    height: clamp(58px, 8vw, 76px);
  }
}


/* PC / wide landscape layout
   横長画面では縦積みをやめ、左に CLEAR/PRESS/TIME、右に ANSWER/ボタンを配置する */
@media (orientation: landscape) and (min-width: 1100px) and (min-aspect-ratio: 16/10) {
  :root {
    --page-max: none;
    --pad-x: clamp(48px, 5vw, 96px);
    --pad-y: clamp(22px, 4svh, 54px);
    --gap-b: clamp(18px, 3svh, 34px);
  }

  .one-app {
    width: 100vw;
    height: 100svh;
    max-height: 100svh;
    padding:
      calc(var(--pad-y) + env(safe-area-inset-top))
      var(--pad-x)
      calc(var(--pad-y) + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: minmax(520px, 1.08fr) minmax(430px, .92fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "top answer"
      "time answer"
      "time button";
    align-items: center;
    align-content: center;
    column-gap: clamp(44px, 6vw, 96px);
    row-gap: clamp(18px, 3vh, 34px);
    overflow: hidden;
  }

  .top-meters {
    grid-area: top;
    align-self: end;
    gap: clamp(18px, 2.4vw, 34px);
  }

  .main-meter {
    grid-area: time;
    align-self: start;
    margin-top: 0;
  }

  .answer-meter {
    grid-area: answer;
    align-self: end;
    margin-top: 0;
  }

  .button-area {
    grid-area: button;
    align-self: start;
    justify-content: center;
  }

  .meter h2 {
    font-size: clamp(28px, 3vw, 48px);
    margin-bottom: clamp(8px, 1.4vh, 14px);
  }

  .main-meter h1,
  .answer-meter h1 {
    font-size: clamp(44px, 4.5vw, 74px);
    margin-bottom: clamp(8px, 1.5vh, 16px);
  }

  .meter .frame {
    height: clamp(92px, 15vh, 140px);
  }

  .small-digits {
    font-size: clamp(64px, 7.2vw, 108px);
    transform: scaleX(.82);
    letter-spacing: -.06em;
  }

  .time-frame {
    height: clamp(200px, 34vh, 300px);
  }

  .time-main {
    font-size: clamp(90px, 9.5vw, 154px);
    gap: clamp(16px, 1.8vw, 30px);
  }

  .time-sec {
    font-size: clamp(48px, 5.1vw, 82px);
    margin-left: clamp(10px, 1.2vw, 20px);
  }

  .answer-frame {
    height: clamp(170px, 29vh, 260px);
  }

  .answer-digits {
    font-size: clamp(90px, 9.2vw, 146px);
  }

  .button-box {
    width: clamp(96px, 8.5vw, 136px);
    height: clamp(96px, 8.5vw, 136px);
    min-width: 0;
    max-height: none;
    aspect-ratio: 1 / 1;
  }

  .round-button {
    width: 60%;
  }

  .rule-button {
    width: clamp(42px, 3.8vw, 56px);
    height: clamp(42px, 3.8vw, 56px);
    font-size: clamp(24px, 2.5vw, 32px);
  }

  .message {
    font-size: clamp(22px, 2.5vw, 42px);
  }
}

/* browser chrome が高くて縦が少し狭いPC横画面向け */
@media (orientation: landscape) and (min-width: 1100px) and (max-height: 760px) and (min-aspect-ratio: 16/10) {
  :root {
    --pad-y: clamp(12px, 2.2svh, 24px);
  }

  .one-app {
    grid-template-columns: minmax(500px, 1.05fr) minmax(400px, .95fr);
    column-gap: clamp(34px, 4.8vw, 72px);
    row-gap: clamp(10px, 2vh, 20px);
  }

  .meter h2 {
    font-size: clamp(24px, 3.5vh, 34px);
    margin-bottom: 6px;
  }

  .main-meter h1,
  .answer-meter h1 {
    font-size: clamp(36px, 6vh, 54px);
    margin-bottom: 6px;
  }

  .meter .frame {
    height: clamp(64px, 13vh, 92px);
  }

  .small-digits {
    font-size: clamp(48px, 8.5vh, 70px);
  }

  .time-frame {
    height: clamp(130px, 28vh, 190px);
  }

  .time-main {
    font-size: clamp(66px, 13vh, 104px);
  }

  .time-sec {
    font-size: clamp(36px, 7vh, 56px);
  }

  .answer-frame {
    height: clamp(116px, 25vh, 168px);
  }

  .answer-digits {
    font-size: clamp(64px, 12vh, 96px);
  }

  .button-box {
    width: clamp(72px, 11vh, 96px);
    height: clamp(72px, 11vh, 96px);
  }
}

/* 横長だけど幅がやや狭いタブレット/小型ノート用 */
@media (orientation: landscape) and (min-width: 900px) and (max-width: 1099px) {
  :root {
    --page-max: none;
    --pad-x: clamp(28px, 4vw, 52px);
    --pad-y: clamp(10px, 2svh, 22px);
    --gap-b: clamp(8px, 1.8svh, 16px);
  }

  .one-app {
    width: 100vw;
    height: 100svh;
    max-height: 100svh;
    display: grid;
    grid-template-columns: minmax(410px, 1fr) minmax(340px, .9fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "top answer"
      "time answer"
      "time button";
    align-items: center;
    align-content: center;
    column-gap: clamp(24px, 4vw, 48px);
    row-gap: clamp(8px, 1.8vh, 16px);
    overflow: hidden;
  }

  .top-meters {
    grid-area: top;
  }

  .main-meter {
    grid-area: time;
    margin-top: 0;
  }

  .answer-meter {
    grid-area: answer;
    margin-top: 0;
  }

  .button-area {
    grid-area: button;
    align-self: start;
    justify-content: center;
  }

  .meter h2 {
    font-size: clamp(20px, 3.2vh, 28px);
    margin-bottom: 5px;
  }

  .main-meter h1,
  .answer-meter h1 {
    font-size: clamp(30px, 5.4vh, 44px);
    margin-bottom: 5px;
  }

  .meter .frame {
    height: clamp(58px, 12vh, 82px);
  }

  .small-digits {
    font-size: clamp(42px, 7.8vh, 62px);
  }

  .time-frame {
    height: clamp(108px, 24vh, 160px);
  }

  .time-main {
    font-size: clamp(58px, 11vh, 86px);
  }

  .time-sec {
    font-size: clamp(32px, 6vh, 46px);
  }

  .answer-frame {
    height: clamp(102px, 22vh, 150px);
  }

  .answer-digits {
    font-size: clamp(58px, 10.5vh, 84px);
  }

  .button-box {
    width: clamp(64px, 11vh, 88px);
    height: clamp(64px, 11vh, 88px);
    min-width: 0;
    max-height: none;
  }

}
