/* factoryjamgames.com 공통 CSS (구현사항 319 §1·§3). tools/site_gen.py가 /site.css로 복사한다. 약관 다섯 장은 각자 스타일. */
:root { --sky: #8fd3ff; --sky2: #d9f1ff; --ink: #1c2238; --card: #ffffff; --accent: #f28c28; --green: #7ccf2a; --muted: #5b6480; --paper: #fff8e6;
  --g0: #cfd6e4; --g1: #9be37a; --g2: #7fc3ff; --g3: #d9a0ff; --g4: #ffcf4d; }
* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Noto Sans KR", "Noto Sans JP", sans-serif; color: var(--ink); background: linear-gradient(var(--sky), var(--sky2) 420px, var(--paper)); line-height: 1.6; min-height: 100vh; }
a { color: var(--ink); }
img { max-width: 100%; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* 머리: 상표 · 메뉴 · 언어 */
header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 14px 0 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; font-size: 1.1rem; margin-right: auto; }
.brand img { width: 36px; height: 36px; border-radius: 8px; image-rendering: pixelated; }
.langs { display: flex; gap: 4px; }
.langs a { border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 999px; padding: 2px 10px; font-weight: 700; text-decoration: none; font-size: .9rem; }
.langs a[aria-current="true"] { background: var(--ink); color: #fff; }
.menu { display: flex; gap: 6px; width: 100%; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.menu::-webkit-scrollbar { display: none; }
.menu a { flex: 0 0 auto; text-decoration: none; font-weight: 800; padding: 6px 14px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; box-shadow: 0 3px 0 var(--ink); }
.menu a[aria-current="page"] { background: var(--accent); color: #fff; }
@media (min-width: 640px) { .menu { width: auto; } }

/* 스토어 버튼 */
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 4px; }
.store { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; padding: 10px 18px; border: 3px solid var(--ink); border-radius: 12px; background: var(--green); box-shadow: 0 4px 0 var(--ink); }
.store.disabled { background: #e6e9f0; color: var(--muted); box-shadow: none; cursor: default; }
.store-hint { color: var(--muted); font-weight: 700; font-size: .95rem; }

/* 랜딩 */
.hero img { width: 100%; height: auto; display: block; border: 4px solid var(--ink); border-radius: 14px; image-rendering: pixelated; box-shadow: 0 8px 0 rgba(28,34,56,.25); }
h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); margin: 24px 0 6px; }
h2 { font-size: 1.35rem; margin: 32px 0 10px; }
.tagline { font-size: 1.1rem; color: var(--muted); margin: 0 0 14px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 28px 0; }
.feature { background: var(--card); border: 3px solid var(--ink); border-radius: 14px; padding: 16px; }
.feature h3 { margin: 0 0 6px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); }
.shots { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 16px; scroll-snap-type: x mandatory; }
.shots img { flex: 0 0 auto; width: 200px; height: auto; border: 3px solid var(--ink); border-radius: 12px; scroll-snap-align: start; box-shadow: 0 4px 0 rgba(28,34,56,.25); }
@media (min-width: 900px) { .shots { overflow: visible; } .shots img { flex: 1 1 0; min-width: 0; width: auto; } }  /* 넓은 화면은 다섯 장이 한 줄에 다 보이게 */
.more { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 8px 0 24px; }
.more a { display: block; text-decoration: none; background: var(--card); border: 3px solid var(--ink); border-radius: 14px; padding: 16px; box-shadow: 0 4px 0 var(--ink); }
.more a strong { display: block; font-size: 1.1rem; }
.more a span { color: var(--muted); }

/* 업데이트 소식 */
.note { background: var(--card); border: 3px solid var(--ink); border-radius: 14px; padding: 16px 18px; margin: 0 0 14px; }
.note h2 { margin: 0 0 8px; font-size: 1.15rem; }
.note ul { margin: 0; padding-left: 20px; }

/* 도감 (319 바뀜 1: 타일 그리드 + 상세 창) */
.grades { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.grades a { text-decoration: none; font-weight: 800; padding: 4px 12px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; }
.grade-head { display: flex; align-items: center; gap: 8px; scroll-margin-top: 12px; }
.grade-head::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 4px; background: var(--gc); }
.grade-head small { color: var(--muted); font-weight: 700; font-size: 1rem; }
.g0 { --gc: var(--g0); } .g1 { --gc: var(--g1); } .g2 { --gc: var(--g2); } .g3 { --gc: var(--g3); } .g4 { --gc: var(--g4); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 8px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 8px; text-decoration: none; text-align: center;
  background: linear-gradient(var(--gc) 0 62%, #fff 62%); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
  transition: transform .08s; min-width: 0; }
.tile:hover { transform: translateY(-2px); }
.tile:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.tile img { width: 100%; max-width: 88px; aspect-ratio: 1; image-rendering: pixelated; }
.tile span { font-weight: 800; font-size: .92rem; line-height: 1.25; overflow-wrap: anywhere; }
.tile small { color: var(--muted); font-weight: 700; font-size: .75rem; }

/* 상세 카드: 보통은 숨기고 창(#sheet)에 복사해 연다. 스크립트가 없으면 :target으로 뜬다 */
.details > .unit { display: none; }
.details > .unit:target { display: block; position: fixed; inset: auto 0 0 0; max-height: 85vh; overflow: auto; z-index: 10; margin: 0 auto; max-width: 520px; }
html.js .details > .unit:target { display: none; }
.unit, #sheet { background: var(--card); border: 3px solid var(--ink); border-radius: 18px 18px 0 0; padding: 18px 16px 22px; color: var(--ink); }
.unit { border-top: 10px solid var(--gc); }
#sheet { width: 100%; max-width: 520px; max-height: 88vh; margin: auto auto 0; border-top: 10px solid var(--gc, var(--g0)); overflow: auto; }
#sheet::backdrop { background: rgba(28,34,56,.45); }
@media (min-width: 640px) { #sheet { margin: auto; border-radius: 18px; box-shadow: 0 8px 0 rgba(28,34,56,.35); } }
.sheet-close { position: sticky; top: 0; float: right; width: 36px; height: 36px; border: 3px solid var(--ink); border-radius: 50%; background: #fff; font-weight: 900; font-size: 1rem; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.unit-head { display: flex; align-items: center; gap: 14px; }
.unit-head img { width: 96px; height: 96px; image-rendering: pixelated; border: 3px solid var(--ink); border-radius: 14px; background: var(--gc, var(--sky2)); flex: 0 0 auto; }
.unit-head h3 { margin: 0 0 6px; font-size: 1.35rem; }
.tag { display: inline-block; font-size: .8rem; font-weight: 800; padding: 1px 8px; border: 2px solid var(--ink); border-radius: 999px; margin-right: 4px; background: #fff; }
.tag.g0, .tag.g1, .tag.g2, .tag.g3, .tag.g4 { background: var(--gc); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.stats li { background: var(--sky2); border: 2px solid var(--ink); border-radius: 12px; padding: 6px 4px; text-align: center; }
.stats span { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; }
.stats b { font-size: 1.15rem; }
#sheet h4, .unit h4 { margin: 16px 0 6px; font-size: .9rem; color: var(--muted); }
.skills { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.skills li { background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; font-size: .95rem; }
.skills b { font-size: 1rem; }
.skills .lock { color: #fff; background: var(--accent); border-radius: 999px; font-weight: 800; font-size: .72rem; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }
.skills .when { display: block; font-weight: 800; margin-top: 2px; }
.skills .desc { display: block; color: var(--muted); }
.recipe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .95rem; margin: 0; }
.recipe a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 800; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px 2px 3px; box-shadow: 0 2px 0 var(--ink); }
.recipe a img { width: 28px; height: 28px; image-rendering: pixelated; }
.recipe .plus { color: var(--muted); font-weight: 900; }

/* 개발사 */
.about p { font-size: 1.05rem; }

/* 꼬리 */
footer { margin-top: 40px; padding: 24px 0 40px; border-top: 2px solid rgba(28,34,56,.15); color: var(--muted); font-size: .95rem; }
footer a { color: var(--ink); font-weight: 700; }
.biz { font-size: 12px; opacity: .75; line-height: 1.6; }

/* 프레스킷 (319 바뀜 2) */
.press .store { margin: 4px 0 8px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; background: var(--card); border: 3px solid var(--ink); border-radius: 14px; padding: 14px 18px; margin: 0; }
.facts dt { font-weight: 800; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; gap: 0; } .facts dd { margin: 0 0 8px; } }
.press-imgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 14px; }
.press-imgs a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; background: var(--card); border: 3px solid var(--ink); border-radius: 14px; padding: 12px; }
.press-imgs img { height: 120px; width: auto; max-width: 100%; object-fit: contain; image-rendering: pixelated; }
.press .shots a { flex: 0 0 auto; display: block; }
.press .shots a img { width: 200px; }
@media (min-width: 900px) { .press .shots a { flex: 1 1 0; min-width: 0; } .press .shots a img { width: 100%; } }

/* 확률 정보 (325): 게임 확률 창처럼 줄마다 등급 색 띠, 오른쪽 확률 알약 (확정은 초록) */
.basis { display: inline-block; font-weight: 800; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; margin: 0 0 8px; }
.odds-box { margin: 0 0 22px; }
.odds-box .lead { margin: 0 0 8px; }
.odds { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.odds th { text-align: left; color: var(--muted); font-size: .85rem; padding: 0 12px; }
.odds th:last-child, .odds td:last-child { text-align: right; }
.odds td { background: var(--card); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 8px 12px; font-weight: 700; }
.odds td:first-child { border-left: 10px solid var(--gc); border-radius: 12px 0 0 12px; }
.odds td:last-child { border-right: 2px solid var(--ink); border-radius: 0 12px 12px 0; white-space: nowrap; }
.odds .pill { display: inline-block; min-width: 76px; text-align: center; color: #fff; background: #3d5a8a; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.odds .pill.sure { background: #2e7d32; }
.odds.cards td:nth-child(2), .odds.cards th:nth-child(2) { text-align: center; }
.odds.cards td:nth-child(3), .odds.cards th:nth-child(3) { text-align: center; }
.odds.cards td:last-child { text-align: left; white-space: normal; font-weight: 600; font-size: .92rem; }
.odds.cards th:last-child { text-align: left; }
.odds.cards th, .odds.cards td:nth-child(-n+3) { white-space: nowrap; }
@media (max-width: 520px) { .odds.cards td, .odds.cards th { padding-left: 6px; padding-right: 6px; } .odds.cards td:last-child { font-size: .85rem; } }
.free-head { margin-top: 36px; }
.odds-notes { color: var(--muted); padding-left: 20px; }
@media (max-width: 520px) { .odds td { padding: 7px 8px; font-size: .92rem; } .odds .pill { min-width: 64px; padding: 1px 6px; } }
