/*
 * PLIP POP 앱 셸.
 * style.css는 게임 무대와 그림 배치를, 이 파일은 화면 구조·정보 위계·상호작용을 맡는다.
 * Apps-in-Toss UX 원칙에 맞춰 한 화면 한 행동, 시스템 글꼴, 단색 표면, 44px 이상 터치 영역을 지킨다.
 */
:root {
  --app-blue: #3182f6;
  --app-blue-pressed: #1b64da;
  --app-blue-light: #e8f3ff;
  --app-bg: #f2f4f6;
  --app-surface: #ffffff;
  --app-text: #191f28;
  --app-text-sub: #4e5968;
  --app-text-muted: #8b95a1;
  --app-line: #e5e8eb;
  --app-danger: #e42939;
  --app-success: #00a86b;
  --app-radius-sm: 12px;
  --app-radius-md: 16px;
  --app-radius-lg: 24px;
  --hot: var(--app-blue);
  --hot-d: var(--app-blue-pressed);
  --ink: var(--app-text);
  --ink-d: var(--app-text);
  --dim: var(--app-text-sub);
  --blue: var(--app-blue);
  --blue-d: var(--app-blue);
  --line: var(--app-line);
  --paper: var(--app-surface);
}

html {
  background: var(--app-bg);
}

body {
  color: var(--app-text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Pretendard", sans-serif;
  letter-spacing: -0.015em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
}

#app {
  max-width: 480px;
  background: var(--app-bg);
  box-shadow: none;
}

/* 화면과 콘텐츠 구조 */
.ov,
#title-screen.on,
#event-screen.on {
  background: var(--app-bg);
}

.ov::before,
.ov::after,
#title-screen::before,
#title-screen::after,
#event-screen::before,
#event-screen::after {
  display: none !important;
}

.ov {
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px
    calc(24px + env(safe-area-inset-bottom, 0px));
}

.ov.on {
  justify-content: flex-start;
}

.ov > .card {
  width: 100%;
  max-width: 420px;
  margin: auto;
}

.ov:not(#title-screen):not(#event-screen) > .card {
  padding: 24px 20px;
  border-radius: var(--app-radius-lg);
  background: var(--app-surface);
  box-shadow: 0 8px 24px rgba(25, 31, 40, 0.08);
}

#pause-screen.on {
  justify-content: center;
  background: rgba(25, 31, 40, 0.52);
}

#pause-screen > .card {
  margin: auto;
}

.card h1,
.ht,
.ev-name,
#clear-n,
#fail-n,
#ev-name {
  color: var(--app-text);
  font-family: inherit;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-shadow: none;
}

h1[tabindex="-1"],
h2[tabindex="-1"] {
  outline: none;
}

.ht {
  margin-bottom: 12px;
  font-size: 26px;
  line-height: 1.3;
  text-align: left;
}

.card .lead,
.story,
.note,
.ev-tell,
.bd-lead,
.dex-sub {
  color: var(--app-text-sub);
  font-weight: 500;
  line-height: 1.55;
}

/* 공통 행동: 한 화면의 주 행동만 파란색, 나머지는 텍스트 또는 중립 표면 */
.go,
.ghost,
#clear-screen #next,
#clear-screen #clear-ad,
#clear-screen .crow > .ghost {
  width: 100%;
  max-width: 360px;
  min-height: 54px;
  margin: 0 auto 10px;
  padding: 14px 18px;
  border: 0;
  border-radius: var(--app-radius-md);
  background-image: none;
  box-shadow: none;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-shadow: none;
  -webkit-text-stroke: 0;
  transition: background-color 120ms ease, color 120ms ease, transform 120ms ease,
    opacity 120ms ease;
}

.go,
#clear-screen #next {
  background: var(--app-blue);
  color: #ffffff;
}

.go::before,
.go::after,
.ghost::before,
.ghost::after,
#clear-screen #next::before,
#clear-screen #clear-ad::before,
#clear-screen .crow > .ghost::before {
  display: none !important;
}

.go:active,
#clear-screen #next:active {
  transform: scale(0.98);
  background: var(--app-blue-pressed);
  box-shadow: none;
}

.ghost,
#clear-screen .crow > .ghost {
  background: transparent;
  color: var(--app-text-sub);
}

.ghost:active,
#clear-screen .crow > .ghost:active {
  transform: scale(0.98);
  background: #e5e8eb;
  box-shadow: none;
}

.go.ghost,
.adbtn,
#clear-screen #clear-ad {
  border: 1px solid var(--app-line);
  background: var(--app-surface);
  color: var(--app-text-sub);
}

