:root {
  --color-bg: #F8E9C1;
  --color-ink: #000000;
  --color-ink-soft: #333333;
  --color-accent: #E60012;
  --font-display: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --space-unit: 8px;
  /* ロゴ・数字・文言の共通幅。数字の大きさはこの幅を基準に決める */
  --block-w: min(72vw, 760px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--space-unit) * 3);
  padding: calc(var(--space-unit) * 4) calc(var(--space-unit) * 2)
           calc(calc(var(--space-unit) * 4) + env(safe-area-inset-bottom));
  text-align: center;
}

.logo {
  margin: 0;
  line-height: 0;
}

.logo img {
  width: var(--block-w);
  height: auto;
}

/* ===== 時計ブロック（PC: 1 行 / スマホ: 2 段） ===== */
.clock {
  width: var(--block-w);
  container-type: inline-size;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.num {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.clock-days {
  position: relative;
  display: flex;
  align-items: flex-end;
  line-height: 0.8;
}
.clock-days .num { font-size: clamp(4rem, 16vw, 12rem); }

.clock-time {
  display: flex;
  gap: calc(var(--space-unit) * 4);
}
.cell {
  position: relative;
  display: flex;
  align-items: flex-end;
  line-height: 0.9;
}
.cell .num {
  font-size: clamp(2.5rem, 10vw, 7.5rem);
  min-width: 2ch; /* 常に 2 桁分の幅（JS 側で 00 埋め） */
  text-align: center;
}

/* 数字に重なっても読めるよう、ベージュの縁取りを付けた英字ラベル */
.tag {
  position: absolute;
  right: 0;
  bottom: -0.35em;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-ink);
  paint-order: stroke fill;
  -webkit-text-stroke: 0.22em var(--color-bg);
  line-height: 1;
  pointer-events: none;
}
.clock-days .tag {
  bottom: 0.12em; /* 日数の数字に重ねる */
  right: 0.1em;
  font-size: clamp(1.2rem, 2.6vw, 2.4rem);
}
.cell .tag { font-size: clamp(0.6rem, 1.4vw, 1.2rem); }

/* 文言: ブロック幅に合わせて均等割付（11 文字） */
.note {
  margin: 0;
  width: var(--block-w);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(var(--block-w) / 10.2);
  letter-spacing: 0;
  line-height: 1;
  color: var(--color-ink);
  text-align: justify;
  text-align-last: justify;
  white-space: nowrap;
  padding-top: calc(var(--space-unit) * 1);
}

@supports (font-size: 1cqw) {
  .clock-days .num { font-size: 26cqw; }
  .cell .num       { font-size: 15cqw; }
  .clock-days .tag { font-size: 3.6cqw; }
  .cell .tag       { font-size: 1.9cqw; }
}

/* ===== スマホ: ロゴ / 日数 / 時分秒 / 文言 を縦に一塊 ===== */
@media (max-width: 600px) {
  :root { --block-w: min(86vw, 360px); }

  .stage {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    gap: calc(var(--space-unit) * 2);
    padding: calc(calc(var(--space-unit) * 3) + env(safe-area-inset-top))
             calc(var(--space-unit) * 2)
             calc(calc(var(--space-unit) * 3) + env(safe-area-inset-bottom));
  }

  .clock {
    flex-direction: column;
    align-items: stretch;
    gap: calc(var(--space-unit) * 2.5);
  }

  .clock-days {
    justify-content: center;
    line-height: 0.78;
  }
  .clock-days .num {
    font-size: clamp(8rem, 60vw, 15rem);
    letter-spacing: -0.04em;
  }

  .clock-time {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: calc(var(--space-unit) * 2);
  }
  .cell { justify-content: center; }
  .cell .num { font-size: clamp(2.5rem, 24vw, 6rem); }

  .clock-days .tag { font-size: clamp(1.4rem, 9vw, 2.2rem); }
  .cell .tag       { font-size: clamp(0.65rem, 4vw, 1rem); }

  @supports (font-size: 1cqw) {
    .clock-days .num { font-size: min(92cqw, 42dvh); }
    .cell .num       { font-size: min(26cqw, 12dvh); }
    .clock-days .tag { font-size: 10cqw; }
    .cell .tag       { font-size: 4.3cqw; }
  }
}
