/* ドットほどき（試作）。舞台は 720×1280 の縦長で、画面に合わせて縮める */
:root {
  --bg: #f3e6cf; --ink: #4a3426; --sub: #7d6352; --accent: #e8654a; --accent2: #c2452f; --card: #fffaf0;
  --font: "Hiragino Maru Gothic ProN", "M PLUS Rounded 1c", "Hiragino Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #e9d8bb; overscroll-behavior: none; overflow: hidden; }
body { font-family: var(--font); color: var(--ink); touch-action: manipulation; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }

#wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#stage { position: relative; width: 720px; height: 1280px; flex: none; transform-origin: 50% 50%; overflow: hidden;
  background: var(--bg); box-shadow: 0 0 60px rgba(90, 60, 30, .25); }
#cv { position: absolute; inset: 0; width: 720px; height: 1280px; touch-action: none; }

/* 上の帯 */
#bar { position: absolute; left: 0; right: 0; top: 0; height: 120px; padding: 34px 26px 0; display: flex; align-items: center; gap: 16px; z-index: 5; }
#bLv { flex: 1; text-align: center; font-size: 44px; font-weight: 800; letter-spacing: .04em; }
.rb { width: 76px; height: 76px; border-radius: 22px; border: none; background: var(--card); font-size: 40px; font-weight: 800;
  box-shadow: 0 6px 0 #d8c3a2, 0 8px 14px rgba(0,0,0,.12); }
.rb:active, .pill:active, .btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #d8c3a2; }
.rb.off { opacity: .45; }
.pill { height: 76px; padding: 0 22px; border-radius: 22px; border: none; background: var(--card); font-size: 32px; font-weight: 800;
  box-shadow: 0 6px 0 #d8c3a2, 0 8px 14px rgba(0,0,0,.12); }
.pill.on { background: #ffd977; }

/* 重ねる画面 */
.ov { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 10; padding: 60px 48px; text-align: center; }
.ov.on { display: flex; }
#title { background: radial-gradient(120% 80% at 50% 20%, #fff6e4, #f0dfc2); justify-content: flex-start; padding-top: 120px; }
.logo { margin: 0 0 24px; font-size: 88px; white-space: nowrap; line-height: 1.1; letter-spacing: .02em; }
.logo span { display: inline-block; padding: 0 6px; margin: 0 2px; border-radius: 18px; color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,.18); }
.logo span:nth-child(1) { background: #e8654a; } .logo span:nth-child(2) { background: #f2a33a; } .logo span:nth-child(3) { background: #5cb85c; }
.logo span:nth-child(4) { background: #3fa7d6; } .logo span:nth-child(5) { background: #8a6fd1; } .logo span:nth-child(6) { background: #e86aa0; }
.lead { font-size: 38px; line-height: 1.55; margin: 0 0 30px; font-weight: 700; }
.how { background: var(--card); border-radius: 28px; padding: 22px 30px; text-align: left; font-size: 30px; line-height: 1.55; box-shadow: 0 6px 0 #e0cba9; margin-bottom: 34px; }
.how p { margin: 8px 0; }
.btns { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; }
.btn { min-width: 460px; padding: 26px 40px; border: none; border-radius: 30px; background: var(--card); font-size: 40px; font-weight: 800;
  box-shadow: 0 8px 0 #d8c3a2, 0 10px 18px rgba(0,0,0,.12); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 0 var(--accent2), 0 10px 18px rgba(0,0,0,.15); }
.levels { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.levels button { width: 96px; height: 96px; border-radius: 24px; border: none; background: var(--card); font-size: 40px; font-weight: 800; box-shadow: 0 6px 0 #d8c3a2; }
.levels button.done { background: #ffe3a3; }
.levels button:disabled { opacity: .35; }
.font { margin-top: 34px; font-size: 30px; display: flex; align-items: center; gap: 10px; }
.fzb { padding: 12px 22px; border-radius: 18px; border: 3px solid #d8c3a2; background: var(--card); font-size: 30px; font-weight: 700; }
.fzb.on { background: #ffd977; border-color: #e0a92a; }
.note { margin-top: 22px; font-size: 26px; color: var(--sub); }

.card { background: var(--card); border-radius: 40px; padding: 44px 40px; width: 600px; display: flex; flex-direction: column; align-items: center; gap: 22px;
  box-shadow: 0 10px 0 #e0cba9, 0 20px 50px rgba(0,0,0,.25); }
#win, #stuck { background: rgba(70, 45, 25, .45); }
.big { font-size: 64px; font-weight: 900; margin: 0; color: var(--accent2); }
.sub { font-size: 38px; font-weight: 800; margin: 0; }
.info { font-size: 32px; line-height: 1.6; margin: 0; }
.info.small { font-size: 26px; color: var(--sub); }
#winPic { width: 360px; height: 360px; image-rendering: pixelated; border-radius: 20px; }

/* 文字の大きさ（大＝1.15倍、特大＝1.3倍） */
#stage.fz1 .how, #stage.fz1 .lead, #stage.fz1 .card .info, #stage.fz1 .card .sub, #stage.fz1 .hint p { zoom: 1.15; }
#stage.fz2 .how, #stage.fz2 .lead, #stage.fz2 .card .info, #stage.fz2 .card .sub, #stage.fz2 .hint p { zoom: 1.3; }
#stage.fz2 .how { padding: 14px 20px; }

/* 開き方の案内 */
.hint { display: none; position: absolute; left: 30px; right: 30px; top: 30px; background: #3c2a1e; color: #fff; border-radius: 24px; padding: 26px 80px 26px 30px;
  text-align: left; font-size: 30px; line-height: 1.55; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.hint.on { display: block; }
.hint p { margin: 0; }
.hint .x { position: absolute; right: 14px; top: 14px; width: 60px; height: 60px; border: none; border-radius: 30px; background: rgba(255,255,255,.15); color: #fff; font-size: 34px; }

#rotate { display: none; position: fixed; inset: 0; z-index: 50; background: #3c2a1e; color: #fff; font-size: 22px; font-weight: 700;
  align-items: center; justify-content: center; text-align: center; padding: 20px; }
#rotate.on { display: flex; }
/* 文字を大きくしたとき、タイトル画面が下にはみ出さないように詰める（それでも入らなければ指で動かせる） */
#title { overflow-y: auto; }
#stage.fz1 #title, #stage.fz2 #title { padding-top: 70px; }
#stage.fz2 .logo { font-size: 76px; margin-bottom: 14px; }
#stage.fz2 .lead { margin-bottom: 18px; }
#stage.fz2 .how { margin-bottom: 22px; }
#stage.fz2 .font { margin-top: 22px; }