.go small,
.ghost small {
  color: inherit;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.72;
}

button:disabled,
button[aria-disabled="true"],
button.done {
  opacity: 0.42;
  cursor: default;
}

/* 메인: 브랜드는 살리고 서비스 행동은 토스식으로 단순화한다. */
#title-screen.on {
  overflow: hidden;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 20px
    calc(16px + env(safe-area-inset-bottom, 0px));
}

#title-screen .card {
  position: relative;
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  color: var(--app-text);
  text-align: center;
}

#title-screen #logo {
  width: clamp(150px, 25vh, 218px) !important;
  height: auto !important;
  aspect-ratio: 1.0068;
  flex: 0 1 auto;
  margin: 0 auto !important;
  padding: 8px;
  border-radius: 28px;
  background: var(--app-surface);
  box-shadow: 0 6px 20px rgba(25, 31, 40, 0.06);
}

#title-tagline {
  max-width: 320px;
  margin: -2px auto 0;
  color: var(--app-text-sub);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  word-break: keep-all;
}

.row2 {
  display: grid;
  width: 100%;
  max-width: 340px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  margin: 0 auto;
}

.pill {
  min-width: 0;
  min-height: 68px;
  padding: 5px 0;
  border: 0;
  border-radius: var(--app-radius-sm);
  background: transparent;
  color: var(--app-text-sub) !important;
  filter: none;
  transition: background-color 120ms ease, transform 120ms ease;
}

.pill:active {
  transform: scale(0.96);
  background: #e5e8eb;
  filter: none;
}

.pill .pico {
  width: 36px;
  height: 36px;
  margin: 0 auto 2px;
}

.pill span {
  color: var(--app-text-sub);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  -webkit-text-stroke: 0;
}

#sound {
  position: absolute;
  top: 2px;
  right: 0;
  z-index: 2;
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--app-line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
}

#sound .pico {
  width: 26px;
  height: 26px;
  margin: 0;
}

#sound span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#sound.off::after {
  top: 20px;
  width: 25px;
  height: 2px;
  background: var(--app-text-muted);
  box-shadow: 0 0 0 1px #ffffff;
}

#title-screen #menu {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
}

#title-screen .row-go {
  display: flex;
  width: 100%;
  max-width: 340px;
  flex-direction: column;
  gap: 2px;
  margin: 0 auto;
}

#title-screen .row-go #play,
#title-screen .row-go #fresh,
#title-screen #morning-ad {
  width: 100%;
  max-width: 340px;
  min-height: 54px;
  margin: 0;
  border-radius: var(--app-radius-md);
  background-image: none;
  font-family: inherit;
  letter-spacing: -0.02em;
}

#title-screen .row-go #play {
  flex: none;
  padding: 14px 18px;
  background: var(--app-blue);
  color: #ffffff;
  font-size: 17px;
  font-weight: 600;
}

#title-screen .row-go #play small {
  color: #ffffff;
  font-family: inherit;
  font-weight: 500;
  opacity: 0.75;
}

#title-screen .row-go #fresh {
  flex: none;
  min-height: 44px;
  padding: 10px 14px;
  background: transparent;
  color: var(--app-text-sub);
  font-size: 15px;
  font-weight: 500;
}

#title-screen #morning-ad {
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--app-line);
  background: var(--app-surface);
  color: var(--app-text-sub);
  font-size: 15px;
  font-weight: 600;
}

#title-screen #morning-ad.done {
  filter: none;
}

#pot-row {
  width: 100%;
  max-width: 340px;
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 12px 10px 10px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-md);
  background: var(--app-surface);
}

#pot-row.thirsty {
  background: #fff7f5;
}

#pot-art {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
}

#pot-tell {
  margin-bottom: 6px;
  color: var(--app-text-sub);
  font-size: 13px;
  font-weight: 500;
}

#pot-gauge {
  height: 6px;
  background: #e5e8eb;
}

#pot-fill,
.today-bar i,
#dex-fill {
  background: var(--app-blue);
}

#pot-row #pot-water {
  min-height: 44px;
  padding: 9px 12px;
  border-radius: var(--app-radius-sm);
  background: var(--app-blue-light);
  color: var(--app-blue-pressed);
  font-size: 13px;
  font-weight: 600;
}

#pot-shelf {
  max-width: 340px;
  margin: -4px auto 0;
  color: var(--app-text-muted);
}

#pot-shelf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  color: var(--app-text);
  font: inherit;
  text-align: left;
}

#pot-shelf:active,
.exchange-row:active {
  background: var(--app-blue-light);
}

