/* 글로 된 안내 페이지(규칙, 소개, 개인정보처리방침)가 함께 쓰는 모양.
   게임 화면은 Flutter가 그리고, 이 페이지들은 검색엔진과 광고 심사가 읽을 수
   있게 일반 HTML로 둔다. 색은 앱 테마(lib/core/theme.dart)와 맞춘다. */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #1b2537;
  --muted: #5a6779;
  --line: #e3e8f0;
  --thick: #2b3648;
  --primary: #1567c8;
  --on-primary: #ffffff;
  --glow: #f2a81c;
  --glow-ink: #231a05;
  --peer: #eaf1f9;
  --pick: #bbddfb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1218;
    --surface: #151a22;
    --text: #e7ecf3;
    --muted: #9aa7b8;
    --line: #262e3a;
    --thick: #a8b7cc;
    --primary: #66b4ff;
    --on-primary: #08203a;
    --glow: #f2a81c;
    --glow-ink: #231a05;
    --peer: #1e2733;
    --pick: #29435f;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* 한국어는 낱말 중간에서 줄을 바꾸지 않는다. 일본어·중국어는 낱말 사이에
   띄어쓰기가 없어서 이걸 켜면 문장부호에서만 줄이 바뀌어 들쭉날쭉해진다. */
html[lang="ko"] body { word-break: keep-all; }

a { color: var(--primary); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* 머리 */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 12px; padding-bottom: 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 800; font-size: 19px;
}
.brand img { width: 32px; height: 32px; }
.top nav { display: flex; gap: 14px; margin-left: auto; flex-wrap: wrap; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a[aria-current="page"] { color: var(--text); font-weight: 700; }
.top nav a:hover { color: var(--primary); }

/* 본문 */
main { padding: 28px 0 40px; }
h1 { font-size: 28px; line-height: 1.3; margin: 0 0 8px; }
h2 { font-size: 21px; margin: 40px 0 10px; padding-top: 4px; }
h3 { font-size: 17px; margin: 24px 0 6px; }
p, ul, ol { margin: 0 0 14px; }
li { margin: 4px 0; }
.lead { color: var(--muted); font-size: 17px; margin-bottom: 22px; }
.meta { color: var(--muted); font-size: 14px; }

.card {
  background: var(--surface); border-radius: 14px; padding: 16px 18px; margin: 16px 0;
}

.play {
  display: inline-block; margin: 6px 0 4px; padding: 12px 22px; border-radius: 14px;
  background: var(--primary); color: var(--on-primary); font-weight: 700; text-decoration: none;
}

/* 표는 좁은 폰에서 옆으로 밀어 본다. 페이지 전체가 옆으로 흔들리면 안 된다. */
.table { overflow-x: auto; margin: 12px 0 18px; }
table { border-collapse: collapse; width: 100%; min-width: 480px; background: var(--surface); border-radius: 12px; overflow: hidden; font-size: 15px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-weight: 700; white-space: nowrap; }
td:first-child { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* 4×4 예시 판 */
.figure { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin: 14px 0 18px; }
.figure figcaption { flex: 1 1 220px; color: var(--muted); font-size: 15px; }
.grid4 {
  display: grid; grid-template-columns: repeat(4, 40px); grid-template-rows: repeat(4, 40px);
  border: 2px solid var(--thick); border-radius: 6px; overflow: hidden; background: var(--surface);
}
.grid4 span {
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 600; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.grid4 span:nth-child(4n) { border-right: 0; }
.grid4 span:nth-child(4n + 2) { border-right: 2px solid var(--thick); }
.grid4 span:nth-child(n + 5):nth-child(-n + 8) { border-bottom: 2px solid var(--thick); }
.grid4 span:nth-child(n + 13) { border-bottom: 0; }
.grid4 .peer { background: var(--peer); }
.grid4 .pick { background: var(--pick); }
.grid4 .ans { color: var(--primary); }
.grid4 .hit { background: var(--glow); color: var(--glow-ink); }

/* 바닥 */
footer { border-top: 1px solid var(--line); padding: 20px 0 32px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; gap: 14px; flex-wrap: wrap; }
footer a { color: var(--muted); }
footer .copy { margin-left: auto; }

/* 언어 고르기. 같은 페이지의 다른 언어판으로 간다. */
footer .langs { margin-top: 10px; gap: 6px; }
footer .langs a[aria-current="page"] { color: var(--text); font-weight: 700; text-decoration: none; }
.top nav .lang-jump { white-space: nowrap; }
