/* Shared styles for the content pages (guide, about, policies) and the content area under the game.
   Layout: one readable column (~68ch) on mint tiles, paper cards for articles, header bar + footer links */
/* Color system: each skin defines a light and a dark palette (--s-*-l / --s-*-d);
   the mode blocks below pick one. Mode follows the phone's setting unless the viewer chooses one. */
:root {
  /* skin: 민트 타일 (기본) */
  --s-tile-l: #cfe7db; --s-grout-l: #b6d5c6; --s-paper-l: #fffdf6;
  --s-accent-l: #d7262f; --s-btn-l: #d7262f; --s-btn-deep-l: #9e1820;
  --s-tile-d: #14201b; --s-grout-d: #1c2b25; --s-paper-d: #212c28;
  --s-accent-d: #ff6b6b; --s-btn-d: #d93a3f; --s-btn-deep-d: #7a171c;

  --display: 'Black Han Sans', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --body: 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;

  /* light mode */
  --tile: var(--s-tile-l); --grout: var(--s-grout-l); --paper: var(--s-paper-l);
  --red: var(--s-accent-l); --btn: var(--s-btn-l); --btn-deep: var(--s-btn-deep-l); --red-deep: var(--s-btn-deep-l);
  --ink: #1f2925; --muted: #56655f; --line: #1f2925; --field: #ffffff; --on-btn: #ffffff;
  --good: #1f8a5b; --gold: #e7aa2e; --silver: #8a979a; --bronze: #b0672b;
  --hilite: rgba(231, 170, 46, .18); --note: rgba(231, 170, 46, .16);
  --scrim: rgba(31, 41, 37, .45); --hover: rgba(31, 41, 37, .06);
  color-scheme: light;
}
:root[data-skin="butter"] {
  --s-tile-l: #f5e4ad; --s-grout-l: #e8d088; --s-paper-l: #fffcf2;
  --s-accent-l: #c2361d; --s-btn-l: #c2361d; --s-btn-deep-l: #82220f;
  --s-tile-d: #1f1a0f; --s-grout-d: #2b2414; --s-paper-d: #2a2418;
  --s-accent-d: #ff8a5c; --s-btn-d: #d0502b; --s-btn-deep-d: #7a2a12;
}
:root[data-skin="sky"] {
  --s-tile-l: #d3e6f5; --s-grout-l: #b7d2ea; --s-paper-l: #fcfdff;
  --s-accent-l: #1d5bd8; --s-btn-l: #1d5bd8; --s-btn-deep-l: #123b8f;
  --s-tile-d: #111a26; --s-grout-d: #182436; --s-paper-d: #1d2836;
  --s-accent-d: #7aa7ff; --s-btn-d: #3a6fe0; --s-btn-deep-d: #1b3a80;
}
:root[data-skin="berry"] {
  --s-tile-l: #f8d8e0; --s-grout-l: #efbccb; --s-paper-l: #fffafb;
  --s-accent-l: #c4185a; --s-btn-l: #c4185a; --s-btn-deep-l: #800c39;
  --s-tile-d: #22141a; --s-grout-d: #301c25; --s-paper-d: #2c1e25;
  --s-accent-d: #ff7aa8; --s-btn-d: #d23a73; --s-btn-deep-d: #7c1a40;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]):not([data-theme="light"]) {
    --tile: var(--s-tile-d); --grout: var(--s-grout-d); --paper: var(--s-paper-d);
    --red: var(--s-accent-d); --btn: var(--s-btn-d); --btn-deep: var(--s-btn-deep-d); --red-deep: var(--s-btn-deep-d);
    --ink: #eaf1ed; --muted: #a0b1aa; --line: #070a09; --field: #161f1c; --on-btn: #ffffff;
    --good: #5ad19a; --gold: #f0b941; --silver: #b7c3c6; --bronze: #d58a4c;
    --hilite: rgba(240, 185, 65, .16); --note: rgba(240, 185, 65, .12);
    --scrim: rgba(0, 0, 0, .6); --hover: rgba(255, 255, 255, .06);
    color-scheme: dark;
  }
}
:root[data-mode="dark"], :root[data-theme="dark"]:not([data-mode="light"]) {
  --tile: var(--s-tile-d); --grout: var(--s-grout-d); --paper: var(--s-paper-d);
  --red: var(--s-accent-d); --btn: var(--s-btn-d); --btn-deep: var(--s-btn-deep-d); --red-deep: var(--s-btn-deep-d);
  --ink: #eaf1ed; --muted: #a0b1aa; --line: #070a09; --field: #161f1c; --on-btn: #ffffff;
  --good: #5ad19a; --gold: #f0b941; --silver: #b7c3c6; --bronze: #d58a4c;
  --hilite: rgba(240, 185, 65, .16); --note: rgba(240, 185, 65, .12);
  --scrim: rgba(0, 0, 0, .6); --hover: rgba(255, 255, 255, .06);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

.page {
  margin: 0;
  background-color: var(--tile);
  background-image:
    linear-gradient(var(--grout) 2px, transparent 2px),
    linear-gradient(90deg, var(--grout) 2px, transparent 2px);
  background-size: 46px 46px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.75;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar { padding-block: 14px; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-size: 24px; color: var(--ink); text-decoration: none; }
.brand em { font-style: normal; color: var(--red); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  font-family: var(--display); font-size: 15px; color: var(--ink); text-decoration: none;
  padding: 6px 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--paper);
}
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.nav a:focus-visible, .article a:focus-visible, .foot a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.article {
  background: var(--paper);
  border: 2.5px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--line);
  padding: 22px 22px 26px;
  margin-block: 8px 24px;
}
.article > * { max-width: 68ch; }
.article h1, .article h2, .article h3 { font-family: var(--display); font-weight: 400; line-height: 1.25; text-wrap: balance; margin: 0; }
.article h1 { font-size: clamp(30px, 7vw, 40px); margin-bottom: 6px; }
.article h1 em { font-style: normal; color: var(--red); }
.article h2 { font-size: 24px; margin-top: 30px; margin-bottom: 8px; }
.article h3 { font-size: 19px; margin-top: 20px; margin-bottom: 4px; }
.article p { margin: 0 0 12px; }
.article ul, .article ol { margin: 0 0 12px; padding-left: 1.3em; }
.article li { margin-bottom: 4px; }
.article a { color: var(--red); font-weight: 700; }
.lede { color: var(--muted); font-size: 17px; }
.meta { color: var(--muted); font-size: 14px; }
.callout {
  background: var(--note); border-radius: 10px; padding: 12px 14px; margin: 14px 0; font-size: 15px;
}
.tablewrap { overflow-x: auto; margin: 10px 0 14px; max-width: 100%; }
.article table { border-collapse: collapse; width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.article th, .article td { text-align: left; padding: 9px 10px; border-bottom: 1.5px dashed var(--grout); vertical-align: top; }
.article th { font-family: var(--display); font-weight: 400; font-size: 15px; border-bottom: 2px solid var(--ink); }
.article td.num { font-family: var(--display); font-size: 17px; color: var(--red); white-space: nowrap; }
.article td:first-child { white-space: nowrap; font-weight: 700; }
.sources { font-size: 14px; color: var(--muted); }
.sources a { font-weight: 400; color: var(--muted); }
.cta, .article .cta {
  display: inline-block; font-family: var(--display); font-size: 18px; color: var(--on-btn); background: var(--btn);
  border: 2.5px solid var(--line); border-radius: 14px; box-shadow: 0 4px 0 var(--line);
  padding: 10px 18px; text-decoration: none; margin-top: 6px;
}
.cta:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ad slot: only rendered when an AdSense slot is configured */
.ad { margin-block: 18px 26px; text-align: center; }
.ad-label { font-size: 12px; color: var(--muted); letter-spacing: .08em; margin-bottom: 4px; }

.foot { padding-block: 10px 28px; font-size: 14px; color: var(--muted); }
.foot .links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 6px; }
.foot a { color: var(--ink); text-decoration: none; font-weight: 700; }
.foot a:hover { text-decoration: underline; }

.linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.linklike:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* theme picker (built by assets/theme.js) */
.tp-scrim {
  position: fixed; inset: 0; z-index: 50; background: var(--scrim);
  display: grid; place-items: end center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 600px) { .tp-scrim { place-items: center; } }
.tp-sheet {
  width: min(440px, 100%); box-sizing: border-box; background: var(--paper); color: var(--ink);
  border: 2.5px solid var(--line); border-radius: 18px; box-shadow: 0 6px 0 var(--line);
  padding: 18px max(18px, env(safe-area-inset-right, 0px)) 18px max(18px, env(safe-area-inset-left, 0px));
  display: grid; gap: 14px; font-family: var(--body);
}
.tp-sheet h2 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 0; }
.tp-label { font-size: 13px; color: var(--muted); letter-spacing: .06em; margin-bottom: -6px; }
.tp-skins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tp-skin {
  display: grid; justify-items: center; gap: 6px; padding: 8px 4px; border-radius: 12px;
  border: 2px solid transparent; background: none; cursor: pointer;
  font: 700 13px var(--body); color: var(--ink);
}
.tp-skin:hover { background: var(--hover); }
.tp-skin[aria-pressed="true"] { border-color: var(--line); background: var(--hover); }
.tp-swatch { width: 52px; height: 52px; border-radius: 12px; border: 2px solid var(--line); position: relative; overflow: hidden; }
.tp-swatch i { position: absolute; inset: 0 0 0 50%; }
.tp-swatch b { position: absolute; width: 18px; height: 18px; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 2px solid var(--line); }
.tp-modes { display: grid; grid-template-columns: repeat(3, 1fr); border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.tp-mode { padding: 10px 6px; border: 0; background: none; cursor: pointer; font: 400 16px var(--display); color: var(--ink); }
.tp-mode + .tp-mode { border-left: 2px solid var(--line); }
.tp-mode[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tp-hint { font-size: 13px; color: var(--muted); margin: -4px 0 0; }
.tp-close {
  font: 400 17px var(--display); padding: 10px; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--line); background: var(--paper); color: var(--ink); box-shadow: 0 3px 0 var(--line);
}
.tp-skin:focus-visible, .tp-mode:focus-visible, .tp-close:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