#pot-shelf .shelf-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

#pot-shelf .shelf-n {
  margin: 0;
  color: var(--app-text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

#pot-shelf .shelf-icons {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
}

#pot-shelf .flower-count {
  display: inline-flex;
  align-items: center;
  color: var(--app-text-muted);
  font-size: 11px;
  font-weight: 600;
}

#pot-shelf .fico {
  width: 22px;
  height: 22px;
}

#pot-shelf .shelf-go {
  flex: 0 0 auto;
  color: var(--app-blue-pressed);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

#garden-screen .card {
  gap: 0;
  flex-shrink: 0;
}

#garden-screen .ev-kicker,
#garden-screen .ht,
#garden-screen .garden-lead {
  text-align: center;
}

#garden-screen .garden-lead {
  margin: 0 0 14px;
  font-size: 14px;
}

#garden-stock {
  display: flex;
  min-height: 58px;
  margin-bottom: 10px;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: var(--app-radius-sm);
  background: var(--app-bg);
}

#garden-stock .stock-title {
  color: var(--app-text);
  font-size: 14px;
  font-weight: 600;
}

#garden-stock .stock-flowers {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

#garden-stock .stock-flower {
  display: inline-flex;
  align-items: center;
  color: var(--app-text-sub);
  font-size: 12px;
  font-weight: 600;
}

#garden-stock .fico {
  width: 28px;
  height: 28px;
}

#garden-exchanges {
  display: grid;
  gap: 8px;
}

.exchange-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  width: 100%;
  min-height: 72px;
  padding: 9px 12px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-md);
  background: var(--app-surface);
  color: var(--app-text);
  font: inherit;
  text-align: left;
}

.exchange-row:disabled {
  opacity: .46;
  cursor: default;
}

.exchange-row .exchange-art {
  width: 48px;
  height: 48px;
}

.exchange-row .exchange-copy {
  min-width: 0;
}

.exchange-row b,
.exchange-row small {
  display: block;
}

.exchange-row b {
  margin-bottom: 2px;
  font-size: 15px;
  font-weight: 600;
}

.exchange-row small {
  color: var(--app-text-sub);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.exchange-row .exchange-cost {
  color: var(--app-blue-pressed);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

#garden-bag {
  min-height: 22px;
  margin: 12px 0 2px;
  text-align: center;
}

#garden-result {
  margin: 0 0 10px;
  color: var(--app-blue-pressed);
  text-align: center;
}

#garden-result:empty {
  display: none;
}

#garden-close {
  margin-top: 8px;
}

#daily-note {
  width: 100%;
  max-width: 340px;
  min-height: 44px;
  margin: 0 auto;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  box-shadow: none;
  color: var(--app-text-sub);
  font-size: 13px;
  font-weight: 500;
}

#tiltmode {
  margin: 0;
  color: var(--app-text-muted) !important;
  font-size: 13px;
  font-weight: 500;
}

#tiltmode small {
  color: var(--app-text-muted);
  font-weight: 400;
}

/* 오늘의 뽑기는 모호한 화면 탭 대신 명시적 행동을 제공한다. */
#event-screen.on {
  padding: calc(24px + env(safe-area-inset-top, 0px)) 20px
    calc(20px + env(safe-area-inset-bottom, 0px));
}

#event-screen .card {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  padding: 24px 20px 20px;
  border-radius: var(--app-radius-lg);
  background: var(--app-surface);
  box-shadow: 0 8px 24px rgba(25, 31, 40, 0.08);
  text-align: left;
}

#event-screen .ev-kicker {
  order: 1;
  align-self: flex-start;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--app-blue);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

#event-screen .ev-kicker::after {
  display: none;
}

#event-screen .ev-kicker.warn {
  background: transparent;
  color: var(--app-danger);
}

#event-screen .ev-name {
  order: 2;
  margin: 0;
  color: var(--app-text);
  font-size: 28px;
  line-height: 1.3;
  text-align: left;
}

#event-screen .ev-tell {
  order: 3;
  max-width: none;
  margin: 0;
  color: var(--app-text-sub);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
}

#event-screen #ev-art {
  order: 4;
  width: min(62vw, 260px);
  height: auto;
  max-height: 36vh;
  align-self: center;
  margin: auto 0;
  filter: none;
}

#event-screen .ev-streak {
  order: 5;
  gap: 8px;
  min-height: 34px;
  margin: 8px 0 2px;
  background: transparent;
}

#event-screen .ev-streak::after {
  display: none;
}

