/* onininon 工作室網站共用樣式：首頁、遊戲介紹頁都用這份 */
:root {
  --bg: #0b0d12;
  --bg-raised: #131722;
  --bg-high: #1a1f2d;
  --line: #242b3b;
  --text: #eef1f6;
  --muted: #9aa4b5;
  --coral: #ff6a3d;       /* 主色：洋蔥外層 */
  --amber: #ffb43d;
  --mint: #3ee6b0;        /* 洋蔥的芽 */
  --max: 1160px;
  --cut: 14px;            /* 按鈕、卡片的斜角 */
  --display: "Space Grotesk", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
html[data-lang="zh"] [data-l="en"],
html[data-lang="en"] [data-l="zh"] { display: none !important; }
a { color: inherit; }
img { max-width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }

/* ── header ── */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11,13,18,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .01em; }
.logo img { width: 30px; height: 30px; border-radius: 8px; }
.logo .hl { color: var(--coral); }
nav.links { display: flex; align-items: center; gap: 24px; font-size: 14px; }
nav.links a { text-decoration: none; color: var(--muted); }
nav.links a:hover { color: var(--text); }
.lang {
  border: 1px solid var(--line); background: transparent; color: var(--text);
  font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
}
.lang:hover { border-color: var(--mint); }
@media (max-width: 640px) { nav.links a.opt { display: none; } }

/* ── buttons ── */
.btn {
  --c: var(--bg-high);
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-weight: 700; font-size: 15px; letter-spacing: .02em;
  padding: 12px 24px; background: var(--c); color: var(--text);
  clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
  transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn.primary { --c: var(--coral); color: #1a0d07; }
.btn.mint { --c: var(--mint); color: #062018; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line); clip-path: none; border-radius: 8px; }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--mint); }
.btn[aria-disabled="true"] { --c: var(--bg-high); color: var(--muted); pointer-events: none; }

/* ── section headings ── */
section { padding: 88px 0; }
.h2 {
  font-family: var(--display); font-size: clamp(26px, 3.6vw, 40px); line-height: 1.2;
  margin: 0 0 10px; font-weight: 700; font-style: italic; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 14px;
}
.h2::before { content: ""; width: 6px; height: .95em; background: var(--coral); transform: skewX(-14deg); }
.sub { color: var(--muted); max-width: 44em; margin: 0 0 40px; }

/* ── chips / badges ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; line-height: 1; padding: 6px 10px; border: 1px solid var(--line); color: var(--muted);
}
.chip.plat { color: var(--mint); border-color: rgba(62,230,176,.35); background: rgba(62,230,176,.06); }
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; line-height: 1; padding: 6px 12px 6px 10px;
  background: var(--mint); color: #062018;
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.badge.proto { background: var(--amber); color: #2a1a02; }
.badge.concept { background: var(--bg-high); color: var(--muted); }

/* ── home hero ── */
.hero { position: relative; overflow: hidden; padding: 104px 0 96px; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 420px at 82% 40%, rgba(255,106,61,.16), transparent 70%),
    radial-gradient(520px 380px at 12% 90%, rgba(62,230,176,.10), transparent 70%);
  mask-image: linear-gradient(#000 60%, transparent);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 10%, transparent 65%);
}
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr .75fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } .toy { max-width: 340px; } }
.eyebrow { display: inline-block; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--mint); margin-bottom: 18px; }
.wordmark {
  font-family: var(--display); font-weight: 700; line-height: .95; margin: 0 0 26px;
  font-size: clamp(56px, 10vw, 128px); letter-spacing: -.03em;
}
.wordmark .hl { color: var(--coral); }
.lede { font-size: clamp(16px, 1.8vw, 19px); color: #c7cfdb; max-width: 34em; margin: 0 0 36px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.mark { justify-self: center; width: 100%; max-width: 340px; aspect-ratio: 1; position: relative; }
.mark img { width: 100%; height: 100%; border-radius: 22%; box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(255,106,61,.25); }

/* ── game cards (home) ── */
.games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 640px) { .games { grid-template-columns: 1fr; } }
.game {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--bg-raised); border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  transition: border-color .15s, transform .15s;
}
.game:hover { border-color: var(--coral); transform: translateY(-3px); }
.game .cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-high); }
.game .cover img, .game .cover svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.game .cover .badge { position: absolute; left: 0; top: 14px; }
.game .body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.game h3 { margin: 0; font-size: 22px; line-height: 1.3; }
.game .alt { margin: -6px 0 0; font-size: 13px; color: var(--amber); font-weight: 700; }
.game p { margin: 0; color: var(--muted); font-size: 15px; }
.game .more { margin-top: auto; padding-top: 8px; font-weight: 700; font-size: 14px; color: var(--coral); }

