/* KOOKE GAMES デザインシステム「ゲーセン看板×レトロゲーム雑誌」
   方針: 黒地に看板イエロー、極太見出し(Dela Gothic One)、電光掲示板(DotGothic16)、
   筐体風カード(硬い影+微回転)、CRT走査線、レシート風リザルト。
   詳細は .claude/skills/design-review/SKILL.md を参照 */

:root {
  --bg: #0c0c0e;
  --panel: #141317;
  --ink: #f4efe3;
  --muted: #9b958a;
  --yellow: #ffd400;
  --red: #ff2e63;
  --cyan: #29d9ff;
  --green: #00e5a0;
  --paper: #f4efe3;
  --font-display: "Dela Gothic One", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-dot: "DotGothic16", "Osaka-Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
::selection { background: var(--yellow); color: #111; }

.wrap { max-width: 860px; margin: 0 auto; padding: 20px 16px 60px; }

/* ── 電光掲示板ティッカー ── */
.ticker {
  background: var(--yellow);
  color: #141414;
  font-family: var(--font-dot);
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  padding: 7px 0;
  border-bottom: 3px solid #000;
}
.ticker-inner { display: inline-block; animation: ticker 26s linear infinite; }
.ticker-inner span { padding-right: 2em; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── ヘッダー ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 20px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  color: var(--yellow);
  text-shadow: 2px 2px 0 #000, 4px 4px 0 rgba(255, 46, 99, 0.6);
  letter-spacing: 0.02em;
}
.logo span { color: var(--ink); }
.logo small {
  display: block;
  font-family: var(--font-dot);
  font-size: 11px;
  color: var(--muted);
  text-shadow: none;
  letter-spacing: 0.35em;
}
.open-sign {
  font-family: var(--font-dot);
  font-size: 13px;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 3px;
  padding: 3px 10px;
  animation: blink 2.4s steps(2) infinite;
  flex-shrink: 0;
}
@keyframes blink { 50% { opacity: 0.35; } }
.back { font-family: var(--font-dot); font-size: 13px; color: var(--muted); flex-shrink: 0; }
.back:hover { color: var(--yellow); }

/* ── ヒーロー ── */
.hero { padding: 6px 0 26px; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 6.4vw, 52px);
  line-height: 1.3;
  margin: 0 0 12px;
}
.hero h1 em {
  font-style: normal;
  color: var(--yellow);
  text-shadow: 3px 3px 0 rgba(255, 46, 99, 0.35);
}
.hero p { margin: 0; color: var(--muted); font-size: 15px; }

/* ── 筐体カード ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 24px;
  padding: 14px 4px 8px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel);
  border: 3px solid #2b2830;
  border-radius: 6px;
  padding: 16px 16px 18px;
  color: var(--ink);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.55);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:nth-child(odd) { transform: rotate(-0.7deg); }
.card:nth-child(even) { transform: rotate(0.5deg); }
.card:hover, .card:focus-visible {
  transform: rotate(0deg) translateY(-4px);
  border-color: var(--yellow);
  box-shadow: 10px 12px 0 rgba(255, 212, 0, 0.16);
}
.cab-no {
  font-family: var(--font-dot);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.25em;
  text-align: center;
}
.cab-screen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a1016;
  border: 2px solid #000;
  border-radius: 4px;
  height: 98px;
  font-size: 46px;
  overflow: hidden;
}
.cab-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, 0.32) 2px 4px);
  pointer-events: none;
}
.card h2 { margin: 2px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 19px; }
.card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.75; flex-grow: 1; }
.specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-family: var(--font-dot);
  font-size: 12px;
  color: var(--cyan);
}
.play {
  font-family: var(--font-display);
  font-weight: 400;
  text-align: center;
  background: var(--yellow);
  color: #141414;
  border: 2px solid #000;
  border-radius: 4px;
  padding: 10px;
  letter-spacing: 0.12em;
  box-shadow: 0 4px 0 #8a7300;
}
.card:hover .play { background: #ffe23d; }
.sticker {
  position: absolute;
  top: -14px;
  right: -8px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 #000;
  transform: rotate(7deg);
  z-index: 1;
}

/* ── ゲームページ ── */
.game-header h1 {
  margin: 6px 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 4.5vw, 30px);
}
.game-header p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

.stage {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  cursor: pointer;
  background: #101318;
  border: 4px solid #2b2830;
  border-radius: 8px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.5);
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  overflow: hidden;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, 0.16) 2px 4px);
  pointer-events: none;
  border-radius: 4px;
}
.stage.is-waiting { background: #481020; border-color: var(--red); }
.stage.is-ready { background: #0a3f2c; border-color: var(--green); }
.stage-msg { font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 5vw, 34px); }
.stage-msg.big-num { font-family: var(--font-dot); font-size: clamp(44px, 10vw, 76px); font-variant-numeric: tabular-nums; }
.stage-sub { font-family: var(--font-dot); color: var(--muted); font-size: 14px; }

canvas { display: block; width: 100%; border-radius: 4px; touch-action: none; }

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(6, 8, 10, 0.84);
  border-radius: 4px;
  text-align: center;
  padding: 20px;
}