#event-screen .stk {
  width: 30px;
  height: 30px;
  border: 1px solid var(--app-line);
  background: var(--app-bg);
  box-shadow: none;
}

#event-screen .stk.fill {
  border-color: var(--app-blue);
  background: var(--app-blue);
  box-shadow: none;
}

#event-screen .stk.fill::after {
  display: none;
}

#event-screen .ev-streak-cap {
  order: 6;
  margin: 0;
  color: var(--app-text-muted);
  text-align: center;
}

#event-screen #ev-reveal,
#event-screen #ev-go {
  order: 7;
  max-width: none;
  min-height: 54px;
  margin: 6px 0 0;
  border: 0;
  border-radius: var(--app-radius-md);
  background: var(--app-blue);
  background-image: none;
  box-shadow: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
}

#event-screen #ev-reveal {
  display: none;
}

/* 기존 종이 버튼보다 우선하도록 덮개 화면과 같은 구체도로 주·보조 행동을 고정한다. */
.ov:not(#title-screen):not(#clear-screen) .go {
  border: 0;
  border-radius: var(--app-radius-md);
  background: var(--app-blue);
  background-image: none;
  box-shadow: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
}

.ov:not(#title-screen):not(#clear-screen) .ghost {
  border: 0;
  border-radius: var(--app-radius-md);
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--app-text-sub);
  font-family: inherit;
}

#help-screen .ht,
#dex-screen .ht,
#deco-screen .ht,
#board-screen .ht,
#shop-screen .ht {
  color: var(--app-text);
  font-family: inherit;
  font-weight: 700;
  text-shadow: none;
}
/* 안내·도감·꾸미기·순위: 문서처럼 읽히는 흰 표면과 분명한 상태. */
#help-screen.on,
#dex-screen.on,
#deco-screen.on,
#board-screen.on,
#shop-screen.on {
  background: var(--app-surface);
}

#help-screen > .card,
#dex-screen > .card,
#deco-screen > .card,
#board-screen > .card,
#shop-screen > .card {
  min-height: 100%;
  margin: 0 auto;
  padding: 12px 0 20px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#help-screen .card {
  max-width: 420px;
  text-align: left;
}

#help-screen .how {
  padding: 16px 18px 16px 34px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-md);
  background: #f9fafb;
  background-image: none;
  box-shadow: none;
}

#help-screen .how::after {
  display: none;
}

#help-screen .help-kicker {
  color: var(--app-blue);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

#help-screen .help-dots i {
  background: #d1d6db;
}

#help-screen .help-dots i.on {
  background: var(--app-blue);
}

#help-screen .help-demo {
  border: 0;
  border-radius: var(--app-radius-md);
  background: var(--app-bg);
  box-shadow: none;
}

#help-screen .help-big,
#help-screen .help-big2,
#help-screen .help-ready {
  color: var(--app-text);
  font-family: inherit;
  font-weight: 600;
  text-align: left;
}

#help-screen .help-big b,
#help-screen .help-big2 b,
#help-screen .help-ready b {
  color: var(--app-blue-pressed);
}

#help-screen .help-rule,
.kinds,
.shop-box,
#board-screen #bd-list {
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-md);
  background: var(--app-surface);
  box-shadow: none;
}

#help-screen .help-rule::after,
.kinds::after,
.shop-box::after,
#board-screen #bd-list::after,
#dex-screen .dex-card::after,
#deco-screen .deco-card::after {
  display: none !important;
}

#help-screen .help-rule b,
#help-screen .how li,
#help-screen .how li b {
  color: var(--app-text);
}

#help-screen .help-rule small,
#help-screen .help-or {
  color: var(--app-text-muted);
}

#help-screen .help-back {
  min-height: 44px;
  color: var(--app-text-sub);
  text-decoration: none;
}

.dex-bar,
.today-bar,
#pot-gauge {
  background: #e5e8eb;
}

.dex-card,
.deco-card {
  border: 1px solid var(--app-line);
  background: var(--app-surface);
  box-shadow: none;
}

.dex-card.got,
.deco-card.got {
  outline: 2px solid var(--app-blue-light);
  background: var(--app-surface);
}

.dex-card.today {
  box-shadow: 0 0 0 2px var(--app-blue);
}

.dex-badge,
.dex-new {
  transform: none;
  box-shadow: none;
}

.deco-tab {
  min-height: 40px;
  border: 1px solid var(--app-line);
  background: var(--app-surface);
  color: var(--app-text-sub);
}

.deco-tab.on {
  border-color: var(--app-blue);
  background: var(--app-blue);
  color: #ffffff;
  box-shadow: none;
}