/* ── news / about / contact ── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.panel { background: var(--bg-raised); border: 1px solid var(--line); border-left: 3px solid var(--mint); padding: 26px 28px; }
.panel p { margin: 0 0 12px; color: #c7cfdb; }
.panel p:last-child { margin: 0; }
.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.news li { display: grid; grid-template-columns: 6.5em 1fr; gap: 14px; font-size: 15px; }
.news time { color: var(--mint); font-variant-numeric: tabular-nums; }
.news a { color: var(--text); }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
.card { background: var(--bg-raised); border: 1px solid var(--line); padding: 22px 24px; }
.card h4 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.contact {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
  background: linear-gradient(120deg, rgba(255,106,61,.16), rgba(62,230,176,.08));
  border: 1px solid var(--line); padding: 36px 34px;
}
.contact h2 { margin: 0 0 4px; font-family: var(--display); font-size: clamp(24px, 3vw, 34px); }
.contact p { margin: 0; color: #c7cfdb; }
[hidden] { display: none !important; }
.contact .cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.contact .mail { font-family: var(--display); font-size: clamp(20px, 3vw, 28px); font-weight: 700; text-decoration: none; border-bottom: 3px solid var(--coral); }

footer.bottom { border-top: 1px solid var(--line); padding: 28px 0 44px; color: var(--muted); font-size: 13px; }
footer.bottom .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ── game intro page ── */
.ghero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.ghero .bgimg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(36px) saturate(1.2); opacity: .45; }
.ghero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,13,18,.35), var(--bg) 96%); }
.ghero .wrap { position: relative; z-index: 1; text-align: center; padding-top: 36px; padding-bottom: 64px; }
.ghero .back { display: block; width: max-content; margin: 0 0 22px; }
.back { display: inline-block; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 26px; }
.back:hover { color: var(--text); }
.ghero .keyart { display: block; width: 100%; height: auto; max-width: 640px; margin: 0 auto 30px; aspect-ratio: 1200 / 630; object-fit: cover; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.ghero h1 { font-family: var(--display); font-size: clamp(34px, 6vw, 60px); line-height: 1.1; margin: 0 0 8px; letter-spacing: -.01em; }
.ghero .alt { color: var(--amber); font-weight: 700; margin: 0 0 16px; }
.ghero .chips { justify-content: center; margin-bottom: 34px; }
.play {
  display: inline-flex; align-items: center; gap: 14px; text-decoration: none;
  font-family: var(--display); font-size: clamp(22px, 3vw, 28px); font-weight: 700; letter-spacing: .04em;
  padding: 20px 56px; background: var(--coral); color: #1a0d07;
  clip-path: polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%);
  box-shadow: 0 0 0 0 rgba(255,106,61,.5);
  transition: filter .15s, transform .15s;
  animation: pulse 2.4s ease-in-out infinite;
}
.play:hover { filter: brightness(1.1); transform: scale(1.03); }
.play svg { width: 22px; height: 22px; }
.play[aria-disabled="true"] { background: var(--bg-high); color: var(--muted); pointer-events: none; animation: none; }
@keyframes pulse { 50% { filter: brightness(1.12) drop-shadow(0 0 18px rgba(255,106,61,.55)); } }
@media (prefers-reduced-motion: reduce) { .play { animation: none; } }
.playnote { display: block; margin-top: 14px; font-size: 14px; color: var(--muted); }

