/* 땅따먹기 대전 화면 (밝은 파스텔). 키트 화면은 kit/kit.css */
:root {
  --bg: #f2fbf7; --card: #ffffff; --line: #dbeee6; --text: #23413d; --muted: #68847f;
  --pink: #ff7eaa; --blue: #4ca6e8; --green: #41bd83; --yellow: #ffc65a; --violet: #7776d9;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { min-height: 100vh; font-family: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; color: var(--text); word-break: keep-all;
  background-color: var(--bg); background-image: linear-gradient(rgba(65,189,131,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(65,189,131,.055) 1px, transparent 1px), radial-gradient(ellipse 65% 45% at 0% 0%, #cef3df 0%, transparent 70%), radial-gradient(ellipse 58% 42% at 100% 12%, #d8efff 0%, transparent 72%); background-size: 28px 28px, 28px 28px, auto, auto; background-attachment: fixed; }
body.playing { overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- 처음 화면 ---------- */
.screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: calc(10px + var(--safe-t)) calc(14px + var(--safe-r)) 6px calc(14px + var(--safe-l)); }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand h1 { margin: 0; font-size: 19px; font-weight: 900; letter-spacing: -.5px; white-space: nowrap; background: linear-gradient(90deg, #209f69, #347fc5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-ico { position: relative; width: 28px; height: 26px; flex: none; }
.brand-ico i { position: absolute; width: 17px; height: 17px; border-radius: 5px; background: var(--pink); box-shadow: 0 3px 0 #e2557f; left: 0; top: 0; }
.brand-ico i + i { background: var(--blue); box-shadow: 0 3px 0 #3b95e0; left: 11px; top: 7px; }
.kit-chip { flex-shrink: 0; }

.home-main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 6px 16px calc(18px + var(--safe-b)); display: grid; gap: 14px; align-content: start; }
.hero { position: relative; border-radius: 18px 34px 18px 34px; overflow: hidden; background: #fff; border: 2px solid rgba(65,189,131,.2); box-shadow: 0 14px 40px rgba(47,128,100,.15); aspect-ratio: 1 / 1; max-height: 44vh; max-height: 44dvh; width: 100%; }
@media (max-aspect-ratio: 3/4) { .home-main { align-content: center; } }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-tag { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); margin: 0; padding: 7px 14px; border-radius: 99px; background: rgba(255, 255, 255, .9); font-size: 14px; font-weight: 800; white-space: nowrap; box-shadow: 0 4px 14px rgba(80, 60, 120, .14); }
.hero-tag b { color: #159864; }

.menu { display: grid; gap: 10px; }
.card { display: grid; gap: 12px; padding: 16px; border-radius: 16px 24px 16px 24px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(47,128,100,.10); text-align: left; }
.card-h { display: flex; align-items: center; gap: 12px; }
.card h2 { margin: 0; font-size: 19px; font-weight: 900; }
.card p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
button.card { cursor: pointer; border: 1px solid var(--line); grid-template-columns: 1fr auto; align-items: center; transition: transform .12s; }
button.card:active { transform: scale(.98); }
.card.friends { border-top: 4px solid var(--green); }
.card.bot { background: linear-gradient(135deg, #edfff6, #eef8ff); border-top: 4px solid var(--blue); }
.card .go { font-size: 30px; font-weight: 900; color: var(--violet); line-height: 1; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.btn { border: 0; border-radius: 16px; padding: 14px 12px; font-weight: 900; font-size: 16px; cursor: pointer; transition: transform .1s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { color: #fff; background: linear-gradient(135deg, #43c78a, #318ecb); box-shadow: 0 6px 16px rgba(49,142,203,.28); }
.btn.soft { background: #e9f8f1; color: #237d5b; }
.btn.tile { display: flex; align-items: center; justify-content: center; gap: 8px; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(140, 110, 180, .08); }
.ico { width: 42px; height: 42px; border-radius: 14px; flex: none; display: inline-block; background-repeat: no-repeat; background-position: center; background-size: 26px; }
.tile .ico { width: 30px; height: 30px; border-radius: 10px; background-size: 20px; }
.ico-friends { background-color: #ffe3ee; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='8' cy='8' r='4' fill='%23ff6b9d'/%3E%3Ccircle cx='16.5' cy='9' r='3.4' fill='%235fb8ff'/%3E%3Cpath d='M1 21c0-4 3-7 7-7s7 3 7 7z' fill='%23ff6b9d'/%3E%3Cpath d='M13 21c0-3 2-6 4-6 3 0 6 2 6 6z' fill='%235fb8ff'/%3E%3C/svg%3E"); }
.ico-bot { background-color: #e1f2ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='6' width='18' height='14' rx='5' fill='%235fb8ff'/%3E%3Ccircle cx='9' cy='13' r='2.2' fill='%23fff'/%3E%3Ccircle cx='15' cy='13' r='2.2' fill='%23fff'/%3E%3Crect x='11' y='1.5' width='2' height='5' fill='%235fb8ff'/%3E%3Ccircle cx='12' cy='2' r='1.8' fill='%23ffbf47'/%3E%3C/svg%3E"); }
.ico-shop { background-color: #fff3d6; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h16l-1.5 12h-13z' fill='%23ffbf47'/%3E%3Cpath d='M8 9V7a4 4 0 0 1 8 0v2' fill='none' stroke='%23e09a1a' stroke-width='2'/%3E%3C/svg%3E"); }
.ico-how { background-color: #e6f9ef; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%235fdc9a'/%3E%3Cpath d='M9.2 9.2a2.9 2.9 0 1 1 3.8 2.8c-.7.3-1 .8-1 1.6v.6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='17.6' r='1.3' fill='%23fff'/%3E%3C/svg%3E"); }

/* 가로 화면 / 넓은 화면: 두 칸 */
@media (min-width: 760px), (orientation: landscape) and (max-height: 520px) {
  .home-main { grid-template-columns: 1.15fr 1fr; align-items: center; align-content: center; }
  .hero { max-height: none; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .top { padding-top: calc(6px + var(--safe-t)); padding-bottom: 2px; }
  .home-main { padding-top: 2px; gap: 12px; }
  .hero { aspect-ratio: auto; height: calc(100dvh - 76px); max-height: 330px; }
  .card { padding: 10px 12px; gap: 8px; border-radius: 18px; }
  .card h2 { font-size: 16px; }
  .card p { font-size: 12px; }
  .ico { width: 34px; height: 34px; background-size: 22px; }
  .btn { padding: 10px; font-size: 15px; min-height: 44px; }
  .menu { gap: 8px; }
}

/* ---------- 게임 화면 ---------- */
#play { position: fixed; inset: 0; z-index: 10; background: #e2f4eb; touch-action: none; user-select: none; -webkit-user-select: none; overflow: hidden; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud-tl { position: absolute; top: calc(8px + var(--safe-t)); left: calc(8px + var(--safe-l)); display: flex; gap: 6px; align-items: stretch; pointer-events: none; }
.hud-tl > * { pointer-events: auto; }
/* 터치 버튼은 프로필의 '버튼 크기'(--kit-btn-scale 0.8~1.5)를 따라 커짐 */
.hud-btn { width: calc(40px * var(--kit-btn-scale, 1)); height: calc(40px * var(--kit-btn-scale, 1)); border: 0; border-radius: calc(13px * var(--kit-btn-scale, 1)); background: rgba(255, 255, 255, .92); color: #6b6f8a; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 12px rgba(80, 60, 120, .16); }
.hud-btn svg { width: calc(19px * var(--kit-btn-scale, 1)); height: calc(19px * var(--kit-btn-scale, 1)); }
.hud-pill { min-width: 62px; padding: 3px 10px; border-radius: 13px; background: rgba(255, 255, 255, .92); box-shadow: 0 4px 12px rgba(80, 60, 120, .16); display: grid; align-content: center; text-align: center; }
.hud-pill small { font-size: 10px; font-weight: 800; color: var(--muted); line-height: 1.1; }
.hud-pill b { font-size: 18px; font-weight: 900; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hud-pill.me b { color: var(--mc, #ff6b9d); }
.hud-pill.warn b { color: #ff4d6d; animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45; } }
.board { position: absolute; top: calc(8px + var(--safe-t)); right: calc(8px + var(--safe-r)); margin: 0; padding: 6px; list-style: none; width: 148px; border-radius: 14px; background: rgba(255, 255, 255, .9); box-shadow: 0 4px 12px rgba(80, 60, 120, .16); display: grid; gap: 2px; pointer-events: none; }
.board li { display: grid; grid-template-columns: 14px 10px 1fr auto; gap: 5px; align-items: center; font-size: 12px; font-weight: 700; padding: 2px 4px; border-radius: 8px; }
.board li.me { background: #f3f0ff; }
.board li.dead { opacity: .45; }
.board .r { color: var(--muted); font-weight: 900; text-align: center; }
.board .c { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.board .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .p { font-weight: 900; font-variant-numeric: tabular-nums; }
.mini-wrap { position: absolute; left: calc(8px + var(--safe-l)); bottom: calc(8px + var(--safe-b)); padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .9); box-shadow: 0 4px 12px rgba(80, 60, 120, .16); pointer-events: none; line-height: 0; }
#mini { width: 104px; height: 104px; border-radius: 10px; display: block; }
.snd { position: absolute; right: calc(8px + var(--safe-r)); bottom: calc(8px + var(--safe-b)); }
.feed { position: absolute; left: 50%; transform: translateX(-50%); top: calc(18px + 40px * var(--kit-btn-scale, 1) + var(--safe-t)); display: grid; gap: 4px; justify-items: center; pointer-events: none; width: min(92vw, 420px); }
.feed div { padding: 5px 12px; border-radius: 99px; background: rgba(47, 53, 80, .78); color: #fff; font-size: 13px; font-weight: 700; animation: feedIn .25s ease-out; max-width: 100%; text-align: center; }
.feed div.out { opacity: 0; transition: opacity .5s; }
.feed i { font-style: normal; color: var(--c); filter: brightness(1.15); font-weight: 900; }
@keyframes feedIn { from { transform: translateY(-6px); opacity: 0; } }
.center-msg { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.center-msg .count { font-size: 96px; font-weight: 900; line-height: 1; color: #8b7cf6; -webkit-text-stroke: 10px #fff; paint-order: stroke fill; filter: drop-shadow(0 6px 0 rgba(90, 70, 160, .2)); animation: pop .5s ease-out; }
.center-msg .go { font-size: 68px; color: #ff5a8f; white-space: nowrap; }
.center-msg .dead { padding: 16px 22px; border-radius: 22px; background: rgba(255, 255, 255, .94); box-shadow: 0 12px 30px rgba(80, 60, 120, .22); animation: pop .35s ease-out; }
.center-msg .dead b { display: block; font-size: 22px; font-weight: 900; color: #ff4d6d; }
.center-msg .dead span { display: block; margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--muted); }
.center-msg .dead em { font-style: normal; font-size: 30px; font-weight: 900; color: #8b7cf6; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); } }
.hint { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); padding: 8px 16px; border-radius: 99px; background: rgba(47, 53, 80, .78); color: #fff; font-weight: 800; font-size: 14px; white-space: nowrap; pointer-events: none; animation: feedIn .3s; }
@media (max-width: 600px) {
  .board { width: 128px; padding: 4px; }
  .board li { font-size: 11px; grid-template-columns: 12px 9px 1fr auto; gap: 4px; padding: 1px 3px; }
  #mini { width: 88px; height: 88px; }
  .hud-pill b { font-size: 16px; }
  .hint { bottom: 24%; font-size: 13px; }
  .feed { top: auto; bottom: calc(118px + var(--safe-b)); }
}
@media (orientation: landscape) and (max-height: 520px) {
  #mini { width: 78px; height: 78px; }
  .board li { font-size: 11px; padding: 0 3px; }
  .feed { top: calc(8px + var(--safe-t)); width: min(44vw, 360px); }
  .hint { bottom: calc(10px + var(--safe-b)); }
}

/* ---------- 창 (결과·설정·놀이 방법) ---------- */
.set-row { display: grid; gap: 6px; margin: 8px 0; }
.set-row > span { font-size: 13px; font-weight: 800; color: var(--muted); }
.seg { display: flex; gap: 6px; }
.seg-b { flex: 1; padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; font-size: 14px; cursor: pointer; }
.seg-b.on { border-color: transparent; color: #fff; background: linear-gradient(135deg, #ff8fb8, #8b7cf6); }
.seg-b:disabled { cursor: default; }
.seg-b:disabled:not(.on) { opacity: .55; }
.res-title { text-align: center; margin: 0 0 4px; font-size: 26px; font-weight: 900; }
.res-sub { text-align: center; margin: 0 0 12px; color: var(--muted); font-weight: 700; }
.res-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.res-list li { display: grid; grid-template-columns: 34px 16px 1fr auto; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 14px; background: #faf8fd; border: 1px solid var(--line); font-weight: 700; }
.res-list li.me { background: #f3f0ff; border-color: #d8cffc; }
.res-list .pl { font-weight: 900; font-size: 18px; text-align: center; color: #9aa0bd; }
.res-list li:nth-child(1) .pl { color: #f5a524; }
.res-list li:nth-child(2) .pl { color: #8e9bb5; }
.res-list li:nth-child(3) .pl { color: #d0864f; }
.res-list .c { width: 16px; height: 16px; border-radius: 5px; background: var(--c); box-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.res-list .nm small { color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 4px; }
.res-list .pc { font-weight: 900; font-variant-numeric: tabular-nums; }
.res-gold { margin: 12px 0 0; text-align: center; font-weight: 900; font-size: 17px; color: #c47f00; }
.res-medal { display: block; margin: 0 auto 4px; }
.how { display: grid; gap: 10px; margin: 8px 0 0; padding: 0; list-style: none; }
.how li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: #faf8fd; border: 1px solid var(--line); font-size: 14.5px; line-height: 1.5; }
.how li b { color: #ff5a8f; }
.how svg { display: block; }
.how-keys { margin: 12px 0 0; padding: 10px 12px; border-radius: 14px; background: #fff6d6; border: 1px solid #ffe08a; font-size: 14px; line-height: 1.6; }

/* 판 중 버튼: 손가락으로 누르기 쉽게 44px 이상 (2026-11-01) */
@media (pointer: coarse) {
  .hud-btn { width: max(44px, calc(40px * var(--kit-btn-scale, 1))); height: max(44px, calc(40px * var(--kit-btn-scale, 1))); }
  .feed { top: calc(18px + max(44px, 40px * var(--kit-btn-scale, 1)) + var(--safe-t)); }
}

/* ---------- ⚡ 빠른 대전 (2026-11-03) ---------- */
.btn.quick { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; min-height: 52px; color: #2a2f55; background: linear-gradient(135deg, #ffd23f, #ff9a5c); box-shadow: 0 6px 16px rgba(255, 154, 92, .32); }
.btn.quick b { font-weight: 900; }
.btn.quick small { font-size: 12.5px; font-weight: 800; color: rgba(42, 47, 85, .78); }
@media (orientation: landscape) and (max-height: 520px) { .btn.quick { min-height: 46px; padding: 8px 10px; } }
/* 채팅 줄(눌러서 신고·차단)도 손가락으로 누르기 쉽게 44px (키트 기본 40px) */
.qm-panel .qm-row:not(.sys) { min-height: 44px; }
.qm-panel .qm-quick button { min-width: 44px; }
#resQuick, #resMenu { min-height: 44px; }
/* 낮은 가로 화면: 💬 채팅 창은 위쪽, 채팅 단추 오른쪽에 화면 높이만큼 — 단추 아래로 열면 화면 밖으로 나감 */
@media (max-height: 520px) and (orientation: landscape) {
  .qm-panel { top: max(8px, env(safe-area-inset-top)) !important; left: calc(68px + env(safe-area-inset-left)) !important; max-height: calc(100dvh - 16px) !important; }
}

/* ---------- 🎬 첫 화면 배경 (kit/title.css 위에 땅따먹기 대전 색·무늬·떠다니는 그림, 2026-11-10) ---------- */
#title { --lt-a: #2fb877; --lt-b: #3d8fe0; --lt-ink: #23413d; --lt-muted: #5f7a75; --lt-brand: #2fa86a; --lt-sh: #22955f; --lt-glow: rgba(65,189,131,.4); --lt-bgc: #f2fbf7;
  background-image: linear-gradient(#dbeee6 2px,transparent 2px),linear-gradient(90deg,#dbeee6 2px,transparent 2px); background-size: 32px 32px;
  --lt-fade: radial-gradient(ellipse at 50% 46%,rgba(255,255,255,0.95) 0,rgba(255,255,255,0.7) 38%,rgba(255,255,255,0) 75%); }
#title .lt-o { filter: drop-shadow(0 6px 10px rgba(30,80,60,.2)); }
#title .tt-o1 { top:-6px; left:-6px; }
#title .tt-o2 { top:104px; left:110px; }
#title .tt-o3 { top:6%; right:-8px; }
#title .tt-o4 { bottom:-8px; left:-10px; }
#title .tt-o5 { bottom:6%; right:-12px; }
#title .tt-o6 { top:25%; right:3%; }
#title .tt-o7 { bottom:14%; right:30%; }
#title .tt-o8 { top:150px; left:188px; }
#title .tt-o9 { top:20%; right:30%; }
#title .tt-o10 { bottom:20%; right:38%; }
#title .tt-o11 { bottom:19%; left:30%; }
#title .tt-o12 { top:30%; left:-20px; }
/* 견본에서 고친 자리: 보라 친구·꼬리 점선이 플레이 단추·작은 단추와 안 닿게 */
#title .tt-o10 { bottom: 15.5%; } #title .tt-o7 { bottom: 9%; }
@media (min-width: 900px) and (min-height: 680px) { #title .tt-o7 { right: 17%; bottom: 10%; } #title .tt-o10 { right: 25%; bottom: 15%; } }
@media (orientation: landscape) and (max-height: 500px) { #title .tt-o7 { display: none; } #title .tt-o10 { right: 27%; bottom: 6%; } }
@media (orientation: portrait) { #title .tt-o11 { bottom: 17%; } }