.deco-tab.lock::after {
  content: " · 잠김";
  font-size: 11px;
}

.bd-list {
  padding: 6px;
  background: var(--app-surface);
}

.bd-row {
  background: var(--app-surface);
  color: var(--app-text);
}

.bd-row.top {
  background: #fff9e8;
  box-shadow: none;
}

.bd-row.me {
  background: var(--app-blue-light);
  box-shadow: none;
  color: var(--app-blue-pressed);
}

.bd-more {
  min-height: 44px;
  border: 0;
  border-radius: var(--app-radius-sm);
  background: var(--app-bg);
  color: var(--app-text-sub);
  box-shadow: none;
  font-family: inherit;
  font-weight: 600;
}

#bd-name,
input[type="text"] {
  min-height: 48px;
  border: 1px solid #d1d6db;
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  box-shadow: none;
  color: var(--app-text);
}

#bd-name:focus,
input[type="text"]:focus {
  border-color: var(--app-blue);
  outline: 2px solid var(--app-blue-light);
  outline-offset: 1px;
}

/* 게임 HUD도 같은 표면 체계를 사용한다. */
#hud {
  border: 1px solid rgba(229, 232, 235, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 20px rgba(25, 31, 40, 0.08);
}

#hud.hide,
#clear-ad.hide,
#clear-ad.out {
  visibility: hidden;
}

#stagenum,
#leftbox,
#recenter,
#mute {
  border: 0;
  background: var(--app-bg);
  box-shadow: none;
  color: var(--app-text-sub);
}

#stagenum,
#leftbox {
  font-weight: 600;
}

#stagenum,
#leftbox,
#leftbox b {
  color: var(--app-text);
}

#stagenum.hell {
  border: 1px solid #ffc9cf;
  background: #fff0f1;
  color: var(--app-danger);
}

#level-note {
  position: fixed;
  top: 42%;
  left: 50%;
  z-index: 26;
  width: max-content;
  max-width: calc(100% - 28px);
  color: transparent;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.35) rotate(-7deg);
}

#level-note.on {
  animation: level-note-pop-burst 1450ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

#level-note .level-word {
  display: block;
  white-space: nowrap;
  background: linear-gradient(100deg, #ff72b6 0%, #ff9c55 18%, #ffd84f 36%, #58d989 54%, #4abfff 72%, #a58bff 88%, #ff72b6 100%);
  background-size: 220% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.92);
  font-family: Jua, Pretendard, "Apple SD Gothic Neo", sans-serif;
  font-size: clamp(48px, 15vw, 76px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.025em;
  filter:
    drop-shadow(0 3px 0 rgba(73, 86, 112, 0.28))
    drop-shadow(0 8px 14px rgba(90, 79, 155, 0.28));
  animation: level-rainbow-shift 700ms linear infinite;
}

#level-note[data-mode="hell"] .level-word {
  background-image: linear-gradient(100deg, #ff416c 0%, #ff8a3d 24%, #ffe45c 46%, #ff5c8a 68%, #b76cff 86%, #ff416c 100%);
}

#level-note .level-spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--spark-size);
  height: var(--spark-size);
  border-radius: 50%;
  background: var(--spark-color);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.88),
    0 0 12px var(--spark-color);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
}

#level-note.on .level-spark {
  animation: level-spark-burst 1450ms ease-out both;
}

@keyframes level-note-pop-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(-7deg);
    filter: blur(5px);
  }
  11% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.18) rotate(2deg);
    filter: blur(0);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }
  68% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
    filter: blur(0) brightness(1);
  }
  77% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1) rotate(-1deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.7) rotate(3deg);
    filter: blur(8px) brightness(1.45);
  }
}

@keyframes level-spark-burst {
  0%,
  67% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }
  73% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.7);
  }
  100% {
    opacity: 0;
    transform:
      translate(-50%, -50%)
      translate(var(--spark-x), var(--spark-y))
      scale(1.25);
  }
}

@keyframes level-rainbow-shift {
  to {
    background-position: -220% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #level-note.on {
    animation: level-note-reduced 900ms ease-out both;
  }

  #level-note .level-word {
    animation: none;
  }

  #level-note .level-spark {
    display: none;
  }
}

@keyframes level-note-reduced {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
  }
  18%,
  75% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

#recenter,
#mute {
  border-radius: var(--app-radius-sm);
}

#recenter:active,
#mute:active {
  transform: scale(0.95);
  background: #d1d6db;
  box-shadow: none;
}

#clear-ad.adchip {
  border: 0;
  background: var(--app-blue);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(49, 130, 246, 0.2);
}

