@font-face { font-family: 'Jua'; src: local('Jua'); font-display: swap; }
@font-face { font-family: 'Pretendard'; src: local('Pretendard Variable'), local('Pretendard'); font-display: swap; }
:root {
  --display: 'Jua', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  --garden-far: #A8C8B4; --garden-mid: #7FA98C; --garden-near: #4E7A63; --garden-ground: #2F5344; --garden-rim: #8FCB9B;
  --safe: #F5D96B; --danger: #E2574C; --coin: #FFC24B; --white: #FFFFFF; --night: #14203A;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--garden-ground); color: var(--white); font-family: var(--body); font-size: 17px; }
button, input { font: inherit; }
button { touch-action: manipulation; }
.hidden { display: none !important; }
#app { position: relative; width: 100vw; height: 100dvh; overflow: hidden; background: var(--garden-ground); }
#gameCanvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; touch-action: none; }
.screen-panel { position: absolute; inset: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); max-width: 1460px; max-height: 850px; margin: auto; padding: 30px; border: 2px solid rgba(245,217,107,.42); border-radius: 30px; background: linear-gradient(145deg, rgba(47,83,68,.93), rgba(78,122,99,.88)); box-shadow: 0 24px 60px rgba(47,83,68,.42), inset 0 1px rgba(255,255,255,.18); overflow: auto; backdrop-filter: blur(12px); }
.screen-panel::before { content: ''; position: absolute; inset: 10px; border: 1px dashed rgba(143,203,155,.35); border-radius: 22px; pointer-events: none; }
.brand-row { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; z-index: 1; }
.title-lockup { max-width: 760px; }
.eyebrow { margin: 0 0 8px; color: var(--safe); font-size: 12px; font-weight: 500; letter-spacing: .04em; }
h1, .overlay-card h2 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; }
h1 { margin: 0; font-size: 48px; line-height: 1.08; text-shadow: 0 5px rgba(47,83,68,.45); }
h1 span { color: var(--safe); }
.subtitle { margin: 12px 0 0; color: rgba(255,255,255,.86); font-size: 17px; line-height: 1.5; }
.version-tag { margin: 8px 0 0; color: var(--garden-rim); font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.hero-tools { display: flex; align-items: flex-start; gap: 16px; }
.hero-mascots { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 24px; background: rgba(168,200,180,.18); border: 1px solid rgba(245,217,107,.35); }
.mascot { position: relative; display: inline-block; width: 54px; height: 46px; border: 4px solid var(--white); box-shadow: 0 7px rgba(47,83,68,.35); }
.mascot::before, .mascot::after { content: ''; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--garden-ground); top: 17px; }
.mascot::before { left: 14px; } .mascot::after { right: 14px; }
.mascot i { position: absolute; left: 50%; top: 29px; width: 14px; height: 7px; transform: translateX(-50%); border-bottom: 3px solid var(--garden-ground); border-radius: 50%; }
.mascot-jump { border-radius: 16px; background: var(--coin); }
.mascot-flight { width: 70px; height: 38px; border-radius: 55% 75% 55% 70%; background: #F2A6C0; transform: rotate(-5deg); }
.mascot-dive { width: 68px; height: 38px; border-radius: 50%; background: #7FE3D4; }
.mascot-dive i::after { content: ''; position: absolute; right: 42px; top: -17px; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-right: 15px solid #FFB4A2; }
.menu-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(510px,1.08fr) minmax(760px,1.72fr); gap: 22px; margin-top: 24px; }
.menu-section { padding: 20px; border-radius: 24px; background: rgba(168,200,180,.13); border: 1px solid rgba(255,255,255,.16); }
.section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-heading > span { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 50%; background: var(--safe); color: var(--garden-ground); font-family: var(--display); font-size: 30px; }
.section-heading h2 { margin: 0; font-family: var(--display); font-size: 30px; font-weight: 400; }
.section-heading p { margin: 3px 0 0; color: rgba(255,255,255,.68); font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.difficulty-list { display: grid; grid-template-columns: repeat(5, minmax(94px,1fr)); gap: 9px; }
.difficulty-card, .stage-card { position: relative; color: var(--white); border: 2px solid rgba(255,255,255,.15); background: rgba(47,83,68,.40); cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.difficulty-card:hover, .stage-card:hover { transform: translateY(-3px); border-color: var(--garden-rim); }
.difficulty-card.selected, .stage-card.selected { border-color: var(--safe); background: rgba(245,217,107,.15); box-shadow: 0 0 0 3px rgba(245,217,107,.12); }
.difficulty-card { min-height: 98px; padding: 15px 8px 12px; border-radius: 18px; text-align: center; }
.difficulty-name { display: block; font-family: var(--display); font-size: 30px; line-height: 1; }
.difficulty-caption { display: block; margin-top: 8px; color: rgba(255,255,255,.72); font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.recommended { position: absolute; top: -9px; right: -5px; padding: 4px 8px; border-radius: 999px; background: var(--coin); color: var(--garden-ground); font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.help-text { min-height: 42px; margin: 12px 0 0; padding: 11px 13px; border-left: 4px solid var(--garden-rim); color: rgba(255,255,255,.80); background: rgba(47,83,68,.36); border-radius: 0 12px 12px 0; font-size: 14px; font-weight: 600; line-height: 1.45; }
.stage-list { display: grid; grid-template-columns: repeat(5, minmax(130px,1fr)); gap: 10px; }
.stage-card { min-height: 198px; padding: 14px 14px 42px; border-radius: 20px; text-align: left; overflow: hidden; }
.stage-card::after { content: ''; position: absolute; inset: auto -24px -38px auto; width: 90px; height: 90px; border: 18px solid rgba(245,217,107,.08); border-radius: 50%; }
.stage-card.completed { background: rgba(143,203,155,.17); }
.stage-top { display: flex; align-items: center; justify-content: space-between; }
.stage-number { color: var(--garden-rim); font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.stage-mode { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(245,217,107,.17); color: var(--safe); font-size: 17px; }
.stage-card strong { display: block; margin-top: 9px; font-family: var(--display); font-size: 30px; font-weight: 400; line-height: 1.08; }
.stage-card small, .stage-best, .stage-stamp { display: block; }
.stage-card small { margin-top: 7px; color: rgba(255,255,255,.66); font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.stage-best { margin-top: 12px; color: var(--safe); font-size: 14px; font-weight: 600; }
.stage-stamp { position: absolute; right: 12px; bottom: 12px; color: var(--garden-rim); font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.menu-actions { position: relative; z-index: 1; display: flex; gap: 12px; margin-top: 20px; }
.primary-button, .secondary-button { min-height: 54px; padding: 0 24px; border-radius: 18px; cursor: pointer; font-size: 17px; font-weight: 600; }
.primary-button { flex: 1; border: 2px solid var(--white); background: var(--safe); color: var(--garden-ground); box-shadow: 0 6px var(--garden-ground); }
.primary-button:active { transform: translateY(4px); box-shadow: 0 2px var(--garden-ground); }
.secondary-button { border: 2px solid rgba(255,255,255,.22); background: rgba(47,83,68,.52); color: var(--white); }
.control-tip { position: relative; z-index: 1; margin: 14px 0 0; text-align: center; color: rgba(255,255,255,.70); font-size: 14px; font-weight: 600; }
.icon-button { display: grid; place-items: center; width: 50px; height: 50px; border: 2px solid rgba(255,255,255,.28); border-radius: 16px; color: var(--white); background: rgba(47,83,68,.62); cursor: pointer; font-size: 30px; box-shadow: 0 5px rgba(47,83,68,.38); }
.game-controls { position: absolute; z-index: 12; top: max(24px, env(safe-area-inset-top)); right: max(28px, env(safe-area-inset-right)); pointer-events: none; }
.game-controls button { pointer-events: auto; }
.pause-button { background: rgba(12,20,38,.68); }
.overlay { position: absolute; z-index: 20; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(12,20,38,.62); backdrop-filter: blur(7px); }
.overlay-card { width: min(590px, 94vw); padding: 30px; border: 2px solid var(--safe); border-radius: 28px; color: var(--white); background: linear-gradient(145deg, rgba(47,83,68,.98), rgba(78,122,99,.96)); box-shadow: 0 26px 80px rgba(12,20,38,.52); text-align: center; }
.overlay-card h2 { margin: 0; color: var(--safe); font-size: 48px; }
.overlay-card > p:not(.eyebrow) { color: rgba(255,255,255,.78); font-size: 17px; line-height: 1.5; }
.stats-list { display: grid; gap: 8px; margin: 18px 0 22px; }
.stat-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-radius: 14px; background: rgba(168,200,180,.14); border: 1px solid rgba(255,255,255,.14); }
.stat-row span { font-size: 14px; font-weight: 600; }
.stat-row strong { color: var(--safe); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-row.new-best { border-color: var(--coin); box-shadow: 0 0 18px rgba(255,194,75,.18); }
.stat-row.new-best strong::after { content: ' NEW'; font-size: 12px; letter-spacing: .04em; }
.overlay-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.overlay-actions button { flex: 1; min-width: 150px; }
.mode-banner { position: absolute; z-index: 15; left: 50%; top: 18%; transform: translateX(-50%); padding: 13px 24px; border-radius: 999px; color: var(--garden-ground); background: var(--safe); border: 3px solid var(--white); font-family: var(--display); font-size: 30px; pointer-events: none; animation: pop .3s ease-out; box-shadow: 0 8px rgba(47,83,68,.32); }
@keyframes pop { from { transform: translateX(-50%) scale(.72); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.portrait-warning { display: none; position: absolute; z-index: 30; inset: 0; place-items: center; align-content: center; gap: 10px; padding: 28px; text-align: center; color: var(--white); background: var(--garden-ground); }
.portrait-warning strong { font-family: var(--display); color: var(--safe); font-size: 30px; font-weight: 400; }
.portrait-warning span { font-size: 17px; }
@media (orientation: portrait) and (max-width: 900px) { .portrait-warning { display: grid; } }
@media (max-width: 1100px) { .screen-panel { padding: 20px; } .menu-grid { grid-template-columns: 1fr; } .stage-list { grid-template-columns: repeat(5, minmax(145px,1fr)); overflow-x: auto; padding-bottom: 8px; } .hero-mascots { display: none; } }
@media (max-height: 650px) { .screen-panel { padding: 16px 20px; } .brand-row { align-items: center; } .subtitle, .version-tag { margin-top: 5px; } .menu-grid { grid-template-columns: .82fr 1.6fr; margin-top: 12px; gap: 12px; } .menu-section { padding: 13px; } .section-heading { margin-bottom: 9px; } .difficulty-card { min-height: 70px; } .stage-card { min-height: 158px; padding: 11px 11px 36px; } .control-tip { display: none; } .menu-actions { margin-top: 10px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
