/* Kinopi Play: the web game collection (play.kinopistudio.com) */
:root {
  --sun: #ffd84d;
  --sun-deep: #f5c518;
  --ink: #231a12;
  --ink-soft: #5b4a36;
  --paper: #fffaf0;
  --card: #ffffff;
  --line: #efe6cf;
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "PingFang TC", sans-serif;
  --pad: clamp(16px, 4vw, 48px);
  --wrap: 1200px;
  --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%; }
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, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--sun); color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.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; }

/* The yellow band: brand, language and one line about what this is */
.band { background: var(--sun); border-radius: 0 0 clamp(28px, 5vw, 56px) clamp(28px, 5vw, 56px); padding-bottom: clamp(96px, 12vw, 150px); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: var(--wrap); margin: 0 auto; padding: 20px var(--pad); }
.mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 1.0625rem; text-decoration: none; }
.mark img { width: 32px; height: 32px; }
.mark b { font-weight: 800; }
.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); }
.intro { max-width: var(--wrap); margin: 0 auto; padding: clamp(28px, 5vw, 64px) var(--pad) 0; }
.intro h1 { max-width: 15em; text-wrap: balance; word-break: auto-phrase; line-break: strict; font-size: clamp(2rem, 5.2vw, 3.75rem); line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
html[lang="zh-TW"] .intro h1, html[lang="ko"] .intro h1 { font-weight: 400; letter-spacing: 0; }
.intro p { max-width: 34em; margin-top: 16px; color: var(--ink-soft); font-size: clamp(1.0625rem, 1.6vw, 1.25rem); }

/* The shelf: the newest game sits wide, the rest in a grid. It overlaps the band. */
main { max-width: var(--wrap); margin: calc(-1 * clamp(64px, 9vw, 110px)) auto 0; padding: 0 var(--pad); }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(16px, 2.4vw, 28px); min-height: 280px; }
.game { animation: rise 520ms var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) { .game { animation: none; } }
.shelf.is-settled .game { animation: none; }
.game-link {
  display: flex; flex-direction: column; height: 100%; text-decoration: none;
  background: var(--card); border-radius: var(--radius); box-shadow: 0 0 0 2px var(--line), 0 14px 34px rgba(91, 74, 54, 0.1);
  overflow: hidden; transition: transform 240ms var(--ease), box-shadow 240ms var(--ease);
}
.game-link:focus-visible { outline-offset: 4px; border-radius: var(--radius); }
.screen { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--line); }
.screen img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.go {
  position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--sun); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7), 0 8px 20px rgba(35, 26, 18, 0.25);
  transition: transform 240ms var(--ease);
}
.go svg { width: 22px; height: 22px; margin-left: 3px; fill: var(--ink); }
.game-text { display: flex; flex-direction: column; flex: 1; gap: 6px; padding: 18px 22px 20px; }
.tag { align-self: flex-start; padding: 2px 12px; border-radius: 99px; background: var(--ink); color: var(--sun); font-size: 0.8125rem; font-weight: 800; }
.game-name { font-size: 1.375rem; font-weight: 800; line-height: 1.3; }
html[lang="zh-TW"] .game-name, html[lang="ko"] .game-name { font-weight: 400; }
.game-line { color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.65; }
.game-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 12px; }
.cta { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 99px; background: var(--ink); color: var(--sun); font-weight: 800; font-size: 0.9375rem; }
.plays { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); font-size: 0.875rem; }
.plays svg { width: 14px; height: 14px; fill: currentColor; }
.plays b { font-weight: 800; }
@media (hover: hover) {
  .game-link:hover { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--sun-deep), 0 20px 40px rgba(91, 74, 54, 0.16); }
  .game-link:hover .screen img { transform: scale(1.04); }
  .game-link:hover .go { transform: scale(1.12); }
}

/* The newest game: wide, cover on the left */
@media (min-width: 760px) {
  .game.is-new { grid-column: 1 / -1; }
  .game.is-new .game-link { flex-direction: row; }
  .game.is-new .screen { flex: 0 0 62%; aspect-ratio: 16 / 9; }
  .game.is-new .game-text { justify-content: center; gap: 10px; padding: clamp(24px, 3vw, 40px); }
  .game.is-new .game-name { font-size: clamp(1.75rem, 3vw, 2.375rem); }
  .game.is-new .game-line { font-size: 1.0625rem; }
  .game.is-new .game-foot { margin-top: 12px; }
  .game.is-new .go { width: 64px; height: 64px; }
}

.note { padding: 32px 0; color: var(--ink-soft); }
.note a { color: var(--ink); font-weight: 800; text-decoration-color: var(--sun-deep); text-decoration-thickness: 2px; text-underline-offset: 4px; }

.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; gap: 8px 24px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { color: var(--ink); font-weight: 800; text-decoration-color: var(--sun-deep); text-decoration-thickness: 2px; text-underline-offset: 4px; }

@media (max-width: 520px) {
  .bar { flex-wrap: wrap; }
  .lang button { padding: 0 10px; }
  .game-text { padding: 16px 18px 18px; }
}
