/* =========================================================================
   픽셀 학교 투어 — 체험 게임 디자인
   게임 창 틀(.game-*)과 카페 게임(.cafe-*). 색·글꼴 변수는 tour.css의 것을 씁니다.
   ========================================================================= */

/* ---------- 게임 창 틀 ---------- */

/* 선배 소개와 놀이 중 안내에 쓰는 공통 카드. */
.senior-card {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 8px 10px; border: 2px solid var(--navy); background: #f2f6ff;
  border-radius: 4px; color: var(--navy); text-align: left;
}
.senior-card > img[src], .senior-card > .addon-portrait {
  flex: none; width: 64px; height: 64px; object-fit: contain;
  background: #fff; border: 1px solid #c9d4e8; border-radius: 3px;
  image-rendering: auto;
}
.senior-card > div { min-width: 0; }
.senior-card strong, .senior-card b {
  display: block; margin: 0; color: var(--navy); font: 700 14px/1.4 var(--font-body, sans-serif);
}
.senior-card p {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; margin: 2px 0 0; font-size: 12px; line-height: 1.5;
}
.senior-card.is-compact > img { width: 44px; height: 44px; }
.senior-card.is-compact p { -webkit-line-clamp: 1; }
.senior-card .addon-portrait { display: grid; place-items: center; overflow: hidden; }
.senior-card .addon-portrait img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.senior-card .addon-portrait canvas { width: 48px; height: 60px; image-rendering: pixelated; }

/* 버튼은 두 색만 사용하고 비활성인 조작만 흐리게 표시한다. */
#game button, #game input[type="range"], #festival-dialog button, #stamps button {
  min-width: 44px; min-height: 44px;
}
#game .btn, #festival-dialog .btn, #stamps .btn {
  border: 2px solid var(--navy); border-radius: 4px;
  background: #fff; color: var(--navy); cursor: pointer;
}
#game .btn.btn-primary, #festival-dialog .btn.btn-primary, #stamps .btn.btn-primary {
  background: var(--navy); color: #fff;
}
#game .btn:hover:enabled, #festival-dialog .btn:hover:enabled { background: #eef2fb; }
#game .btn.btn-primary:hover:enabled, #festival-dialog .btn.btn-primary:hover:enabled { background: var(--navy-2); }
#game button:disabled, #game input:disabled, #festival-dialog button:disabled, #stamps button:disabled {
  opacity: .5; cursor: default; box-shadow: none;
}
#game button:enabled { opacity: 1; }
#game .btn[aria-pressed="true"] { outline: 2px solid var(--navy); outline-offset: -5px; }
#game .melody-pad b { border-bottom: 5px solid var(--key-colour); }
#game .melody-pad.is-lit { outline: 4px solid var(--key-dark); outline-offset: -7px; }
#game .pp-roll[data-state="now"] { outline: 3px solid #e0a21e; outline-offset: -6px; }
.ui-icon { display: inline-block; width: 20px; height: 20px; vertical-align: middle; image-rendering: pixelated; }
.ui-emoji { display: inline-block; font-size: 1.05em; line-height: 1; vertical-align: -0.1em; }
#game .sound-toggle {
  display: grid; place-items: center; margin-inline-start: auto; flex: 0 0 44px;
  width: 44px; height: 44px; padding: 0;
}
#game .sound-toggle .ui-icon { width: 24px; height: 24px; }
#game .sound-toggle[hidden] { display: none; }

#game {
  width: min(960px, 100% - 28px); max-width: none;
  max-height: 92dvh;
  padding: 0; overflow: hidden;
}
#game[open] { display: flex; flex-direction: column; }
body.game-open { overflow: hidden; }
.game-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); background: var(--paper);
}
.game-head .eyebrow { margin: 0 0 2px; font-size: 12px; }
.game-head h2 { margin: 0; font-family: var(--font-title); font-weight: 900; font-size: 20px; line-height: 1.3; color: var(--navy); }
#game-close { flex-shrink: 0; width: 44px; height: 44px; border: 0; background: none; font-size: 20px; }



.game-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 18px 18px; }

/* 공통 결과 화면 */
.game-result { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0; text-align: center; }
.game-result-stars { margin: 0; font-size: 34px; line-height: 1.2; letter-spacing: 3px; color: #e0a21e; }
.game-result-score { margin: 0; font-size: 15px; color: var(--muted); }
.game-stamp {
  display: inline-flex; align-items: center; gap: 12px;
  margin: 6px 0; padding: 12px 18px;
  background: #fff; border: 2px solid var(--navy); box-shadow: var(--pixel-shadow);
  font-size: 18px; color: var(--navy);
}
.game-stamp-seal {
  display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0;
}
.game-stamp-seal img, .stamp-seal img { display: block; width: 48px; height: 48px; image-rendering: pixelated; }
.game-result-text { margin: 0; max-width: 480px; font-size: 15px; }
.game-result-best { margin: 0; font-size: 13px; color: var(--muted); }
.game-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; width: 100%; }
.game-result-actions .btn { min-height: 44px; font-size: 14px; }

/* 첫 화면에서 도장과 재시도를 함께 확인합니다. */
@media (max-width: 760px) {
  .game-result { gap: 8px; padding: 4px 0; }
  .game-stamp { max-width: 100%; margin: 2px 0; padding: 8px 12px; font-size: 16px; }
  .game-result-text { font-size: 14px; line-height: 1.5; }
  .game-result-actions { margin-top: 4px; }
  .game-result-actions .btn { flex: 1 1 auto; padding: 9px 12px; }
}

/* ---------- 카페 게임 ---------- */

