/* 사과 10 만들기 — 햇살 과수원(하늘 · 초록 언덕 · 나무 상자 위 소풍 돗자리) */
/* ── AAA 공통 꾸밈(숫자 퍼즐 6개가 같은 사본을 쓴다 — 단추 · HUD 느낌 통일). 색은 --k1(주색) --k2(주색 어둠) --k3(곁색) ── */
.k-title { background: none; backdrop-filter: none; padding: 0; overflow: hidden; }
.k-title .k-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.k-wrap { position: relative; width: min(440px, 100%); max-height: 100%; overflow: visible; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 16px 22px; text-align: center; scrollbar-width: none; }
.k-wrap::-webkit-scrollbar { display: none; }
.k-art { position: relative; animation: k-bob 3.2s ease-in-out infinite; }
@keyframes k-bob { 50% { transform: translateY(-7px); } }
.k-logo { position: relative; margin: 0; font-family: var(--logo, var(--title)); font-weight: 400; font-size: clamp(34px, 9.4vw, 62px); line-height: 1.08; letter-spacing: 0.01em; max-width: 100%; text-wrap: balance;
  color: var(--k2); -webkit-text-stroke: 12px var(--k2); filter: drop-shadow(0 6px 0 var(--k2)) drop-shadow(0 14px 18px rgba(0, 0, 0, 0.4)); }
.k-logo::after { content: attr(data-t); position: absolute; inset: 0; -webkit-text-stroke: 0; color: transparent; background: linear-gradient(180deg, #fff 0%, #fff 42%, var(--k-logo2, #ffe08a) 100%); -webkit-background-clip: text; background-clip: text; }
.k-logo.long { font-size: clamp(30px, 7.6vw, 50px); }
.k-wrap > * { max-width: 100%; }
.k-sub { margin: -4px 0 0; font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, 0.88); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); max-width: 340px; line-height: 1.4; }
.k-modes { display: flex; gap: 8px; width: 100%; justify-content: center; flex-wrap: wrap; }
.k-modes button { flex: 1 1 0; min-width: 0; max-width: 140px; padding: 9px 4px 8px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, 0.13); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18), 0 4px 0 rgba(0, 0, 0, 0.25);
  display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.15; transition: transform 0.15s, background 0.15s; cursor: pointer; }
