/* Kinopi Studio homepage */
:root {
  --sun: #ffd84d;
  --ink: #231a12;
  --ink-soft: #5b4a36;
  --paper: #ffffff;
  --line: #efe6cf;
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "PingFang TC", sans-serif;
  --pad: clamp(16px, 4vw, 48px);
  --wrap: 1280px;
  --radius: 28px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
html[lang="zh-TW"] { --font: "Huninn", "M PLUS Rounded 1c", "PingFang TC", "Noto Sans TC", sans-serif; }
html[lang="ko"] { --font: "Gowun Dodum", "M PLUS Rounded 1c", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; word-break: keep-all; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 1.0625rem; line-height: 1.7; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--sun); color: var(--ink); }

.skip { position: absolute; left: 12px; top: -80px; z-index: 10; padding: 10px 16px; background: var(--ink); color: var(--sun); border-radius: 10px; }
.skip:focus { top: 12px; }

/* Top bar */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--wrap); margin: 0 auto; padding: 20px var(--pad);
}
.top-wrap { background: var(--sun); }
.mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; font-size: 1.0625rem; }
.mark img { width: 32px; height: 32px; }
.lang { display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: rgba(35, 26, 18, 0.08); }
.lang button {
  min-height: 36px; padding: 0 12px; border: 0; border-radius: 99px; background: transparent;
  color: var(--ink); font: 500 0.875rem/1 var(--font); cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--sun); }

/* Hero: who we are, beside the two game posters */
.hero-wrap { background: var(--sun); overflow: hidden; }
.hero {
  max-width: var(--wrap); margin: 0 auto; padding: clamp(16px, 4vw, 48px) var(--pad) 0;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 72px); align-items: center;
}
.hero-copy { padding-bottom: clamp(40px, 6vw, 88px); }
.hero h1 {
  font-family: "M PLUS Rounded 1c", var(--font);
  font-size: clamp(3.25rem, 1.6rem + 6vw, 7.5rem); font-weight: 800; line-height: 0.95; letter-spacing: -0.035em;
}
.hero-text { margin-top: clamp(18px, 2.4vw, 28px); font-size: clamp(1.25rem, 1rem + 0.9vw, 1.75rem); font-weight: 800; line-height: 1.45; max-width: 22em; }
html[lang="zh-TW"] .hero-text, html[lang="ko"] .hero-text { font-weight: 400; }
html[lang="ja"] .hero-text, html[lang="ja"] .group-head h2 { word-break: auto-phrase; }
.hero-sub { margin-top: 12px; color: var(--ink-soft); max-width: 32em; }
.hero-jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.jump {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 99px;
  background: var(--ink); color: var(--sun); font-weight: 800; text-decoration: none; transition: transform 200ms var(--ease);
}
.jump.is-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.jump:hover { transform: translateY(-2px); }

/* The capsule machine: turn the crank, a capsule rolls out with one of our works inside */
.gacha { position: relative; align-self: end; justify-self: center; width: min(100%, 380px); padding-bottom: clamp(28px, 4vw, 48px); }
.gacha-stage { position: relative; width: 100%; aspect-ratio: 360 / 520; }
.gacha:not(.has-turned) .crank { animation: g-hint 3.2s ease-in-out infinite 1.5s; }
@keyframes g-hint { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-18deg); } 88% { transform: rotate(10deg); } }
.gacha-machine .cat-eye { transform-box: fill-box; transform-origin: center; animation: g-blink 5.2s ease-in-out infinite 1.2s; }
@keyframes g-blink { 0%, 42%, 48%, 100% { transform: scaleY(1); } 45% { transform: scaleY(.12); } }
@media (prefers-reduced-motion: reduce) {
  .gacha .crank, .gacha .cat-eye { animation: none !important; }
  .gacha-count img { transition: none; }
}
.gacha-machine { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; cursor: pointer; }
.gacha-machine .crank, .gacha-machine .caps > g > g, .gacha-machine .body { transform-box: fill-box; transform-origin: center; }
.gacha-machine .body { transform-origin: 50% 100%; }
.gacha-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; margin-top: 10px; }
.gacha-turn {
  min-height: 48px; padding: 0 26px; border: 0; border-radius: 99px; background: var(--ink); color: var(--sun);
  font: 800 1rem/1 var(--font); cursor: pointer; transition: transform 0.2s var(--ease);
}
.gacha-turn:hover { transform: translateY(-2px); }
.gacha-turn:active { transform: translateY(1px); }
.gacha-turn:disabled { opacity: 0.6; cursor: default; transform: none; }
.gacha-count { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 500; }
.gacha-count .dots { display: flex; gap: 4px; }
.gacha-count img { width: 20px; height: 20px; border-radius: 6px; opacity: 0.25; filter: grayscale(1); transition: opacity 0.3s, filter 0.3s; }
.gacha-count img.got { opacity: 1; filter: none; }

