* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; background: #04050f; color: #eef2ff; overflow: hidden;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: none; overscroll-behavior: none;
}
button { font-family: inherit; }
#stage {
  position: absolute; left: 50%; top: 50%;
  width: var(--w, 450px); height: var(--h, 800px);
  transform: translate(-50%, -50%);
  overflow: hidden; background: #07081a;
  box-shadow: 0 0 60px rgba(80, 120, 255, .15);
}
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
}
.screen[hidden], .hint[hidden], .hud-btn[hidden], #rotate[hidden], button[hidden] { display: none !important; }
.screen.dim { background: rgba(4, 5, 20, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#title { justify-content: flex-start; overflow-y: auto; touch-action: pan-y; padding-bottom: calc(34px + env(safe-area-inset-bottom)); gap: 12px;
  background: linear-gradient(to bottom, rgba(7,8,26,0) 0%, rgba(7,8,26,.15) 40%, rgba(7,8,26,.82) 75%); }

.logo { margin-bottom: auto; padding-top: 8%; }
.logo h1 {
  margin: 4px 0 0; font-size: 64px; letter-spacing: .12em; font-weight: 900; line-height: 1.1;
  background: linear-gradient(180deg, #fff 0%, #bfe7ff 45%, #ff9ad5 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(120, 200, 255, .55));
}
.logo-sub { font-size: 14px; letter-spacing: .5em; color: #9fb4ff; font-weight: 700; }
.logo-line { height: 2px; width: 70%; margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, #7fe0ff, #ff7fc8, transparent); }

.how { background: rgba(10, 14, 40, .7); border: 1px solid rgba(140, 170, 255, .25); border-radius: 12px;
  padding: 10px 14px; text-align: left; font-size: 15px; line-height: 1.6; max-width: 400px; }
.how p { margin: 2px 0; }
.how b { color: #8fe3ff; display: inline-block; min-width: 3.6em; }
body.is-touch .pc, body:not(.is-touch) .touch { display: none; }

button.big, button.mid {
  border: 0; border-radius: 999px; cursor: pointer; font-weight: 800; color: #0b0d22;
  background: linear-gradient(180deg, #ffffff, #a9e6ff); box-shadow: 0 0 24px rgba(120, 210, 255, .45);
  letter-spacing: .08em;
}
button.big { font-size: 22px; padding: 14px 46px; min-width: 240px; }
button.mid { font-size: 17px; padding: 11px 28px; min-width: 200px; background: rgba(255,255,255,.12);
  color: #eef2ff; box-shadow: none; border: 1px solid rgba(255,255,255,.35); }
button.big:active, button.mid:active { transform: scale(.97); }
.row { display: flex; gap: 10px; }
.hi { font-size: 16px; color: #ffd86b; letter-spacing: .06em; font-weight: 700; }

.opts { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.opt { display: flex; align-items: center; gap: 6px; justify-content: center; }
.opt span { margin-right: 4px; color: #c4ccf0; }
.opt button { font-size: 14px; padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.06); color: #eef2ff; cursor: pointer; }
.opt button.on { background: #a9e6ff; color: #0b0d22; border-color: #a9e6ff; font-weight: 800; }

.hint { position: relative; width: 100%; max-width: 420px; flex: none;
  background: rgba(255, 230, 120, .96); color: #221a00; border-radius: 10px; padding: 12px 40px 12px 14px;
  font-size: 15px; line-height: 1.5; text-align: left; font-weight: 600; z-index: 5; }
.hint-x { position: absolute; right: 4px; top: 4px; width: 34px; height: 34px; border: 0; background: none;
  font-size: 22px; color: #221a00; cursor: pointer; }

h2 { margin: 0 0 6px; font-size: 34px; letter-spacing: .1em; color: #fff;
  text-shadow: 0 0 18px rgba(120, 200, 255, .7); }
.res { font-size: 18px; line-height: 1.8; margin-bottom: 8px; }
.res .big-num { font-size: 32px; font-weight: 900; color: #ffd86b; }
.clear-msg { font-size: 18px; margin: 0; color: #cfe8ff; }

.hud-btn { position: absolute; border: 1px solid rgba(255,255,255,.35); color: #fff; cursor: pointer;
  background: rgba(20, 24, 60, .45); font-weight: 800; z-index: 3; }
#btn-pause { top: calc(4px + env(safe-area-inset-top)); right: 6px; width: 44px; height: 44px; border-radius: 10px; font-size: 16px; }
#btn-bomb { right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 76px; height: 76px; border-radius: 50%;
  font-size: 18px; background: radial-gradient(circle at 40% 35%, rgba(255,140,200,.55), rgba(120,30,90,.45));
  border-color: rgba(255,170,220,.7); }
#btn-bomb.empty { opacity: .3; }

#rotate { position: fixed; inset: 0; background: #04050f; z-index: 50; display: flex; align-items: center;
  justify-content: center; font-size: 20px; font-weight: 700; text-align: center; padding: 20px; }

/* 文字の大きさ */
.fz1 .screen > *, .fz1 .hint { zoom: 1.15; }
.fz2 .screen > *, .fz2 .hint { zoom: 1.3; }
.fz2 .how { max-width: 330px; }
.fz2 #title { gap: 8px; }
.fz2 .logo h1 { font-size: 46px; }
.fz1 .logo-sub, .fz2 .logo-sub { display: none; }
.fz2 .how { line-height: 1.45; }

/* タイトルの演出 */
.logo h1 { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; animation: logoIn 1.2s cubic-bezier(.2,.8,.2,1) both; }
.logo-sub { animation: fadeIn 1.2s .3s both; }
.logo-line { animation: lineIn 1s .5s both; }
.logo-tag { margin-top: 10px; font-size: 15px; color: #ffe2f1; letter-spacing: .2em; font-weight: 700;
  text-shadow: 0 0 10px rgba(255,120,200,.6); animation: fadeIn 1.2s .8s both; }
#btn-start { animation: pulse 2.2s ease-in-out infinite; }
@keyframes logoIn { from { opacity: 0; transform: translateY(18px) scale(.96); letter-spacing: .4em; } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lineIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 18px rgba(120,210,255,.4); } 50% { box-shadow: 0 0 36px rgba(255,140,210,.75); } }

/* タイトルの並び（絵を見せる） */
#title { justify-content: flex-start; gap: 10px; padding-top: calc(16px + env(safe-area-inset-top));
  background: linear-gradient(to bottom, rgba(7,8,26,.25) 0%, rgba(7,8,26,0) 30%, rgba(7,8,26,0) 55%, rgba(7,8,26,.75) 85%); }
.logo { padding-top: 4%; }
.logo h1 { text-shadow: none; filter: drop-shadow(0 2px 0 rgba(90,20,60,.6)) drop-shadow(0 0 16px rgba(255,150,210,.6)); }
.logo-sub, .logo-tag { text-shadow: 0 1px 6px rgba(60,10,40,.9); }
.logo-sub { color: #fff; }
.menu { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: auto; }
.lead { font-size: 15px; color: #fff; font-weight: 700; text-shadow: 0 1px 6px rgba(0,0,0,.9); }
button.sm { font-size: 15px; padding: 8px 18px; min-width: 120px; background: rgba(10,10,30,.55); }
.opt .sep { width: 10px; }
#howto .how { max-width: 400px; font-size: 16px; }
#howto .how p { margin: 8px 0; }
#howto .how b { display: block; min-width: 0; }
.opt button { white-space: nowrap; }
.opts { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
.logo h1 { white-space: nowrap; }
/* 題字：明るい空の上でも読めるように */
.logo h1 { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: #fff; filter: none;
  text-shadow: 0 0 2px #4a0f3a, 0 2px 0 #6a1550, 0 4px 0 #3a0a2a, 0 0 22px rgba(255,90,170,.85), 0 0 48px rgba(255,140,90,.6); }
.logo-sub { color: #fff; text-shadow: 0 0 2px #4a0f3a, 0 1px 3px #4a0f3a, 0 0 10px rgba(80,10,50,.8); }
.logo-tag { color: #fff; text-shadow: 0 0 2px #4a0f3a, 0 1px 3px #4a0f3a, 0 0 12px rgba(255,80,160,.9); }
.opt.diff button { font-size: 15px; padding: 7px 12px; }
.diff-note { font-size: 13px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.95); margin-top: -4px; min-height: 1.2em; }
