/* 과일 합치기 — 노을빛 과일 가게 */
.stage.fm { justify-content: flex-start; padding: 6px 6px 4px; gap: 4px; touch-action: none; overscroll-behavior: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.55) 0 38px, transparent 40px),
    radial-gradient(circle at 86% 30%, rgba(255, 255, 255, 0.4) 0 26px, transparent 28px),
    radial-gradient(130% 90% at 50% 0%, #ffe9c9 0%, #ffc9a8 55%, #f6a39a 100%); }
.stage.fm::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(rgba(255, 255, 255, 0.55) 1.6px, transparent 2px); background-size: 26px 26px; }

/* 위 점수 줄 */
.fm-hud { position: relative; z-index: 1; flex: none; gap: 6px; flex-wrap: nowrap; align-items: stretch; width: 100%; max-width: 520px; }
.fm-hud .fm-box { min-width: 0; flex: 1; padding: 3px 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.72); border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(190, 90, 70, 0.18); color: #6b3a3a; }
.fm-hud span { color: #b0675f; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-hud b { display: block; font-size: 24px; color: #5a2e3a; white-space: nowrap; }
.fm-hud .v-score { color: #e8505b; }
.fm-hud .v-score.bump { animation: fm-bump 0.22s ease-out; }
@keyframes fm-bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.fm-hud .fm-nextbox { flex: 0 0 auto; width: 74px; display: flex; flex-direction: column; align-items: center; }
.fm-nextcv { display: block; width: 38px; height: 38px; }
.fm-nextcv.pop { animation: fm-bump 0.3s ease-out; }
.fm-pausebtn { flex: none; width: 46px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.9); background: rgba(255, 255, 255, 0.72); color: #8a4a4a;
  font-size: 15px; font-weight: 900; letter-spacing: -2px; cursor: pointer; padding: 0; box-shadow: 0 4px 12px rgba(190, 90, 70, 0.18); }
.fm-pausebtn:hover { background: #fff; }

.fm-wrap { position: relative; z-index: 1; flex: 1; min-height: 0; width: 100%; }
.fm-cv { position: absolute; left: 0; top: 0; display: block; touch-action: none; cursor: pointer; }

/* 새 과일 알림 */
.fm-banner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none; text-align: center; white-space: nowrap;
  padding: 10px 26px 8px; border-radius: 20px; background: linear-gradient(135deg, rgba(255, 120, 120, 0.96), rgba(240, 80, 110, 0.95));
  box-shadow: 0 12px 30px rgba(150, 40, 60, 0.35), 0 0 0 3px #fff; }
.fm-banner[hidden] { display: none; }
.fm-banner b { display: block; font-family: var(--title); font-weight: 400; font-size: 18px; color: #ffe8e8; }
.fm-banner span { display: block; font-family: var(--title); font-weight: 400; font-size: 32px; line-height: 1.15; color: #fff; text-shadow: 0 2px 0 rgba(120, 20, 40, 0.35); }
.fm-banner.gold { background: linear-gradient(135deg, rgba(255, 212, 71, 0.98), rgba(255, 150, 50, 0.96)); box-shadow: 0 12px 34px rgba(160, 90, 0, 0.4), 0 0 0 3px #fff, 0 0 46px rgba(255, 212, 71, 0.75); }
.fm-banner.gold b { color: #6a3a00; }
.fm-banner.gold span { text-shadow: 0 3px 0 #c2410c; }
.fm-banner.show { animation: fm-banner 2s ease-out both; }
@keyframes fm-banner {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  20% { transform: translate(-50%, -50%) scale(1); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(1); }
}

/* 시작 · 쉬기 · 끝 화면: 크림색 판 */
.fm .overlay { background: rgba(120, 50, 50, 0.32); }
.fm .panel { background: linear-gradient(180deg, #fffaf2, #fff0e2); color: #5a2e3a; border: 3px solid #fff; touch-action: pan-y;
  box-shadow: 0 24px 60px rgba(120, 40, 40, 0.35), 0 0 0 1px rgba(232, 80, 91, 0.15); }
.fm .panel [hidden] { display: none; }
.fm .panel h2 { color: #e8505b; text-shadow: 0 2px 0 #ffd6c2; }
.fm .panel p, .fm .panel ul { color: #7a4a4a; }
.fm .panel ul { font-size: 14.5px; line-height: 1.5; margin-bottom: 10px; }
.fm .panel li::marker { color: #ff8a5b; }
.fm .panel .stats div { background: #fff; border: 2px solid #ffe0cf; }
.fm .panel .stats b { color: #e8505b; }
.fm .panel .stats span { color: #b0675f; }
.fm .panel .newbest { color: #e8505b; }
.fm .big-btn { background: linear-gradient(135deg, #ff8a5b, #e8505b); box-shadow: 0 8px 22px rgba(232, 80, 91, 0.4); cursor: pointer; }
.fm .big-btn:hover { filter: brightness(1.06); }
.fm .sub-btn { background: #fff; border: 2px solid #ffd9c6; color: #9a5a52; text-decoration: none; cursor: pointer; font-weight: 700; }
.fm .sub-btn:hover { background: #fff6ef; }
.fm-art { display: block; width: 100%; max-width: 300px; height: auto; margin: -8px auto 2px; }
.fm .panel .fm-keys { font-size: 13px; color: #b0675f; margin-bottom: 8px; }
.fm .panel .fm-bestline { margin: 10px 0 0; font-size: 15px; color: #e8505b; font-weight: 700; }
.fm-endfruit { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 2px 0 0; }
.fm-endcv { width: 76px; height: 76px; flex: none; animation: fm-wob 1.6s ease-in-out infinite; }
.fm-endfruit .end-msg { margin: 0; font-size: 17px; font-weight: 700; text-align: left; }
@keyframes fm-wob { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) translateY(-3px); } }
@media (pointer: coarse) { .fm .panel .fm-keys { display: none; } }
@media (max-width: 380px) {
  .fm-hud b { font-size: 20px; }
  .fm-hud .fm-nextbox { width: 62px; }
  .fm-banner span { font-size: 26px; }
}
/* 낮은 화면: 시작 판이 넘치지 않게 그림 · 글을 줄인다 */
@media (max-height: 800px) {
  .fm-art { width: auto; height: min(150px, 17vh); }
  .fm .panel { padding: 18px 20px; }
  .fm .panel h2 { font-size: 30px; margin: 0 0 4px; }
  .fm .panel p { margin-bottom: 8px; font-size: 14.5px; }
  .fm .panel ul { font-size: 13.5px; margin-bottom: 6px; }
}
@media (max-height: 560px) {
  .fm-art { display: none; }
  .fm .panel { padding: 12px 18px; width: min(460px, 100%); }
  .fm .panel h2 { font-size: 25px; }
  .fm .panel p { font-size: 13.5px; margin-bottom: 4px; }
  .fm .panel ul { font-size: 12.5px; line-height: 1.4; margin-bottom: 4px; }
  .fm .big-btn { font-size: 20px; padding: 10px; }
  .fm .sub-btn { padding: 8px; margin-top: 6px; }
  .fm .panel .stats { margin: 8px 0 10px; }
  .fm-endcv { width: 56px; height: 56px; }
}
@media (max-height: 430px) { .fm .panel ul { display: none; } }
/* 낮은 가로 화면(폰을 눕힘): 점수 줄을 왼쪽 세로 칸으로 */
@media (orientation: landscape) and (max-height: 560px) {
  .stage.fm { flex-direction: row; justify-content: center; align-items: stretch; padding: 4px; }
  .fm-hud { flex-direction: column; width: 96px; max-width: none; justify-content: center; gap: 5px; }
  .fm-hud .fm-box { flex: none; padding: 2px 6px; }
  .fm-hud b { font-size: 19px; }
  .fm-hud .fm-nextbox { width: auto; }
  .fm-pausebtn { width: auto; height: 38px; }
  .fm-wrap { width: auto; flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .fm-endcv { animation: none; } }