/* 다섯 번의 도전마다 여는 결산. 결과와 행동만 남겨 한 화면 안에서 끝낸다. */
#clear-screen.on {
  justify-content: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px
    calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--app-bg);
}

#clear-screen > .card {
  display: flex;
  width: 100%;
  max-width: 400px;
  min-height: 0;
  max-height: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 20px;
  overflow: auto;
}

#clear-screen > .card > * {
  width: 100%;
  max-width: none;
  margin: 0 !important;
}

#clear-screen .chapter-kicker {
  color: var(--app-blue);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

#clear-screen #clear-art {
  width: clamp(92px, 18vh, 144px);
  max-width: 144px;
  align-self: center;
  filter: none;
  animation-duration: 280ms;
}

#clear-screen #clear-n {
  font-size: clamp(24px, 7vw, 30px);
  line-height: 1.25;
  text-align: center;
}

#clear-screen #clear-sub {
  color: var(--app-text-sub);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

#clear-screen #clear-rank {
  max-height: min(25vh, 180px);
  overflow: auto;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-md);
  background: var(--app-surface);
}

#clear-screen #clear-ad {
  min-height: 54px;
  padding: 11px 14px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-md);
  background: var(--app-surface);
  background-image: none;
  box-shadow: none;
  color: var(--app-text);
  font-size: 15px;
  font-weight: 600;
}

#clear-screen #clear-ad.hide {
  display: none;
}

#clear-screen #clear-ad small {
  display: block;
  margin-top: 2px;
  color: var(--app-text-sub);
  font-size: 12px;
  font-weight: 500;
}

#clear-screen .crow {
  display: block;
}

#clear-screen #tomain {
  min-height: 44px;
  padding: 9px 14px;
  font-size: 14px;
}

#clear-screen #next {
  min-height: 54px;
  padding: 14px 18px;
  border: 0;
  border-radius: var(--app-radius-md);
  background: var(--app-blue);
  color: #ffffff;
  font-size: 17px;
  font-weight: 600;
}

#promo-info {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: var(--app-radius-sm);
  background: var(--app-blue-light);
  color: var(--app-text-sub);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  word-break: keep-all;
}

#promo-info b {
  color: var(--app-text);
  font-weight: 700;
}

#promo-info[data-state="pending"] {
  background: #fff4d6;
}

#promo-test {
  display: grid;
  width: 100%;
  max-width: 340px;
  gap: 7px;
  margin: 8px auto 0;
  padding: 10px;
  border: 2px dashed rgba(12, 134, 109, .38);
  border-radius: 17px;
  background: rgba(240, 255, 249, .94);
  color: var(--ink-d);
  text-align: center;
}

#promo-test > b {
  font-size: 14px;
  font-weight: 900;
}

#promo-test > small {
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
}

.promo-test-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

#promo-test button {
  min-width: 0;
  padding: 9px 4px;
  border: 1px solid rgba(12, 134, 109, .28);
  border-radius: 12px;
  background: #ffffff;
  color: #0c866d;
  font: inherit;
  font-size: 11.5px;
  font-weight: 900;
}

#promo-test button:disabled {
  opacity: .55;
}

#promo-test .promo-test-reset {
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 11px;
}

@media (max-height: 700px) {
  #clear-screen > .card {
    gap: 7px;
    padding: 14px 16px;
  }

  #clear-screen #clear-art {
    width: 86px;
  }

  #clear-screen #clear-rank {
    max-height: 118px;
  }
}

/* 소리 설정은 놀이를 막지 않는 한 번짜리 보조 카드다. */
#soundask {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: grid;
  width: calc(100% - 40px);
  max-width: 350px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--app-line);
  border-radius: 20px;
  background: var(--app-surface);
  box-shadow: 0 10px 30px rgba(25, 31, 40, 0.14);
  color: var(--app-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

#soundask.on {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

#soundask.closing {
  opacity: 0;
  transform: translate(-50%, 12px);
}

.soundask-actions {
  display: flex;
  gap: 6px;
}

#soundask button {
  min-width: 54px;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--app-radius-sm);
  background: var(--app-bg);
  color: var(--app-text-sub);
  font-size: 13px;
  font-weight: 600;
}

#soundask .soundask-primary {
  background: var(--app-blue);
  color: #ffffff;
}

#soundask button:active {
  transform: scale(0.97);
}

/* 초점은 키보드 사용자에게만 선명하게 보인다. */
:where(button, [role="button"], a, input, select, textarea):focus {
  outline: none;
}

