/* 소담마을 site look (2026-11-21): the game's storybook palette — cream paper, warm brown ink, leaf green, wood. */
@font-face { font-family: 'Jua'; src: url('/assets/site/jua.woff2') format('woff2'); font-display: swap; }
/* Cute rounded faces for the other languages (owner, 2026-11-21), subset to the site's words (+ the script's common
   characters for chat). Each loads only on pages in its language. Licences: /assets/site/fonts/*-OFL.txt */
@font-face { font-family: 'Fredoka'; src: url('/assets/site/fonts/fredoka.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('/assets/site/fonts/nunito.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: 'Mochiy Pop One'; src: url('/assets/site/fonts/mochiy-pop-one.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Zen Maru Gothic'; src: url('/assets/site/fonts/zen-maru-gothic.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'ZCOOL KuaiLe'; src: url('/assets/site/fonts/zcool-kuaile.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Itim'; src: url('/assets/site/fonts/itim.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Mali'; src: url('/assets/site/fonts/mali.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Kdam Thmor Pro'; src: url('/assets/site/fonts/kdam-thmor-pro.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Kantumruy Pro'; src: url('/assets/site/fonts/kantumruy-pro.woff2') format('woff2'); font-weight: 100 700; font-display: swap; }
:root {
  color-scheme: light;
  --cream: #f6e9cd;
  --paper: #fff8e8;
  --ink: #4a2c18;
  --ink-soft: #7a5a3c;
  --leaf: #7fb24f;
  --leaf-dark: #4f8a2c;
  --forest: #284e42;
  --wood: #8d6a3e;
  --wood-light: #c49a62;
  --sun: #ffcf5a;
  --line: #e4cfa6;
  --shadow: 0 6px 0 rgba(74, 44, 24, .18), 0 14px 28px rgba(74, 44, 24, .12);
  --display: 'Jua', 'Noto Sans KR', 'Hiragino Maru Gothic ProN', system-ui, sans-serif;
  font: 16px/1.65 'Noto Sans KR', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Thai', 'Noto Sans Khmer', sans-serif;
  background: var(--cream);
  color: var(--ink);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; min-height: 100vh; background: var(--cream); overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p { margin: 0; }
:root:lang(en) { --display: 'Fredoka', 'Jua', system-ui, sans-serif; font-family: 'Nunito', 'Noto Sans KR', system-ui, sans-serif; }
:root:lang(ja) { --display: 'Mochiy Pop One', 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', sans-serif; font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Noto Sans JP', sans-serif; }
:root:lang(zh-Hans) { --display: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif; font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; }
:root:lang(th) { --display: 'Itim', 'Mali', sans-serif; font-family: 'Mali', 'Noto Sans Thai', sans-serif; }
:root:lang(km) { --display: 'Kdam Thmor Pro', 'Kantumruy Pro', sans-serif; font-family: 'Kantumruy Pro', 'Noto Sans Khmer', sans-serif; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.25; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 8px 14px; background: var(--paper); border-radius: 10px; }
.skip-link:focus { top: 12px; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.noscript-note { position: fixed; bottom: 0; left: 0; right: 0; padding: 10px; text-align: center; background: var(--ink); color: var(--paper); }

/* Buttons */
.wood-button, .play-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; font-family: var(--display); letter-spacing: .02em;
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.wood-button {
  min-height: 44px; padding: 8px 20px; font-size: 17px;
  background: linear-gradient(#a98152, var(--wood)); color: #fff8e8;
  box-shadow: 0 4px 0 #5e4325, 0 8px 14px rgba(74, 44, 24, .2);
}
.wood-button.small { min-height: 40px; padding: 6px 16px; font-size: 16px; }
.wood-button:hover, .play-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.wood-button:active, .play-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #5e4325; }
.wood-button:disabled { opacity: .6; cursor: default; transform: none; }
.play-button {
  min-height: 72px; padding: 14px 44px 14px 36px; font-size: clamp(24px, 3.4vw, 32px);
  color: #fff; background: linear-gradient(#94c862, var(--leaf-dark));
  box-shadow: 0 7px 0 #34621b, 0 16px 30px rgba(40, 78, 66, .35);
  text-shadow: 0 2px 0 rgba(30, 60, 20, .35);
}
.play-button .icon { width: 30px; height: 30px; fill: currentColor; stroke: none; }
.play-button:active { box-shadow: 0 2px 0 #34621b; }
.play-button[aria-busy="true"] { opacity: .8; cursor: progress; }
.text-button { border: 0; background: none; padding: 4px 6px; color: var(--wood); text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }
.text-button:hover { color: var(--ink); }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--ink); }
.icon-button:hover { background: rgba(141, 106, 62, .12); }
.icon-button:disabled { opacity: .45; cursor: default; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  min-height: 72px; padding: 10px clamp(16px, 4vw, 48px);
  background: rgba(255, 248, 232, .94); backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; }
.brand-text { display: grid; line-height: 1.1; }
.brand-text b { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--forest); }
.brand-text small { font-size: 10px; letter-spacing: .22em; color: var(--wood); }
.site-nav { display: flex; gap: 6px; margin-right: auto; }
.site-nav a { padding: 8px 12px; border-radius: 10px; font-family: var(--display); font-size: 17px; color: var(--ink-soft); }
.site-nav a:hover { background: rgba(127, 178, 79, .18); color: var(--forest); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.lang-pick { position: relative; display: flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--wood); }
.lang-pick select { min-height: 38px; padding: 4px 6px; border: 0; background: transparent; color: var(--ink); font-size: 15px; }
#account { display: flex; align-items: center; gap: 4px; }
.account-name { display: inline-flex; align-items: center; gap: 6px; max-width: 180px; padding: 6px 12px; border-radius: 12px; background: rgba(127, 178, 79, .18); color: var(--forest); font-weight: 700; }
.account-name #name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Hero */
.hero { position: relative; display: grid; align-items: end; min-height: min(78vh, 760px); padding: clamp(20px, 5vw, 64px); overflow: hidden; }
.hero-art { position: absolute; inset: 0; background: url('/assets/site/hero.webp') center 40% / cover no-repeat, var(--forest); }
.hero-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(40, 78, 66, 0) 40%, rgba(40, 30, 16, .45)); }
.hero-card {
  position: relative; max-width: 560px; padding: clamp(22px, 3.5vw, 36px);
  background: rgba(255, 248, 232, .95); border: 4px solid var(--paper); border-radius: 28px;
  box-shadow: var(--shadow); outline: 2px dashed var(--wood-light); outline-offset: -12px;
}
.hero-kicker { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--leaf); color: #fff; font-family: var(--display); font-size: 15px; }
.hero h1 { margin: 10px 0 8px; font-size: clamp(44px, 7vw, 76px); color: var(--forest); text-shadow: 0 3px 0 rgba(255, 207, 90, .6); }
.hero-lead { font-size: clamp(16px, 1.6vw, 18px); color: var(--ink-soft); margin-bottom: 22px; }
.play-status { min-height: 1.6em; margin-top: 12px; font-weight: 700; color: var(--forest); }
.hero-note { font-size: 13px; color: var(--ink-soft); }

/* Sections */
.section { max-width: 1180px; margin: 0 auto; padding: clamp(48px, 7vw, 88px) clamp(16px, 4vw, 40px) 0; }
.section-title { display: flex; justify-content: center; margin-bottom: 30px; text-align: center; }
.section-title span {
  position: relative; padding: 10px 34px 12px; font-size: clamp(26px, 3.4vw, 36px); color: var(--paper);
  background: linear-gradient(#a98152, var(--wood)); border-radius: 14px; box-shadow: 0 5px 0 #5e4325;
}
.section-title span::before, .section-title span::after { content: ''; position: absolute; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: #5e4325; }
.section-title span::before { left: 12px; }
.section-title span::after { right: 12px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.feature-card { overflow: hidden; background: var(--paper); border: 3px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.feature-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.feature-body { position: relative; padding: 30px 20px 22px; }
.feature-badge { position: absolute; top: -24px; left: 18px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--leaf); color: #fff; border: 4px solid var(--paper); }
.feature-body h3 { font-size: 22px; color: var(--forest); margin-bottom: 6px; }
.feature-body p { color: var(--ink-soft); font-size: 15px; }
.place-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0; margin: 0; list-style: none; }
.place-card { position: relative; overflow: hidden; border-radius: 22px; border: 4px solid var(--paper); box-shadow: var(--shadow); }
.place-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .4s; }
.place-card:hover img { transform: scale(1.05); }
.place-name { position: absolute; left: 12px; bottom: 12px; padding: 4px 14px; border-radius: 999px; background: rgba(255, 248, 232, .95); font-family: var(--display); font-size: 18px; color: var(--forest); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 0; margin: 0; list-style: none; counter-reset: none; }
.steps li { position: relative; padding: 34px 22px 24px; background: var(--paper); border: 3px dashed var(--wood-light); border-radius: 22px; }
.steps b { position: absolute; top: -20px; left: 20px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--sun); font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--ink); box-shadow: 0 3px 0 #c99a2a; }
.steps h3 { font-size: 21px; color: var(--forest); margin-bottom: 4px; }
.steps p { color: var(--ink-soft); font-size: 15px; }
.how-play { display: flex; justify-content: center; margin-top: 40px; }
.site-footer { display: grid; justify-items: center; gap: 6px; margin-top: clamp(56px, 8vw, 96px); padding: 36px 16px 110px; background: var(--forest); color: #e9f0dc; text-align: center; }
.site-footer img { width: 32px; height: 32px; border-radius: 8px; }
.site-footer b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--sun); letter-spacing: .03em; }
.site-footer small { opacity: .75; }

/* Chat lounge */
.chat-launcher {
  position: fixed; right: clamp(14px, 3vw, 28px); bottom: clamp(14px, 3vw, 28px); z-index: 30;
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 10px 20px;
  border: 3px solid var(--paper); border-radius: 999px; background: var(--forest); color: #fff;
  font-family: var(--display); font-size: 18px; box-shadow: var(--shadow);
}
.chat-launcher:hover { filter: brightness(1.1); }
.chat-panel {
  position: fixed; inset: auto clamp(14px, 3vw, 28px) calc(clamp(14px, 3vw, 28px) + 64px) auto; z-index: 31; margin: 0;
  width: min(380px, calc(100vw - 28px)); height: min(600px, calc(100dvh - 120px)); padding: 0;
  flex-direction: column; border: 3px solid var(--line); border-radius: 24px;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow); overflow: hidden;
}
.chat-panel[open] { display: flex; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 14px 14px 10px 18px; background: var(--cream); border-bottom: 2px solid var(--line); }
.panel-header h2 { display: flex; align-items: center; gap: 6px; font-size: 21px; color: var(--forest); }
#connection { font-size: 12px; color: var(--ink-soft); }
.chat-panel .language { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 18px; font-size: 13px; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.chat-panel .language select { min-height: 34px; padding: 2px 8px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; }
.chat-history { position: relative; flex: 1; min-height: 0; }
#messages { height: 100%; margin: 0; padding: 12px 14px; overflow-y: auto; list-style: none; display: flex; flex-direction: column; gap: 10px; }
#messages li { padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: #fff; border: 2px solid var(--line); }
#messages bdi { display: block; font-weight: 700; font-size: 13px; color: var(--leaf-dark); }
#messages p { overflow-wrap: anywhere; }
#messages small { display: block; margin-top: 2px; font-size: 12px; color: var(--wood); opacity: .85; overflow-wrap: anywhere; }
#empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 20px; text-align: center; color: var(--ink-soft); }
.empty-chat-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(127, 178, 79, .2); color: var(--leaf-dark); }
.empty-chat-icon .icon { width: 28px; height: 28px; }
#empty p { font-family: var(--display); font-size: 18px; color: var(--forest); }
.feedback { min-height: 0; padding: 0 18px; font-size: 13px; color: #b0452c; }
.feedback:empty { display: none; }
.chat-bottom { padding: 10px 14px 12px; border-top: 2px solid var(--line); background: var(--cream); }
#chat-login-hint { margin-bottom: 8px; font-size: 14px; color: var(--ink-soft); }
.composer { display: flex; gap: 6px; padding: 4px; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.composer input { flex: 1; min-width: 0; min-height: 40px; padding: 6px 10px; border: 0; background: transparent; }
.composer input:focus { outline: none; }
.composer:focus-within { border-color: var(--leaf); }
.send { background: var(--leaf); color: #fff; }
.send:hover { background: var(--leaf-dark); }
.chat-bottom .note { margin-top: 6px; font-size: 11px; color: var(--ink-soft); }

/* Sign-in dialog */
.auth-dialog {
  width: min(420px, calc(100vw - 28px)); padding: 30px 26px 24px; border: 4px solid var(--paper); border-radius: 28px;
  background: var(--cream); color: var(--ink); box-shadow: var(--shadow); text-align: center;
}
.auth-dialog::backdrop { background: rgba(40, 30, 16, .55); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 10px; right: 10px; }
.auth-mark { width: 56px; height: 56px; margin: 0 auto 8px; border-radius: 14px; }
.auth-dialog h2 { font-size: 28px; color: var(--forest); }
.auth-description { margin: 4px 0 18px; color: var(--ink-soft); }
.auth-description.attention { color: var(--forest); font-weight: 700; }
.google-login { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 8px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-weight: 700; box-shadow: 0 3px 0 var(--line); }
.google-login:hover { border-color: var(--leaf); }
.google-g { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); color: #fff; font-weight: 900; font-size: 14px; }
.divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 13px; color: var(--ink-soft); }
.divider::before, .divider::after { content: ''; flex: 1; height: 2px; background: var(--line); }
#login-form, #password-form { display: grid; gap: 12px; text-align: left; }
#login-form label, #password-form label { display: grid; gap: 4px; font-size: 14px; color: var(--ink-soft); }
#login-form input, #password-form input { min-height: 46px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
#login-form input:focus, #password-form input:focus { outline: none; border-color: var(--leaf); }
#login-form .wood-button, #password-form .wood-button { margin-top: 4px; }
#auth-feedback { margin-top: 12px; padding: 0; }

/* Narrow screens */
@media (max-width: 900px) {
  .site-nav { display: none; }
  .place-strip { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 600px) {
  .site-header { gap: 8px; padding: 8px 12px; min-height: 60px; }
  .brand-text small { display: none; }
  .brand-text b { font-size: 20px; }
  .brand-mark { width: 34px; height: 34px; }
  .lang-pick { padding-left: 6px; }
  .lang-pick select { max-width: 92px; font-size: 14px; }
  .account-name { max-width: 110px; padding: 4px 8px; }
  #password-open, #logout { font-size: 13px; }
  .hero { min-height: 82vh; padding: 14px; }
  .hero-card { padding: 20px 18px; border-radius: 22px; }
  .play-button { width: 100%; }
  .place-strip { grid-template-columns: 1fr; }
  .chat-launcher span { display: none; }
  .chat-launcher { padding: 10px 14px; }
}
@media (max-width: 460px) {
  .brand-text { display: none; }
  .lang-pick .icon { display: none; }
  .lang-pick select { max-width: 84px; }
  .header-actions { gap: 6px; }
  .account-name { max-width: 84px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