.intro { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .intro { grid-template-columns: 1fr; } }
.intro p { color: #c7cfdb; margin: 0 0 16px; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.facts li { display: grid; grid-template-columns: 6em 1fr; gap: 12px; font-size: 15px; }
.facts b { color: var(--muted); font-weight: 500; }
.feat { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.feat li { position: relative; padding-left: 22px; color: #c7cfdb; }
.feat li::before { content: ""; position: absolute; left: 0; top: .7em; width: 10px; height: 3px; background: var(--mint); }

.machine { margin-top: 64px; }
.machine h3 { font-size: clamp(22px, 2.8vw, 30px); margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.machine .tagline { color: var(--muted); margin: 0 0 22px; max-width: 46em; }
.shots { display: grid; gap: 14px; }
.shots.portrait { grid-template-columns: repeat(5, 1fr); }
.shots.wide { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .shots.portrait { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) {
  .shots.portrait { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .shots.portrait figure { scroll-snap-align: start; }
  .shots.wide { grid-template-columns: 1fr; }
}
.shots figure { margin: 0; }
.shots button { all: unset; cursor: zoom-in; display: block; width: 100%; }
.shots img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--bg-high); transition: border-color .15s; }
.shots button:hover img, .shots button:focus-visible img { border-color: var(--coral); }
.shots figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.note { font-size: 13px; color: var(--muted); }

.more-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.mini { display: block; text-decoration: none; background: var(--bg-raised); border: 1px solid var(--line); transition: border-color .15s; }
.mini:hover { border-color: var(--coral); }
.mini .cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-high); }
.mini .cover img, .mini .cover svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini div:last-child { padding: 12px 16px 14px; }
.mini b { display: block; }
.mini span { font-size: 13px; color: var(--muted); }

/* 截圖放大 */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(5,6,9,.92); display: none; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border: 1px solid var(--line); }

/* ── 好玩的部分：會跳的字、小鬼洋蔥、迷你柏青哥、跑馬燈、貼紙 ── */
.wordmark .bounce { display: inline-flex; }
.wordmark i, .wordmark b { font-style: normal; font-weight: 700; display: inline-block; transition: transform .25s cubic-bezier(.3,1.8,.5,1), color .2s; }
.wordmark b { color: var(--coral); }
.wordmark i:hover, .wordmark b:hover { transform: translateY(-.18em) rotate(-6deg); color: var(--mint); }
.wordmark.wave i, .wordmark.wave b { animation: wave .7s cubic-bezier(.3,1.6,.5,1) both; }
.wordmark.wave :nth-child(2) { animation-delay: .05s } .wordmark.wave :nth-child(3) { animation-delay: .1s }
.wordmark.wave :nth-child(4) { animation-delay: .15s } .wordmark.wave :nth-child(5) { animation-delay: .2s }
.wordmark.wave :nth-child(6) { animation-delay: .25s } .wordmark.wave :nth-child(7) { animation-delay: .3s }
.wordmark.wave :nth-child(8) { animation-delay: .35s }
@keyframes wave { 40% { transform: translateY(-.22em); } }

.toy {
  position: relative; justify-self: center; width: 100%; max-width: 380px; aspect-ratio: 4 / 5;
  background: radial-gradient(circle at 50% 30%, var(--bg-high), var(--bg-raised) 70%);
  border: 1px solid var(--line); border-radius: 28px; overflow: hidden; cursor: pointer;
  box-shadow: 0 30px 80px rgba(255,106,61,.18), inset 0 0 0 6px rgba(255,255,255,.02);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.toy canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mascot { position: absolute; left: 50%; top: 4%; width: 30%; transform: translateX(-50%); overflow: visible; pointer-events: none; }
.mascot-body { transform-origin: 256px 420px; transform-box: view-box; }
.mascot .eyes { transform-origin: 256px 290px; transform-box: view-box; animation: blink 4.2s infinite; }
.mascot .sprout { transform-origin: 256px 168px; transform-box: view-box; animation: sway 2.6s ease-in-out infinite; }
.toy.poke .mascot-body { animation: squish .45s cubic-bezier(.3,1.8,.5,1); }
.toy.poke .mouth, .toy.happy .mouth { opacity: 1; }
.toy.happy .mascot-body { animation: hop .5s cubic-bezier(.3,1.8,.5,1) 3; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes sway { 50% { transform: rotate(9deg); } }
@keyframes squish { 30% { transform: scale(1.12, .86); } 60% { transform: scale(.94, 1.08); } }
@keyframes hop { 40% { transform: translateY(-14%) rotate(-6deg); } }
.toy-hud {
  position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted); letter-spacing: .06em; pointer-events: none;
}
.toy-hud b { color: var(--amber); font-variant-numeric: tabular-nums; font-size: 15px; }
.toy-tip {
  position: absolute; left: 50%; top: 42%; transform: translateX(-50%); pointer-events: none;
  font-size: 13px; font-weight: 700; color: var(--mint); background: rgba(11,13,18,.8); padding: 6px 12px; border-radius: 999px;
  animation: nudge 1.4s ease-in-out infinite; transition: opacity .3s;
}
.toy.played .toy-tip { opacity: 0; }
@keyframes nudge { 50% { transform: translate(-50%, 6px); } }
.toy-banner {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0) rotate(-8deg); pointer-events: none;
  font-family: var(--display); font-size: clamp(34px, 6vw, 52px); font-weight: 700; color: var(--amber);
  text-shadow: 0 0 18px rgba(255,180,61,.8), 0 4px 0 #7a3a10; white-space: nowrap;
}
.toy.happy .toy-banner { animation: banner 1.5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes banner { 15% { transform: translate(-50%, -50%) scale(1.15) rotate(-8deg); } 25%, 80% { transform: translate(-50%, -50%) scale(1) rotate(-8deg); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1) rotate(-8deg); opacity: 0; } }

.ticker-wrap { overflow: hidden; padding-block: 10px; }
.ticker { overflow: hidden; border-block: 1px solid var(--line); background: var(--coral); color: #1a0d07; transform: rotate(-1.2deg); margin: 0 -2%; }
.ticker-track { display: flex; width: max-content; animation: ticker 38s linear infinite; }
.ticker span { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .08em; padding: 10px 22px; white-space: nowrap; }
.ticker span::after { content: "✦"; margin-left: 44px; }
@keyframes ticker { to { transform: translateX(-50%); } }

.game { transform-style: preserve-3d; will-change: transform; }
.game .cover img { transition: transform .4s; }
.game:hover .cover img { transform: scale(1.06); }
.sticker {
  position: absolute; right: 14px; bottom: 14px; font-weight: 800; font-size: 14px; padding: 6px 12px;
  background: var(--amber); color: #2a1a02; border-radius: 6px; transform: rotate(6deg) scale(0); transition: transform .3s cubic-bezier(.3,1.8,.5,1);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.sticker.mint { background: var(--mint); color: #062018; }
.game:hover .sticker, .game:focus-visible .sticker { transform: rotate(6deg) scale(1); }
@media (hover: none) { .sticker { transform: rotate(6deg) scale(1); } }

/* 介紹頁的大按鈕：按下去噴鋼珠 */
.spark { position: fixed; z-index: 60; width: 12px; height: 12px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #fff, #c9d2dc 45%, #6b7685); box-shadow: 0 0 6px rgba(255,255,255,.5); }

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .mascot .eyes, .mascot .sprout, .toy-tip { animation: none; }
  .wordmark.wave i, .wordmark.wave b { animation: none; }
}
