/* Dodomimi Games — one stylesheet for every page. Palette shared with Pop 21 (Okabe-Ito based). */
@font-face { font-family: 'Fredoka'; font-weight: 500; font-display: swap; src: url('/fonts/fredoka-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url('/fonts/fredoka-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 700; font-display: swap; src: url('/fonts/fredoka-latin-700-normal.woff2') format('woff2'); }

:root {
  --navy: #1b2440;
  --navy-2: #222d52;
  --navy-deep: #121a30;
  --ink: #1b2440;
  --ink-2: #4a5478;
  --paper: #fbf8f1;
  --ivory: #f5f0e6;
  --line: #e6dfcf;
  --sky: #56b4e9;
  --orange: #e69f00;
  --vermilion: #d55e00;
  --dim: #7d88ad;
  --radius: 22px;
  --display: 'Fredoka', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', Roboto, sans-serif;
  --wrap: 1120px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 var(--body);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ivory); padding: 8px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { left: 16px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-weight: 700; font-size: clamp(2.6rem, 7vw, 4.6rem); }
h2 { font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.5rem); }
h3 { font-weight: 600; font-size: 1.25rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 44ch; }

/* ---------------------------------------------------------------- header */
.site-header { position: sticky; top: 0; z-index: 5; background: rgba(27, 36, 64, 0.92); backdrop-filter: blur(10px); color: var(--ivory); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.brand img { width: 38px; height: 38px; }
.brand span b { color: var(--sky); font-weight: 600; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 12px; font-weight: 600; font-size: 0.95rem; color: #d9dcea; }
.nav a:hover, .nav a[aria-current='page'] { background: var(--navy-2); color: #fff; }
.nav .lang { border: 1.5px solid #3a4776; }
@media (max-width: 640px) {
  .nav .hide-sm { display: none; }
  .brand span { font-size: 1.05rem; }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  min-height: 52px; padding: 12px 24px; border-radius: 999px;
  font: 700 1.05rem/1.2 var(--display); text-decoration: none; border: 0; cursor: pointer;
  background: var(--orange); color: var(--navy);
  box-shadow: 0 6px 0 rgba(13, 19, 38, 0.55);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 rgba(13, 19, 38, 0.55); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(13, 19, 38, 0.55); }
.btn.sky { background: var(--sky); }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px currentColor; }
.btn[aria-disabled='true'] { background: #39446b; color: #b8bfd6; box-shadow: none; cursor: default; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btns { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------------------------------------------------------------- hero */
.hero { background: radial-gradient(1200px 500px at 85% -10%, #2c3966 0%, transparent 60%), var(--navy); color: var(--ivory); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; align-items: center; padding: clamp(48px, 8vw, 96px) 0; }
.hero .lead { color: #c9cee0; }
.eyebrow { display: inline-block; font: 600 0.85rem/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sky); margin-bottom: 18px; }
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: var(--orange); }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

/* Floating number tiles, drawn like the in-game tiles. */
.tiles { position: relative; height: 360px; }
.tile {
  position: absolute; width: var(--s, 110px); aspect-ratio: 1; border-radius: 24%;
  background: var(--ivory);
  box-shadow: 0 calc(var(--s, 110px) * 0.075) 0 rgba(13, 19, 38, 0.55);
  display: grid; place-items: center;
  font: 600 calc(var(--s, 110px) * 0.62) / 1 'Fredoka', sans-serif; color: var(--navy);
  transform: rotate(var(--r, 0deg));
  animation: bob 3.2s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
}
.tile::before { content: ''; position: absolute; left: 8%; right: 8%; top: 6%; height: 17%; border-radius: 999px; background: rgba(255, 255, 255, 0.45); }
.tile.pop { background: var(--orange); color: var(--navy); }
.spark { position: absolute; border-radius: 50%; animation: bob 2.4s ease-in-out infinite alternate; }
@keyframes bob { to { translate: 0 -12px; } }
@media (max-width: 820px) { .tiles { height: 240px; transform: scale(0.72); transform-origin: top center; margin-bottom: -60px; } }
@media (prefers-reduced-motion: reduce) { .tile, .spark { animation: none; } html { scroll-behavior: auto; } }

/* ---------------------------------------------------------------- sections */
section { padding: clamp(56px, 8vw, 96px) 0; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head p { color: var(--ink-2); }
.alt { background: var(--ivory); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 30px -18px rgba(27, 36, 64, 0.35);
}
.card .top { display: flex; gap: 16px; align-items: center; }
.card .top img { width: 84px; height: 84px; border-radius: 22%; box-shadow: 0 6px 0 rgba(13, 19, 38, 0.25); }
.card h3 { margin: 0; font-size: 1.5rem; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.card .tag { margin: 2px 0 0; color: var(--ink-2); font-weight: 600; }
.card p { margin: 0; color: var(--ink-2); }
.card .btns { margin-top: auto; }
.card .btn { min-height: 46px; padding: 10px 18px; font-size: 0.98rem; }
.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font: 600 0.8rem/1 var(--display); padding: 7px 11px; border-radius: 999px; background: #e9f5fc; color: #1d6d99; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hero .badge { background: rgba(86, 180, 233, 0.16); color: var(--sky); }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.point { padding: 22px; border-radius: var(--radius); background: #fff; border: 1.5px solid var(--line); }
.point .num { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font: 700 1.3rem/1 var(--display); background: var(--navy); color: var(--ivory); margin-bottom: 14px; box-shadow: 0 4px 0 rgba(13, 19, 38, 0.35); }
.point:nth-child(4n+2) .num { background: var(--sky); color: var(--navy); }
.point:nth-child(4n+3) .num { background: var(--orange); color: var(--navy); }
.point:nth-child(4n+4) .num { background: var(--vermilion); color: #fff; }
.point p { margin: 0; color: var(--ink-2); }

.contact { background: var(--navy); color: var(--ivory); border-radius: 28px; padding: clamp(28px, 5vw, 48px); display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.contact p { color: #c9cee0; margin: 0; }
.contact h2 { color: #fff; }

/* ---------------------------------------------------------------- game page */
.game-hero .wrap { grid-template-columns: auto 1fr; gap: 32px; }
.game-hero .icon { width: clamp(120px, 20vw, 200px); border-radius: 22%; box-shadow: 0 10px 0 rgba(13, 19, 38, 0.6); }
.game-hero h1 { margin-bottom: 0.2em; }
.game-hero .tagline { font: 600 clamp(1.2rem, 3vw, 1.6rem)/1.3 var(--display); color: var(--orange); margin-bottom: 0.8em; }
@media (max-width: 680px) { .game-hero .wrap { grid-template-columns: 1fr; } }
.crumbs { font-size: 0.9rem; color: #aab2cc; margin-bottom: 14px; }
.crumbs a { color: #d9dcea; }

.shots { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 18px; -webkit-overflow-scrolling: touch; }
.shots figure { margin: 0; flex: 0 0 clamp(200px, 26vw, 260px); scroll-snap-align: start; }
.shots img { border-radius: 26px; border: 6px solid var(--navy); box-shadow: 0 12px 30px -16px rgba(27, 36, 64, 0.6); background: var(--navy); }
.shots figcaption { font-size: 0.9rem; color: var(--ink-2); margin-top: 10px; }

.how { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.how li { counter-increment: step; display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; }
.how li::before { content: counter(step); width: 56px; height: 56px; border-radius: 14px; background: var(--ivory); box-shadow: 0 5px 0 rgba(13, 19, 38, 0.3); display: grid; place-items: center; font: 600 1.8rem/1 'Fredoka', sans-serif; color: var(--navy); }
.how li:nth-child(2)::before { background: var(--orange); }

.faq details { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 4px 20px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font: 700 1.4rem/1 var(--display); color: var(--sky); }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--ink-2); }
.meta-line { font-size: 0.9rem; color: var(--dim); }
.meta-line code { font-size: 0.88rem; }

/* ---------------------------------------------------------------- prose (privacy) */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.45rem; margin-top: 1.8em; }
.prose .meta { color: var(--dim); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 0 0 1.2em; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--ivory); font-family: var(--display); font-weight: 600; }
.prose code { background: var(--ivory); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }
.page-head { background: var(--navy); color: var(--ivory); padding: clamp(40px, 6vw, 64px) 0; }
.page-head h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--navy-deep); color: #aab2cc; padding: 40px 0; font-size: 0.92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: #d9dcea; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .brand { color: var(--ivory); font-size: 1rem; }
.site-footer .brand img { width: 30px; height: 30px; }