.hud {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-dot);
  font-size: 15px;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
  margin: 10px 2px;
}

/* ── 瞬間記憶 ── */
.mem-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 420px;
}
.mem-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  color: #141414;
  font-family: var(--font-dot);
  font-size: clamp(20px, 5vw, 30px);
  border: 2px solid #000;
  border-radius: 6px;
  box-shadow: 0 4px 0 #8a7300;
  cursor: pointer;
}
.mem-cell.is-hidden { color: transparent; background: #1c1a20; border-color: #3a3742; box-shadow: 0 4px 0 #000; }
.mem-cell.is-done { visibility: hidden; }
.mem-cell.is-shown { color: #141414; background: var(--yellow); }
.mem-cell.is-wrong { color: #fff; background: var(--red); box-shadow: 0 4px 0 #7a0f2c; }
.mem-empty { aspect-ratio: 1; }

/* ── テンポキープ ── */
.beat-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.beat-dot {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 6px 0 #8a7300, inset 0 0 0 6px #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-dot);
  font-size: 15px;
  color: #141414;
  will-change: transform;
}
.beat-feed { font-family: var(--font-dot); font-size: 16px; min-height: 20px; color: var(--muted); }
.beat-feed.is-good { color: var(--green); }
.beat-feed.is-bad { color: var(--red); }

/* ── タイピングチャレンジ ── */
.type-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.type-kana {
  font-family: var(--font-dot);
  color: var(--cyan);
  font-size: clamp(18px, 4vw, 24px);
  letter-spacing: 0.08em;
}
.type-target {
  font-family: var(--font-dot);
  font-size: clamp(22px, 5.5vw, 34px);
  letter-spacing: 0.04em;
  word-break: break-all;
}
.type-char { color: var(--muted); }
.type-char.is-done { color: var(--green); }
.type-char.is-current { color: var(--ink); border-bottom: 3px solid var(--yellow); }
.type-input {
  width: min(100%, 320px);
  background: #0a1016;
  color: var(--ink);
  border: 2px solid #3a3742;
  border-radius: 4px;
  padding: 12px 14px;
  font-family: var(--font-dot);
  font-size: 18px;
  text-align: center;
  letter-spacing: 0.08em;
}
.type-input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-color: var(--yellow); }

/* ── リザルト(レシート風) ── */
.result {
  margin-top: 22px;
  background: var(--paper);
  color: #17140f;
  border: 2px solid #000;
  border-radius: 4px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.5);
  padding: 24px 20px;
  text-align: center;
}
.result::before {
  content: "─ RESULT ─";
  display: block;
  font-family: var(--font-dot);
  font-size: 12px;
  letter-spacing: 0.4em;
  color: #8a8378;
  margin-bottom: 10px;
}
.rank { font-family: var(--font-display); font-weight: 400; font-size: 78px; line-height: 1.1; }
.rank-SSS, .rank-神 { color: var(--red); text-shadow: 3px 3px 0 rgba(255, 46, 99, 0.25); }
.rank-SS { color: #d98200; }
.rank-S { color: #0a9e6c; }
.rank-A { color: #0a6fbf; }
.rank-B { color: #6b58c9; }
.rank-C, .rank-D, .rank-E { color: #6f6a60; }
.rank-label { font-family: var(--font-dot); color: #6f6a60; font-size: 13px; margin-top: 4px; }
.result .headline { font-size: 24px; font-weight: 800; margin: 12px 0 2px; }
.result .detail { font-family: var(--font-dot); color: #6f6a60; font-size: 13px; }
.notice { margin-top: 12px; font-size: 12px; color: #8a8378; }

/* ── ボタン ── */
.btn {
  display: inline-block;
  appearance: none;
  border: 2px solid #000;
  border-radius: 4px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn:focus-visible, .card:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000 !important; }
.btn-primary { background: var(--yellow); color: #141414; box-shadow: 0 4px 0 #8a7300; }
.btn-ghost { background: #1c1a20; color: var(--ink); border-color: #3a3742; box-shadow: 0 4px 0 #000; }
.result .btn-ghost { background: #17140f; color: var(--paper); border-color: #000; box-shadow: 0 4px 0 #5c564a; }

.share-row {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.hidden { display: none !important; }

/* ── フロア案内板(1F→2F誘導) ── */
.floor-guide {
  margin: 34px 4px 0;
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 3px dashed #3a3742;
  border-radius: 6px;
  padding: 18px 20px;
  color: var(--ink);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.55);
  transform: rotate(-0.4deg);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.floor-guide:hover, .floor-guide:focus-visible {
  border-color: var(--cyan);
  transform: rotate(0deg) translateY(-3px);
  outline: none;
}
.floor-guide .floor-no {
  font-family: var(--font-dot);
  color: var(--cyan);
  font-size: 13px;
  letter-spacing: 0.25em;
}
.floor-guide h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.floor-guide h2 em { font-style: normal; color: var(--cyan); }
.floor-guide p { margin: 0; color: var(--muted); font-size: 13px; flex: 1 1 240px; line-height: 1.75; }
.floor-guide .go {
  font-family: var(--font-display);
  font-size: 14px;
  background: var(--cyan);
  color: #06232b;
  border: 2px solid #000;
  border-radius: 4px;
  padding: 9px 16px;
  box-shadow: 0 4px 0 #0e6a80;
}

/* ── 2F advanceテーマ(シアン基調)──
   2Fのページ(フロアポータル+2F所属ゲーム)は body に .theme-advance を付ける。
   1Fの看板イエローが担う役割を、2Fでは --cyan が担う */
.ticker-advance { background: var(--cyan); }
.theme-advance ::selection { background: var(--cyan); color: #111; }
.theme-advance .logo { color: var(--cyan); }
.theme-advance .hero h1 em { color: var(--cyan); text-shadow: 3px 3px 0 rgba(255, 46, 99, 0.35); }
.theme-advance .card:hover, .theme-advance .card:focus-visible {
  border-color: var(--cyan);
  box-shadow: 10px 12px 0 rgba(41, 217, 255, 0.16);
}
.theme-advance .play { background: var(--cyan); color: #06232b; box-shadow: 0 4px 0 #0e6a80; }
.theme-advance .card:hover .play { background: #63e5ff; }
.theme-advance .hud { color: var(--cyan); }
.theme-advance .btn-primary { background: var(--cyan); color: #06232b; box-shadow: 0 4px 0 #0e6a80; }
.theme-advance .btn-primary:focus-visible { outline-color: var(--yellow); }
.theme-advance .site-footer .footer-title { color: var(--cyan); }

/* ── 2048(A-01号機) ── */
.stage-2048 { touch-action: none; cursor: default; }
.board-2048 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: min(100%, 400px);
  aspect-ratio: 1;
  background: #0a1016;
  border: 2px solid #000;
  border-radius: 6px;
  padding: 8px;
}
.cell-2048 {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  border: 2px solid #000;
  font-family: var(--font-dot);
  font-size: clamp(18px, 5.4vw, 32px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.cell-2048.t-0 { background: #17151b; border-color: #26232b; }
.cell-2048.t-2 { background: var(--paper); color: #17140f; }
.cell-2048.t-4 { background: #ffe9a3; color: #17140f; }
.cell-2048.t-8 { background: var(--yellow); color: #141414; }
.cell-2048.t-16 { background: #ffab00; color: #141414; }
.cell-2048.t-32 { background: #ff7a2f; color: #fff; }
.cell-2048.t-64 { background: #ff4d3d; color: #fff; }
.cell-2048.t-128 { background: var(--red); color: #fff; }
.cell-2048.t-256 { background: var(--cyan); color: #062430; }
.cell-2048.t-512 { background: var(--green); color: #062b1f; }
.cell-2048.t-1024 { background: #17140f; color: var(--cyan); border-color: var(--cyan); }
.cell-2048.t-2048 {
  background: #17140f;
  color: var(--yellow);
  border-color: var(--yellow);
  box-shadow: 0 0 14px rgba(255, 212, 0, 0.55);
}
.cell-2048.t-big { background: var(--yellow); color: #141414; box-shadow: 0 0 14px rgba(255, 212, 0, 0.55); }
.cell-2048.is-new { animation: tile-in 0.16s ease; }
.cell-2048.is-merged { animation: tile-merge 0.2s ease; }
@keyframes tile-in { from { transform: scale(0.3); } }
@keyframes tile-merge { 50% { transform: scale(1.18); } }
.overlay-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── フッター(店舗案内板) ── */
.site-footer {
  margin-top: 52px;
  border-top: 2px dashed #3a3742;
  padding-top: 20px;
  text-align: center;
  font-family: var(--font-dot);
  font-size: 12px;
  color: var(--muted);
  line-height: 2.1;
}
.site-footer .footer-title { color: var(--yellow); letter-spacing: 0.3em; margin-bottom: 4px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .ticker-inner, .open-sign { animation: none; }
  .card, .card:hover { transition: none; }
  .cell-2048.is-new, .cell-2048.is-merged { animation: none; }
  .floor-guide, .floor-guide:hover { transition: none; }
}