/* The capsule that rolls out */
.cap-drop { position: absolute; width: 15.5%; aspect-ratio: 1; pointer-events: none; z-index: 3; }
.cap-drop span { position: absolute; left: 0; right: 0; height: 50%; border: 3px solid var(--ink); }
.cap-drop .top { top: 0; padding: 0; border-radius: 999px 999px 0 0; border-bottom-width: 1.5px; background: #fff6da; }
.cap-drop .top::after { content: ""; position: absolute; left: 16%; top: 20%; width: 15%; height: 45%; border-radius: 99px; background: #fff; rotate: 35deg; }
.cap-drop .bottom { bottom: 0; border-radius: 0 0 999px 999px; border-top-width: 1.5px; background: var(--accent); box-shadow: inset 0 -5px 0 rgba(35, 26, 18, 0.12); }
.cap-drop img { position: absolute; left: 22%; top: 22%; width: 56%; height: 56%; border-radius: 22%; }
.cap-flash { position: absolute; z-index: 2; width: 28%; aspect-ratio: 1; border: 5px solid #fff6da; border-radius: 50%; background: #fff6da; pointer-events: none; }
.cap-flash::after { content: ""; position: absolute; inset: -16%; border: 2px solid #fff6da; border-radius: 50%; }

/* What came out */
.gacha-card {
  position: absolute; left: 50%; top: 4%; z-index: 4; width: min(310px, 94%); translate: -50% 0;
  padding: 22px 22px 20px; border-radius: 26px; background: #fff; color: var(--ink);
  box-shadow: 0 24px 60px rgba(35, 26, 18, 0.3), 0 0 0 4px var(--ink);
  text-align: center; transform-origin: 50% 90%;
}
.gacha-card[hidden] { display: none; }
.gacha-card .icon { width: 84px; height: 84px; margin: 0 auto; border-radius: 22.5%; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2); }
.gacha-card .got { margin-top: 14px; color: var(--accent); font-size: 0.8125rem; font-weight: 800; }
.gacha-card h3 { margin-top: 2px; font-size: 1.625rem; font-weight: 800; line-height: 1.2; }
html[lang="zh-TW"] .gacha-card h3, html[lang="ko"] .gacha-card h3 { font-weight: 400; }
.gacha-card .kind { margin-top: 4px; color: var(--ink-soft); font-size: 0.875rem; }
.gacha-card .line { margin-top: 10px; font-weight: 500; line-height: 1.55; }
.gacha-card .acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.gacha-card .acts a, .gacha-card .acts button {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: 99px; border: 0;
  font: 800 0.875rem/1 var(--font); text-decoration: none; cursor: pointer;
}
.gacha-card .more { background: var(--ink); color: var(--sun); }
.gacha-card .again { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.gacha-card .x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(35, 26, 18, 0.06); cursor: pointer; }
.gacha-card .x svg { width: 14px; height: 14px; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
.confetti { position: absolute; z-index: 5; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; }

/* App groups */
.group { max-width: var(--wrap); margin: 0 auto; padding: clamp(56px, 8vw, 104px) var(--pad) 0; scroll-margin-top: 0; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin-bottom: clamp(20px, 2.4vw, 32px); }
.group-head h2 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); font-weight: 800; line-height: 1.15; }
html[lang="zh-TW"] .group-head h2, html[lang="ko"] .group-head h2 { font-weight: 400; }
.group-head p { color: var(--ink-soft); }

/* Catalogue cards, three to a row: fanned screens on the app's colour, then name, line and stores */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
.card {
  --bg: #eee; --fg: var(--ink); --soft: var(--ink-soft);
  display: flex; flex-direction: column; overflow: hidden; scroll-margin-top: 24px;
  border-radius: var(--radius); background: var(--bg); color: var(--fg);
  transition: transform 300ms var(--ease);
}
.card:hover { transform: translateY(-4px); }
.card-art { position: relative; display: grid; place-items: start center; aspect-ratio: 5 / 4; overflow: hidden; padding-top: 9%; }
.card-art img {
  grid-area: 1 / 1; width: 36%; aspect-ratio: 600 / 1304; object-fit: cover; object-position: top;
  border-radius: clamp(10px, 1.2vw, 16px); background: rgba(0, 0, 0, 0.15);
  box-shadow: 0 18px 36px rgba(10, 4, 30, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: var(--fan); transition: transform 400ms var(--ease);
}
.card-art img:nth-child(1) { --fan: translateY(-2%) scale(1.06); z-index: 2; }
.card-art img:nth-child(2) { --fan: translateX(-70%) translateY(8%) rotate(-8deg); }
.card-art img:nth-child(3) { --fan: translateX(70%) translateY(8%) rotate(8deg); }
.card:hover .card-art img:nth-child(2) { --fan: translateX(-82%) translateY(6%) rotate(-11deg); }
.card:hover .card-art img:nth-child(3) { --fan: translateX(82%) translateY(6%) rotate(11deg); }
.card-body { flex: 1; display: flex; flex-direction: column; padding: 0 clamp(20px, 2.2vw, 32px) clamp(22px, 2.2vw, 30px); }
.card-icon { position: relative; z-index: 3; width: 72px; height: 72px; margin-top: -36px; border-radius: 22.5%; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); }
.card h3 { margin-top: 14px; font-size: clamp(1.5rem, 1.3rem + 0.4vw, 1.75rem); font-weight: 800; line-height: 1.2; }
html[lang="zh-TW"] .card h3, html[lang="ko"] .card h3 { font-weight: 400; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card { position: relative; }
.card-kind { margin-top: 4px; color: var(--soft); font-size: 0.9375rem; line-height: 1.5; }
.card-line { margin-top: 12px; font-size: 1.125rem; font-weight: 500; line-height: 1.55; }
.card-text { margin-top: 10px; color: var(--soft); font-size: 1rem; line-height: 1.75; }
.card-links { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 20px; }
.store {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px 0 10px; border-radius: 99px;
  text-decoration: none; font-weight: 800; font-size: 0.875rem;
  background: color-mix(in srgb, var(--fg) 10%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--fg) 26%, transparent);
}
.store:hover { background: color-mix(in srgb, var(--fg) 18%, transparent); }
.store img { width: 22px; height: 22px; border-radius: 5px; }

.is-planet { --bg: #1b1043; --fg: #f6f4ff; --soft: #c9c4ec; background: radial-gradient(circle at 70% 18%, #4b2b93 0, transparent 50%), #1b1043; }
.is-iq     { --bg: #0b1546; --fg: #f4f6ff; --soft: #c3cdf2; background: radial-gradient(circle at 70% 18%, #23409c 0, transparent 52%), #0b1546; }
.is-paw    { --bg: #f0e4cf; --fg: #2b2118; --soft: #66553f; }
.is-oshi   { --bg: #f8b9d0; --fg: #3a1230; --soft: #6a2f55; background: linear-gradient(180deg, #fcd7e4 0%, #f6a3c3 100%); }
.is-bit    { --bg: #e46b55; --fg: #2a0f08; --soft: #4a1c12; }
.is-even   { --bg: #095a59; --fg: #f4fbf8; --soft: #c4e4de; background: radial-gradient(circle at 70% 18%, #0f8783 0, transparent 52%), #095a59; }

.foot { max-width: var(--wrap); margin: clamp(56px, 8vw, 96px) auto 0; padding: 24px var(--pad) 40px; border-top: 2px solid var(--line); color: var(--ink-soft); font-size: 0.875rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; }
.foot-ig { color: var(--ink); font-weight: 800; text-underline-offset: 4px; text-decoration-thickness: 2px; text-decoration-color: var(--sun); min-height: 32px; display: inline-flex; align-items: center; }

/* Wide screens: room to read, so each card also carries its full description */
@media (min-width: 1400px) {
  .hero { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .gacha { width: min(100%, 420px); }
}

/* Tablet: two cards a row; the third of each group lies on its side across the full width */
@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards > .card:nth-child(3):last-child { grid-column: 1 / -1; flex-direction: row; }
  .cards > .card:nth-child(3):last-child .card-art { flex: 0 0 48%; aspect-ratio: auto; min-height: 320px; padding-top: 6%; }
  .cards > .card:nth-child(3):last-child .card-body { justify-content: center; padding-top: clamp(22px, 3vw, 32px); }
  .cards > .card:nth-child(3):last-child .card-icon { margin-top: 0; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 0; }
  .gacha { width: min(100%, 300px); margin-top: 16px; }
}

/* Phone: one card a row, shorter pictures so the words come sooner, no long descriptions */
@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .cards > .card:nth-child(3):last-child { flex-direction: column; }
  .cards > .card:nth-child(3):last-child .card-art { flex: none; aspect-ratio: 16 / 10; min-height: 0; padding-top: 7%; }
  .cards > .card:nth-child(3):last-child .card-body { padding-top: 0; }
  .cards > .card:nth-child(3):last-child .card-icon { margin-top: -36px; }
  .card-art { aspect-ratio: 16 / 10; padding-top: 7%; }
  .card-art img { width: 30%; }
  .card-text { display: none; }
  .card h3 { font-size: 1.5rem; }
  .card-icon { width: 64px; height: 64px; margin-top: -32px; }
  .gacha { width: min(78%, 260px); }
  .gacha-card { width: min(310px, calc(100vw - 40px)); padding: 18px; }
  .gacha-card .icon { width: 72px; height: 72px; }
  .hero-text { font-size: 1.25rem; }
  .group-head { flex-direction: column; gap: 6px; }
  .group-head p { font-size: 0.9375rem; }
}
@media (max-width: 420px) {
  .top { padding-top: 14px; padding-bottom: 14px; }
  .mark span { display: none; }
  .lang button { padding: 0 10px; }
}

/* The result dialog: the work's trailer (or its screens) beside what it is */
html.gacha-open { overflow: hidden; }
.gacha-modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(35, 26, 18, 0.62);
}
.gacha-modal[hidden] { display: none; }
.gacha-modal .gacha-card {
  position: relative; left: auto; top: auto; translate: none; width: min(760px, 100%); max-height: calc(100svh - 32px);
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); padding: 0; overflow: auto;
  text-align: left; border-radius: 28px;
}
.gacha-card .media { position: relative; display: grid; place-items: center; padding: 22px; background: var(--accent); min-height: 100%; }
.gacha-card .media.is-video img, .gacha-card .media iframe {
  width: 100%; aspect-ratio: 9 / 16; height: auto; object-fit: cover; border: 0; border-radius: 18px; background: #000;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
.gacha-card .play {
  position: absolute; left: 50%; bottom: 40px; translate: -50% 0; display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 20px 0 14px; border: 0; border-radius: 99px; background: #fff; color: var(--ink);
  font: 800 0.9375rem/1 var(--font); cursor: pointer; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); white-space: nowrap;
}
.gacha-card .play svg { width: 18px; height: 18px; fill: currentColor; }
.gacha-card .play:hover { transform: scale(1.04); }
.gacha-card .media.is-shots { display: flex; justify-content: center; align-items: center; gap: 0; padding: 28px 12px; }
.gacha-card .media.is-shots img { width: 34%; aspect-ratio: 600 / 1304; height: auto; object-fit: cover; object-position: top; border-radius: 12px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
.gacha-card .media.is-shots img:nth-child(1) { transform: rotate(-7deg) translateX(14%); }
.gacha-card .media.is-shots img:nth-child(2) { position: relative; z-index: 1; transform: scale(1.1); }
.gacha-card .media.is-shots img:nth-child(3) { transform: rotate(7deg) translateX(-14%); }
.gacha-card .info { padding: 30px 30px 28px; display: flex; flex-direction: column; }
.gacha-card .info .icon { margin: 0; width: 72px; height: 72px; }
.gacha-card .info .text { margin-top: 10px; color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.7; }
.gacha-card .info .acts { justify-content: flex-start; margin-top: auto; padding-top: 20px; }
@media (max-width: 640px) {
  .gacha-modal { padding: 10px; align-items: end; }
  .gacha-modal .gacha-card { grid-template-columns: 1fr; max-height: calc(100svh - 20px); border-radius: 24px; }
  .gacha-card .media { padding: 16px; min-height: 0; }
  .gacha-card .media.is-video img, .gacha-card .media iframe { width: auto; height: min(52svh, 420px); }
  .gacha-card .media.is-shots { padding: 18px 8px; }
  .gacha-card .media.is-shots img { width: 28%; }
  .gacha-card .info { padding: 20px 20px 22px; }
  .gacha-card .info .icon { display: none; }
  .gacha-card .info .text { display: none; }
  .gacha-card .play { bottom: 28px; }
}

/* A landscape trailer: the film runs across the top of the dialog, the words below */
.gacha-modal .gacha-card.is-wide { grid-template-columns: 1fr; width: min(820px, 100%); }
.gacha-card .media.is-wide { padding: 20px; }
.gacha-card .media.is-wide img, .gacha-card .media.is-wide iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.gacha-card.is-wide .info { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: start; }
.gacha-card.is-wide .info .icon { grid-row: 1 / span 4; }
.gacha-card.is-wide .info > :not(.icon) { grid-column: 2; }
.gacha-card.is-wide .info .acts { padding-top: 16px; }
.gacha-card .media.is-wide .play { bottom: 32px; }
@media (max-width: 640px) {
  .gacha-card .media.is-wide { padding: 12px; }
  .gacha-card .media.is-wide img, .gacha-card .media.is-wide iframe { width: 100%; height: auto; }
  .gacha-card.is-wide .info { display: flex; }
  .gacha-card .media.is-wide .play { bottom: 22px; }
}
