:root {
  --paper: #f5f6f2;
  --surface: #ffffff;
  --ink: #171917;
  --muted: #636860;
  --line: #dfe3dc;
  --acid: #c8f53c;
  --blue: #5bd6e8;
  --danger: #ee6657;
  --shadow: 0 12px 30px rgba(18, 24, 18, .09);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; line-height: 1.7; background: var(--paper); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; opacity: .34; background-image: linear-gradient(rgba(20,25,20,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(20,25,20,.035) 1px, transparent 1px); background-size: 24px 24px; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
button, select { font: inherit; }
button { touch-action: manipulation; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 4px solid rgba(91,214,232,.55); outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: #111; color: #fff; padding: .75rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.shell { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(23,25,23,.12); background: rgba(245,246,242,.92); backdrop-filter: blur(12px); }
.header-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { display: inline-flex; align-items: center; gap: .7rem; font-weight: 900; text-decoration: none; letter-spacing: -.04em; }
.logo-mark { display: grid; place-items: center; width: 38px; aspect-ratio: 1; border: 2px solid #111; border-radius: 50% 50% 46% 54%; background: var(--acid); box-shadow: 3px 3px 0 #111; transform: rotate(-4deg); }
.nav { display: flex; gap: 1.1rem; align-items: center; }
.nav a { text-decoration: none; font-size: .92rem; font-weight: 700; }
.hero { padding: clamp(3rem, 8vw, 7rem) 0 3rem; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.eyebrow, .lab-label { display: inline-flex; gap: .45rem; align-items: center; width: fit-content; font-size: .78rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 4px rgba(200,245,60,.25); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.045em; }
h1 { margin: .8rem 0 1rem; font-size: clamp(2.7rem, 8vw, 6.6rem); }
h2 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.7rem); }
h3 { margin: 0; font-size: 1.22rem; }
.hero-copy { max-width: 39rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.17rem); }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 2px solid #151715; border-radius: 999px; padding: .72rem 1.2rem; color: #111; background: var(--acid); box-shadow: 3px 3px 0 #111; font-weight: 900; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.button:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 #111; }
.button:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 #111; }
.button.secondary { background: #fff; }
.button.danger { background: var(--danger); color: #fff; }
.specimen { min-height: 370px; position: relative; display: grid; place-items: center; overflow: hidden; border: 2px solid #111; border-radius: 48% 52% 45% 55% / 54% 44% 56% 46%; background: var(--blue); box-shadow: 12px 14px 0 #111; }
.specimen::before, .specimen::after { content: ""; position: absolute; border: 3px solid #111; border-radius: 50%; }
.specimen::before { width: 220px; height: 220px; background: var(--acid); }
.specimen::after { width: 128px; height: 128px; background: #fff; }
.specimen-face { z-index: 1; font-size: 4rem; transform: rotate(-6deg); }
.section { padding: 3.5rem 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.section-kicker { margin: .4rem 0 0; color: var(--muted); }
.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.game-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 0 rgba(23,25,23,.08); transition: transform .18s, box-shadow .18s; }
.game-card:hover { transform: translateY(-4px) rotate(-.2deg); box-shadow: var(--shadow); }
.thumb { position: relative; display: grid; place-items: center; min-height: 150px; overflow: hidden; background: var(--card-color, var(--blue)); font-size: 3.2rem; border-bottom: 1px solid var(--line); }
.thumb::after { content: "LAB " attr(data-no); position: absolute; right: .7rem; bottom: .35rem; font-size: .7rem; font-weight: 900; letter-spacing: .16em; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 1rem; }
.meta { display: flex; flex-wrap: wrap; gap: .4rem; margin: .65rem 0; color: var(--muted); font-size: .78rem; }
.badge { display: inline-flex; align-items: center; border: 1px solid #111; border-radius: 999px; padding: .08rem .48rem; background: #fff; color: #111; font-size: .7rem; font-weight: 900; }
.badge.hot { background: var(--acid); }
.card-link { margin-top: auto; font-weight: 900; }
.ad-slot { display: grid; place-items: center; min-height: 110px; margin: 2rem 0; border: 1px dashed #9ca39a; border-radius: 16px; color: #777d75; background: rgba(255,255,255,.55); font-size: .8rem; letter-spacing: .12em; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.4rem 0; }
.filter-button { min-height: 44px; border: 1px solid #bcc2ba; border-radius: 999px; padding: .45rem .8rem; background: #fff; font-weight: 800; cursor: pointer; }
.filter-button[aria-pressed="true"] { border-color: #111; background: var(--acid); box-shadow: 2px 2px 0 #111; }
.page-hero { padding: 3.2rem 0 1.8rem; }
.page-hero h1 { font-size: clamp(2.3rem, 7vw, 4.7rem); }
.breadcrumb { padding-top: 1rem; color: var(--muted); font-size: .86rem; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1.5rem; align-items: start; }
.game-panel { border: 2px solid #111; border-radius: 28px; padding: clamp(1rem, 4vw, 2rem); background: #fff; box-shadow: 7px 8px 0 #111; }
.game-stage { min-height: 340px; display: grid; place-items: center; align-content: center; gap: 1rem; overflow: hidden; border-radius: 18px; padding: 1rem; text-align: center; background: #ecefe9; touch-action: manipulation; user-select: none; }
.game-stage.action { cursor: pointer; }
.game-stage.waiting { background: #e8e5da; }
.game-stage.ready { background: var(--acid); }
.game-stage.fail { background: #ffd5cf; }
.game-status { margin: 0; font-size: clamp(1.4rem, 5vw, 2.5rem); font-weight: 950; line-height: 1.15; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; width: 100%; }
.metric { padding: .75rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.metric b { display: block; font-size: 1.25rem; }
.settings { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; justify-content: space-between; margin: 1rem 0 0; }
.settings label { font-weight: 800; }
.settings select { min-height: 44px; border: 1px solid #aaa; border-radius: 10px; padding: .35rem .6rem; background: #fff; }
.result-card { margin-top: 1rem; padding: 1rem; border: 2px solid #111; border-radius: 18px; background: #fff; }
.result-card[hidden] { display: none; }
.content-card { margin-top: 1rem; padding: clamp(1.2rem,3vw,2rem); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.content-card p:last-child { margin-bottom: 0; }
.content-card li + li { margin-top: .4rem; }
.title-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; padding: 0; list-style: none; }
.title-list li { padding: .7rem; border-left: 4px solid var(--acid); background: #f4f5f0; }
/* サイドバーは現在空(広告枠は審査後に設置)のため非表示。広告導入時にこの2行を戻す */
.sidebar { position: sticky; top: 90px; display: none; }
.game-layout { grid-template-columns: minmax(0, 1fr); }
.sidebar .ad-slot { min-height: 280px; }
.notice { padding: .85rem 1rem; border-left: 5px solid var(--blue); background: #eefbfc; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 2rem; font-size: 1.65rem; }
.site-footer { margin-top: 4rem; padding: 2.5rem 0; border-top: 1px solid var(--line); background: #1a1d19; color: #f6f7f3; }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; }
.footer-links a { color: inherit; }
.copyright { color: #aeb5aa; font-size: .82rem; }
.cat-scene { position: relative; width: min(100%, 530px); height: 270px; border-radius: 20px; background: #dfe6d7; }
.cat { position: absolute; left: 50%; top: 45%; width: 130px; height: 86px; border-radius: 55% 48% 45% 52%; background: #e6a959; transform: translate(-50%,-50%); }
.cat::before { content: "⌁ ᴗ ⌁"; position: absolute; width: 95px; left: 20px; top: 18px; font-weight: 900; }
.cat::after { content: ""; position: absolute; right: -35px; bottom: 8px; width: 65px; height: 25px; border: 12px solid #e6a959; border-left: 0; border-bottom: 0; border-radius: 50%; }
.pickup { position: absolute; display: grid; place-items: center; width: 64px; height: 64px; border: 2px solid #111; border-radius: 16px; background: #fff; font-size: 1.7rem; cursor: grab; touch-action: none; box-shadow: 3px 3px 0 #111; }
.pickup:nth-child(2) { left: 8%; bottom: 10%; }
.pickup:nth-child(3) { right: 8%; bottom: 12%; }
.pickup:nth-child(4) { right: 12%; top: 8%; }
.pickup.collected { opacity: .2; pointer-events: none; transform: scale(.8); }
.meter { width: 100%; height: 16px; overflow: hidden; border: 2px solid #111; border-radius: 999px; background: #fff; }
.meter > span { display: block; width: 0; height: 100%; background: var(--danger); transition: width .15s; }
.boss { width: 150px; padding: .7rem; border: 2px solid #111; border-radius: 20px; background: #fff; font-size: 4rem; transition: transform .2s; }
.boss.looking { transform: rotateY(0); background: #ffd8d2; }
.boss.away { transform: rotateY(180deg); background: #dff5e3; }
.big-tap { width: min(100%, 340px); min-height: 100px; font-size: 1.25rem; }
.shake { animation: shake .3s; }
.extra-stage { min-height: 390px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; width: 100%; }
.choice-button { min-height: 64px; border: 2px solid #111; border-radius: 14px; padding: .7rem; background: #fff; box-shadow: 2px 2px 0 #111; font-weight: 900; cursor: pointer; }
.choice-button:hover { background: var(--acid); }
.choice-button:disabled { opacity: .55; cursor: not-allowed; }
.large-display { font-size: clamp(3rem, 13vw, 7rem); line-height: 1; }
.progress-track { position: relative; width: 100%; height: 28px; border: 2px solid #111; border-radius: 999px; background: #fff; overflow: hidden; }
.progress-marker { position: absolute; top: 0; bottom: 0; width: 6px; left: 50%; background: #111; transition: left .08s linear; }
.progress-zone { position: absolute; top: 0; bottom: 0; left: 43%; width: 14%; background: var(--acid); }
.train-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; width: min(100%, 360px); }
.train-cell { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #999; border-radius: 8px; background: #fff; font-size: 1.35rem; }
.train-cell.player { background: var(--acid); border: 2px solid #111; }
.train-cell.exit { background: var(--blue); }
.train-cell.blocked { background: #d8dbd5; }
.typing-input { width: 100%; min-height: 54px; border: 2px solid #111; border-radius: 12px; padding: .7rem; font: inherit; font-size: 1.05rem; }
.versus { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; width: 100%; }
.versus .choice-button { min-height: 130px; font-size: 1.25rem; }
.rank-list { width: 100%; margin: 0; padding: 0; list-style: none; text-align: left; }
.rank-list li { display: flex; justify-content: space-between; padding: .45rem .65rem; border-bottom: 1px solid var(--line); }
.tiny-note { color: var(--muted); font-size: .78rem; }
.canvas-wrap { width: 100%; max-width: 520px; margin-inline: auto; overflow: hidden; border: 2px solid #111; border-radius: 18px; background: #e9ece6; box-shadow: inset 0 0 0 1px rgba(255,255,255,.6); }
.game-canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; touch-action: none; background: transparent; }
.canvas-hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; width: 100%; }
.canvas-hud > div { padding: .55rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: .8rem; }
.canvas-hud b { display: block; font-size: 1.15rem; }
.control-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; width: 100%; }
.control-pad .choice-button { min-height: 58px; }
@keyframes shake { 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }

@media (max-width: 820px) {
  .hero-grid, .game-layout { grid-template-columns: 1fr; }
  .specimen { min-height: 260px; width: min(100%, 420px); margin-inline: auto; }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { position: static; }
  .sidebar .ad-slot { min-height: 110px; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 22px, 1120px); }
  .nav a:not(:last-child) { display: none; }
  .game-grid { grid-template-columns: 1fr; }
  .section { padding: 2.5rem 0; }
  .section-head { align-items: start; flex-direction: column; }
  .metric-row, .title-list { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .canvas-hud { grid-template-columns: repeat(3, 1fr); }
  .game-stage { min-height: 310px; }
  .footer-grid { grid-template-columns: 1fr; }
  .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
