/* あそび場 — 工房と同じ型帳「紙の機械」を、遊ぶ人向けに明るく軽くしたもの。
   白い工作用紙の札にゲームの窓を型抜きし、押すとカチッと沈む。色は記号の穴からのぞく紙だけ。主役はゲームの絵。 */
:root {
  --paper: #F4F6F6;
  --card: #FAFBFB;
  --grid: #E2E5E5;
  --edge: #D3D8D8;
  --shadow: #C6CCCC;
  --ink: #1A1A1A;
  --sub: #55595A;
  --line: #878888;
  --off: #9E9E9E;
  --red: #E2231A;
  --blue: #044B97;
  --yellow: #F6B800;
  --good: #007460;

  --f-title: "Rampart One", "IBM Plex Sans JP", sans-serif;
  --f-body: "IBM Plex Sans JP", "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;

  --lift1: 3px 4px 0 var(--shadow);
  --lift2: 5px 7px 0 var(--shadow);
  --sink: inset 3px 4px 0 var(--shadow);
  --side: 2px 2px 0 var(--edge);
  --gutter: 28px;
  --max: 1200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  font: 400 17px/1.75 var(--f-body); letter-spacing: .02em;
  display: flex; flex-direction: column;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--card); padding: 6px 10px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.3; }

/* 記号の穴 */
.hole { display: inline-block; flex: none; width: 12px; height: 12px; border: 1px solid var(--ink); background: var(--ink); vertical-align: -1px; }
.hole.red { background: var(--red); } .hole.blue { background: var(--blue); } .hole.yellow { background: var(--yellow); } .hole.white { background: var(--card); }
.hole.ci { border-radius: 50%; }
.hole.tri { border: 0; width: 13px; height: 12px; clip-path: polygon(50% 0, 100% 100%, 0 100%); position: relative; }
.hole.tri::after { content: ""; position: absolute; inset: 1.6px 1.4px 1px; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: var(--red); }
.mono { font-family: var(--f-mono); font-weight: 500; letter-spacing: 0; }
.eyebrow { font: 500 12px/1 var(--f-mono); color: var(--sub); letter-spacing: .12em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note { font-size: 13px; color: var(--sub); line-height: 1.65; }

/* 上の帯 */
.bar { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--ink); box-shadow: 0 3px 0 var(--edge); }
.bar-in { max-width: var(--max); margin: 0 auto; height: 60px; padding: 0 var(--gutter); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: .08em; white-space: nowrap; }
.brand svg { width: 28px; height: 28px; }
.brand small { font: 500 11px/1 var(--f-mono); color: var(--sub); letter-spacing: .06em; font-weight: 500; }
.bar .count { margin-left: auto; font: 500 12px/1 var(--f-mono); color: var(--sub); white-space: nowrap; }
.bar .count b { font-size: 16px; color: var(--ink); margin-right: 3px; }

main { display: block; width: 100%; max-width: var(--max); margin: 0 auto; padding: 40px var(--gutter) 80px; flex: 1; }

/* 紙の札 */
.sheet { position: relative; background: var(--card); border: 1px solid var(--ink); box-shadow: var(--side), var(--lift1); }
.sheet.lift2 { box-shadow: var(--side), var(--lift2); }
.window { background: var(--paper); border: 1px solid var(--ink); box-shadow: var(--sink); }

