/* 양 굴리기 모양. 색은 base.css 토큰 */
body { background: var(--sky); }
.st-app { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.st-extra { display: flex; gap: 8px; }
.st-tiltbtn, .st-pausebtn { background: var(--cream); color: var(--ink); font-size: 18px; }
.st-tiltbtn { font-size: 12px; font-weight: 900; letter-spacing: -.04em; }
.st-tiltbtn.off { opacity: .5; text-decoration: line-through; }

/* 시작 화면 */
.st-start { padding-top: 8px; }
.st-lead { max-width: 30em; font-weight: 700; }
.st-cover { position: relative; width: min(360px, 100%); aspect-ratio: 4 / 3; border-radius: var(--r-card); background: var(--field); overflow: hidden; }
.st-cover img { width: 100%; height: 100%; object-fit: cover; }
.st-cover-board { position: absolute; left: 10%; top: 30%; width: 80%; height: 12px; border-radius: 8px; background: var(--wood); transform: rotate(-6deg); }
.st-cover-sheep {
  position: absolute; top: 14%; left: 22%; width: 44px; height: 44px; border-radius: 50%; background: var(--white);
  background: radial-gradient(ellipse 30% 36% at 72% 52%, var(--ink) 96%, transparent), var(--white);
  box-shadow: -10px -7px 0 -5px var(--white), -10px 7px 0 -5px var(--white), 0 -11px 0 -5px var(--white), 0 11px 0 -5px var(--white);
  animation: st-roll 2.4s ease-in infinite;
}
@keyframes st-roll { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 10% { opacity: 1; } 60% { transform: translate(160px, 0) rotate(-360deg); } 100% { transform: translate(200px, 140px) rotate(-480deg); opacity: 0; } }

/* 게임 화면: 휴대폰 한 화면에 꽉 (스크롤 없음) */
body.st-playing { overflow: hidden; overscroll-behavior: none; }
body.st-playing .st-app { max-width: 1100px; height: 100vh; height: 100svh; display: flex; flex-direction: column; }
body.st-playing .st-main { flex: 1; min-height: 0; }
.st-game { height: 100%; display: flex; flex-direction: column; gap: 8px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.st-hud { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-hud .chip { font-size: 16px; }
.st-time.flash { background: var(--joy); color: #fff; animation: jw-breathe .5s infinite; }
.st-dots { display: inline-flex; gap: 4px; flex: 1; justify-content: center; }
.st-dots i { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--cream); }
.st-dots i.on { background: var(--cream); }
.st-stage {
  position: relative; flex: 1; min-height: 0; border-radius: var(--r-card); overflow: hidden; background: var(--sky);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.st-canvas { display: block; }
.st-pad { display: flex; justify-content: space-between; gap: 16px; }
.st-padbtn {
  flex: 1; min-height: 64px; border: 0; border-radius: 999px; cursor: pointer; font-size: 28px; font-weight: 900;
  background: var(--cream); color: var(--ink); box-shadow: 0 5px 0 rgba(28, 37, 84, .2);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.st-padbtn.down { transform: translateY(4px); box-shadow: 0 1px 0 rgba(28, 37, 84, .2); background: var(--gold); }
@media (hover: hover) and (pointer: fine) { .st-pad { max-width: 420px; margin: 0 auto; width: 100%; } }

/* 위에 덮는 것들 */
.st-intro, .st-pause, .st-over { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(28, 37, 84, .35); }
.st-intro-card, .st-pause-card { width: min(420px, 100%); display: grid; gap: 12px; justify-items: center; padding: 16px; border-radius: var(--r-card); background: var(--sky); }
.st-intro-card .say-row { width: 100%; }
.st-pause-title { font-size: 24px; font-weight: 900; }
.st-over-text { font-size: 44px; font-weight: 900; color: var(--cream); text-shadow: 0 4px 0 var(--ink); }
.st-tutorial { position: absolute; left: 12px; right: 12px; bottom: 16px; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.st-tutorial .say-row { margin: 0; max-width: 420px; }
.st-tut-icon { width: 44px; height: 72px; border-radius: 10px; border: 5px solid var(--ink); background: var(--cream); animation: st-tilt 1.6s ease-in-out infinite; }
@keyframes st-tilt { 25% { transform: rotate(-18deg); } 75% { transform: rotate(18deg); } }

/* 단계 올라감 (원작: 원이 닫혔다가 숫자, 다시 열림) */
.st-wipe { position: absolute; inset: 0; display: grid; place-items: center; background: var(--advent); clip-path: circle(0 at 50% 50%); transition: clip-path 1s ease-in; }
.st-wipe.close { clip-path: circle(80% at 50% 50%); }
.st-wipe.open { clip-path: circle(0 at 50% 50%); transition-duration: .5s; transition-timing-function: ease-out; }
.st-wipe-num { font-size: 56px; font-weight: 900; color: var(--gold); transform: scale(.3); opacity: 0; transition: transform .4s cubic-bezier(.3, 1.6, .5, 1), opacity .2s; }
.st-wipe-num.show { transform: scale(1); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .st-wipe.close { clip-path: none; } .st-wipe-num { transform: none; } }

/* 끝 화면 */
.st-party { display: flex; gap: 6px; justify-content: center; min-height: 64px; align-items: end; }
.st-sheep-img { width: 58px; height: 58px; object-fit: contain; }
.st-sheep-chip { /* 자리표시 양: 하얀 털뭉치 + 까만 얼굴 */
  width: 52px; height: 52px; border-radius: 50%;
  background: radial-gradient(ellipse 30% 36% at 72% 52%, var(--ink) 96%, transparent), var(--white);
  box-shadow: -12px -8px 0 -6px var(--white), -12px 8px 0 -6px var(--white), 0 -13px 0 -6px var(--white), 0 13px 0 -6px var(--white);
}
.st-stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.st-star { font-weight: 800; }
.st-verse { text-align: center; }
.st-verse-text { font-size: 20px; font-weight: 800; line-height: 1.5; }
.st-verse-ref { font-size: 14px; opacity: .75; margin-top: 4px; }

/* 가로 휴대폰: 그림 왼쪽, 제목·설명·시작 오른쪽 (시작 단추가 첫 화면 안, 고칠 일 1) */
@media (orientation: landscape) and (max-height: 500px) {
  .st-start { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: dense; align-items: center; gap: 10px 20px; padding: 8px 0; }
  .st-start > * { grid-column: 2; }
  .st-start > .st-cover { grid-column: 1; grid-row: 1 / span 9; width: min(100%, calc((100svh - 110px) * 4 / 3)); justify-self: center; padding: 8px; }
}
/* 좁은 휴대폰 놀이 중: 기울이기·멈춤 단추가 더해져 머리 줄이 넘침(390px → 문서 437px). 다른 게임(beard-salon 등)처럼 대림절 칩·제목을 숨긴다 (Daniel 10/19 베타) */
@media (max-width: 440px) { body.st-playing .count-chip, body.st-playing .topbar-title { display: none; } }
