:root {
  --night-1: #120c33;
  --night-2: #2a1259;
  --night-3: #4a1a6e;
  --cyan: #4ff0ff;
  --blue: #3a7bff;
  --pink: #ff6fb5;
  --yellow: #ffd84a;
  --orange: #ff8a3d;
  --mint: #6dffc0;
  --cream: #fff6e5;
  --ink: #241640;
  --ink-soft: #5b4a7a;
  --round: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", system-ui, sans-serif;
  --sign: "Dela Gothic One", "Zen Maru Gothic", "Hiragino Sans", sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--round);
  font-weight: 500;
  color: var(--cream);
  background: linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 45%, var(--night-3) 100%) fixed;
  line-height: 1.8;
  overflow-x: clip;
}
a { color: var(--cyan); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- 夜空 ---------- */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.stars, .stars.far {
  position: absolute; inset: -50%;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 120px 80px, #fff9, transparent),
    radial-gradient(2px 2px at 200px 150px, #bff, transparent),
    radial-gradient(1px 1px at 260px 40px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 330px 210px, #ffd, transparent),
    radial-gradient(1px 1px at 80px 250px, #fff, transparent);
  background-size: 360px 280px;
  animation: drift 160s linear infinite;
  opacity: .8;
}
.stars.far { background-size: 220px 190px; opacity: .45; animation-duration: 260s; }
@keyframes drift { to { transform: translate(180px, 120px); } }

/* ---------- 入場ゲート ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 50% 40%, #3b1a72cc, #0b0722f2 70%);
  backdrop-filter: blur(4px);
  transition: opacity .5s, visibility .5s;
}
.gate.gone { opacity: 0; visibility: hidden; }
.ticket {
  position: relative;
  width: min(440px, 92vw);
  padding: 36px 32px 28px;
  background: var(--cream); color: var(--ink);
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 0 0 6px var(--pink), 0 0 0 10px var(--yellow), 0 30px 80px #0009;
  transform: rotate(-2deg);
  animation: ticket-in .7s cubic-bezier(.2, 1.6, .4, 1) both;
}
.ticket::before, .ticket::after {
  content: ""; position: absolute; top: 62%; width: 28px; height: 28px; border-radius: 50%;
  background: #1a0f40;
}
.ticket::before { left: -14px; }
.ticket::after { right: -14px; }
@keyframes ticket-in { from { transform: translateY(40px) rotate(8deg) scale(.8); opacity: 0; } }
.ticket-kicker { margin: 0; font-family: var(--sign); letter-spacing: .3em; color: var(--pink); font-size: .85rem; }
.ticket-title { word-break: keep-all; margin: 6px 0 4px; font-family: var(--sign); font-weight: 400; font-size: clamp(1.7rem, 7vw, 2.4rem); line-height: 1.25; }
.ticket-sub { margin: 0 0 22px; color: var(--ink-soft); font-size: .9rem; }
.enter {
  display: block; width: 100%; margin: 0 0 10px;
  padding: 14px; border: 0; border-radius: 999px; cursor: pointer;
  font-size: 1.1rem; font-weight: 900; color: var(--ink);
  background: var(--yellow); box-shadow: 0 5px 0 var(--orange);
  transition: transform .1s, box-shadow .1s;
}
.enter:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--orange); }
.enter:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--orange); }
.enter.quiet { background: transparent; box-shadow: none; font-size: .9rem; font-weight: 700; color: var(--ink-soft); text-decoration: underline; }
.ticket-stub {
  margin-top: 14px; padding-top: 12px; border-top: 2px dashed #c9b9a0;
  font-family: var(--sign); font-size: .8rem; color: var(--ink-soft); letter-spacing: .15em;
}

/* ---------- ヘッダー ---------- */
.marquee-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, calc((100% - var(--max)) / 2));
  background: #120c33d9; backdrop-filter: blur(8px);
  border-bottom: 3px solid transparent;
  border-image: repeating-linear-gradient(90deg, var(--pink) 0 16px, var(--yellow) 16px 32px, var(--cyan) 32px 48px) 1;
}
.logo { font-family: var(--sign); color: var(--yellow); text-decoration: none; font-size: 1.05rem; text-shadow: 0 0 12px #ffd84a88; white-space: nowrap; }
.mini-nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.mini-nav a {
  color: var(--cream); text-decoration: none; font-weight: 700; font-size: .85rem;
  padding: 4px 12px; border-radius: 999px; border: 2px solid #ffffff22;
  transition: background .2s, transform .2s;
}
.mini-nav a:hover { background: var(--pink); border-color: var(--pink); transform: translateY(-2px) rotate(-2deg); }
@media (max-width: 640px) { .mini-nav { display: none; } }

main { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- ヒーロー ---------- */
.hero { position: relative; padding: 70px 0 60px; text-align: center; overflow-x: clip; }
.sunburst {
  position: absolute; left: 50%; top: 210px; width: 1100px; height: 1100px; margin: -550px 0 0 -550px;
  background: repeating-conic-gradient(from 0deg, #ffffff10 0 10deg, transparent 10deg 20deg);
  border-radius: 50%;
  mask-image: radial-gradient(circle, #000 20%, transparent 65%);
  animation: spin 90s linear infinite;
  z-index: -1;
}
@keyframes spin { to { transform: rotate(360deg); } }

.arch {
  position: relative; display: inline-block; max-width: calc(100% - 24px);
  padding: 40px clamp(24px, 6vw, 72px) 30px;
  border-radius: 260px 260px 24px 24px;
  background: linear-gradient(180deg, #ff6fb5 0%, #c34bd8 100%);
  box-shadow: inset 0 -10px 0 #0003, 0 0 0 8px #2a1259, 0 0 0 12px var(--yellow), 0 0 60px #ff6fb566;
}
.bulbs {
  position: absolute; inset: 10px; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(circle, var(--yellow) 3px, transparent 4px) 0 0 / 22px 22px;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  padding: 8px;
  animation: blink 1.2s steps(2) infinite;
}
@keyframes blink { 50% { filter: brightness(.55); } }
.hero-kicker { margin: 0; font-family: var(--sign); letter-spacing: .4em; font-size: .9rem; color: var(--cream); }
.hero-title {
  word-break: keep-all;
  margin: 4px 0 6px; font-family: var(--sign); font-weight: 400;
  font-size: clamp(2rem, 7.5vw, 4.2rem); line-height: 1.15;
  color: var(--cream);
  text-shadow: 0 4px 0 #8a2a8a, 0 0 24px #fff6;
}
.hero-lead { margin: 0; font-weight: 900; font-size: clamp(1rem, 2.6vw, 1.25rem); color: var(--yellow); }
.hero-note { max-width: 40em; margin: 28px auto 34px; color: #e9ddff; }

.park-map {
  list-style: none; padding: 0; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px;
  max-width: 980px;
}
.sign {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 18px 14px 16px; border-radius: 20px;
  text-decoration: none; color: var(--ink);
  background: var(--cream);
  box-shadow: 0 6px 0 #0004;
  transition: transform .25s cubic-bezier(.2, 1.8, .4, 1);
}
.sign:hover { transform: translateY(-8px) rotate(var(--tilt, -3deg)) scale(1.04); }
.sign b { font-family: var(--sign); font-weight: 400; font-size: 1.15rem; }
.sign small { color: var(--ink-soft); font-weight: 700; }
.sign-icon { font-size: 2.2rem; line-height: 1.2; }
.s1 { border-top: 10px solid var(--cyan); }
.s2 { border-top: 10px solid var(--orange); --tilt: 3deg; }
.s3 { border-top: 10px solid var(--pink); }
.s4 { border-top: 10px solid var(--mint); --tilt: 3deg; }

/* ---------- ゾーン共通 ---------- */
.zone { position: relative; padding: 90px 0 70px; }
.zone-head { text-align: center; margin-bottom: 34px; }
.zone-no {
  display: inline-block; margin: 0 0 8px; padding: 2px 14px;
  font-family: var(--sign); font-size: .75rem; letter-spacing: .25em;
  color: var(--ink); background: var(--yellow); border-radius: 999px;
}
.zone-head h2 {
  margin: 0; font-family: var(--sign); font-weight: 400;
  font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.2;
  color: var(--zone-color, var(--cyan));
  text-shadow: 0 0 18px color-mix(in srgb, var(--zone-color, var(--cyan)) 60%, transparent), 0 4px 0 #0005;
}
.zone-head p:last-child { margin: 8px 0 0; color: #e0d4ff; }
.zone-games { --zone-color: var(--cyan); }
.zone-works { --zone-color: var(--orange); }
.zone-services { --zone-color: var(--pink); }
.zone-about { --zone-color: var(--mint); }

.empty {
  grid-column: 1 / -1; padding: 40px 20px; text-align: center;
  border: 3px dashed #ffffff40; border-radius: 22px; color: #d8ccf5; font-weight: 700;
}
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.tags li { font-size: .74rem; font-weight: 700; padding: 1px 10px; border-radius: 999px; background: #24164014; color: var(--ink); }

/* ---------- ゲームの館: 筐体カード ---------- */
.cabinets { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 26px; }
.cabinet {
  position: relative; display: flex; flex-direction: column;
  padding: 14px 14px 16px; border-radius: 26px 26px 14px 14px;
  background: linear-gradient(160deg, #3a7bff, #2338a8);
  box-shadow: 0 8px 0 #11195a, 0 0 0 3px #ffffff30 inset;
  transition: transform .3s cubic-bezier(.2, 1.6, .4, 1);
}
.cabinet:hover { transform: translateY(-6px) rotate(-1deg); }
.cabinet:nth-child(even):hover { transform: translateY(-6px) rotate(1deg); }
.screen {
  aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden;
  background: #070a1f; border: 4px solid #0b0f2e;
  display: grid; place-items: center; color: #7a86c7; font-family: var(--sign); letter-spacing: .1em;
  position: relative;
}
.screen img { width: 100%; height: 100%; object-fit: cover; }
.screen::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, #0000 0 2px, #0002 2px 3px); pointer-events: none; }
.cabinet .plate { margin-top: 12px; padding: 14px 14px 12px; border-radius: 12px; background: var(--cream); color: var(--ink); flex: 1; display: flex; flex-direction: column; gap: 6px; }
.cabinet h3 { margin: 0; font-family: var(--sign); font-weight: 400; font-size: 1.2rem; line-height: 1.35; }
.cabinet p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.badge { align-self: flex-start; font-size: .72rem; font-weight: 900; padding: 1px 10px; border-radius: 999px; background: #e7defa; color: var(--ink); }
.badge.live { background: var(--mint); }
.cabinet .meta { font-size: .76rem; color: var(--ink-soft); font-weight: 700; }
.coin-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 16px; border-radius: 999px; border: 0;
  font-weight: 900; font-size: .88rem; text-decoration: none;
  color: var(--ink); background: #ece3ff;
  box-shadow: 0 3px 0 #0003;
  transition: transform .1s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.coin { background: var(--yellow); box-shadow: 0 3px 0 var(--orange); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- からくり工房 ---------- */
.filters { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.filters button {
  cursor: pointer; padding: 4px 14px; border-radius: 999px;
  font-weight: 700; font-size: .85rem;
  border: 2px solid #ffffff33; background: transparent; color: var(--cream);
}
.filters button[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.gadgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.gadget {
  position: relative; padding: 22px 20px 18px; border-radius: 6px 22px 22px 22px;
  background: var(--cream); color: var(--ink);
  box-shadow: 0 6px 0 #0004;
  transform: rotate(var(--r, 0deg));
  transition: transform .3s cubic-bezier(.2, 1.6, .4, 1);
  display: flex; flex-direction: column; gap: 8px;
}
.gadget:hover { transform: rotate(0deg) translateY(-6px) scale(1.02); }
.gadget::before {
  content: ""; position: absolute; top: -10px; left: 22px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 4px var(--night-2);
}
.gadget .cat { font-size: .74rem; font-weight: 900; color: var(--orange); letter-spacing: .05em; }
.gadget h3 { margin: 0; font-family: var(--sign); font-weight: 400; font-size: 1.12rem; line-height: 1.4; }
.gadget p { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.gadget .coin-row { margin-top: auto; }

/* ---------- リクエスト受付所: チケット ---------- */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.req {
  position: relative; display: grid; grid-template-columns: 1fr 100px;
  background: var(--cream); color: var(--ink); border-radius: 16px;
  box-shadow: 0 6px 0 #0004;
  transition: transform .3s cubic-bezier(.2, 1.6, .4, 1);
}
.req:hover { transform: translateY(-6px) rotate(-1.5deg); }
.req-main { padding: 20px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.req h3 { margin: 0; font-family: var(--sign); font-weight: 400; font-size: 1.1rem; line-height: 1.4; }
.req p { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.req ul { margin: 0; padding-left: 1.1em; font-size: .86rem; color: var(--ink-soft); }
.req-stub {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-left: 3px dashed #d7c6a8; padding: 10px 6px;
  background: var(--pink); border-radius: 0 16px 16px 0; color: var(--ink);
  text-align: center;
}
.req-stub .fee-label { font-size: .7rem; font-weight: 900; letter-spacing: .1em; }
.req-stub .fee { font-family: var(--sign); font-size: .95rem; line-height: 1.3; word-break: keep-all; }
.req .coin-row { margin-top: auto; }

/* ---------- 案内所 ---------- */
.info-board {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px;
  padding: 30px; border-radius: 26px;
  background: #ffffff10; border: 3px solid #ffffff22;
}
.info-text p { margin: 0 0 14px; }
.toolbox { margin: 0; display: grid; gap: 12px; }
.toolbox div { padding: 12px 16px; border-radius: 16px; background: var(--cream); color: var(--ink); }
.toolbox dt { font-family: var(--sign); font-size: .95rem; color: var(--zone-color); filter: brightness(.6); }
.toolbox dd { margin: 4px 0 0; }
@media (max-width: 760px) { .info-board { grid-template-columns: 1fr; padding: 20px; } }

/* ---------- 出口 ---------- */
.zone-exit { text-align: center; padding-bottom: 120px; }
.zone-exit h2 { margin: 0 0 6px; font-family: var(--sign); font-weight: 400; font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--yellow); }
.big-button {
  display: inline-block; margin-top: 20px; padding: 16px 34px; border-radius: 999px;
  font-weight: 900; font-size: 1.15rem; text-decoration: none; color: var(--ink);
  background: var(--yellow); box-shadow: 0 6px 0 var(--orange), 0 0 30px #ffd84a66;
  transition: transform .15s;
}
.big-button:hover { transform: translateY(-3px) rotate(-2deg); }
.big-button[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.exit-links { list-style: none; padding: 0; margin: 26px 0 0; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-weight: 700; }
.footer { text-align: center; padding: 24px 20px 40px; color: #b8a8e0; }

/* ---------- 案内役 ---------- */
.guide {
  position: fixed; right: 12px; bottom: 0; z-index: 50;
  width: 300px; height: 420px;
  pointer-events: none;
  transition: transform .5s cubic-bezier(.3, 1.4, .5, 1);
}
.guide.away { transform: translateY(110%); }
.guide-stage { position: absolute; inset: 0; pointer-events: auto; cursor: pointer; }
.guide-stage canvas { width: 100%; height: 100%; display: block; }
#guide-fallback {
  position: absolute; left: 50%; bottom: 40px; width: 190px; margin-left: -95px;
  border-radius: 50%; border: 6px solid var(--cream); box-shadow: 0 0 0 4px var(--cyan), 0 10px 30px #0008;
  transform-origin: 50% 100%;
}
.guide-bubble {
  position: absolute; right: 230px; bottom: 250px;
  width: min(330px, calc(100vw - 260px));
  padding: 14px 18px 18px; border-radius: 22px;
  background: var(--cream); color: var(--ink);
  box-shadow: 0 0 0 4px var(--cyan), 0 12px 30px #0008;
  pointer-events: auto; cursor: pointer;
  animation: pop .35s cubic-bezier(.2, 1.8, .4, 1);
}
.guide-bubble::after {
  content: ""; position: absolute; right: -16px; bottom: 26px;
  border: 12px solid transparent; border-left: 18px solid var(--cream);
  filter: drop-shadow(4px 0 0 var(--cyan));
}
@keyframes pop { from { transform: scale(.6) translateY(20px); opacity: 0; } }
.guide-name {
  position: absolute; top: -14px; left: 16px; padding: 0 12px; border-radius: 999px;
  font-family: var(--sign); font-size: .78rem; background: var(--cyan); color: var(--ink);
}
.guide-text { margin: 6px 0 0; font-weight: 700; line-height: 1.7; min-height: 1.7em; white-space: pre-wrap; }
.guide-next { position: absolute; right: 14px; bottom: 4px; font-size: .7rem; color: var(--pink); opacity: 0; }
.guide-bubble.waiting .guide-next { opacity: 1; animation: nudge .8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }
.guide-controls { position: absolute; right: 6px; bottom: 8px; display: flex; gap: 6px; pointer-events: auto; }
.guide-controls button, .guide-call {
  cursor: pointer; border: 0; border-radius: 999px; padding: 4px 10px;
  font-weight: 900; font-size: .75rem; color: var(--ink); background: #fff6e5e6;
  box-shadow: 0 2px 0 #0004;
}
.guide-call { position: fixed; right: 14px; bottom: 14px; z-index: 50; padding: 8px 16px; font-size: .85rem; background: var(--cyan); }

@media (max-width: 640px) {
  .guide { width: 170px; height: 240px; right: 0; }
  .guide-bubble { right: 8px; bottom: 236px; width: calc(100vw - 24px); position: fixed; }
  .guide-bubble::after { right: 70px; bottom: -22px; border: 12px solid transparent; border-top: 16px solid var(--cream); filter: drop-shadow(0 4px 0 var(--cyan)); }
  #guide-fallback { width: 120px; margin-left: -60px; bottom: 36px; }
}

/* ---------- プレイヤー ---------- */
dialog#player {
  width: min(1100px, 96vw); height: min(760px, 90vh);
  padding: 0; border: 0; border-radius: 22px; overflow: hidden;
  background: #0b0f2e; color: var(--cream);
  box-shadow: 0 0 0 6px var(--blue), 0 0 0 10px var(--yellow);
}
dialog#player[open] { display: flex; flex-direction: column; }
dialog#player::backdrop { background: #0b0722d9; }
.player-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; font-family: var(--sign); font-weight: 400; }
.player-actions { display: flex; gap: 14px; align-items: center; font-family: var(--round); font-size: .88rem; }
.player-actions button { font-size: 1.1rem; background: none; border: 0; color: var(--cream); cursor: pointer; }
#player-frame { flex: 1; width: 100%; border: 0; background: #000; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
