/* TCM Arcade (game.tcm-study.ca): its own look, from the games themselves (fonts, five-phase colours). Not the tcm-study.ca design. */
:root {
  --bg: #edf1ec; --surface: #fff; --ink: #1d2927; --ink-2: #3d4a46; --muted: #5a6966; --line: #cdd7d1; --accent: #1f6f5c;
  --wood: #3d8a57; --fire: #c5452f; --earth: #b07f22; --metal: #74808e; --water: #2d5c9c;
  --display: "Bricolage Grotesque", "IBM Plex Sans KR", ui-sans-serif, system-ui, sans-serif;
  --body: "IBM Plex Sans", "IBM Plex Sans KR", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121816; --surface: #1b2422; --ink: #e7ede9; --ink-2: #c4cfcb; --muted: #9aa8a4; --line: #30403c; --accent: #5cbba1;
    --wood: #4f9d6a; --fire: #d95a43; --earth: #c1933a; --metal: #8793a1; --water: #4b7fc4; }
}
/* the game colour: set per card / page as style="--g:…;--g-dk:…" */
:root, [style*="--g:"] { --gc: var(--g, var(--accent)); }
@media (prefers-color-scheme: dark) { :root, [style*="--g:"] { --gc: var(--g-dk, var(--accent)); } }
html[data-lang="en"] .ko, html[data-lang="ko"] .en { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.125rem/1.65 var(--body); }
html[data-lang="ko"] body { word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
p { margin: 0; }
.in { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
:focus-visible { outline: 3px solid var(--gc); outline-offset: 2px; border-radius: 6px; }

/* header */
.top { border-bottom: 1px solid var(--line); }
.top .in { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.3125rem/1 var(--display); letter-spacing: -0.02em; text-decoration: none; }
.dots { display: grid; grid-template-columns: repeat(5, 8px); gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; }
.dots i:nth-child(1) { background: var(--wood); } .dots i:nth-child(2) { background: var(--fire); } .dots i:nth-child(3) { background: var(--earth); }
.dots i:nth-child(4) { background: var(--metal); } .dots i:nth-child(5) { background: var(--water); }
.lang { margin-left: auto; display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button { font: 600 .875rem/1 var(--body); color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }


/* list page */
.hero { padding-top: 56px; padding-bottom: 8px; }
.hero h1 { font-size: clamp(2.5rem, 9vw, 4.75rem); line-height: 1; letter-spacing: -0.035em; }
.lede { margin-top: 18px; max-width: 34em; font-size: 1.25rem; color: var(--ink-2); }
.sh { margin-top: 48px; font-size: 1.5rem; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.sh small { font: 500 1rem/1.4 var(--body); color: var(--muted); letter-spacing: 0; }
.cards { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card a { display: flex; flex-direction: column; height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.card a:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(20, 40, 34, .12); }
.pic { position: relative; display: block; height: 210px; overflow: hidden; background: var(--gc);
  background-image: radial-gradient(circle at 18% 22%, rgba(255,255,255,.18) 0 46px, transparent 47px), radial-gradient(circle at 88% 70%, rgba(255,255,255,.12) 0 70px, transparent 71px); }
.phone { display: block; border: 5px solid #0d1311; border-radius: 22px; overflow: hidden; background: #0d1311; box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.pic .phone { position: absolute; left: 50%; top: 26px; width: 158px; transform: translateX(-50%) rotate(-3deg); }
.card:nth-child(even) .pic .phone { transform: translateX(-50%) rotate(3deg); }
.txt { display: block; padding: 18px 20px 22px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .9375rem; color: var(--muted); }
.genre { font-weight: 600; color: var(--gc); background: color-mix(in srgb, var(--gc) 13%, transparent); padding: 2px 10px; border-radius: 999px; }
.txt strong { display: block; margin-top: 10px; font: 700 1.5rem/1.15 var(--display); letter-spacing: -0.02em; }
.txt .aq { display: block; margin-top: 6px; color: var(--ink-2); font-size: 1.0625rem; line-height: 1.5; }
.apart .card a { flex-direction: row; }
.apart .pic, .cards.one .pic { flex: 0 0 150px; height: auto; min-height: 190px; }
.apart .pic .phone, .cards.one .pic .phone { width: 112px; top: 22px; }
.apart .txt, .cards.one .txt { align-self: center; }
.cards.one { grid-template-columns: 1fr; }
.cards.one .card a { flex-direction: row; }

/* About page */
.ghero { background: color-mix(in srgb, var(--gc) 11%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--gc) 25%, var(--line)); border-top: 6px solid var(--gc); padding: 22px 0 40px; }
.crumb { font-size: .9375rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.crumb a { text-decoration: none; } .crumb a:hover { text-decoration: underline; }
.gh { margin-top: 22px; display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-areas: "pic t" "pic p"; column-gap: 40px; align-items: end; }
.gh-pic { grid-area: pic; } .gh-t { grid-area: t; } .gh-p { grid-area: p; align-self: start; }
.gh-pic .phone { transform: rotate(-2deg); }
.gh h1 { font-size: clamp(2.375rem, 7vw, 4rem); letter-spacing: -0.035em; line-height: 1; }
.gh .aq { margin-top: 14px; font-size: 1.3125rem; line-height: 1.45; color: var(--ink-2); max-width: 26em; }
.playbtn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; margin-top: 26px; min-height: 64px; padding: 0 48px; border-radius: 18px;
  background: var(--gc); color: #fff; font: 700 1.5rem/1 var(--display); text-decoration: none; box-shadow: 0 6px 0 color-mix(in srgb, var(--gc) 70%, #000); transition: transform .08s ease, box-shadow .08s ease; }
@media (prefers-color-scheme: dark) { .playbtn { color: #0d1311; } }
.playbtn:hover { filter: brightness(1.06); }
.playbtn:active { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--gc) 70%, #000); }
.playbtn svg { width: 24px; height: 24px; }
.free { margin-top: 14px; color: var(--muted); font-size: .9375rem; }
@media (max-width: 640px) {
  .gh { grid-template-columns: minmax(0, 1fr) 104px; grid-template-areas: "t pic" "p p"; column-gap: 18px; align-items: center; margin-top: 16px; }
  .gh .aq { font-size: 1.125rem; margin-top: 10px; }
  .gh-pic .phone { border-width: 3px; border-radius: 14px; transform: rotate(3deg); }
  .playbtn { display: flex; width: 100%; margin-top: 22px; }
}

.body { max-width: 760px; padding-bottom: 24px; }
.blk { margin-top: 48px; }
.blk h2 { font-size: 1.625rem; margin-bottom: 14px; }
.blk p + p { margin-top: 14px; }
.blk a { color: var(--gc); font-weight: 600; text-underline-offset: 3px; }
.ctrl { margin: 18px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
.ctrl dt { font-weight: 600; } .ctrl dd { margin: 0; color: var(--ink-2); }
.levels { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.levels li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; line-height: 1.4; }
.levels.nolv li { grid-template-columns: minmax(0, 1fr); }
.levels .lv { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--gc) 14%, transparent); color: var(--gc); font: 700 1rem/1 var(--display); }
.levels small { display: block; color: var(--muted); font-size: .9375rem; margin-top: 2px; }
.note { margin-top: 14px; color: var(--ink-2); }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tips li { position: relative; padding-left: 28px; }
.tips li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 11px; height: 11px; border-radius: 50%; background: var(--gc); }
.info { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.info div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.info div:last-child { grid-column: 1 / -1; }
.info dt { font-size: .875rem; font-weight: 600; color: var(--muted); }
.info dd { margin: 2px 0 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 700 1.375rem/1 var(--display); color: var(--gc); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 16px; color: var(--ink-2); }
.all { margin-top: 16px; }
.all a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.all svg { width: 18px; height: 18px; }

/* footer */
.foot { margin-top: 64px; border-top: 1px solid var(--line); padding: 28px 0 44px; color: var(--muted); font-size: .9375rem; }
.foot p + p { margin-top: 10px; }
.foot .f1 { max-width: 40em; }
.foot a { color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .card a, .playbtn { transition: none; } .card a:hover { transform: none; } }
@media (max-width: 480px) {
  .apart .pic, .cards.one .pic { flex-basis: 116px; min-height: 170px; }
  .apart .pic .phone, .cards.one .pic .phone { width: 88px; top: 20px; border-width: 3px; border-radius: 14px; }
  .apart .txt, .cards.one .txt { padding: 14px 16px 16px; }
  .apart .txt strong, .cards.one .txt strong { font-size: 1.3125rem; }
}

/* Report a problem (About pages) */
.rp { margin-top: 48px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.rp summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--ink-2); list-style: none; display: flex; justify-content: space-between; }
.rp summary::-webkit-details-marker { display: none; }
.rp summary::after { content: "+"; font: 700 1.25rem/1 var(--display); color: var(--muted); }
.rp[open] summary::after { content: "–"; }
.rpf { padding: 0 18px 18px; display: grid; gap: 8px; }
.rpf .d { color: var(--ink-2); margin-bottom: 6px; }
.rpf label { font-weight: 600; font-size: .9375rem; margin-top: 6px; }
.rpf small { font-weight: 400; color: var(--muted); }
.rpf textarea, .rpf input { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.rpf textarea { resize: vertical; min-height: 96px; }
.rpf .row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.sendbtn { font: 700 1.0625rem/1 var(--display); color: #fff; background: var(--gc); border: 0; border-radius: 12px; padding: 14px 26px; cursor: pointer; }
@media (prefers-color-scheme: dark) { .sendbtn { color: #0d1311; } }
.sendbtn[disabled] { opacity: .5; cursor: default; }
.rpf .msg { color: var(--ink-2); font-size: .9375rem; }

/* app-browser notice (arcade.js): only in KakaoTalk, Instagram and other in-app browsers */
.inapp { background: #1d2927; color: #e7ede9; }
.inapp .in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 14px; padding-bottom: 14px; }
.inapp p { flex: 1 1 260px; font-size: .9375rem; line-height: 1.5; }
.inapp p b { display: block; font-size: 1rem; margin-bottom: 2px; }
.inapp .how { display: block; margin-top: 6px; }
html[data-lang="en"] .inapp .how.ko, html[data-lang="ko"] .inapp .how.en { display: none; }
.inapp .how b { display: inline; font-size: inherit; color: #fff; }
.inapp .acts { display: flex; gap: 8px; }
.inapp .go { background: #5cbba1; color: #0d1311; font-weight: 700; text-decoration: none; border-radius: 10px; padding: 10px 16px; white-space: nowrap; }
.inapp .x { background: none; border: 1px solid #4a5a56; color: #c4cfcb; font: inherit; font-size: .9375rem; border-radius: 10px; padding: 9px 14px; cursor: pointer; }
