:root {
  --bg: #120f0c;
  --panel: #1d1813;
  --panel2: #261f18;
  --line: #3a3128;
  --ink: #f4ecdf;
  --mute: #a99b88;
  --gold: #e6b95e;
  --gold2: #f5d58f;
  --radius: 16px;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.wrap, .steps, .tools, .shelf, .foot { max-width: 1180px; margin-inline: auto; padding-inline: 20px; }

/* 上の帯 */
.bar {
  position: absolute; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 20px 12px;
  background: linear-gradient(#0009, #0000);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 20px; letter-spacing: .14em; color: var(--gold2); }
.brand img { width: 30px; height: 30px; }
.share { border: 1px solid #fff4; background: #0006; color: var(--ink); padding: 7px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; backdrop-filter: blur(8px); }
.share:hover { border-color: var(--gold); color: var(--gold2); }

/* おすすめ */
.hero { position: relative; min-height: min(78vh, 640px); display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 1s ease, transform 7s ease-out; }
.hero-bg img.on { opacity: 1; transform: scale(1); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #120f0cf2 0%, #120f0c99 45%, #120f0c00 75%), linear-gradient(0deg, var(--bg) 0%, #120f0c00 40%); }
.hero-in { width: 100%; max-width: 1180px; margin: 0 auto; padding: 120px 20px 56px; }
.hero-in > * { max-width: 520px; }
.kicker { margin: 0 0 6px; color: var(--gold); font-size: 13px; letter-spacing: .2em; }
.hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(40px, 7vw, 72px); line-height: 1.1; letter-spacing: .08em; text-shadow: 0 4px 30px #000; }
.hero-desc { color: #e6dccd; line-height: 1.7; margin: 14px 0 10px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid #fff3; background: #0005; color: var(--ink); }
.pill.gold { border-color: var(--gold); color: var(--gold2); }
.hero-act, .d-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 26px; border-radius: 999px; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; border: 1px solid transparent; font-family: inherit; transition: transform .15s, box-shadow .15s, background .15s; }
.btn.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #24190a; box-shadow: 0 6px 24px #e6b95e40; }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px #e6b95e66; }
.btn.primary::before { content: "▶"; font-size: 11px; }
.btn.ghost { background: #0006; color: var(--ink); border-color: #fff4; }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold2); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.dots { position: absolute; right: 20px; bottom: 26px; display: flex; gap: 8px; }
.dots button { width: 9px; height: 9px; padding: 0; border-radius: 999px; border: 0; background: #fff5; cursor: pointer; transition: width .3s, background .3s; }
.dots button.on { width: 26px; background: var(--gold); }

/* 友だちと遊ぶ */
.steps { margin-top: 8px; }
.steps h2, .shelf h2 { font-size: 14px; color: var(--mute); font-weight: 600; margin: 0 0 12px; letter-spacing: .12em; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; line-height: 1.5; }
.steps b { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--gold); color: var(--gold2); font-family: var(--serif); }

/* 絞り込み */
.tools { display: flex; align-items: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; }
.chips button { flex: none; border: 1px solid var(--line); background: transparent; color: var(--mute); padding: 8px 15px; border-radius: 999px; font-size: 14px; cursor: pointer; font-family: inherit; }
.chips button:hover { color: var(--ink); }
.chips button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
#q { flex: 0 1 240px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 15px; font-family: inherit; }
#q:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

/* 棚 */
.shelf { margin-top: 30px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.row .card { flex: 0 0 220px; }
.card {
  position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; color: inherit; text-align: left; padding: 0; font: inherit; cursor: pointer;
  transition: transform .2s ease, border-color .2s, box-shadow .2s; animation: rise .5s both;
}
.card:hover, .card:focus-visible { transform: translateY(-4px); border-color: #e6b95e99; box-shadow: 0 14px 36px #0009; outline: none; }
.card.off { opacity: .5; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: radial-gradient(circle at 30% 25%, hsl(var(--h) 70% 62% / .5), transparent 60%), linear-gradient(135deg, hsl(var(--h) 45% 24%), hsl(calc(var(--h) + 40) 40% 10%)); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .cover img { transform: scale(1.05); }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #000a, #0000 45%); }
.glyph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 64px; color: hsl(var(--h) 80% 92%); text-shadow: 0 4px 18px #000c; }
.cover::after { z-index: 1; }
.badges { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: flex; gap: 5px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #000b; color: #fff; }
.badge.on { background: var(--gold); color: #24190a; font-weight: 700; }
.fav { position: absolute; top: 8px; right: 8px; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #0008; color: #fff8; font-size: 17px; cursor: pointer; }
.fav.on { color: var(--gold2); }
.body { padding: 12px 14px 14px; }
.title { font-weight: 700; font-size: 17px; }
.tag { color: var(--gold); font-size: 12px; margin-top: 2px; font-family: var(--serif); letter-spacing: .06em; }
.meta { color: var(--mute); font-size: 12px; margin-top: 6px; }
.note { color: #ee9a8f; font-size: 12px; margin-top: 6px; }
.empty { color: var(--mute); padding: 40px 0; text-align: center; }

/* くわしく */
dialog { width: min(720px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--ink); overflow: auto; }
dialog::backdrop { background: #000b; backdrop-filter: blur(4px); }
dialog[open] { animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.d-cover { position: relative; aspect-ratio: 16 / 9; background-size: cover; background-position: center; }
.d-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--panel), #0000 50%); }
.d-close { position: absolute; top: 10px; right: 10px; z-index: 1; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #000a; color: #fff; font-size: 22px; cursor: pointer; }
.d-body { padding: 0 24px 24px; margin-top: -28px; position: relative; }
.d-body h2 { margin: 0; font-family: var(--serif); font-size: 32px; letter-spacing: .06em; }
.d-desc { color: #e0d6c6; line-height: 1.7; }
.d-body h3 { font-size: 13px; color: var(--gold); letter-spacing: .14em; margin: 20px 0 8px; }
.d-rules, .d-how { margin: 0; padding-left: 1.2em; line-height: 1.8; color: #e0d6c6; font-size: 14px; }

.foot { margin: 48px auto 0; color: var(--mute); font-size: 13px; line-height: 1.8; border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 40px; }
.foot code { color: var(--ink); background: var(--panel); padding: 1px 6px; border-radius: 6px; user-select: all; }

#toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 14px; transition: .2s; pointer-events: none; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 640px) {
  .wrap, .steps, .tools, .shelf, .foot { padding-inline: 16px; }
  .bar { padding-inline: 16px; }
  .hero { min-height: 72vh; }
  .hero::after { background: linear-gradient(0deg, var(--bg) 8%, #120f0ccc 45%, #120f0c33 100%); }
  .hero-in { padding: 100px 16px 52px; }
  .steps ol { grid-template-columns: 1fr; gap: 8px; }
  .steps li { padding: 10px 14px; }
  .tools { margin-top: 24px; }
  #q { flex: 1 1 100%; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .title { font-size: 15px; }
  .tag, .meta { font-size: 11px; }
  .body { padding: 10px 11px 12px; }
  .glyph { font-size: 44px; }
  .row .card { flex-basis: 160px; }
  .d-body { padding: 0 18px 20px; }
  .d-body h2 { font-size: 26px; }
  .btn { padding: 11px 20px; }
  .d-act .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