.k-modes button b { font-family: var(--title); font-weight: 400; font-size: 17px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.k-modes button small { font-size: 11px; font-weight: 700; opacity: 0.85; white-space: nowrap; }
.k-modes button.on { background: #fff; color: var(--k2); box-shadow: 0 0 0 3px var(--k3), 0 6px 0 rgba(0, 0, 0, 0.28); transform: translateY(-3px); }
.k-modes button:active { transform: translateY(1px); }
.k-best { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 14px 5px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); color: #ffe08a; font-weight: 800; font-size: 14px; box-shadow: inset 0 0 0 1.5px rgba(255, 224, 138, 0.35); margin: 0; }
.k-best svg { width: 22px; height: 22px; flex: none; fill: currentColor; }
.k-best.none { color: rgba(255, 255, 255, 0.78); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.2); }
/* 크고 도톰한 입체 단추 (눌림 · 반짝임 · 숨쉬기) */
.k-play.big-btn, .k-play { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: min(300px, 100%); min-height: 68px; margin: 6px 0 0; padding: 0 28px; border: 0; border-radius: 22px; overflow: hidden; cursor: pointer;
  font-family: var(--title); font-weight: 400; font-size: 30px; letter-spacing: 0.02em; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  background: linear-gradient(180deg, var(--k-btn1, #7cf08f) 0%, var(--k-btn2, #22b85a) 100%); box-shadow: 0 8px 0 var(--k-btn3, #137a3a), 0 14px 26px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.55);
  animation: k-breathe 1.8s ease-in-out infinite; transition: transform 0.08s, box-shadow 0.08s; }
.k-play svg { width: 26px; height: 26px; fill: #fff; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.25)); flex: none; }
.k-play::after { content: ''; position: absolute; top: -20%; bottom: -20%; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: skewX(-18deg); animation: k-shine 2.8s ease-in-out infinite; pointer-events: none; }
.k-play:active { transform: translateY(6px) scale(0.98) !important; box-shadow: 0 2px 0 var(--k-btn3, #137a3a), 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.4); animation: none; }
@keyframes k-breathe { 50% { transform: scale(1.04); } }
@keyframes k-shine { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
.k-link { display: inline-block; border: 0; background: none; color: rgba(255, 255, 255, 0.8); font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 12px; text-decoration: none; cursor: pointer; }
.k-link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.k-link[hidden] { display: none; }
.k-row { display: flex; gap: 2px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
/* HUD 알약: 아이콘 + 숫자 */
.k-pill { display: inline-flex; align-items: center; gap: 5px; min-width: 0; height: 40px; padding: 0 10px 0 5px; border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.06)); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.14), 0 4px 10px rgba(0, 0, 0, 0.22); color: #fff; }
.k-pill .ic { width: 29px; height: 29px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--ic, var(--k1)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.35); }
.k-pill .ic svg { width: 17px; height: 17px; fill: #fff; }
.k-pill b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: Fredoka, var(--title); font-weight: 600; font-size: 19px; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.k-pill.bump { animation: k-bump 0.35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes k-bump { 40% { transform: scale(1.16); } }
/* 결과 카드 */
.k-card.panel { position: relative; width: min(380px, 100%); background: linear-gradient(180deg, var(--k-card1, #2b2f6b), var(--k-card2, #1a1d45)); color: #fff; border-radius: 28px; padding: 30px 22px 18px; margin-top: 40px; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12), 0 28px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2); overflow: visible; animation: k-cardin 0.5s cubic-bezier(.2, 1.4, .4, 1); }
.overlay:has(.k-card) { overflow: auto; }
@keyframes k-cardin { from { transform: translateY(40px) scale(0.85); opacity: 0; } }
.k-card h2 { margin: 2px 0 2px; font-family: var(--logo, var(--title)); font-weight: 400; font-size: 40px; color: #fff; text-shadow: 0 4px 0 var(--k2), 0 8px 18px rgba(0, 0, 0, 0.35); }
.k-card p { color: rgba(255, 255, 255, 0.8); margin: 0 0 6px; }
.k-stars { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: -76px 0 4px; height: 86px; }
.k-stars i { width: 62px; height: 62px; display: grid; place-items: center; }
.k-stars i:nth-child(2) { width: 82px; height: 82px; transform: translateY(-10px); }
.k-stars svg { width: 100%; height: 100%; overflow: visible; }
.k-stars .bg { fill: #14163a; stroke: rgba(255, 255, 255, 0.25); stroke-width: 3; }
.k-stars .fg { fill: url(#kStarG); stroke: #b87400; stroke-width: 3; transform-origin: 50px 52px; transform: scale(0); }
.k-stars i.on .fg { animation: k-starin 0.5s cubic-bezier(.2, 1.8, .4, 1) forwards; }
@keyframes k-starin { 0% { transform: scale(2.2) rotate(-30deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.k-score { font-family: Fredoka, var(--title); font-weight: 600; font-size: 46px; line-height: 1.1; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.k-card .stats { margin: 10px 0 8px; }
.k-card .stats div { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.k-card .stats b { color: #fff; font-family: Fredoka, var(--title); font-weight: 600; }
.k-card .stats span { color: rgba(255, 255, 255, 0.68); }
.k-ribbon { display: inline-block; margin: 4px auto 6px; padding: 6px 22px; font-family: var(--title); font-size: 18px; color: #4a2a00; background: linear-gradient(180deg, #ffe680, #ffb627); border-radius: 8px; box-shadow: 0 4px 0 #b86f00, 0 8px 16px rgba(0, 0, 0, 0.3); transform: rotate(-3deg); animation: k-rib 0.6s cubic-bezier(.2, 1.6, .4, 1) both 1.2s; }
.k-ribbon[hidden] { display: none; }
@keyframes k-rib { from { transform: scale(0) rotate(-20deg); } }
.k-next { font-size: 14px; font-weight: 700; color: #ffe08a !important; min-height: 1.4em; }
.k-card .k-play { width: 100%; font-size: 26px; min-height: 62px; margin-top: 10px; }
/* 처음 하는 사람 안내 손가락 */
.k-hand { position: fixed; z-index: 70; width: 58px; height: 58px; margin: -4px 0 0 -22px; pointer-events: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)); }
.k-hand svg { width: 100%; height: 100%; }
.k-hand.tap svg { animation: k-tap 0.9s ease-in-out infinite; transform-origin: 40% 10%; }
@keyframes k-tap { 0%, 100% { transform: translate(0, 10px); } 45% { transform: translate(0, 0) scale(0.9); } }
.k-tapring { position: fixed; z-index: 69; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.8); pointer-events: none; animation: k-ring 0.9s ease-out infinite; }
@keyframes k-ring { 0%, 40% { transform: scale(0.3); opacity: 0; } 50% { opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.k-tip { position: fixed; z-index: 70; transform: translate(-50%, 0); max-width: 86vw; padding: 7px 14px; border-radius: 14px; background: #fff; color: #1c2140; font-weight: 800; font-size: 14px; text-align: center; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); pointer-events: none; animation: pop-in 0.3s ease-out; }
@media (prefers-reduced-motion: reduce) { .k-play, .k-art, .k-play::after { animation: none !important; } }
html:not([lang="ko"]) .k-modes button b, html:not([lang="ko"]) .k-play, html:not([lang="ko"]) .k-ribbon, html:not([lang="ko"]) .k-pill b { font-weight: 800; }
.k-play.k-sm { min-height: 50px; width: min(250px, 100%); font-size: 20px; margin-top: 2px; border-radius: 18px; animation: none; box-shadow: 0 6px 0 var(--k-btn3, #137a3a), 0 10px 18px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.5); }
.k-play.k-sm::after { display: none; }
.k-play.k-sm svg { width: 20px; height: 20px; }
.k-next:empty { display: none; }
@media (max-height: 600px) { .k-wrap { overflow: auto; } }

.stage { --k1: #ef3b4a; --k2: #7a1222; --k3: #ffd23f; --k-logo2: #ffd0c8; --k-btn1: #ff8a6a; --k-btn2: #ef3b4a; --k-btn3: #9e1a2a; --k-card1: #2f6b3a; --k-card2: #173d20;
  gap: 8px; padding: 10px; background: linear-gradient(180deg, #7fcdf7 0%, #b8e8ff 45%, #d9f5ff 70%, #bfe9a0 100%); }
.as-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.as-sky::before { content: ''; position: absolute; left: 8%; top: 6%; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, #fff7c2 0 35%, rgba(255, 240, 160, 0.5) 50%, transparent 70%); animation: as-sun 6s ease-in-out infinite alternate; }
@keyframes as-sun { to { transform: scale(1.12); } }
.as-sky::after { content: ''; position: absolute; left: -20%; top: 14%; width: 160px; height: 46px; border-radius: 40px; background: #fff; opacity: 0.85; box-shadow: 70px -18px 0 6px #fff, 140px 4px 0 -4px #fff; animation: as-cloud 60s linear infinite; }
@keyframes as-cloud { to { transform: translateX(140vw); } }
.as-sky i { position: absolute; left: -10%; right: -10%; border-radius: 50% 50% 0 0; }
.as-sky .h1 { bottom: -12%; height: 40%; background: linear-gradient(180deg, #8fd65e, #5cb342); }
.as-sky .h2 { bottom: -22%; height: 40%; left: 30%; right: -30%; background: linear-gradient(180deg, #7ccb4f, #48a035); }
.stage > :not(.as-sky):not(.overlay):not(.as-hurry) { position: relative; z-index: 1; }

/* 위쪽: 알약 HUD + 도화선 시간 막대 */
.as-top { flex: none; display: flex; flex-direction: column; gap: 7px; max-width: 100%; }
.as-hud { display: flex; gap: 8px; justify-content: center; }
.as-hud .k-pill { flex: 1 1 0; justify-content: flex-start; background: linear-gradient(180deg, rgba(20, 60, 40, 0.62), rgba(10, 40, 25, 0.72)); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.25), 0 4px 10px rgba(20, 60, 40, 0.25); }
.as-hud .k-pill b { font-size: 21px; }
.as-hud .p-score b { color: #ffe27a; }
.as-hud .h-time.hurry { background: linear-gradient(180deg, #ff6b5a, #c8283a); animation: as-beat 0.5s ease-in-out infinite alternate; }
@keyframes as-beat { to { transform: scale(1.06); } }
.as-timebar { position: relative; height: 14px; border-radius: 99px; background: rgba(20, 60, 40, 0.45); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(255, 255, 255, 0.5); }
.as-timebar i { position: absolute; inset: 0; border-radius: 99px; transform-origin: left; background: linear-gradient(90deg, #3ecf7a, #a6e86a 55%, #ffd23f); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.4); transition: transform 0.1s linear; }
.as-timebar.hurry i { background: linear-gradient(90deg, #ff4d5a, #ff9a5a); animation: as-blink 0.5s ease-in-out infinite alternate; }
@keyframes as-blink { to { opacity: 0.6; } }
.as-timebar .spark { display: none; }

/* 판: 나무 상자 안 소풍 돗자리 */
.as-board {
  flex: none; position: relative; border-radius: 22px; line-height: 0;
  background:
    repeating-linear-gradient(0deg, rgba(239, 59, 74, 0.09) 0 18px, transparent 18px 36px),
    repeating-linear-gradient(90deg, rgba(239, 59, 74, 0.09) 0 18px, transparent 18px 36px),
    radial-gradient(120% 120% at 30% 10%, #fffaf0 0%, #fff1d8 60%, #ffe3bd 100%);
  box-shadow: 0 0 0 5px #f3c98a, 0 0 0 11px #b97a3e, 0 0 0 12px #7d4a20, 0 20px 40px rgba(40, 70, 20, 0.45);
}
.as-board.thump { animation: as-thump 0.32s ease-out; }
@keyframes as-thump { 30% { transform: scale(1.012) rotate(-0.4deg); } 60% { transform: scale(0.996) rotate(0.3deg); } }
.as-cv { display: block; touch-action: none; cursor: crosshair; border-radius: 22px; }

/* 마지막 10초: 붉은 숨결 테두리 */
.as-hurry { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; box-shadow: inset 0 0 60px 10px rgba(255, 40, 60, 0.55); }
.stage.as-hot .as-hurry { animation: as-hot 1s ease-in-out infinite; }
@keyframes as-hot { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.85; } }

/* 크게 땄을 때 글자 */
.as-flair {
  position: absolute; left: 50%; top: 42%; z-index: 4; pointer-events: none; line-height: 1.1; white-space: nowrap;
  font-family: var(--logo, var(--title)); color: #ffd23f; opacity: 0; transform: translate(-50%, -50%);
  -webkit-text-stroke: 8px #7a1222; paint-order: stroke fill;
  text-shadow: 0 6px 0 #4a0a14, 0 12px 24px rgba(60, 10, 20, 0.45);
}
.as-flair.show { animation: as-flair 1s ease-out forwards; }
.as-flair.hot { color: #fff; -webkit-text-stroke-color: #ef3b4a; text-shadow: 0 6px 0 #9e1a2a, 0 0 30px rgba(255, 210, 63, 0.9); }
.as-flair.warn { color: #fff; -webkit-text-stroke-color: #ff6b5a; text-shadow: 0 6px 0 #b8322a, 0 10px 24px rgba(0, 0, 0, 0.35); }
@keyframes as-flair {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.5) rotate(-6deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(3deg); }
  30% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
  75% { opacity: 1; transform: translate(-50%, -58%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(0.95); }
}

/* 제목 화면: 과수원 */
.stage .ov-start.k-title { background: linear-gradient(180deg, #6cc4f5 0%, #b2e6ff 55%, #dff7ff 100%); }
.as-tbg .hill { position: absolute; border-radius: 50% 50% 0 0; }
.as-tbg .hill.a { left: -20%; right: 20%; bottom: -14%; height: 42%; background: linear-gradient(180deg, #8fd65e, #5cb342); }
.as-tbg .hill.b { left: 35%; right: -25%; bottom: -20%; height: 40%; background: linear-gradient(180deg, #7ccb4f, #3f9a30); }
.as-tbg .tree { position: absolute; bottom: 18%; width: 150px; height: 190px; }
.as-tbg .tree::before { content: ''; position: absolute; left: 50%; bottom: 0; width: 22px; height: 80px; margin-left: -11px; border-radius: 6px; background: linear-gradient(90deg, #8a5228, #6b3a1a); }
.as-tbg .tree::after { content: ''; position: absolute; left: 0; top: 0; width: 150px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle at 30% 40%, #ef3b4a 0 7px, transparent 8px), radial-gradient(circle at 62% 30%, #ef3b4a 0 7px, transparent 8px), radial-gradient(circle at 72% 62%, #ef3b4a 0 7px, transparent 8px), radial-gradient(circle at 42% 70%, #ef3b4a 0 7px, transparent 8px), radial-gradient(circle at 40% 35%, #6fd25a, #3d9a33 70%); box-shadow: inset -10px -14px 0 rgba(0, 0, 0, 0.12); }
.as-tbg .t1 { left: 3%; transform: scale(1.1); }
.as-tbg .t2 { right: 2%; bottom: 12%; transform: scale(1.4); }
.as-tbg span { position: absolute; left: var(--x); top: -40px; width: calc(26px * var(--s)); height: calc(26px * var(--s)); animation: as-fall var(--t) linear infinite; animation-delay: var(--dl); }
.as-tbg span.ap { border-radius: 50% 50% 46% 46%; background: radial-gradient(circle at 35% 35%, #ff9585, #ef3b4a 55%, #b81d33); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.12); }
.as-tbg span.lf { width: calc(20px * var(--s)); height: calc(12px * var(--s)); border-radius: 0 100% 0 100%; background: linear-gradient(135deg, #6ee68f, #2fb865); }
@keyframes as-fall { to { transform: translateY(115vh) rotate(300deg); } }
.as-art { display: flex; align-items: flex-end; gap: 0; padding-top: 6px; }
.as-art .mascot { display: block; width: 130px; height: auto; filter: drop-shadow(0 10px 12px rgba(40, 70, 20, 0.35)); }
.as-crate { position: relative; display: grid; grid-template-columns: repeat(2, 34px); gap: 2px; padding: 8px 8px 10px; margin-left: -14px; border-radius: 8px; background: repeating-linear-gradient(0deg, #c98a4a 0 12px, #a8683c 12px 14px); box-shadow: 0 10px 16px rgba(40, 70, 20, 0.35); transform: rotate(4deg); }
.as-crate i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-style: normal; font-weight: 900; font-size: 17px; color: #fff; -webkit-text-stroke: 3px #7a1222; paint-order: stroke fill; background: radial-gradient(circle at 35% 35%, #ff9585, #ef3b4a 55%, #b81d33); }
.stage .k-title .k-sub { color: #2d5a1f; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }
.stage .k-title .k-best { background: rgba(20, 60, 40, 0.7); }

/* 결과 카드 */
.stage .overlay:not(.k-title) { background: rgba(20, 50, 25, 0.5); }
.as-endp .e-note { color: #ffe27a !important; font-weight: 700; }
.as-endp .e-note[hidden] { display: none; }
.as-endp .k-score { color: #ffe27a; }
.as-endp .stats b { font-size: 22px; }

@media (max-width: 420px) {
  .stage { padding: 8px; gap: 6px; }
  .as-hud { gap: 5px; }
  .as-hud .k-pill b { font-size: 19px; }
}
@media (max-height: 640px) { .as-art { display: none; } }

/* 낮은 가로 화면: 점수판을 왼쪽 세로 줄로 */
.stage.as-side { flex-direction: row; gap: 14px; padding: 8px; }
.as-side .as-top { width: 104px; }
.as-side .as-hud { flex-direction: column; gap: 6px; }
.as-side .as-hud .k-pill { flex: none; }
.as-hud .k-pill { justify-content: center; }