/* 起き上がる */
.pop { transform-origin: 50% 100%; animation: popUp 380ms both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes popUp {
  0% { transform: perspective(700px) rotateX(85deg); opacity: 0; animation-timing-function: cubic-bezier(.3,.7,.4,1); }
  20% { opacity: 1; }
  62% { transform: perspective(700px) rotateX(-7deg); animation-timing-function: ease-in-out; }
  86% { transform: perspective(700px) rotateX(1.5deg); animation-timing-function: steps(1, end); }
  100% { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .pop { animation: none !important; } }

/* ボタン（押すと沈む） */
.btn {
  --edge-w: 3px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px; border: 1px solid var(--ink); background: var(--card); color: var(--ink);
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: var(--edge-w) var(--edge-w) 0 var(--edge), calc(var(--edge-w) + 1px) calc(var(--edge-w) + 2px) 0 var(--shadow);
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end), background 120ms;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: #fff; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge), 2px 3px 0 var(--shadow); }
.btn.ink { background: var(--ink); color: var(--card); box-shadow: var(--edge-w) var(--edge-w) 0 #5E6364, calc(var(--edge-w) + 1px) calc(var(--edge-w) + 2px) 0 var(--shadow); }
.btn.ink:hover { background: #2d2f30; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; --edge-w: 2px; }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: var(--card); }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink); text-decoration: none; }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn:hover { border-color: var(--ink); }

/* 札（印） */
.stamp { display: inline-flex; align-items: center; gap: 6px; font: 500 11px/1 var(--f-mono); letter-spacing: .08em; padding: 5px 8px; border: 1px solid var(--ink); background: var(--card); white-space: nowrap; }
.stamp.new { background: var(--ink); color: var(--card); }
.stamp.new::before { content: ""; width: 7px; height: 7px; background: var(--yellow); border: 1px solid var(--card); }
.tags { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--sub); }
.tags span { display: inline-flex; align-items: center; gap: 5px; }
.tags span::before { content: ""; width: 6px; height: 6px; border: 1px solid var(--ink); }

/* ---------- 棚の頭 ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px; align-items: center; margin-bottom: 56px; }
.title { font: 400 76px/1.04 var(--f-title); letter-spacing: .02em; margin-top: 12px; }
.lede { font-size: 18px; color: var(--sub); margin-top: 16px; max-width: 30em; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; font-size: 14px; }
.facts span { display: inline-flex; align-items: center; gap: 8px; }

.feature { display: block; text-decoration: none; padding: 14px 14px 18px; transition: transform 120ms steps(2, end), box-shadow 120ms steps(2, end); }
.feature:hover { transform: translate(-2px, -3px); box-shadow: var(--side), 8px 11px 0 var(--shadow); }
.feature .shot { aspect-ratio: 16 / 9; overflow: hidden; position: relative; }
.feature .shot img { width: 100%; height: 100%; object-fit: cover; }
.feature .row { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 0 4px; }
.feature .row > div { flex: 1; min-width: 0; }
.feature h2 { font-size: 26px; }
.feature p { color: var(--sub); font-size: 15px; margin-top: 2px; }
.feature .label { position: absolute; left: 12px; top: 12px; }
.go { flex: none; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; border: 1px solid var(--ink); background: var(--paper); box-shadow: var(--sink); }
.go span { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: var(--card); font-weight: 700; font-size: 14px; letter-spacing: .08em; box-shadow: 3px 3px 0 #5E6364, 4px 5px 0 var(--shadow); transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end); }
.feature:active .go span { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #5E6364, 1px 2px 0 var(--shadow); }

/* ---------- 選ぶ（下線） ---------- */
.filters { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.filters .h { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-right: 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 2px; }
.seg button { position: relative; border: 0; background: none; padding: 8px 12px 12px; cursor: pointer; font-weight: 700; color: var(--sub); font-size: 14px; }
.seg button::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 140ms linear; }
.seg button:hover, .seg button[aria-pressed="true"] { color: var(--ink); }
.seg button[aria-pressed="true"]::after { transform: scaleX(1); }

/* ---------- 札の並び ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr)); gap: 32px 28px; }
.card { display: flex; flex-direction: column; text-decoration: none; transition: transform 120ms steps(2, end), box-shadow 120ms steps(2, end); }
.card:hover { transform: translate(-2px, -3px); box-shadow: var(--side), var(--lift2); }
.card .shot { position: relative; margin: 12px 12px 0; aspect-ratio: 16 / 9; overflow: hidden; }
.card .shot img { width: 100%; height: 100%; object-fit: cover; }
.card .shot .stamp { position: absolute; left: 8px; top: 8px; }
.card .body { padding: 14px 16px 16px; display: grid; gap: 6px; flex: 1; align-content: start; }
.card h3 { font-size: 19px; }
.card .line { font-size: 14px; color: var(--sub); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.2em; }
.card .meta { display: flex; align-items: center; gap: 12px; margin-top: 4px; font: 500 12px/1 var(--f-mono); color: var(--sub); }
.card .meta .grow { flex: 1; }
.empty { padding: 40px; text-align: center; color: var(--sub); }

/* ---------- このあそび場について ---------- */
.about { margin-top: 72px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.about div { padding: 18px 20px; }
.about h3 { font-size: 16px; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.about p { font-size: 14px; color: var(--sub); line-height: 1.7; }

/* ---------- 遊ぶ ---------- */
.play-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; flex-wrap: wrap; }
.play-head .title { font-size: 52px; margin-top: 8px; }
.play-head .lede { margin-top: 8px; }
.stage { padding: 14px; }
.stage .frame { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 200px); margin: 0 auto; background: #0d0d0d; }
.stage .frame.portrait { aspect-ratio: 9 / 16; width: auto; height: min(calc(100vh - 200px), 860px); }
.stage .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.stage .frame:fullscreen { max-height: none; aspect-ratio: auto; width: 100vw; height: 100vh; }
.stage .tools { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.stage .tools .grow { flex: 1; }
.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; margin-top: 32px; align-items: start; }
.panel { padding: 20px 22px; }
.panel + .panel { margin-top: 24px; }
.panel h2 { font-size: 19px; margin-top: 6px; }
.how { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.how li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.how li::before { content: counter(s, decimal-leading-zero); display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--ink); border-radius: 50%; font: 500 11px/1 var(--f-mono); margin-top: 3px; }
.kv { display: grid; grid-template-columns: 72px 1fr; gap: 8px 14px; font-size: 14px; margin: 14px 0 0; }
.kv dt { color: var(--sub); font-size: 12px; padding-top: 3px; }
.kv dd { margin: 0; }
.checked { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 14px; }
.checked li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; }
.checked li::before { content: ""; width: 12px; height: 7px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg); margin-top: 7px; }
.more { margin-top: 56px; }
.more .grid { margin-top: 16px; }

/* ---------- 下 ---------- */
.foot { border-top: 1px solid var(--ink); background: var(--card); }
.foot-in { max-width: var(--max); margin: 0 auto; padding: 22px var(--gutter) 28px; display: flex; gap: 12px 28px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--sub); }
.foot-in .grow { flex: 1; }
.foot-note { max-width: var(--max); margin: -14px auto 0; padding: 0 var(--gutter) 24px; font-size: 12px; color: var(--sub); }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .play-grid { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  main { padding-top: 24px; }
  .bar-in { height: 54px; }
  .brand small { display: none; }
  .title { font-size: 50px; }
  .hero { margin-bottom: 40px; gap: 24px; }
  .facts { gap: 6px 14px; font-size: 13px; margin-top: 14px; }
  .about { margin-top: 48px; }
  .play-head .title { font-size: 38px; }
  .lede { font-size: 16px; }
  .feature h2 { font-size: 21px; }
  .go { width: 68px; height: 68px; }
  .go span { width: 52px; height: 52px; font-size: 13px; }
  .stage { padding: 8px; }
  .stage .frame { aspect-ratio: auto; height: 72vh; max-height: none; }
  .stage .frame.portrait { width: 100%; height: 76vh; }
  .grid { gap: 24px; }
  .play-head { gap: 14px; }
}
