* { box-sizing: border-box; }
:root {
  --ink: #1b1d1a;
  --muted: #6b7068;
  --line: #e3e5e0;
  --accent: #5f8f1f;
  --accent-soft: #eef6dc;
}
html, body { height: 100%; }
body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.deck {
  height: 100dvh;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

/* ---------- top bar ---------- */
.topbar {
  flex: 0 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--muted);
}
.brand b { color: var(--ink); font-weight: 700; }
.counter { font-variant-numeric: tabular-nums; letter-spacing: .08em; }

/* ---------- image stage ---------- */
.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}
.stage-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade .25s ease;
}
.stage-inner img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.title-card { text-align: center; padding: 24px; }
.title-card .kicker { font-size: 13px; letter-spacing: .2em; color: var(--accent); font-weight: 700; margin-bottom: 18px; }
.title-card h1 { margin: 0; font-size: clamp(40px, 7vw, 84px); line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.title-card .sub { margin-top: 20px; font-size: clamp(16px, 2vw, 24px); color: var(--muted); }
.fallback { text-align: center; color: var(--muted); font-size: 14px; }
.fallback b { display: block; font-size: 28px; color: #a0a69a; margin-bottom: 6px; }

/* ---------- text box ---------- */
.textbox {
  flex: 0 0 auto;
  margin-top: 16px;
  padding: 20px 26px 22px;
  max-height: 36vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 2px 0 var(--ink);
}
.textbox h2 {
  margin: 0 0 10px;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 1.4;
}
.textbox h2::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 1em;
  margin-right: 10px;
  vertical-align: -.12em;
  border-radius: 2px;
  background: var(--accent);
}
.textbox p {
  margin: 0;
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.9;
  color: #33362f;
}

/* ---------- controls ---------- */
.controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0 18px;
}
.btn {
  font: inherit;
  font-size: 14px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .35; cursor: default; border-color: var(--line); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #000; }
.btn-primary:disabled { background: var(--ink); }
.btn-icon { padding: 10px 12px; }
.progress { flex: 1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 700px) {
  .deck { padding: 0 14px; }
  .topbar { height: 44px; }
  .textbox { padding: 16px 18px 18px; max-height: 40vh; }
  .btn { padding: 10px 14px; }
  #full { display: none; }
}