:where(button, [role="button"], a, input, select, textarea):focus-visible {
  outline: 3px solid rgba(49, 130, 246, 0.48);
  outline-offset: 2px;
}

@media (max-height: 700px) {
  #title-screen.on {
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  #title-screen .card {
    gap: 6px;
  }

  #title-screen #logo {
    width: clamp(128px, 21vh, 162px) !important;
    padding: 4px;
  }

  #title-tagline {
    font-size: 12.5px;
  }

  .pill {
    min-height: 58px;
    padding: 2px 0;
  }

  .pill .pico {
    width: 30px;
    height: 30px;
  }

  #pot-row {
    min-height: 62px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  #pot-art {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  #daily-note {
    min-height: 44px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  #event-screen .card {
    padding-top: 18px;
  }

  #event-screen #ev-art {
    width: min(44vw, 190px);
    max-height: 28vh;
  }
}

@media (min-width: 600px) {
  #app {
    border-right: 1px solid var(--app-line);
    border-left: 1px solid var(--app-line);
  }
}

@media (prefers-reduced-motion: reduce) {
  .go,
  .ghost,
  .pill,
  #recenter,
  #mute {
    transition: none;
  }
}

/* ══ 그림책 스킨 (2026-09-02) ═══════════════════════════════
 * 위의 셸은 토스 중립(흰 표면·파랑)이었다 — 어느 앱에나 있는 얼굴이라
 * 이 게임의 수채 소품·손그림 로고와 겉돌았다. 셸이 토큰으로 잘 짜여 있어,
 * 여기서 토큰만 갈아 끼우면 화면 전부가 한 번에 옷을 갈아입는다.
 *
 * 정체성: **수채 그림책** — 물방울 한 방울이 욕실에서 하늘까지 가는 책 한 권.
 *   종이  #FDF7EA(표면) · #F3E8D2(눌린 면) — 무대의 수채 워시(scene.js)와 한 벌
 *   잉크  #4A3626(글) · #8E7048(선) — 타이틀 손그림 물결과 같은 갈색
 *   풀빛  #5E7F4A(주 행동) — 덮개 종이 버튼이 쓰던 색을 주 행동으로 승격
 *   물빛  #1D6693(숫자·물의 강조) — 주인공의 색은 숫자에만 아껴 쓴다
 * 서명: 주 행동과 HUD 조각의 **어긋난 둥글기 + 잉크빛 오프셋 그림자**
 *   (붙여 놓은 종이 스티커). 광택·유리·블러는 쓰지 않는다.
 * 위계·간격·터치 크기(54px)는 셸의 것을 그대로 물려받는다. */
:root {
  --app-blue: #5E7F4A;
  --app-blue-pressed: #46613A;
  --app-blue-light: #EAF0DD;
  --app-bg: #F3E8D2;
  --app-surface: #FDF7EA;
  --app-text: #4A3626;
  --app-text-sub: #6B5238;
  --app-text-muted: #7A6142;   /* #8A7150 은 종이 위 3.9:1 — 작은 글자 기준 미달이라 내렸다 */
  --app-line: #E0D0AF;
  --app-danger: #B4432E;
  --app-success: #4E6B3E;
  /* 잉크 선·그림자 — 아래에서 두루 쓴다 */
  --pb-ink-line: rgba(142, 112, 72, 0.48);
  --pb-ink-drop: rgba(142, 112, 72, 0.30);
}

/* 종이 위 문서 배경의 회색 잔재들 */
#help-screen .help-demo { background: #F3E8D2; }
#help-screen .how { background: #FDF7EA; }
#help-screen .help-dots i { background: #D8C9A8; }
.ghost:active,
#clear-screen .crow > .ghost:active { background: #EBDFC6; }
#recenter:active,
#mute:active { background: #E3D5B8; }

/* 상태 물감 — 흰 바탕용 파스텔을 종이에 스민 톤으로 */
#stagenum.hell { border-color: #E0B4A8; background: #F9E8E0; }
#pot-row.thirsty { background: #F8E7DC; }
.bd-row.top { background: #F8EFD4; }
#promo-info[data-state="pending"] { background: #F8ECC9; }
#promo-test button { background: var(--app-surface); color: var(--app-success); }

/* HUD — 흰 카드에서 종이 쪽지로. 조각들은 어긋난 둥글기 */
#hud {
  border: 2px solid var(--pb-ink-line);
  background: rgba(253, 247, 234, 0.94);
  box-shadow: 0 3px 10px rgba(96, 74, 52, 0.14);
  border-radius: 19px 16px 20px 15px;
}
#stagenum { border-radius: 13px 11px 14px 10px; }
#leftbox { border-radius: 11px 14px 10px 13px; }
#recenter { border-radius: 10px 13px 9px 12px; }
#mute { border-radius: 12px 9px 13px 10px; }
#stagenum, #leftbox, #recenter, #mute {
  box-shadow: 0 2px 0 var(--pb-ink-drop);
}
#stagenum { font-family: var(--font-cute, inherit); font-weight: 400; font-size: 15px; }
#leftbox b { color: #1D6693; }
#sound { background: rgba(253, 247, 234, 0.94); }
#sound.off::after { box-shadow: 0 0 0 1px #FDF7EA; }

