/* 暇つぶしゲーム100 WEB体験版 — アプリと同じ見た目（クリーム地・黒い太枠・黄色いボタン） */
:root {
  --cream: #fff5d9;
  --ink: #1b1b1b;
  --yellow: #ffd60a;
  --red: #e5002b;
  --muted: #6b6459;
  --white: #ffffff;
  --line: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "BIZ UDPGothic", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.6;
  word-break: auto-phrase; /* 日本語を文節で折り返す（対応ブラウザのみ） */
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }

/* ------------------------------------------------------------ ボタン・札 */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 10px 16px;
  border: var(--line); box-shadow: var(--shadow);
  background: var(--white); color: var(--ink);
  font-weight: 900; font-size: 18px; text-decoration: none; text-align: center;
  cursor: pointer; user-select: none; touch-action: manipulation;
  transition: transform .06s ease, box-shadow .06s ease;
}
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.btn-primary { background: var(--yellow); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-sm { min-height: 46px; font-size: 15px; box-shadow: 3px 3px 0 var(--ink); padding: 8px 10px; }
.btn-sm:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.no { display: inline-block; background: var(--red); color: var(--white); font-weight: 900; font-size: 13px; padding: 1px 8px; letter-spacing: .02em; }
.tag { display: inline-block; border: 2px solid var(--ink); font-weight: 800; font-size: 12px; padding: 0 6px; line-height: 1.5; background: var(--white); }
.clear-mark { display: inline-block; background: var(--yellow); border: 2px solid var(--ink); font-weight: 900; font-size: 12px; padding: 0 6px; line-height: 1.5; }

/* ------------------------------------------------------------ 一覧 */
.hero { text-align: center; padding: 32px 0 8px; }
.hero-icon { width: 104px; height: 104px; border-radius: 24px; border: var(--line); box-shadow: var(--shadow); display: block; margin: 0 auto; }
.hero h1 { font-size: 32px; font-weight: 900; margin: 18px 0 0; line-height: 1.2; letter-spacing: .02em; }
.hero .edition { display: inline-block; margin-top: 8px; background: var(--ink); color: var(--white); font-weight: 900; font-size: 14px; padding: 2px 12px; }
.hero .lead { font-size: 15px; margin: 14px 0 6px; font-weight: 700; }
.hero .price { font-size: 14px; font-weight: 900; margin: 0 0 4px; }
.hero .stats { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 18px; }
.hero .btn { margin-top: 6px; }
.non-ios-note, .app-cta-note { font-size: 12px; color: var(--muted); text-align: center; margin: 8px 0 0; font-weight: 700; }

.sec-title { font-size: 20px; font-weight: 900; margin: 34px 0 6px; display: flex; align-items: baseline; gap: 8px; }
.sec-title small { font-size: 13px; color: var(--muted); font-weight: 700; }
.sec-lead { font-size: 14px; margin: 0 0 14px; color: var(--muted); font-weight: 700; }

.game-card {
  display: block; position: relative; background: var(--white);
  border: var(--line); box-shadow: var(--shadow);
  padding: 12px 14px 12px; margin: 0 0 18px; text-decoration: none;
  transition: transform .06s ease, box-shadow .06s ease;
}
.game-card:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.game-card .tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.game-card h3 { font-size: 22px; font-weight: 900; margin: 6px 0 2px; line-height: 1.3; }
.game-card p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.game-card .meta { font-size: 13px; font-weight: 800; margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.game-card .play { position: absolute; right: 12px; top: 12px; font-weight: 900; font-size: 13px; }

.locked-cat { margin: 0 0 18px; }
.locked-cat h3 { font-size: 15px; font-weight: 900; margin: 0 0 6px; }
.locked-cat h3 small { color: var(--muted); font-weight: 700; margin-left: 4px; }
.locked-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.locked-list a, .locked-list span {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
  border: 2px solid var(--ink); background: var(--white); font-size: 13px; font-weight: 700;
  text-decoration: none; line-height: 1.5;
}
.locked-list a::before { content: ""; width: 9px; height: 10px; flex: none; background: var(--muted); border-radius: 2px; box-shadow: inset 0 0 0 0 transparent; clip-path: polygon(0 40%, 15% 40%, 15% 20%, 30% 0, 70% 0, 85% 20%, 85% 40%, 100% 40%, 100% 100%, 0 100%); }
.locked-list .is-trial { background: var(--yellow); }

.apps { display: grid; gap: 14px; }
.app-card { display: flex; gap: 12px; align-items: center; background: var(--white); border: var(--line); box-shadow: var(--shadow); padding: 12px; text-decoration: none; }
.app-card img { width: 64px; height: 64px; border-radius: 15px; border: 2px solid var(--ink); flex: none; }
.app-card b { display: block; font-size: 16px; font-weight: 900; line-height: 1.3; }
.app-card span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; line-height: 1.5; }
.app-card .get { flex: none; margin-left: auto; background: var(--yellow); border: 2px solid var(--ink); font-weight: 900; font-size: 13px; padding: 4px 10px; color: var(--ink); }

.site-foot { margin: 40px 0 0; padding: 22px 0 40px; border-top: var(--line); font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.site-foot a { margin: 0 8px; }

/* ------------------------------------------------------------ 広告枠 */
.ad-slot { margin: 26px 0; min-height: 0; }
.ad-slot.is-live { min-height: 100px; }
.ad-slot.is-placeholder {
  min-height: 100px; display: grid; place-items: center;
  border: 2px dashed var(--muted); color: var(--muted); font-size: 12px; font-weight: 800;
}

/* ------------------------------------------------------------ タイトル画面 */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; font-size: 14px; font-weight: 800; }
.topbar a { text-decoration: none; }
.topbar button { background: none; border: 2px solid var(--ink); padding: 2px 10px; font-weight: 800; font-size: 13px; cursor: pointer; }
.title-body { text-align: center; padding: 28px 0 10px; }
.title-body h1 { font-size: 30px; font-weight: 900; margin: 14px 0 10px; line-height: 1.3; }
.title-body .rule { font-size: 16px; font-weight: 700; line-height: 1.9; margin: 0 auto 16px; max-width: 26em; text-align: left; }
.title-body .target { display: inline-block; border: var(--line); padding: 2px 12px; font-weight: 900; font-size: 17px; background: var(--white); }
.title-body .best { color: var(--muted); font-weight: 700; font-size: 14px; margin: 14px 0 18px; }
.title-body .back-link { display: inline-block; margin-top: 22px; font-weight: 900; }

.app-cta {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 0;
  background: var(--white); border: var(--line); padding: 10px 12px; text-decoration: none; text-align: left;
}
.app-cta img { width: 56px; height: 56px; border-radius: 13px; border: 2px solid var(--ink); flex: none; }
.app-cta-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.app-cta-text b { font-size: 15px; font-weight: 900; }
.app-cta-text span { font-size: 12px; color: var(--muted); font-weight: 700; }
.app-cta-btn { margin-left: auto; flex: none; background: var(--yellow); border: 2px solid var(--ink); font-weight: 900; font-size: 14px; padding: 4px 12px; }

.more-trials { margin: 26px 0 0; }
.more-trials h2 { font-size: 15px; font-weight: 900; margin: 0 0 8px; }

/* ------------------------------------------------------------ プレイ画面 */
body.is-playing { overflow: hidden; }
.stage { position: fixed; inset: 0; z-index: 50; background: #111; }
.g-wrap {
  --fg: var(--white);
  position: relative; height: 100%; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; background: var(--stage-bg, #3a2126); color: var(--fg);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}
.stage[data-theme="light"] .g-wrap { --fg: var(--ink); }
.g-hud { position: relative; padding: 14px 18px 8px; text-align: center; }
.g-quit { position: absolute; left: 10px; top: 8px; background: none; border: 0; color: var(--fg); opacity: .6; font-size: 12px; font-weight: 800; padding: 6px; cursor: pointer; z-index: 2; }
.g-bar { height: 12px; border-radius: 6px; background: rgba(0,0,0,.28); overflow: hidden; margin: 20px 0 10px; }
.stage[data-theme="light"] .g-bar { background: rgba(0,0,0,.12); }
.g-bar i { display: block; height: 100%; background: var(--yellow); transform-origin: left center; transform: scaleX(1); }
.g-score { font-weight: 900; line-height: 1.1; min-height: 44px; }
.g-score b { font-size: 40px; font-variant-numeric: tabular-nums; }
.g-score small { font-size: 22px; margin-left: 6px; }
.g-sub { font-size: 13px; font-weight: 700; opacity: .8; min-height: 20px; margin-top: 4px; }
.g-field { position: relative; flex: 1; overflow: hidden; touch-action: none; }
.g-note { padding: 12px 18px 18px; text-align: center; font-size: 15px; font-weight: 800; min-height: 54px; }

.pop-text {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none;
  font-weight: 900; font-size: 18px; white-space: nowrap;
  animation: pop-up .9s ease-out forwards; z-index: 5;
}
@keyframes pop-up { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -40px; } }

/* ------------------------------------------------------------ モーダル */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 14px;
  opacity: 0; transition: opacity .15s ease; overflow-y: auto;
}
.modal-back.is-open { opacity: 1; }
.modal {
  width: 100%; max-width: 400px; max-height: calc(100dvh - 28px); overflow-y: auto;
  background: var(--cream); border: var(--line); padding: 18px 18px 16px; text-align: center; color: var(--ink);
}
.result .r-label { font-weight: 900; font-size: 15px; }
.result .r-score { font-weight: 900; font-size: 52px; line-height: 1.15; margin: 4px 0 8px; font-variant-numeric: tabular-nums; word-break: keep-all; }
.result .r-goal { display: inline-block; border: var(--line); padding: 1px 12px; font-weight: 900; color: var(--red); background: var(--white); }
.result .r-goal.is-clear { color: var(--ink); background: var(--yellow); }
.result .r-best { margin: 10px 0 0; font-weight: 800; font-size: 14px; color: var(--muted); }
.result .r-best.is-new { color: var(--red); }
.result .r-detail { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.result .r-rank { font-weight: 900; font-size: 18px; margin: 8px 0 2px; }
.result .r-review { font-size: 14px; font-weight: 700; color: #4a443b; margin: 0 0 14px; }
.result .r-review.is-rare { color: #b38600; font-size: 16px; font-weight: 900; animation: shine 1.2s ease-in-out infinite alternate; }
@keyframes shine { from { text-shadow: 0 0 0 transparent; } to { text-shadow: 0 0 12px rgba(255, 196, 0, .9); } }
.r-share { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.r-share .btn { font-size: 14px; padding: 8px 4px; white-space: nowrap; }
.result .app-cta { padding: 8px 10px; gap: 10px; }
.result .app-cta img { width: 46px; height: 46px; border-radius: 11px; }
.result .app-cta-text b { font-size: 14px; }
.r-links { display: flex; justify-content: space-between; gap: 10px; margin: 16px 0 2px; font-size: 13px; font-weight: 900; }
.promo .promo-kicker { font-size: 12px; font-weight: 900; color: var(--muted); letter-spacing: .1em; }
.promo .promo-icon { width: 96px; height: 96px; border-radius: 22px; border: var(--line); margin: 12px auto 6px; display: block; }
.promo h2 { margin: 4px 0; font-size: 22px; font-weight: 900; }
.promo p { font-size: 14px; font-weight: 700; margin: 6px 0 16px; text-align: left; }
.promo .promo-skip { margin-top: 14px; }
.img-modal .img-preview { width: 100%; border: 2px solid var(--ink); display: block; }
.img-modal .img-help { font-size: 13px; font-weight: 700; margin: 10px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--white); padding: 8px 16px; font-weight: 800; font-size: 14px;
  opacity: 0; transition: all .2s ease;
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ 規約ページ */
.doc { padding: 24px 0; }
.doc h1 { font-size: 24px; font-weight: 900; }
.doc h2 { font-size: 17px; font-weight: 900; margin-top: 26px; }
.doc p, .doc li { font-size: 14px; font-weight: 500; }

/* ============================================================ 各ゲーム */

/* 逃げるスタートボタン */
.ns-btn {
  position: absolute; left: 0; top: 0; width: 160px; height: 62px;
  background: var(--yellow); border: var(--line); box-shadow: var(--shadow);
  font-weight: 900; font-size: 22px; cursor: pointer; touch-action: none;
  transition: transform .14s cubic-bezier(.2,.9,.3,1.3);
}
.ns-btn.is-pressed { background: var(--red); color: var(--white); }
.ns-curtain { position: absolute; inset: 0; display: grid; place-items: center; background: var(--cream); font-size: 26px; font-weight: 900; text-align: center; padding: 20px; animation: fade-in .3s ease; }
.ns-curtain small { display: block; font-size: 15px; color: var(--muted); margin-top: 8px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* だいたい10秒 */
.dj-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.dj-clock { background: #0e1512; color: #8dffb5; border: var(--line); border-color: #000; padding: 10px 22px; font: 900 64px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .02em; min-width: 250px; text-align: center; box-shadow: 0 0 0 6px rgba(255,255,255,.08); font-variant-numeric: tabular-nums; }
.dj-cap { font-size: 13px; font-weight: 800; opacity: .75; }
.dj-big { font-size: 22px; font-weight: 900; margin-top: 12px; }
.dj-reveal { font-size: 16px; font-weight: 800; text-align: center; line-height: 1.8; }
.dj-reveal b { font-size: 28px; color: var(--yellow); }

/* ハンコ連打 */
.hk-desk { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 10px; }
.hk-doc {
  position: relative; width: min(78vw, 300px); height: min(48vh, 330px);
  background: var(--white); color: var(--ink); border: 2px solid #222; box-shadow: 4px 6px 0 rgba(0,0,0,.35);
  padding: 20px 18px; cursor: pointer; transition: transform .1s ease-out, opacity .1s;
  touch-action: manipulation;
}
.hk-doc h4 { margin: 0 0 14px; font-size: 22px; font-weight: 900; text-align: center; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.hk-doc .ln { height: 8px; background: #e7e2d6; margin: 10px 0; border-radius: 4px; }
.hk-doc .box { position: absolute; right: 16px; bottom: 16px; width: 70px; height: 70px; border: 2px solid #999; font-size: 11px; color: #999; text-align: center; padding-top: 2px; }
.hk-doc.is-out { transform: translateX(-120%) rotate(-12deg); opacity: 0; }
.hk-doc.is-in { transform: translateX(120%) rotate(8deg); opacity: 0; transition: none; }
.hk-stamp {
  position: absolute; width: 74px; height: 74px; border: 4px solid var(--red); border-radius: 50%;
  color: var(--red); font-weight: 900; font-size: 21px; display: grid; place-items: center;
  transform: translate(-50%, -50%) rotate(-14deg); pointer-events: none; opacity: .9;
  animation: stamp .12s ease-out;
}
@keyframes stamp { from { transform: translate(-50%, -50%) rotate(-14deg) scale(1.6); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-14deg) scale(1); opacity: .9; } }
.hk-reject { width: min(78vw, 300px); }
.hk-flash { position: absolute; inset: 0; background: rgba(229, 0, 43, .35); pointer-events: none; animation: fade-out .4s forwards; }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

/* 当たり判定がでかい */
.ad-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* 運だけ */
.ud-doors { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px; align-content: center; }
.ud-door {
  height: min(46vh, 300px); border: var(--line); box-shadow: var(--shadow); background: #7a4a2a;
  color: var(--white); font-weight: 900; font-size: 34px; cursor: pointer; position: relative; overflow: hidden;
  touch-action: manipulation;
}
.ud-door::after { content: ""; position: absolute; right: 16%; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--ink); }
.ud-door.is-win { background: var(--yellow); color: var(--ink); }
.ud-door.is-lose { background: #444; color: #bbb; }
.ud-door.is-win::after, .ud-door.is-lose::after { display: none; }
.ud-door:disabled { cursor: default; }
.ud-door.is-picked { outline: 5px solid var(--white); outline-offset: 3px; }
.ud-msg { position: absolute; left: 0; right: 0; top: 14px; text-align: center; font-weight: 900; font-size: 18px; }

/* 射的 */
.st-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

/* もぐらたたき */
.mg-grid { position: absolute; inset: 10px; display: grid; gap: 6px; align-content: center; justify-content: center; }
.mg-cell { position: relative; aspect-ratio: 1; cursor: pointer; touch-action: manipulation; }
.mg-hole { position: absolute; left: 8%; right: 8%; bottom: 6%; height: 38%; border-radius: 50%; background: #1d140c; box-shadow: inset 0 6px 0 rgba(0,0,0,.5); }
.mg-mole {
  position: absolute; left: 18%; right: 18%; bottom: 18%; height: 62%;
  background: #8b5a33; border: 3px solid #2a1a0c; border-radius: 45% 45% 18% 18%;
  transform: translateY(70%) scaleY(.2); opacity: 0; transition: transform .09s ease-out, opacity .09s;
}
.mg-mole::before {
  content: ""; position: absolute; left: 22%; right: 22%; top: 30%; height: 16%;
  background: radial-gradient(circle at 20% 50%, #111 0 28%, transparent 30%), radial-gradient(circle at 80% 50%, #111 0 28%, transparent 30%);
}
.mg-mole::after { content: ""; position: absolute; left: 40%; right: 40%; top: 52%; height: 14%; background: #f29bb0; border-radius: 50%; }
.mg-cell.is-up .mg-mole { transform: none; opacity: 1; }
.mg-cell.is-hit .mg-mole { transform: translateY(20%) scaleY(.7); opacity: 1; background: #b07a4f; }
.mg-cell.is-hit .mg-mole::before { background: none; content: "× ×"; color: #111; font-weight: 900; font-size: 12px; text-align: center; line-height: 1; height: auto; }
.mg-grow { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); background: var(--yellow); color: var(--ink); border: var(--line); padding: 6px 14px; font-weight: 900; font-size: 20px; pointer-events: none; animation: fade-out 1s .3s forwards; z-index: 3; }

/* 100m走 */
.rs-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rs-call { position: absolute; left: 0; right: 0; top: 18%; text-align: center; font-weight: 900; font-size: 54px; line-height: 1.1; pointer-events: none; }
.rs-call.is-real { color: var(--red); text-shadow: 3px 3px 0 var(--ink); font-size: 72px; }
.rs-call small { display: block; font-size: 18px; margin-top: 6px; }
.rs-flash { position: absolute; inset: 0; background: rgba(255,255,255,.7); pointer-events: none; animation: fade-out .25s forwards; }