.cafe { display: grid; gap: 12px; grid-template-areas: "top" "stage" "message" "tray" "actions"; }
.cafe-top { grid-area: top; display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.cafe-customer { position: relative; width: 88px; height: 88px; }
.cafe-customer img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.cafe-customer[data-emoji]::before { content: attr(data-emoji); display: grid; place-items: center; width: 100%; height: 100%; font-size: 56px; }
.cafe-customer.is-happy img { animation: cafe-bounce .5s ease-in-out 2; }
@keyframes cafe-bounce { 50% { transform: translateY(-6px); } }

.cafe-bubble {
  position: relative; padding: 10px 14px;
  background: #fff; border: 2px solid var(--navy); box-shadow: var(--pixel-shadow);
}
.cafe-bubble::before {   /* 말풍선 꼬리 (픽셀풍 네모) */
  content: ""; position: absolute; left: -9px; top: 50%; width: 12px; height: 12px;
  transform: translateY(-50%) rotate(45deg); background: #fff; border-left: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
}
.cafe-who { display: block; font-size: 12px; font-weight: 700; color: var(--green); }
.cafe-order { margin: 2px 0 0; font-size: 17px; font-weight: 700; line-height: 1.4; }
.cafe-recipe { margin: 6px 0 0; font-size: 14px; color: var(--orange); font-weight: 700; }
.cafe-score { text-align: right; white-space: nowrap; }
.cafe-round { display: block; font-size: 12px; color: var(--muted); }
.cafe-stars { font-size: 24px; line-height: 1.2; letter-spacing: 2px; color: #e0a21e; }

/* 카운터와 컵 */
.cafe-stage {
  grid-area: stage; position: relative; height: 230px;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 22px;
  background: #f6e7d2 url("../img/games/cafe/counter-bg.webp") center / cover no-repeat;
  border: 2px solid var(--navy); image-rendering: pixelated;
}
.cafe-cup {
  position: relative; width: 84px; height: 124px;
  display: flex; flex-direction: column; justify-content: flex-end;
  border: 3px dashed rgba(20, 40, 90, .55); background: rgba(255, 255, 255, .25);
}
.cafe-cup[hidden], .cafe-finished[hidden] { display: none; }
.cafe-finished { display: block; width: 144px; height: 144px; object-fit: contain; image-rendering: pixelated; }
.cafe-cup-hint { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--navy); }
.cafe-cup[data-cup]:not([data-cup=""]) .cafe-cup-hint { display: none; }
.cafe-cup[data-cup="ice"] {
  border: 3px solid var(--navy); border-top-width: 5px; border-radius: 0 0 8px 8px;   /* 투명컵: 두꺼운 테두리가 입구 */
  background: rgba(255, 255, 255, .45);
}
.cafe-cup[data-cup="mug"] {
  width: 96px; height: 100px;
  border: 3px solid var(--navy); background: #fffcf2;
}
.cafe-cup[data-cup="mug"]::after {   /* 손잡이 */
  content: ""; position: absolute; right: -22px; top: 18px; width: 22px; height: 46px;
  border: 3px solid var(--navy); border-left: 0; border-radius: 0 10px 10px 0; background: #fffcf2;
}
.cafe-layers { display: flex; flex-direction: column-reverse; padding: 0 5px 5px; }
.cafe-layer { height: 20px; flex-shrink: 1; }
.cafe-layer.is-new { animation: cafe-drop .35s ease-out; }
@keyframes cafe-drop { from { transform: translateY(-70px); opacity: 0; } }
.cafe-layer[data-ing="water"] { background: #cfe8f7; }
.cafe-layer[data-ing="shot"] { background: #5b3a1e; box-shadow: inset 0 3px 0 #a9743f; }
.cafe-layer[data-ing="milk"] { background: #fff6e6; }
.cafe-layer[data-ing="steamed-milk"] { background: #fff; box-shadow: inset 0 5px 0 #f3ede0; }
.cafe-layer[data-ing="vanilla"] { background: #f6d98b; }
.cafe-layer[data-ing="strawberry"] { background: #f48ca0; }
.cafe-layer[data-ing="ice"] {   /* 얼음은 늘 맨 위에 떠 있음 */
  order: 9; height: 18px;
  background: repeating-linear-gradient(90deg, rgba(234, 247, 255, .95) 0 14px, #b9dff2 14px 16px, rgba(234, 247, 255, .95) 16px 30px);
}
.cafe-cup.is-shake { animation: cafe-shake .4s ease-in-out; }
@keyframes cafe-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.cafe-cup.is-served { animation: cafe-bounce .5s ease-in-out; }

.cafe-message { grid-area: message; margin: 0; min-height: 24px; font-size: 15px; font-weight: 700; color: var(--navy); text-align: center; }

/* 재료 버튼 9개 (3×3, 최소 44px) */
.cafe-tray { grid-area: tray; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cafe-tray-help { grid-column: 1 / -1; margin: 0; align-self: end; font-size: 12px; color: var(--muted); }
.cafe-ing {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 78px; padding: 6px 4px;
  font-size: 13px; font-weight: 700; line-height: 1.25; text-align: center;
}
.cafe-ing img { width: 40px; height: 40px; image-rendering: pixelated; }
.cafe-ing-emoji { display: grid; place-items: center; width: 40px; height: 40px; font-size: 28px; }
.cafe-ing:active img { transform: translateY(2px); }

.cafe-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 8px; }
.cafe-actions .btn { flex: 1 1 auto; }
.cafe-actions .cafe-serve { flex: 2 1 auto; }

/* PC: 왼쪽 카운터, 오른쪽 재료 */
@media (min-width: 761px) {
  .cafe {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 18px;
    grid-template-areas: "top top" "stage tray" "message tray" "actions tray";
    align-content: start;
  }
  .cafe-stage { height: 300px; }
  .cafe-cup { width: 96px; height: 140px; }
  .cafe-cup[data-cup="mug"] { width: 110px; height: 112px; }
  .cafe-layer { height: 23px; }
  .cafe-ing { min-height: 92px; font-size: 14px; }
  .cafe-ing img, .cafe-ing-emoji { width: 48px; height: 48px; }
  .cafe-actions { align-self: end; }
}

/* 휴대폰: 화면 가득 */
@media (max-width: 760px) {
  #game {
    width: 100%; height: 100dvh; max-height: none; margin: 0;
    border: 0; box-shadow: none;
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .game-head { padding-left: 16px; }
  .game-head h2 { font-size: 18px; }
  .game-body { padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .cafe-top { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "customer bubble" "score score"; gap: 8px 10px; }
  .cafe-customer { grid-area: customer; width: 64px; height: 64px; }
  .cafe-customer[data-emoji]::before { font-size: 42px; }
  .cafe-bubble { grid-area: bubble; padding: 8px 12px; }
  .cafe-order { font-size: 15px; }
  .cafe-score { grid-area: score; display: flex; justify-content: space-between; align-items: center; }
  .cafe-stage { height: 190px; padding-bottom: 16px; }
  .cafe-cup { width: 72px; height: 104px; }
  .cafe-cup[data-cup="mug"] { width: 82px; height: 86px; }
  .cafe-cup[data-cup="mug"]::after { right: -18px; width: 18px; height: 40px; }
  .cafe-layer { height: 17px; }
  .cafe-ing { min-height: 72px; font-size: 12px; }
  .cafe-ing img, .cafe-ing-emoji { width: 36px; height: 36px; }
  .cafe-message { font-size: 14px; }
}

/* 휴대폰 가로: 왼쪽에 손님·컵, 오른쪽에 재료 */
@media (max-width: 1000px) and (max-height: 500px) and (orientation: landscape) {
  #game { width: 100%; height: 100dvh; max-height: none; margin: 0; border: 0; box-shadow: none; }
  .game-head { padding: 2px 4px 2px 14px; }
  .game-head h2 { font-size: 16px; }
  .game-head .eyebrow { display: none; }
  .game-body { padding: 8px 12px; }
  .cafe {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px;
    grid-template-areas: "top tray" "stage tray" "message tray" "actions tray";
  }
  .cafe-top { grid-template-columns: 48px minmax(0, 1fr); grid-template-areas: "customer bubble" "customer score"; gap: 2px 8px; }
  .cafe-customer { grid-area: customer; width: 48px; height: 48px; }
  .cafe-customer[data-emoji]::before { font-size: 32px; }
  .cafe-bubble { grid-area: bubble; padding: 4px 10px; }
  .cafe-who { display: none; }
  .cafe-order { margin: 0; font-size: 13px; }
  .cafe-recipe { margin-top: 2px; font-size: 12px; }
  .cafe-score { grid-area: score; text-align: left; }
  .cafe-round { display: inline; margin-right: 6px; }
  .cafe-stars { font-size: 18px; }
  .cafe-stage { height: 118px; padding-bottom: 8px; }
  .cafe-finished { width: 96px; height: 96px; }
  .cafe-cup { width: 54px; height: 84px; border-width: 2px; }
  .cafe-cup[data-cup="mug"] { width: 62px; height: 68px; }
  .cafe-cup[data-cup="mug"]::after { right: -14px; top: 10px; width: 14px; height: 32px; border-width: 2px; }
  .cafe-layers { padding: 0 3px 3px; }
  .cafe-layer { height: 13px; }
  .cafe-layer[data-ing="ice"] { height: 12px; }
  .cafe-cup-hint { font-size: 12px; }
  .cafe-message { min-height: 20px; font-size: 13px; }
  .cafe-tray { gap: 6px; align-content: start; }
  .cafe-ing { flex-direction: row; justify-content: flex-start; gap: 6px; min-height: 44px; padding: 2px 8px; font-size: 12px; text-align: left; }
  .cafe-ing img, .cafe-ing-emoji { width: 28px; height: 28px; font-size: 20px; }
  .cafe-actions { gap: 6px; }
  .cafe-actions .btn { min-height: 44px; padding: 6px 10px; font-size: 13px; }
  .game-result { gap: 6px; padding: 0; }
  .game-result-stars { font-size: 26px; }
  .game-stamp { margin: 2px 0; padding: 8px 14px; font-size: 16px; }
  .game-stamp-seal { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .cafe-layer.is-new, .cafe-cup.is-shake, .cafe-cup.is-served, .cafe-customer.is-happy img, .game-stamp-seal { animation: none !important; }
}

/* ---------- AI 광고 문구 고르기 ---------- */

.ai {
  display: grid; gap: 12px;
  grid-template-areas: "progress" "product" "panel" "reaction" "next";
  color: var(--navy);
}
.ai > * { min-width: 0; }
.ai-progress { grid-area: progress; margin: 0; font-size: 13px; font-weight: 700; color: var(--green); }
.ai-product {
  grid-area: product; padding: 14px; text-align: center;
  background: var(--cream); border: 2px solid var(--navy); box-shadow: var(--pixel-shadow);
}
.ai-product img, .ai-post img { display: block; width: 128px; height: 128px; margin: 0 auto; image-rendering: pixelated; }
.ai-emoji { display: grid; place-items: center; width: 128px; height: 128px; margin: 0 auto; font-size: 72px; }
.ai-name { margin: 8px 0 4px; font-family: var(--font-title); font-size: 21px; }
.ai-description { margin: 0; font-size: 14px; }
.ai-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.ai-tag { padding: 3px 8px; background: var(--paper); border: 1px solid var(--line-strong); font-size: 12px; color: var(--green); }
.ai-panel { grid-area: panel; display: flex; flex-direction: column; gap: 10px; }
.ai-guide { margin: 0; font-size: 14px; font-weight: 700; }
.ai-choices { display: grid; gap: 8px; }
.ai-choice {
  width: 100%; min-height: 56px; padding: 12px 14px;
  font-family: var(--font); font-size: 15px; font-weight: 700; line-height: 1.5; text-align: left;
  overflow-wrap: anywhere;
}
.ai-choice.is-dim { border-style: dashed; }
.ai-hint-note { display: block; margin-top: 6px; color: var(--orange); font-size: 12px; }
.ai-hint { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.ai-hint img, .ai-hint .ai-emoji { width: 32px; height: 32px; margin: 0; image-rendering: pixelated; font-size: 24px; }
.ai-hint[aria-pressed="true"] { border-color: var(--orange); color: var(--orange); background: var(--cream); }
.ai-reaction { grid-area: reaction; min-width: 0; }
.ai-post { padding: 12px 16px; background: var(--paper); border: 2px solid var(--navy); box-shadow: var(--pixel-shadow); }
.ai-post-head { margin: 0 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--green); }
.ai-caption { margin: 8px 0; font-size: 15px; font-weight: 700; }
.ai-likes { margin: 8px 0 0; font-size: 20px; font-weight: 700; }
.ai-heart { display: inline-block; color: #e85d75; animation: ai-heart-pop .6s ease-in-out 2; }
@keyframes ai-heart-pop { 50% { transform: scale(1.15); } }
.ai-count { font-variant-numeric: tabular-nums; }
.ai-feedback { margin: 12px 0 6px; font-size: 14px; color: var(--green); font-weight: 700; }
.ai-stars { margin: 0; font-size: 26px; letter-spacing: 2px; color: var(--orange); }
.ai-next { grid-area: next; width: 100%; min-height: 44px; align-self: end; }
.ai-total { margin: 0; font-family: var(--font-title); font-size: clamp(22px, 5vw, 30px); color: var(--navy); }
.ai.is-picked .ai-panel { display: none; }

/* PC: 왼쪽 상품이 반응 화면으로 바뀌고 오른쪽에는 고른 후보가 남습니다. */
@media (min-width: 761px) {
  .ai {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 18px;
    grid-template-areas: "progress progress" "product panel";
    align-items: start;
  }
  .ai-product { padding: 24px 16px; }
  .ai-product img, .ai-product .ai-emoji { width: 160px; height: 160px; }
  .ai.is-picked { grid-template-areas: "progress progress" "reaction panel" "reaction next"; }
  .ai.is-picked .ai-product { display: none; }
  .ai.is-picked .ai-panel { display: flex; }
}

/* 휴대폰 가로: 두 열, 버튼은 최소 44px 유지 */
@media (max-height: 500px) and (orientation: landscape) {
  .ai {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px;
    grid-template-areas: "progress panel" "product panel";
    align-items: start;
  }
  .ai-product { padding: 8px; }
  .ai-product img, .ai-post img, .ai-product .ai-emoji, .ai-post .ai-emoji { width: 80px; height: 80px; font-size: 50px; }
  .ai-name { margin: 4px 0; font-size: 17px; }
  .ai-description, .ai-guide, .ai-caption, .ai-feedback { font-size: 12px; }
  .ai-tags { margin-top: 6px; gap: 4px; }
  .ai-tag { padding: 2px 5px; font-size: 12px; }
  .ai-panel, .ai-choices { gap: 6px; }
  .ai-choice { min-height: 44px; padding: 6px 10px; font-size: 12px; }
  .ai-hint { padding: 4px 10px; font-size: 13px; }
  .ai-post { padding: 8px 12px; }
  .ai-post-head { margin-bottom: 4px; padding-bottom: 4px; font-size: 12px; }
  .ai-caption, .ai-feedback, .ai-likes { margin: 4px 0; }
  .ai-stars { font-size: 20px; }
  .ai.is-picked { grid-template-areas: "progress panel" "reaction panel" "reaction next"; }
  .ai.is-picked .ai-product { display: none; }
  .ai.is-picked .ai-panel { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-heart { animation: none; }
}

/* ---------- 정보처리실: 타자 속도 재기 ---------- */
.typing { display: grid; gap: 12px; max-width: 720px; margin: 0 auto; color: var(--navy); }
.typing > * { min-width: 0; }
.typing-guide { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--paper); border: 1px solid var(--line); }
.typing-guide p { margin: 0; font-size: 14px; }
.typing-monitor { flex: 0 0 48px; }
.typing-monitor img { display: block; image-rendering: pixelated; }
.typing-emoji { font-size: 32px; }
.typing-target { margin: 0; padding: 14px; background: #fff; border: 2px solid var(--navy); font-size: 19px; line-height: 1.9; white-space: pre-wrap; word-break: break-all; }
.typing-target span { border: 1px solid transparent; border-radius: 2px; }
.typing-target .typing-correct { color: var(--green); }
.typing-target .typing-wrong { color: #c8402e; text-decoration: underline; background: #fde8e6; }
.typing-target .typing-current { border-color: var(--navy); }
.typing-target .typing-pending { border-color: #87909b; color: var(--muted); }
.typing-input, .rain-input { width: 100%; min-width: 0; min-height: 48px; padding: 10px; font: 16px/1.5 var(--font); color: var(--navy); background: #fff; border: 2px solid var(--line-strong); border-radius: 0; }
.typing-input { resize: vertical; }
.typing-stats { text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.typing-actions { display: flex; gap: 8px; }
.typing-actions .btn { flex: 1; min-width: 44px; }
.typing-summary, .rain-summary { color: var(--navy); }
.typing-speed, .rain-total { display: block; font-family: var(--font-title); font-size: clamp(24px, 5vw, 34px); }
.typing-detail, .rain-detail { margin: 4px 0 0; font-size: 14px; }

/* ---------- 사무자동화실: 타자 소나기 ---------- */
.rain-intro { display: grid; gap: 16px; max-width: 720px; margin: 0 auto; color: var(--navy); }
.rain-rules { margin: 0; padding-left: 24px; }
.rain-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rain-item-guide { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line-strong); background: var(--paper); }
.rain-item-guide img, .rain-word img, .rain-emoji { flex-shrink: 0; width: 32px; height: 32px; image-rendering: pixelated; }
.rain-emoji { display: inline-grid; place-items: center; font-size: 25px; }
.rain-item-description p { margin: 2px 0 0; font-size: 13px; }
.rain { display: grid; gap: 12px; grid-template-areas: "status" "sky" "controls"; color: var(--navy); }
.rain > * { min-width: 0; }
.rain-status { grid-area: status; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rain-lives { color: #c8402e; letter-spacing: 2px; }
.rain-lives span { display: inline-block; }
.rain-effects { color: var(--green); }
.rain-sky { grid-area: sky; position: relative; overflow: hidden; height: 320px; border: 2px solid var(--navy); background: linear-gradient(#eaf7ff, var(--paper)); }
.rain-sky::after { content: ""; position: absolute; inset: auto 0 0; height: 10px; border-top: 2px solid var(--navy); background: #e8c48a; }
.rain-word { position: absolute; width: calc(20% - 6px); margin-left: 2px; display: flex; flex-direction: column; align-items: center; padding: 5px 2px; border: 2px solid var(--navy); background: #fff; box-shadow: var(--pixel-shadow); font-size: 16px; font-weight: 700; line-height: 1.3; text-align: center; overflow-wrap: anywhere; word-break: break-all; }
.rain-item { background: #fff4e0; border-color: var(--orange); }
.rain-controls { grid-area: controls; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.rain-controls .btn, .rain-start { min-width: 44px; min-height: 44px; }
.rain-message { margin: 0; }
.rain-burst { animation: rain-pop .25s ease-out forwards; z-index: 1; }
.rain-shake { animation: rain-shake .25s ease-in-out; }
@keyframes rain-pop { to { transform: scale(1.25); opacity: 0; } }
@keyframes rain-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

@media (max-width: 760px) {
  .typing { gap: 8px; }
  .typing-target { padding: 10px; font-size: 17px; line-height: 1.8; }
  .typing-guide { padding: 4px 8px; gap: 8px; }
  .typing-guide p { font-size: 13px; }
  .rain-items { grid-template-columns: minmax(0, 1fr); }
  .rain-sky { height: clamp(220px, 42dvh, 360px); }
  .rain-word { font-size: 14px; }
  .rain-controls { grid-template-columns: minmax(0, 1fr) auto; }
  .rain-stop { grid-column: 1 / -1; }
  .rain-status { gap: 4px 12px; }
}

/* 가로 화면: 문장과 입력을 가깝게, 소나기는 왼쪽에 둡니다. */
@media (max-height: 500px) and (orientation: landscape) {
  .typing { gap: 6px; }
  .typing-guide { display: none; }
  .typing-target { padding: 8px; font-size: 16px; line-height: 1.6; }
  .typing-input { padding: 6px 10px; }
  .typing-actions .btn { padding: 6px 12px; }
  .rain { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-areas: "sky status" "sky controls"; gap: 8px 12px; align-items: start; }
  .rain-sky { height: 160px; }
  .rain-status { gap: 2px 10px; font-size: 13px; }
  .rain-controls { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .rain-input { grid-column: 1 / -1; }
  .rain-controls .btn { padding: 6px 10px; }
  .rain-stop { grid-column: auto; }
  .rain-word { font-size: 14px; }
  .rain-intro { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .rain-items { grid-column: 2; grid-row: 1 / 3; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .rain-item-guide { padding: 3px 8px; }
  .rain-item-description p { font-size: 12px; }
  .rain-start { align-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  .rain-burst, .rain-shake { animation: none; }
}

/* ---------- 조리제빵실: n.00초 빵 굽기 ---------- */
.bakery-game {
  display: grid; gap: 10px; color: var(--navy); text-align: center;
  grid-template-areas: "progress" "target" "tip" "clock" "bread" "feedback" "button";
}
.bakery-game > * { min-width: 0; }
.bakery-progress { grid-area: progress; margin: 0; font-size: 14px; font-weight: 700; color: var(--green); }
.bakery-target { grid-area: target; margin: 0; font-family: var(--font-title); font-size: 28px; }
.bakery-tip { grid-area: tip; margin: 0; font-size: 14px; color: var(--muted); }
.bakery-clock { grid-area: clock; align-self: center; }
.bakery-time {
  margin: 0; font-family: var(--font-title); font-size: 48px; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.bakery-time.bakery-hidden { color: var(--muted); }
.bakery-guide { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.bakery-hidden-event .bakery-guide { color: var(--orange); font-weight: 700; }
.bakery-bread { grid-area: bread; justify-self: center; align-self: center; width: 128px; height: 128px; image-rendering: pixelated; }
.bakery-feedback { grid-area: feedback; }
.bakery-error, .bakery-grade { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.bakery-stars { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: 2px; color: #e0a21e; }
.bakery-button { grid-area: button; width: 100%; min-height: 72px; font-size: 20px; touch-action: manipulation; }
.bakery-summary { max-width: 100%; color: var(--navy); }
.bakery-total { display: block; font-family: var(--font-title); font-size: clamp(24px, 5vw, 34px); }
.bakery-detail { margin: 4px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bakery-picked .bakery-bread { animation: bakery-rise .3s ease-out; }
.bakery-miss .bakery-button { animation: bakery-shake .25s ease-in-out; }
@keyframes bakery-rise { from { transform: translateY(6px); opacity: .5; } }
@keyframes bakery-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* PC: 왼쪽 빵, 오른쪽 숫자와 버튼 */
@media (min-width: 761px) {
  .bakery-game {
    grid-template-columns: minmax(160px, 1fr) minmax(0, 1.5fr); gap: 12px 24px;
    grid-template-areas: "progress progress" "target target" "tip tip" "bread clock" "bread feedback" "bread button";
  }
  .bakery-bread { width: 160px; height: 160px; }
  .bakery-time { font-size: 64px; }
}

/* 휴대폰 가로: 두 열로 눌러 담고 팁을 숨깁니다. */
@media (max-height: 500px) and (orientation: landscape) {
  .bakery-game {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 6px 16px;
    grid-template-areas: "progress clock" "target clock" "bread feedback" "bread button";
  }
  .bakery-tip { display: none; }
  .bakery-target { font-size: 24px; }
  .bakery-time { font-size: 40px; }
  .bakery-bread { width: 112px; height: 112px; }
  .bakery-guide { margin-top: 4px; font-size: 12px; }
  .bakery-button { min-height: 56px; font-size: 18px; }
  .bakery-error, .bakery-grade { margin-bottom: 2px; font-size: 13px; }
  .bakery-stars { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .bakery-picked .bakery-bread, .bakery-miss .bakery-button { animation: none; }
}

/* ---------- 커리어존: 내 취향 찾기 ---------- */
.career-game, .career-summary { width: 100%; max-width: 720px; margin: 0 auto; color: var(--navy); overflow-wrap: anywhere; }
.career-game { display: grid; gap: 14px; }
.career-game > *, .career-summary > * { min-width: 0; }
.career-intro { text-align: center; padding: 18px 0; }
.career-intro p { margin: 14px 0 20px; }
.career-title { margin: 0; font-family: var(--font-title); font-size: 24px; line-height: 1.4; }
.career-progress { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--green); }
.career-choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.career-choice {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 14px;
  font: 700 16px/1.5 var(--font); text-align: left; overflow-wrap: anywhere; touch-action: manipulation;
}
.career-choice-emoji { flex-shrink: 0; font-size: 26px; }
.career-choice-text { min-width: 0; }
.career-reply { padding: 14px 18px; background: var(--green-soft); border-left: 5px solid var(--green); color: var(--ink); }
.career-reply-other { background: #fff4e0; border-left-color: var(--orange); }
.career-reply-text { margin: 0; }
.career-reply-animate { animation: career-reply-in .2s ease-out; }
.career-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; font-size: 14px; color: var(--navy); }
.career-start, .career-next { min-height: 44px; min-width: 44px; }
.career-next { width: 100%; }
.career-picture { display: block; width: 96px; height: 96px; margin: 0 auto 10px; object-fit: contain; image-rendering: pixelated; }
.career-count-help { margin: 8px 0; font-size: 13px; color: var(--muted); }
.career-emoji { display: grid; place-items: center; font-size: 60px; }
.career-activity { margin: 8px 0 16px; font-size: 15px; }
.career-bars { display: grid; gap: 8px; margin: 16px 0; text-align: left; }
.career-bar-row { display: grid; grid-template-columns: minmax(0, 132px) minmax(0, 1fr) 32px; gap: 8px; align-items: center; font-size: 14px; }
.career-bar-track { height: 14px; background: var(--green-soft); }
.career-bar-fill { height: 100%; background: var(--navy); }
.career-count { text-align: right; font-variant-numeric: tabular-nums; }
@keyframes career-reply-in { from { opacity: 0; transform: translateY(4px); } }

@media (min-width: 761px) {
  .career-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 휴대폰 가로: 두 열로 표시하되 보기의 56px 터치 영역은 유지합니다. */
@media (max-height: 500px) and (orientation: landscape) {
  .career-game { gap: 8px; }
  .career-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .career-title { font-size: 20px; }
  .career-choice { padding: 8px 10px; font-size: 14px; gap: 8px; }
  .career-choice-emoji { font-size: 22px; }
  .career-reply { padding: 10px 14px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .career-reply-animate { animation: none; }
}

/* ---------- 금융실습실: 피싱 탐정 ---------- */
.phishing-intro, .cashier-intro { max-width: 640px; margin: 0 auto; text-align: center; color: var(--navy); }
.phishing-intro h3, .cashier-intro h3 { font: 24px/1.4 var(--font-title); margin: 8px 0; }
.phishing-intro ul, .cashier-intro ul { text-align: left; padding-left: 24px; font-size: 15px; }
.phishing-start, .cashier-start { width: 100%; min-height: 56px; }
.phishing-detective { display: block; width: 128px; height: 128px; margin: auto; image-rendering: pixelated; font-size: 80px; }
.phishing-game { display: grid; gap: 14px; grid-template-areas: "stats" "phone" "panel"; color: var(--navy); }
.phishing-game > *, .cashier-game > * { min-width: 0; }
.phishing-stats { grid-area: stats; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; font-variant-numeric: tabular-nums; }
.phishing-wallet { font: 24px/1.4 var(--font-title); }
.phishing-negative { color: #c8402e; }
.phishing-progress, .phishing-combo { font-size: 14px; font-weight: 700; }
.phishing-phone { grid-area: phone; width: 100%; max-width: 360px; justify-self: center; min-height: 250px; padding: 14px; border: 6px solid var(--navy); border-radius: 26px; background: #eaf7ff; box-shadow: var(--pixel-shadow); }
.phishing-phone-head { display: flex; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid #aebfe3; font-size: 13px; font-weight: 700; }
.phishing-phone-head span { font-size: 9px; }
.phishing-from { font-size: 13px; font-weight: 700; margin: 10px 0; }
.phishing-timer { height: 8px; border-radius: 4px; overflow: hidden; background: #cfe8f7; }
.phishing-timer div { height: 100%; width: 100%; background: var(--green); }
.phishing-timer .phishing-urgent { background: #c8402e; }
.phishing-bubble { margin: 14px 0 4px; padding: 14px; background: #fff; border: 1px solid #aebfe3; border-radius: 14px 14px 14px 2px; overflow-wrap: anywhere; font-size: 16px; }
.phishing-panel { grid-area: panel; display: flex; flex-direction: column; gap: 10px; }
.phishing-event, .cashier-event { margin: 0; padding: 8px 12px; background: #fff4e0; color: var(--orange); font-size: 14px; font-weight: 700; border-left: 4px solid var(--orange); }
.phishing-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.phishing-choices .btn { display: flex; flex-direction: column; gap: 2px; min-height: 64px; font-size: 20px; padding: 10px 6px; }
.phishing-real { background: var(--green-soft); border-color: var(--green); }
.phishing-scam { background: #fff4e0; border-color: var(--orange); }
.phishing-key, .cashier-key { font: 12px/1.2 var(--font); color: var(--muted); }
.phishing-feedback { font-size: 15px; }
.phishing-feedback p { margin: 4px 0 0; }
.phishing-feedback:empty, .phishing-clue-result:empty { display: none; }
.phishing-clues { display: grid; gap: 6px; }
.phishing-clue { min-width: 44px; min-height: 44px; padding: 8px 12px; text-align: left; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.phishing-found { border-color: var(--green); background: var(--green-soft); font-weight: 700; }
.phishing-found::before { content: ""; display: inline-block; width: 20px; height: 20px; vertical-align: middle; background: url("../img/ui/magnifier.png") center / contain no-repeat; image-rendering: pixelated; }
.phishing-clue-result { margin: 0; font-size: 14px; color: var(--green); }
.phishing-next, .phishing-open { min-height: 48px; width: 100%; }
.phishing-summary, .cashier-summary { color: var(--navy); overflow-wrap: anywhere; }
.phishing-total, .cashier-summary-total { display: block; font: clamp(24px, 5vw, 34px)/1.4 var(--font-title); }
.phishing-summary p, .cashier-summary p { margin: 6px 0; font-size: 14px; }
.phishing-rank { color: var(--green); font-weight: 700; }
.phishing-arrive { animation: phishing-arrive .2s ease-out; }
.phishing-shake { animation: phishing-shake .25s ease-in-out; }
.phishing-gain { animation: phishing-gain .4s ease-out; }
.phishing-loss { animation: phishing-loss .4s ease-out; }
@keyframes phishing-arrive { from { transform: translateY(10px); opacity: 0; } }
@keyframes phishing-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes phishing-gain { 0%, 75% { color: var(--green); background: var(--green-soft); } }
@keyframes phishing-loss { 0%, 75% { color: #c8402e; background: #fde8e6; } }

/* ---------- 전산회계1실: 매점 계산왕 ---------- */
.cashier-intro-art { display: flex; justify-content: center; gap: 12px; margin: 20px 0; }
.cashier-intro-art img, .cashier-game img { image-rendering: pixelated; object-fit: contain; }
.cashier-game { display: grid; gap: 12px; color: var(--navy); }
.cashier-stats { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.cashier-time { font: 32px/1.2 var(--font-title); }
.cashier-urgent { color: #c8402e; }
.cashier-sales { color: var(--green); }
.cashier-counter { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: center; }
.cashier-customer { display: flex; align-items: center; gap: 12px; }
.cashier-person { flex-shrink: 0; width: 80px; height: 80px; display: grid; place-items: center; }
.cashier-person img { width: 100%; height: 100%; }
.cashier-emoji { display: inline-grid; place-items: center; font-size: 30px; }
.cashier-person .cashier-emoji { font-size: 60px; }
.cashier-line { margin: 0; padding: 10px 12px; border: 2px solid var(--navy); background: #fff; box-shadow: var(--pixel-shadow); font-size: 14px; }
.cashier-receipt { min-width: 0; padding: 12px; border: 2px dashed var(--line-strong); background: var(--paper); }
.cashier-receipt h3 { margin: 0 0 8px; font-size: 15px; text-align: center; }
.cashier-goods { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cashier-good { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 14px; }
.cashier-good img { width: 36px; height: 36px; }
.cashier-total { margin: 8px 0 4px; padding-top: 8px; border-top: 1px dashed var(--line-strong); font-weight: 700; }
.cashier-paid { display: block; font-size: 18px; }
.cashier-controls { display: grid; gap: 10px; }
.cashier-tray { padding: 8px 12px; border: 2px solid var(--navy); border-radius: 8px; background: #eaf7ff; }
.cashier-coins { display: flex; flex-wrap: wrap; align-content: start; height: 46px; overflow-y: auto; overflow-x: hidden; gap: 0 2px; }
.cashier-coins img { flex-shrink: 0; width: 40px; height: 40px; }
.cashier-tray-total { display: block; text-align: right; font-variant-numeric: tabular-nums; }
.cashier-money { display: flex; gap: 6px; }
.cashier-money-button { flex: 1; min-width: 44px; min-height: 76px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 6px 2px; font-size: 14px; font-weight: 700; touch-action: manipulation; }
.cashier-money-button img { width: 40px; height: 32px; }
.cashier-actions { display: flex; gap: 8px; }
.cashier-actions .btn { flex: 1; min-height: 48px; min-width: 44px; }
.cashier-feedback { min-height: 24px; margin: 0; font-size: 14px; font-weight: 700; }
.cashier-ledger { max-width: 600px; margin: auto; color: var(--navy); }
.cashier-ledger h3 { text-align: center; font: 26px/1.4 var(--font-title); }
.cashier-ledger-table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--paper); }
.cashier-ledger-table th, .cashier-ledger-table td { padding: 10px; border-bottom: 1px solid var(--line); }
.cashier-ledger-table th { text-align: left; }
.cashier-ledger-table td { text-align: right; font-variant-numeric: tabular-nums; }
.cashier-ledger-note { font-weight: 700; color: var(--green); }
.cashier-result { width: 100%; min-height: 48px; }
.cashier-drop { animation: cashier-drop .2s ease-out; }
.cashier-arrive { animation: cashier-arrive .2s ease-out; }
.cashier-shake { animation: cashier-shake .25s ease-in-out; }
@keyframes cashier-drop { from { transform: translateY(-12px); opacity: 0; } }
@keyframes cashier-arrive { from { transform: translateX(-14px); opacity: 0; } }
@keyframes cashier-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* PC: 휴대폰 오른쪽에 상태와 조작, 매점은 손님과 영수증 두 열 */
@media (min-width: 761px) {
  .phishing-game { grid-template-columns: 360px minmax(0, 1fr); grid-template-areas: "phone stats" "phone panel"; gap: 14px 24px; align-items: start; max-width: 840px; margin: auto; }
  .phishing-phone { min-height: 390px; }
  .phishing-stats { align-self: end; }
  .cashier-counter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .cashier-customer { flex-direction: column; }
  .cashier-person { width: 128px; height: 128px; }
  .cashier-controls { max-width: 720px; width: 100%; margin: auto; }
}

/* 휴대폰 가로: 두 열로 담고 세로 스크롤은 허용합니다. */
@media (max-height: 500px) and (orientation: landscape) {
  .phishing-game { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "phone stats" "phone panel"; gap: 8px 14px; }
  .phishing-phone { min-height: 220px; padding: 10px; border-width: 4px; border-radius: 18px; }
  .phishing-bubble { font-size: 14px; padding: 10px; margin-top: 8px; }
  .phishing-wallet { font-size: 20px; }
  .phishing-choices .btn { min-height: 48px; font-size: 16px; padding: 6px; }
  .phishing-panel { gap: 6px; }
  .phishing-event, .cashier-event, .phishing-feedback { font-size: 12px; }
  .phishing-detective { width: 80px; height: 80px; }
  .cashier-game { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; }
  .cashier-stats, .cashier-event { grid-column: 1 / -1; }
  .cashier-counter { grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; }
  .cashier-customer { flex-direction: row; gap: 6px; }
  .cashier-person { width: 48px; height: 48px; }
  .cashier-line { font-size: 12px; padding: 6px; }
  .cashier-receipt { padding: 8px; }
  .cashier-receipt h3 { font-size: 13px; margin-bottom: 4px; }
  .cashier-good { font-size: 12px; grid-template-columns: 24px minmax(0, 1fr) auto; }
  .cashier-good img { width: 24px; height: 24px; }
  .cashier-total { margin-top: 4px; padding-top: 4px; font-size: 13px; }
  .cashier-paid { font-size: 15px; }
  .cashier-controls { gap: 6px; align-content: start; }
  .cashier-money-button { min-height: 60px; font-size: 12px; }
  .cashier-money-button img { height: 24px; }
  .cashier-feedback { font-size: 12px; }
}

@media (pointer: coarse) {
  .phishing-key, .cashier-key { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .phishing-arrive, .phishing-shake, .phishing-gain, .phishing-loss,
  .cashier-drop, .cashier-arrive, .cashier-shake { animation: none; }
}

/* ---------- 도장판 (스탬프 투어) ---------- */
.tour-position .stamp-open { font-weight: 700; border-color: var(--navy); background: #fff; }
.tour-position .stamp-open.is-complete { background: var(--green); border-color: var(--green); color: #fff; }
#stamps-close { flex-shrink: 0; width: 44px; height: 44px; border: 0; background: none; font-size: 20px; }
#stamps { width: min(620px, 100% - 24px); overflow: hidden; }
#stamps[open] { display: flex; flex-direction: column; }
#stamps .game-head { flex: none; }
.stamp-summary { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--navy); white-space: nowrap; }
#stamps-progress { display: block; appearance: none; width: 100%; height: 5px; border: 0; margin-bottom: 18px; background: var(--line); color: var(--green); }
#stamps-progress::-webkit-progress-bar { background: var(--line); }
#stamps-progress::-webkit-progress-value { background: var(--green); }
#stamps-progress::-moz-progress-bar { background: var(--green); }
.stamp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.stamp-floor h3 { margin: 0 0 8px; font-size: 14px; color: var(--green); }
.stamp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stamp-grid > li { display: flex; min-width: 0; }
.stamp-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 100%; min-height: 114px; padding: 8px 3px;
  background: var(--paper); border: 1px solid var(--line);
  color: var(--navy); font: inherit; cursor: pointer; text-align: center;
}
.stamp-item:hover { border-color: var(--green); background: var(--green-soft); }
.stamp-item strong { font-size: 12px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.stamp-seal {
  display: grid; place-items: center; width: 52px; height: 52px; flex: none;
  border: 1px dashed var(--line-strong); border-radius: 50%;
  color: var(--muted); font-weight: 700;
}
.stamp-item:not(.is-got) .stamp-seal img { filter: grayscale(1); opacity: .25; }
.stamp-item.is-got { border-color: var(--line-strong); background: #fff; }
.stamp-item.is-got .stamp-seal { border-color: transparent; }
.stamp-stars { margin-top: auto; font-size: 13px; letter-spacing: 1px; color: var(--orange); }
.stamp-item:not(.is-got) .stamp-stars { color: var(--muted); }
.stamp-done[hidden] { display: none; }
.stamp-done { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.stamp-done .btn { flex: 1 1 auto; }
.stamp-reset-area { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line-strong); }
.stamp-reset-panel { margin-top: 12px; padding: 12px; border: 2px solid #9b352c; background: #fff6e6; }
.stamp-reset-panel[hidden] { display: none; }
.stamp-reset-panel p { margin: 0 0 10px; font-size: 14px; }
.stamp-reset-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stamp-reset-confirm { background: #9b352c; border-color: #9b352c; color: #fff; }
.stamp-reset-status { margin: 10px 0 0; font-size: 14px; color: var(--navy); }
.stamp-reset-status:empty { display: none; }
.game-result-board {
  min-height: 44px; padding: 8px 12px; border: 0; background: none;
  color: var(--navy); font-weight: 700; font-size: 14px; text-decoration: underline;
}

/* ---------- AI 면접실: AI 면접 도전 ---------- */
.interview-intro { display: grid; gap: 12px; justify-items: center; max-width: 560px; margin: 0 auto; text-align: center; color: var(--navy); }
.interview-intro h3 { margin: 0; font-family: var(--font-title); font-size: 24px; }
.interview-intro ul { margin: 0; padding-left: 20px; text-align: left; font-size: 15px; }
.interview-intro .btn { width: 100%; min-height: 48px; }
.interview-face { display: grid; place-items: center; }
.interview-robot { display: block; width: 96px; height: 96px; image-rendering: pixelated; }
span.interview-robot { display: grid; place-items: center; font-size: 64px; }
.interview-game {
  display: grid; gap: 10px; max-width: 640px; margin: 0 auto; color: var(--navy);
  grid-template-areas: "stats" "stage" "event" "timer" "answers" "feedback" "next";
}
.interview-game > * { min-width: 0; }
.interview-stats { grid-area: stats; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; font-weight: 700; }
.interview-gauge { height: 16px; background: #fff; border: 2px solid var(--navy); }
.interview-gauge-fill { height: 100%; width: 40%; background: #e85d75; transition: width .4s ease-out; }
.interview-score { white-space: nowrap; font-variant-numeric: tabular-nums; }
.interview-stage { grid-area: stage; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; }
.interview-bubble { position: relative; padding: 12px 14px; background: #fff; border: 2px solid var(--navy); box-shadow: var(--pixel-shadow); }
.interview-bubble::before {
  content: ""; position: absolute; left: -9px; top: 50%; width: 12px; height: 12px;
  transform: translateY(-50%) rotate(45deg); background: #fff; border-left: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
}
.interview-question { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.4; }
.interview-reaction { margin: 6px 0 0; font-size: 14px; font-weight: 700; color: var(--green); }
.interview-reaction:empty { display: none; }
.interview-event { grid-area: event; margin: 0; font-size: 14px; font-weight: 700; color: var(--orange); }
.interview-event:empty { display: none; }
.interview-timer { grid-area: timer; height: 8px; background: var(--green-soft); }
.interview-timer div { height: 100%; width: 100%; background: var(--green); }
.interview-rush .interview-timer div { background: var(--orange); }
.interview-timer .interview-urgent { background: #c8402e; }
.interview-answers { grid-area: answers; display: grid; gap: 8px; align-content: start; }
.interview-answer {
  width: 100%; min-height: 52px; padding: 10px 14px; text-align: left;
  font: 700 15px/1.45 var(--font); overflow-wrap: anywhere; touch-action: manipulation;
}
.interview-answer.is-best::after { content: " ✓"; }
.interview-feedback { grid-area: feedback; }
.interview-feedback strong { display: block; font-size: 16px; }
.interview-feedback .is-plus { color: var(--green); }
.interview-feedback .is-minus { color: #c8402e; }
.interview-feedback p { margin: 2px 0 0; font-size: 14px; }
.interview-next { grid-area: next; width: 100%; min-height: 48px; }
.interview-summary { display: grid; justify-items: center; gap: 4px; color: var(--navy); }
.interview-summary .interview-robot { width: 80px; height: 80px; }
.interview-grade { font-family: var(--font-title); font-size: clamp(24px, 5vw, 32px); }
.interview-detail { margin: 0; font-size: 14px; }
.interview-pop { animation: interview-pop .3s ease-out; }
.interview-shake { animation: interview-shake .3s ease-in-out; }
@keyframes interview-pop { 50% { transform: translateY(-6px) scale(1.08); } }
@keyframes interview-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

@media (max-width: 760px) {
  .interview-stage { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .interview-stage .interview-robot { width: 72px; height: 72px; }
  .interview-question { font-size: 16px; }
}

/* 휴대폰 가로: 왼쪽 면접관, 오른쪽 답변 */
@media (max-height: 500px) and (orientation: landscape) {
  .interview-game {
    max-width: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 6px 12px;
    grid-template-areas: "stats answers" "stage answers" "event answers" "timer answers" "feedback next";
  }
  .interview-stage { grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }
  .interview-stage .interview-robot { width: 56px; height: 56px; }
  .interview-bubble { padding: 6px 10px; }
  .interview-question { font-size: 14px; }
  .interview-reaction, .interview-feedback p { font-size: 12px; }
  .interview-answers { gap: 6px; }
  .interview-answer { min-height: 44px; padding: 6px 10px; font-size: 13px; }
  .interview-next { min-height: 44px; align-self: end; }
  .interview-intro { grid-template-columns: auto minmax(0, 1fr); text-align: left; justify-items: start; }
  .interview-intro .interview-face { grid-row: 1 / 4; }
}

@media (prefers-reduced-motion: reduce) {
  .interview-pop, .interview-shake { animation: none; }
  .interview-gauge-fill { transition: none; }
}