/* 주 행동 — 풀빛 종이 스티커. 서명이 앉는 자리 */
.go,
#clear-screen #next,
#title-screen .row-go #play,
#event-screen #ev-go,
#soundask .soundask-primary,
.ov:not(#title-screen):not(#clear-screen) .go {
  border-radius: 19px 15px 20px 14px;
  box-shadow: 0 3px 0 var(--pb-ink-drop);
}
.go:active,
#clear-screen #next:active,
#title-screen .row-go #play:active,
#event-screen #ev-go:active {
  box-shadow: 0 1px 0 var(--pb-ink-drop);
}
/* 보조·광고 버튼도 조금씩 어긋나게 — 다만 그림자는 없다(위계) */
.ghost, .adbtn, #clear-screen #clear-ad, #clear-screen .crow > .ghost {
  border-radius: 15px 18px 14px 17px;
}

/* 큰 행동·화면 제목에는 붓글씨 한 벌 — 본문은 셸의 시스템 글꼴 그대로 */
#clear-screen #next,
#title-screen .row-go #play,
.ht {
  font-family: var(--font-cute, inherit);
  font-weight: 400;
  letter-spacing: 0;
}

/* 무대 위 종잇조각들 — 효과 배지·보상 칩 */
#fxbar .fx {
  background: rgba(253, 247, 234, 0.92);
  border-color: var(--pb-ink-line);
  color: var(--app-text);
}
#fxbar .fx.ice { border-color: #8FBBD8; color: #2C6B87; }
#fxbar .fx.item { border-color: #DEC27E; color: #7A5E1B; }
#fxbar .fx.bad { border-color: #DCA48C; color: #A14D2C; }
#fxbar .fx.shard { background: rgba(250, 244, 238, 0.94); }

/* 잠깐 멈춤 — 유리 대신 얇은 종이 그늘 */
#pause-screen { background: rgba(74, 54, 38, 0.30); }
#pause-screen .card {
  background: linear-gradient(180deg, rgba(253, 247, 234, 0.97), rgba(243, 232, 210, 0.95));
  border: 2px solid var(--pb-ink-line);
  box-shadow: 0 16px 36px rgba(74, 54, 38, 0.30);
}

/* 그림 그림자 — 파랑 그늘은 유리, 세피아 그늘이 종이다 */
#ev-art { filter: drop-shadow(0 10px 18px rgba(96, 74, 52, 0.24)); }
#pause-art { filter: drop-shadow(0 8px 14px rgba(96, 74, 52, 0.22)); }
#clear-art { filter: drop-shadow(0 8px 16px rgba(96, 74, 52, 0.22)); }

/* 풀빛을 **글자**로 쓸 때는 한 단계 진하게 — #5E7F4A 는 종이 위 4.27:1 로
 * 작은 글자 기준(4.5)에 조금 모자란다. 버튼 배경으로는 그대로 쓴다. */
#event-screen .ev-kicker, #garden-screen .ev-kicker,
#clear-screen #clear-kicker, #ev-kicker, #clear-kicker, .help-kicker { color: #4E6B3E; }
:root { --blue: #4E6B3E; --blue-d: #46613A; }
/* 위험 강조 주황도 종이 위에선 3.74:1 — 익힌 벽돌색으로 내린다 */
.kt.danger b { color: #B4432E; }
#fxbar .fx.bad { color: #9A4526; }
/* (광고 자리 표기는 지금 숨겨져 있지만, 켜질 때를 대비해 잉크로) */
#adbar .ad-tag { color: #6B5238; }

/* 광고 자리표시 — 파랑 빗금을 종이 결로(그림책 스킨 후속, 2026-09-02) */
#adbar{
  background: repeating-linear-gradient(135deg,
    rgba(253, 247, 234, .72) 0 10px, rgba(238, 226, 199, .72) 10px 20px);
  border: 2px dashed rgba(142, 112, 72, .38);
  box-shadow: none;
}
