/*
 * 官網樣式。紙卡、木板、草地都是遊戲的素材（建置時從 src/assets/ 帶進 /art/），
 * 九宮格的切線跟 src/styles/app.css 一樣。只用系統字型，不載外部字型。
 */

:root {
  --ink: #4a3220;
  --muted: #6f5236;
  --accent: #a8551d;
  --line: rgba(139, 94, 52, 0.25);
  --paper: #fffaf0;
  --shadow: 0 8px 24px rgba(87, 67, 58, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #e9e4b4;
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', 'Noto Sans', sans-serif;
  line-height: 1.75;
}

/* 用固定的底層而不是 background-attachment: fixed：iOS Safari 不支援後者 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/art/bg-meadow.webp') center / cover no-repeat;
}

article {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px 16px 0;
}

article:lang(zh-Hant) {
  font-family: system-ui, -apple-system, 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', sans-serif;
}

article:lang(ja) {
  font-family: system-ui, -apple-system, 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', 'Noto Sans JP', sans-serif;
}

article:lang(ko) {
  font-family: system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  word-break: keep-all;
}

/* 有 JS 時只顯示選到的語言；沒有 JS 就四種依序全部顯示 */
.js article[lang]:not(.is-current) {
  display: none;
}

h1,
h2,
h3 {
  line-height: 1.35;
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  font-weight: 800;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.3rem;
  font-weight: 800;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

p {
  margin: 8px 0 0;
}

a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 頁首 */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 24px;
}

.brand {
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.88);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

nav.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

nav.langs a {
  padding: 2px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.88);
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

nav.langs a[aria-current='true'] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* 遊戲的紙卡素材 */

.panel {
  --corner: 112px;
  position: relative;
  border: 0 solid transparent;
  border-image: url('/art/panel-daily.webp') 343 347 fill / var(--corner) stretch;
}

.card {
  margin-top: 24px;
  padding: 28px clamp(20px, 5vw, 44px);
  border: 0 solid transparent;
  border-image: url('/art/chip-blank.webp') 100 fill / 24px stretch;
}

.hero {
  margin-top: 8px;
  padding: 56px clamp(28px, 8vw, 88px);
  text-align: center;
}

.hero.has-peek {
  margin-top: 96px;
}

/* 探頭柯基趴在紙卡上緣，紙卡蓋住牠的下半身 */
.peek {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 190px;
  height: 118px;
  margin-bottom: -8px;
  transform: translateX(-50%);
  background: url('/art/corgi-peek-top.webp') center / contain no-repeat;
}

.alt-name {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 600;
}

.tagline {
  margin-top: 4px;
  color: var(--accent);
  font-weight: 700;
}

.lead {
  max-width: 34em;
  margin: 16px auto 0;
  font-size: 1.05rem;
  text-wrap: balance;
}

.pill {
  display: inline-block;
  margin: 16px 0 0;
  padding: 4px 30px;
  border: 0 solid transparent;
  border-image: url('/art/pill-blank.webp') 0 199 fill / 0 25px stretch;
  color: var(--accent);
  font-weight: 800;
}

.plank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 270px;
  min-height: 81px;
  margin-top: 12px;
  padding: 0 56px;
  background: url('/art/btn-plank.webp') center / 100% 100% no-repeat;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

/* 公司首頁的作品 */

.work-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 32px;
}

.work-shot img,
.shots img {
  width: 100%;
  border: 3px solid var(--paper);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

/* 遊戲畫面 */

.shots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0 0;
}

.shots figure {
  margin: 0;
}

.shots figcaption {
  margin-top: 8px;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(255, 250, 240, 0.9);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

.rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 16px;
}

.rules img {
  width: 104px;
  margin-bottom: 10px;
  border-radius: 14px;
}

.modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.modes img {
  width: auto;
  height: 112px;
  margin-bottom: 10px;
}

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 28px;
}

.features li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.features img {
  flex: none;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.features p {
  margin-top: 0;
}

.facts {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.contact a {
  font-weight: 700;
}

/* 頁尾：遊戲首頁底部的場景 */

.ground {
  display: flex;
  align-items: flex-end;
  height: clamp(130px, 26vw, 230px);
  margin-top: 28px;
}

.ground span {
  height: 100%;
  background: center bottom / contain no-repeat;
}

.ground .is-left,
.ground .is-right {
  flex: 1;
  height: 62%;
}

.ground .is-left {
  background-image: url('/art/ground-left.webp');
}

.ground .is-middle {
  flex: 2.6;
  background-image: url('/art/ground-middle.webp');
}

.ground .is-right {
  background-image: url('/art/ground-right.webp');
}

.foot {
  padding: 14px 16px 18px;
  border-radius: 16px 16px 0 0;
  background: rgba(255, 250, 240, 0.92);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.foot p {
  margin-top: 4px;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
}

@media (max-width: 720px) {
  .brand {
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .panel {
    --corner: 76px;
  }

  .hero {
    padding: 44px 24px;
  }

  .shots {
    grid-template-columns: repeat(2, 1fr);
  }

  .rules,
  .modes,
  .features {
    grid-template-columns: 1fr;
  }

  .rules li {
    display: grid;
    grid-template-columns: 72px 1fr;
    column-gap: 14px;
    align-items: center;
  }

  .rules img {
    grid-row: span 2;
    width: 72px;
    margin-bottom: 0;
  }

  .rules p {
    margin-top: 0;
  }
}

@media (max-width: 560px) {
  .work-row {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 20px;
    text-align: center;
  }

  .work-shot {
    width: min(200px, 60vw);
  }

  .plank {
    min-width: 0;
    width: 100%;
    max-width: 280px;
    padding: 0 40px;
  }
}
