* {
  box-sizing:border-box
}
body {
  margin:0;
  background:#f4f6f0;
  color:#173b32;
  font-family:Arial,"Malgun Gothic",sans-serif
}
main {
  max-width:1488px;
  margin:0 auto;
  padding:38px 24px
}
header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:24px
}
.eyebrow {
  font-size:11px;
  font-weight:800;
  letter-spacing:2px;
  color:#528475
}
h1 {
  font-size:32px;
  letter-spacing:-1.5px;
  margin:8px 0 0
}
.tag {
  font-size:10px;
  letter-spacing:1.4px;
  border:1px solid #cddbd1;
  border-radius:20px;
  padding:10px 15px
}
#game {
  position:relative;
  aspect-ratio:3/1;
  overflow:hidden;
  border-radius:22px;
  background:#5ac5f2;
  box-shadow:0 18px 48px #183c3220;
  touch-action:none;
  user-select:none
}
#world {
  position:absolute;
  width:1440px;
  height:480px;
  transform-origin:top left
}
#background,#entities {
  position:absolute;
  inset:0
}
.map {
  position:absolute;
  top:0;
  height:480px;
  width:1440px
}
#map-dim {
  position:absolute;
  inset:0;
  background:#000;
  opacity:0;
  pointer-events:none
}
.entity {
  position:absolute;
  object-fit:contain;
  will-change:transform
}
#runner {
  position:absolute;
  width:132px;
  height:132px;
  object-fit:contain;
  will-change:transform;
  z-index:3
}
#runner.hurt {
  animation:blink .16s infinite
}
#runner.slow {
  filter:drop-shadow(0 0 8px #30c8ff)
}
#shadow {
  position:absolute;
  left:245px;
  top:417px;
  width:80px;
  height:10px;
  border-radius:50%;
  background:#183c3238
}
.hud {
  position:absolute;
  top:22px;
  left:26px;
  right:26px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  z-index:5
}
.stats {
  display:flex;
  gap:28px;
  background:#ffffffeb;
  border-radius:16px;
  padding:14px 22px
}
.stats small {
  display:block;
  font-size:9px;
  letter-spacing:1.4px;
  color:#68857a;
  margin-bottom:4px
}
.stats strong {
  font-size:23px;
  font-variant-numeric:tabular-nums
}
.right {
  display:flex;
  align-items:center;
  gap:18px
}
#hearts {
  color:#fa5861;
  font-size:26px;
  text-shadow:0 2px white
}
button {
  cursor:pointer;
  font:inherit;
  border:0
}
button:disabled {
  cursor:wait;
  opacity:.6
}
#pause {
  width:40px;
  height:40px;
  border-radius:50%;
  background:#fffffff0;
  color:#173b32;
  font-weight:bold
}
#overlay {
  position:absolute;
  inset:0;
  z-index:6;
  background:#e5f5ef50;
  display:flex;
  align-items:center;
  justify-content:center;
  backdrop-filter:blur(3px)
}
#overlay.hidden {
  display:none
}
.panel {
  text-align:center;
  padding:24px 36px;
  background:#fffef4f2;
  border-radius:24px;
  box-shadow:0 12px 40px #173b3220
}
.panel h2 {
  font-size:30px;
  line-height:1.2;
  letter-spacing:-1px;
  margin:12px 0
}
.panel p {
  font-size:13px;
  line-height:1.8;
  color:#527366
}
.primary {
  padding:14px 32px;
  border-radius:30px;
  background:#145a43;
  color:white;
  font-weight:bold;
  min-width:180px
}
.panel .hint {
  font-size:10px;
  margin-bottom:0
}
#jump {
  position:absolute;
  right:24px;
  bottom:22px;
  background:#ffffffda;
  border:1px solid #ffffff;
  border-radius:18px;
  width:70px;
  height:64px;
  color:#185b45;
  font-weight:bold;
  font-size:26px;
  z-index:5
}
#jump span {
  display:block;
  font-size:9px;
  letter-spacing:1px
}
#status {
  position:absolute;
  left:50%;
  top:24px;
  transform:translateX(-50%);
  background:#154f45e8;
  color:#fff;
  border-radius:20px;
  padding:9px 16px;
  font-size:13px;
  z-index:5
}
#status:empty {
  display:none
}
.popup {
  position:absolute;
  color:#155940;
  font-weight:bold;
  font-size:22px;
  z-index:4;
  pointer-events:none;
  text-shadow:0 1px 3px white
}
footer {
  display:flex;
  justify-content:space-between;
  gap:14px;
  margin-top:22px;
  font-size:12px;
  color:#6b8178
}
kbd {
  background:white;
  border:1px solid #dbe3db;
  padding:4px 6px;
  border-radius:5px;
  font-size:10px
}
@keyframes blink {
  50% {
    opacity:.25
  }
}
@media(max-width:700px) {
  main {
    padding:20px 12px
  }
  h1 {
    font-size:24px
  }
  .tag {
    display:none
  }
  #game {
    aspect-ratio:1.5/1
  }
  .hud {
    top:12px;
    left:12px;
    right:12px
  }
  .stats {
    gap:12px;
    padding:9px 12px
  }
  .stats strong {
    font-size:16px
  }
  .stats small {
    font-size:8px
  }
  #hearts {
    font-size:18px
  }
  .right {
    gap:8px
  }
  #pause {
    width:32px;
    height:32px
  }
  .panel {
    padding:18px
  }
  .panel h2 {
    font-size:24px
  }
  .panel p {
    font-size:11px
  }
  footer {
    flex-direction:column;
    font-size:10px
  }
  #status {
    top:72px;
    font-size:11px;
    white-space:nowrap
  }
  #jump {
    right:12px;
    bottom:12px;
    width:54px;
    height:52px
  }
}
/* 게임 가로 폭은 기존의 60%, 세로 높이는 유지합니다. */
#game {
  width: 60%;
  margin-inline: auto;
  aspect-ratio: 1.8 / 1;
}
@media (max-width: 700px) {
  #game {
    aspect-ratio: 0.9 / 1;
  }
}
/* 실제 충돌 판정 디버그 표시. 게임과 같은 좌표/배율을 사용합니다. */
#hitbox-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
#hitbox-layer[hidden] {
  display: none;
}
.hitbox {
  position: absolute;
  border: 2px solid #ff0000;
  background: transparent;
  color: #ff0000;
  font: bold 10px Arial, sans-serif;
  white-space: nowrap;
}
#hitbox-toggle {
  display: inline-block;
  color: #173b32;
  background: white;
}
#hitbox-toggle[aria-pressed="true"] {
  border-color: #16862a;
  background: #e7f4e8;
}
#slide-runner {
  position:absolute;
  z-index:3;
  pointer-events:none
}
#runner[hidden],#slide-runner[hidden] {
  display:none
}
#slide-runner.hurt {
  animation:blink .16s infinite
}
#slide-runner.slow {
  filter:drop-shadow(0 0 8px #30c8ff)
}
#slide {
  position:absolute;
  right:106px;
  bottom:22px;
  background:#ffffffda;
  border:1px solid white;
  border-radius:18px;
  width:70px;
  height:64px;
  color:#185b45;
  font-weight:bold;
  font-size:26px;
  z-index:5
}
#slide span {
  display:block;
  font-size:9px;
  letter-spacing:1px
}
#slide:disabled {
  cursor:default;
  opacity:.45
}
@media(max-width:700px) {
  #slide {
    right:78px;
    bottom:12px;
    width:54px;
    height:52px
  }
}
.barrier-hitbox {
  position:absolute;
  overflow:visible;
  pointer-events:none
}
/* 왼쪽 기둥(뒤) → 캐릭터 → 가로봉·오른쪽 기둥(앞) → 판정 표시 */
#barrier-rear,#barrier-front {
  position:absolute;
  inset:0;
  pointer-events:none
}
#barrier-rear {
  z-index:2
}
#barrier-front {
  z-index:4
}
#hitbox-layer {
  z-index:5
}
/* 재료 보관함과 컬렉션 */
.workshop {
  margin-top:42px;
  padding:30px;
  background:#fffef8;
  border:1px solid #dce6dc;
  border-radius:24px
}
.workshop-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  margin-bottom:30px
}
.workshop h2 {
  font-size:26px;
  letter-spacing:-1px;
  margin:10px 0
}
.workshop-heading p {
  font-size:13px;
  color:#6b8178
}
.collection-progress {
  min-width:145px;
  text-align:right
}
.collection-progress strong {
  display:block;
  font-size:30px
}
.collection-progress span {
  font-size:11px;
  color:#68857a
}
progress {
  display:block;
  margin-top:10px;
  width:145px;
  height:6px;
  accent-color:#218c68
}
.inventory-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:24px 0 14px
}
.inventory-heading h3 {
  font-size:16px;
  margin:0
}
.inventory-heading>span {
  font-size:11px;
  color:#6b8178
}
.inventory-grid {
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:12px
}
.ingredient-tile {
  display:grid;
  grid-template-columns:42px 1fr;
  gap:5px 10px;
  padding:16px;
  background:#f2f5ee;
  border-radius:14px;
  align-items:center
}
.ingredient-tile img {
  width:42px;
  height:42px;
  object-fit:contain;
  grid-row:span 3
}
.ingredient-tile span {
  font-size:12px
}
.ingredient-tile strong {
  font-size:20px
}
.ingredient-tile small {
  font-size:10px;
  color:#738478
}
.collection-notice {
  font-size:12px;
  line-height:1.7;
  color:#527366;
  min-height:22px
}
.recipe-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px
}
.recipe-card {
  position:relative;
  border:1px solid #e0e6db;
  border-radius:18px;
  padding:20px;
  background:#fafbf7
}
.recipe-card.collected {
  border-color:#70aa8c;
  background:#f3faf1
}
.recipe-badge {
  display:inline-block;
  border-radius:20px;
  padding:5px 9px;
  font-size:9px;
  color:#7f887c;
  background:#e9eee4
}
.collected .recipe-badge {
  background:#d8edda;
  color:#236e4b
}
.product-art {
  height:155px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  margin:18px 0;
  position:relative
}
.product-art img {
  width:100%;
  height:155px;
  object-fit:contain;
  position:absolute;
  inset:0
}
.product-bottle {
  width:64px;
  height:114px;
  border:2px solid var(--product-color);
  border-radius:20px 20px 12px 12px;
  position:relative;
  background:linear-gradient(90deg,#ffffff80,var(--product-color));
  opacity:.55;
  display:flex;
  align-items:center;
  justify-content:center
}
.collected .product-bottle {
  opacity:1
}
.product-bottle:before {
  content:'';
  position:absolute;
  top:-28px;
  width:24px;
  height:28px;
  background:var(--product-color);
  border-radius:5px 5px 0 0
}
.product-bottle span {
  display:block;
  background:#fffef3ed;
  text-align:center;
  font-size:9px;
  width:54px;
  padding:12px 3px;
  color:#224c3d
}
.product-bottle[hidden] {
  display:none
}
.recipe-number {
  font-size:9px;
  letter-spacing:1.3px;
  color:#819080
}
.recipe-card h4 {
  font-size:18px;
  margin:8px 0
}
.recipe-owned {
  font-size:10px;
  color:#768674;
  min-height:28px;
  margin-bottom:14px
}
.recipe-needs {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  min-height:70px
}
.need-chip {
  display:flex;
  align-items:center;
  gap:4px;
  border:1px solid #e5d9d2;
  border-radius:8px;
  padding:4px;
  font-size:10px;
  color:#aa705d
}
.need-chip img {
  width:20px;
  height:20px;
  object-fit:contain
}
.need-chip.enough {
  color:#297857;
  border-color:#b9d4b8;
  background:#edf5e8
}
.craft-button {
  width:100%;
  padding:12px;
  border-radius:10px;
  background:#175f46;
  color:white;
  font-size:12px;
  font-weight:bold;
  margin-top:14px
}
.craft-button:disabled {
  background:#e6ebe0;
  color:#87917f;
  cursor:default;
  opacity:1
}
.recipe-note {
  font-size:10px;
  color:#87917f;
  line-height:1.8;
  margin-top:22px
}
@media(max-width:1050px) {
  .inventory-grid {
    grid-template-columns:repeat(3,1fr)
  }
  .recipe-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
}
@media(max-width:550px) {
  .workshop {
    padding:18px
  }
  .workshop-heading {
    align-items:flex-start;
    gap:10px
  }
  .workshop h2 {
    font-size:20px
  }
  .collection-progress {
    min-width:75px
  }
  .collection-progress strong {
    font-size:22px
  }
  progress {
    width:75px
  }
  .inventory-heading {
    align-items:flex-start;
    flex-direction:column
  }
  .inventory-grid {
    grid-template-columns:repeat(2,1fr)
  }
  .ingredient-tile {
    padding:12px
  }
  .recipe-card {
    padding:12px
  }
  .recipe-card h4 {
    font-size:15px
  }
  .recipe-needs {
    min-height:100px
  }
}
.ingredient-craft {
  display:flex;
  align-items:center;
  gap:18px;
  padding:18px;
  margin-top:14px;
  border:1px solid #d4b99b;
  background:#fcf3e7;
  border-radius:14px
}
.ingredient-craft>img {
  width:60px;
  height:60px;
  object-fit:contain
}
.ingredient-craft strong {
  font-size:14px
}
.ingredient-craft p {
  font-size:12px;
  margin:8px 0;
  color:#765238
}
.ingredient-craft small {
  font-size:10px;
  color:#92725c
}
.ingredient-craft .craft-button {
  width:auto;
  min-width:175px;
  margin:0 0 0 auto;
  background:#754525
}
.ingredient-craft .craft-button:disabled {
  background:#e6ddce;
  color:#988779
}
@media(max-width:550px) {
  .ingredient-craft {
    flex-wrap:wrap;
    gap:12px
  }
  .ingredient-craft .craft-button {
    width:100%;
    margin:0
  }
}
.ingredient-tile {
  text-align:left;
  color:inherit;
  border:1px solid transparent;
  font-family:inherit;
  cursor:pointer
}
.ingredient-tile:hover {
  border-color:#76a68a;
  background:#eaf3e4
}
.ingredient-tile:focus-visible {
  outline:2px solid #175f46;
  outline-offset:3px
}
#ingredient-dialog {
  width:min(620px,calc(100vw - 32px));
  max-height:85vh;
  overflow-y:auto;
  padding:30px;
  border:1px solid #d8e1d3;
  border-radius:22px;
  background:#fffef8;
  color:#173b32;
  box-shadow:0 22px 80px #12382a40
}
#ingredient-dialog::backdrop {
  background:#102b2466;
  backdrop-filter:blur(3px)
}
.dialog-close {
  position:absolute;
  right:12px;
  top:12px;
  width:34px;
  height:34px;
  border-radius:50%;
  background:#edf2e8;
  font-size:24px;
  color:#173b32
}
.ingredient-detail-image {
  display:block;
  width:110px;
  height:110px;
  object-fit:contain;
  margin:8px auto 18px
}
#ingredient-title {
  text-align:center;
  font-size:24px
}
#ingredient-detail-count {
  text-align:center;
  color:#57735f;
  font-size:13px
}
#ingredient-description {
  font-size:12px;
  line-height:1.8
}
#ingredient-dialog-notice {
  font-size:12px;
  color:#765238;
  line-height:1.7
}
.ingredient-craft[hidden] {
  display:none
}
#ingredient-dialog .ingredient-craft {
  flex-wrap:wrap
}
#ingredient-dialog .ingredient-craft .craft-button {
  width:100%;
  margin:0
}
/* 선양 브랜드 UI: 제공된 로고의 블루를 기준으로 관리합니다. */
:root {
  --brand-blue:#0068b7;
  --brand-dark:#00457c;
  --brand-pale:#edf6ff;
  --brand-border:#d6e6f4;
  --ink:#123450;
  --muted:#6a8296
}
body {
  background:linear-gradient(180deg,#eef7ff 0,#f7faff 620px,#eef5fb 100%);
  color:var(--ink);
  font-family:"Malgun Gothic",Arial,sans-serif
}
main {
  padding-top:28px
}
header {
  padding:18px 24px;
  background:white;
  border:1px solid var(--brand-border);
  border-radius:22px;
  margin-bottom:28px;
  box-shadow:0 8px 30px #005aa608
}
.brand-heading {
  display:flex;
  align-items:center;
  gap:24px
}
.brand-logo {
  width:180px;
  height:74px;
  object-fit:contain
}
.brand-title {
  border-left:1px solid var(--brand-border);
  padding-left:24px
}
h1 {
  font-size:26px;
  margin-top:6px
}
.eyebrow {
  color:var(--brand-blue);
  letter-spacing:1.6px
}
.play-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:0 4px 18px
}
.section-index {
  font-size:11px;
  letter-spacing:1.7px;
  color:var(--brand-blue);
  font-weight:800
}
.play-heading p {
  font-size:13px;
  color:var(--muted);
  margin:0
}
#game {
  border:4px solid white;
  border-radius:24px;
  box-shadow:0 18px 50px #0068b71c
}
.stats {
  color:var(--brand-dark);
  box-shadow:0 4px 18px #00559612
}
.stats small {
  color:var(--muted)
}
#pause,#jump,#slide {
  color:var(--brand-blue)
}
#status {
  background:#0068b7ed
}
.panel {
  background:#ffffffef;
  border:1px solid #ffffff;
  box-shadow:0 18px 50px #00518c20
}
.panel p {
  color:var(--muted)
}
#overlay {
  background:#e8f4ff50
}
.primary {
  background:var(--brand-blue);
  box-shadow:0 6px 18px #0068b72b
}
.primary:hover {
  background:var(--brand-dark)
}
footer {
  color:var(--muted)
}
kbd {
  border-color:var(--brand-border)
}
#hitbox-toggle {
  color:var(--brand-blue);
  border-color:var(--brand-border);
  letter-spacing:.5px
}
#hitbox-toggle[aria-pressed="true"] {
  background:var(--brand-pale);
  border-color:#86b9e1
}
.workshop {
  background:white;
  border-color:var(--brand-border);
  padding:32px;
  border-radius:24px;
  box-shadow:0 10px 40px #0068b709
}
.workshop-heading {
  padding-bottom:24px;
  border-bottom:1px solid var(--brand-border)
}
.workshop h2 {
  color:var(--brand-dark)
}
.workshop-heading p,.inventory-heading>span,.collection-progress span {
  color:var(--muted)
}
.collection-progress {
  padding:16px 20px;
  background:var(--brand-pale);
  border-radius:16px;
  color:var(--brand-blue)
}
progress {
  accent-color:var(--brand-blue)
}
progress::-webkit-progress-bar {
  background:#dbeafa;
  border-radius:8px
}
progress::-webkit-progress-value {
  background:var(--brand-blue);
  border-radius:8px
}
.ingredient-tile {
  background:#f5f9fd;
  border:1px solid #e5eef7;
  transition:background .15s,border-color .15s,transform .15s
}
.ingredient-tile:hover {
  background:var(--brand-pale);
  border-color:#87bce5;
  transform:translateY(-2px)
}
.ingredient-tile:focus-visible {
  outline-color:var(--brand-blue)
}
.ingredient-tile strong {
  color:var(--brand-blue)
}
.ingredient-tile small {
  color:var(--muted)
}
.collection-notice {
  color:var(--muted);
  padding:10px 14px;
  background:#f5f9fd;
  border-radius:10px
}
.recipe-card {
  background:#fbfdff;
  border-color:var(--brand-border);
  border-radius:18px
}
.recipe-card.collected {
  background:#edf6ff;
  border-color:#79b5e3
}
.recipe-badge {
  background:#eaf0f6;
  color:#6a8296
}
.collected .recipe-badge {
  background:var(--brand-blue);
  color:white
}
.recipe-card h4 {
  color:var(--brand-dark)
}
.recipe-number,.recipe-owned,.recipe-note {
  color:var(--muted)
}
.product-bottle span {
  background:#ffffffed;
  color:var(--brand-dark)
}
.need-chip {
  border-color:#e5dcd3;
  color:#926b4f;
  background:#fffaf4
}
.need-chip.enough {
  color:var(--brand-blue);
  border-color:#b4d7f2;
  background:#edf6ff
}
.craft-button {
  background:var(--brand-blue)
}
.craft-button:hover:not(:disabled) {
  background:var(--brand-dark)
}
.craft-button:disabled {
  background:#eaf0f6;
  color:#899bac
}
#ingredient-dialog {
  background:white;
  border-color:var(--brand-border);
  color:var(--ink)
}
#ingredient-dialog::backdrop {
  background:#002d5266
}
.dialog-close {
  background:var(--brand-pale);
  color:var(--brand-blue)
}
#ingredient-detail-count {
  color:var(--brand-blue)
}
.ingredient-detail-image {
  padding:10px;
  background:var(--brand-pale);
  border-radius:22px
}
.ingredient-craft {
  background:#f2f8fe;
  border-color:var(--brand-border)
}
.ingredient-craft p,.ingredient-craft small,#ingredient-dialog-notice {
  color:var(--muted)
}
.ingredient-craft .craft-button {
  background:var(--brand-blue)
}
.ingredient-craft .craft-button:disabled {
  background:#e1ebf4;
  color:#879aab
}
.brand-signoff {
  margin-top:30px;
  border-radius:22px;
  overflow:hidden;
  background:var(--brand-blue);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:36px;
  padding:12px 24px
}
.brand-signoff img {
  width:280px;
  max-width:60%;
  height:118px;
  object-fit:contain
}
.brand-signoff p {
  color:white;
  font-size:13px;
  letter-spacing:.4px
}
@media(max-width:700px) {
  header {
    padding:12px 14px;
    border-radius:16px
  }
  .brand-heading {
    gap:12px
  }
  .brand-logo {
    width:115px;
    height:52px
  }
  .brand-title {
    padding-left:12px
  }
  h1 {
    font-size:20px
  }
  .brand-title .eyebrow {
    font-size:9px
  }
  .play-heading {
    align-items:flex-start;
    gap:12px
  }
  .play-heading p {
    font-size:11px
  }
  .workshop {
    padding:18px
  }
  .collection-progress {
    padding:10px
  }
  .brand-signoff {
    gap:8px;
    padding:8px 12px;
    flex-direction:column
  }
  .brand-signoff img {
    max-width:100%;
    height:108px
  }
  .brand-signoff p {
    margin:0 0 16px;
    font-size:11px
  }
}
/* 맵 색상과 관계없이 읽기 쉬운 공통 HUD */
.hud .stats {
  background:rgba(15,32,48,.88);
  color:#fff;
  border:1px solid #ffffff40;
  box-shadow:0 4px 18px #00000020;
  backdrop-filter:blur(8px)
}
.hud .stats small {
  color:#d2dfeb
}
.hud .stats strong {
  color:#fff
}
.hud .right {
  background:rgba(15,32,48,.88);
  border:1px solid #ffffff40;
  padding:6px 10px;
  border-radius:16px;
  backdrop-filter:blur(8px)
}
#hearts {
  text-shadow:none;
  color:#ff8796
}
#pause {
  background:#ffffff1f;
  color:white
}
/* 제조 전은 소등된 회색 제품, 최초 제조 후 원래 색상으로 표시 */
.product-art {
  height:190px;
  border-radius:14px;
  background:radial-gradient(ellipse at bottom,#e4eaf0 0%,#f6f8fb 65%);
  overflow:hidden
}
.product-art img {
  height:190px;
  padding:10px;
  filter:grayscale(1) brightness(.55);
  opacity:.65;
  transition:filter .65s ease,opacity .65s ease
}
.collected .product-art {
  background:radial-gradient(ellipse at bottom,#d1e8fb 0%,#f5faff 70%)
}
.collected .product-art img {
  filter:grayscale(0) brightness(1);
  opacity:1
}
@media(max-width:550px) {
  .product-art,.product-art img {
    height:165px
  }
}
/* 조합 재료: 이름 길이와 수량에 관계없이 동일한 카드 크기 */
.recipe-needs {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-auto-rows:68px;
  gap:8px;
  min-height:144px;
  align-content:start
}
.need-chip {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  width:100%;
  height:68px;
  padding:8px;
  border-radius:10px;
  border:1px solid #dbcbbc;
  background:#fff8ef;
  color:#795638
}
.need-chip img {
  width:28px;
  height:28px;
  flex:0 0 28px;
  object-fit:contain
}
.need-info {
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width:0
}
.need-name {
  font-size:11px;
  font-weight:700;
  line-height:1.2;
  overflow-wrap:anywhere
}
.need-count {
  font-size:14px;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
  line-height:1.2;
  letter-spacing:-.3px
}
.need-chip.enough {
  color:#005a9f;
  border-color:#a5cfee;
  background:#eaf5ff
}
@media(max-width:550px) {
  .recipe-needs {
    grid-template-columns:minmax(0,1fr);
    grid-auto-rows:64px;
    min-height:208px;
    gap:8px
  }
  .need-chip {
    height:64px;
    padding:8px 10px
  }
  .need-chip img {
    width:28px;
    height:28px
  }
  .need-name {
    font-size:11px
  }
  .need-count {
    font-size:14px
  }
}
/* モバイル全画面: mobile-playing以外ではPC含め既存の表示を維持 */
#mobile-exit,#rotate-guide {
  display:none
}
body.mobile-playing {
  overflow:hidden;
  overscroll-behavior:none;
  touch-action:none
}
.mobile-playing main {
  padding:0
}
.mobile-playing main>header,.mobile-playing main>.play-heading,.mobile-playing main>footer,.mobile-playing .workshop,.mobile-playing .brand-signoff {
  display:none
}
.mobile-playing #game {
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  height:100dvh;
  max-width:none;
  margin:0;
  border:0;
  border-radius:0;
  aspect-ratio:auto;
  z-index:100;
  box-shadow:none;
  touch-action:none
}
.mobile-playing #game:fullscreen {
  width:100%;
  height:100%
}
.mobile-playing .hud {
  top:max(12px,env(safe-area-inset-top));
  left:max(16px,env(safe-area-inset-left));
  right:max(16px,env(safe-area-inset-right));
  gap:12px
}
.mobile-playing .stats {
  padding:8px 14px;
  gap:18px;
  border-radius:14px
}
.mobile-playing .stats small {
  font-size:9px
}
.mobile-playing .stats strong {
  font-size:20px
}
.mobile-playing #hearts {
  font-size:23px
}
.mobile-playing #pause {
  width:40px;
  height:40px
}
.mobile-playing #slide,.mobile-playing #jump {
  bottom:max(16px,env(safe-area-inset-bottom));
  width:76px;
  height:76px;
  border-radius:50%;
  background:#0068b7c9;
  border:2px solid #ffffffdc;
  color:white;
  font-size:32px;
  box-shadow:0 4px 16px #002c5433;
  touch-action:none
}
.mobile-playing #slide {
  left:max(20px,env(safe-area-inset-left));
  right:auto
}
.mobile-playing #jump {
  right:max(20px,env(safe-area-inset-right))
}
.mobile-playing #slide span,.mobile-playing #jump span {
  font-size:10px
}
.mobile-playing #mobile-exit {
  display:block;
  position:absolute;
  top:76px;
  right:max(18px,env(safe-area-inset-right));
  z-index:8;
  background:#102b43bd;
  color:#fff;
  border:1px solid #ffffff60;
  padding:8px 14px;
  border-radius:20px;
  font-size:11px
}
.mobile-playing #status {
  top:76px;
  font-size:12px
}
.mobile-playing .panel {
  padding:20px 28px;
  max-height:calc(100dvh - 32px);
  overflow:auto
}
.mobile-playing .panel h2 {
  font-size:26px
}
.mobile-playing .panel p {
  font-size:12px
}
.mobile-playing .panel .hint {
  display:none
}
.mobile-portrait #rotate-guide {
  position:absolute;
  inset:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  background:#003e70f5;
  color:white;
  text-align:center;
  padding:28px;
  gap:12px
}
#rotate-guide>span {
  font-size:64px
}
#rotate-guide strong {
  font-size:20px
}
#rotate-guide p {
  font-size:13px;
  color:#d1e8fa
}
#rotate-exit {
  padding:12px 24px;
  background:white;
  color:#0068b7;
  border-radius:24px;
  font-weight:bold
}
@media(pointer:coarse) and (max-width:700px) {
  body:not(.mobile-playing) #game {
    width:100%;
    aspect-ratio:1.5/1
  }
}
@media(max-width:550px) {
  .recipe-needs {
    min-height:280px
  }
}
/* 이름은 아이콘 옆, 수량은 전체 너비의 별도 행으로 배치합니다. */
.recipe-needs {
  grid-auto-rows:84px;
  min-height:176px
}
.need-chip {
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  grid-template-rows:30px 22px;
  align-content:center;
  gap:5px 6px;
  height:84px;
  padding:8px
}
.need-chip img {
  width:24px;
  height:24px;
  grid-column:1;
  grid-row:1
}
.need-info {
  display:contents
}
.need-name {
  grid-column:2;
  grid-row:1;
  font-size:11px;
  line-height:1.25;
  overflow-wrap:anywhere
}
.need-count {
  grid-column:1 / -1;
  grid-row:2;
  display:block;
  min-width:0;
  text-align:center;
  font-size:12px;
  letter-spacing:-.4px;
  white-space:nowrap
}
.ingredient-tile {
  grid-template-columns:36px minmax(0,1fr);
  min-width:0;
  gap:5px 8px
}
.ingredient-tile img {
  width:36px;
  height:36px
}
.ingredient-tile strong {
  font-size:18px;
  white-space:nowrap;
  font-variant-numeric:tabular-nums
}
.ingredient-tile span,.ingredient-tile small {
  min-width:0;
  overflow-wrap:anywhere
}
@media(max-width:550px) {
  .recipe-needs {
    grid-auto-rows:84px;
    min-height:360px
  }
  .need-chip {
    height:84px
  }
  .need-count {
    font-size:13px
  }
}
@media(max-width:360px) {
  .ingredient-tile {
    grid-template-columns:28px minmax(0,1fr);
    gap:5px 6px;
    padding:10px
  }
  .ingredient-tile img {
    width:28px;
    height:28px
  }
  .ingredient-tile strong {
    font-size:16px
  }
  .need-count {
    font-size:12px;
    letter-spacing:-.5px
  }
}
/* 모바일 컬렉션: 재료 수에 맞춰 높이를 계산하고 큰 빈 공간을 제거합니다. */
@media(max-width:550px) {
  .recipe-grid {
    gap:10px;
    align-items:start
  }
  .recipe-card {
    padding:10px;
    border-radius:14px;
    min-width:0
  }
  .product-art,.product-art img {
    height:112px
  }
  .product-art {
    margin:12px 0
  }
  .product-art img {
    padding:6px
  }
  .recipe-badge {
    font-size:9px;
    padding:4px 7px
  }
  .recipe-number {
    font-size:8px;
    letter-spacing:.7px
  }
  .recipe-card h4 {
    font-size:14px;
    line-height:1.35;
    margin:6px 0;
    overflow-wrap:anywhere
  }
  .recipe-owned {
    font-size:10px;
    min-height:0;
    line-height:1.5;
    margin:0 0 10px
  }
  .recipe-needs {
    grid-template-columns:minmax(0,1fr);
    grid-auto-rows:54px;
    min-height:0;
    gap:6px
  }
  .need-chip {
    height:54px;
    padding:5px 7px;
    grid-template-columns:20px minmax(0,1fr);
    grid-template-rows:20px 17px;
    gap:2px 5px;
    border-radius:8px
  }
  .need-chip img {
    width:20px;
    height:20px
  }
  .need-name {
    font-size:10px;
    line-height:1.1
  }
  .need-count {
    font-size:12px;
    line-height:17px;
    letter-spacing:-.4px
  }
  .recipe-card .craft-button {
    margin-top:10px;
    padding:10px 4px;
    min-height:40px;
    font-size:11px
  }
}
/* 시작 안내가 잘리지 않도록 모바일 대기 화면의 높이와 글자 크기를 확보합니다. */
.panel .browser-guide {
  font-size:10px;
  line-height:1.5;
  max-width:260px;
  margin:12px auto 0;
  color:#6a8296
}
@media(max-width:700px) {
  body:not(.mobile-playing) #game {
    width:100%;
    min-height:320px;
    aspect-ratio:1.5 / 1
  }
  body:not(.mobile-playing) #overlay {
    padding:16px
  }
  body:not(.mobile-playing) .panel {
    width:min(100%,340px);
    padding:22px 18px;
    border-radius:20px;
    max-height:100%;
    overflow-y:auto
  }
  body:not(.mobile-playing) .panel .eyebrow {
    font-size:10px
  }
  body:not(.mobile-playing) .panel h2 {
    font-size:25px;
    line-height:1.3;
    margin:10px 0
  }
  body:not(.mobile-playing) .panel p {
    font-size:12px;
    line-height:1.7;
    margin:10px 0
  }
  body:not(.mobile-playing) .panel .browser-guide {
    font-size:10px;
    line-height:1.5;
    margin:12px auto 0
  }
  body:not(.mobile-playing) .panel .primary {
    min-height:48px;
    width:100%;
    max-width:250px;
    font-size:15px
  }
  footer {
    font-size:10px;
    line-height:1.7;
    margin-top:14px
  }
}
@media(max-height:450px) {
  .mobile-playing .panel .browser-guide {
    font-size:10px;
    margin-top:8px
  }
  .mobile-playing .panel {
    padding:14px 22px
  }
  .mobile-playing .panel h2 {
    font-size:22px;
    margin:8px 0
  }
  .mobile-playing .panel p {
    margin:8px 0;
    line-height:1.5
  }
}
/* 작은 모바일에서 컬렉션 숫자와 게이지가 요약 카드 안에 머물도록 합니다. */
.collection-progress {
  flex-shrink:0
}
.collection-progress strong {
  white-space:nowrap;
  font-variant-numeric:tabular-nums
}
.collection-progress progress {
  max-width:100%;
  box-sizing:border-box
}
@media(max-width:550px) {
  .workshop-heading {
    display:grid;
    grid-template-columns:minmax(0,1fr) 82px;
    gap:12px;
    align-items:start
  }
  .workshop-heading>div:first-child {
    min-width:0
  }
  .collection-progress {
    width:82px;
    min-width:0;
    padding:12px 8px;
    text-align:center;
    border-radius:16px
  }
  .collection-progress strong {
    font-size:20px;
    line-height:1.25;
    letter-spacing:-.8px
  }
  .collection-progress span {
    display:block;
    font-size:9px;
    white-space:nowrap;
    margin-top:5px
  }
  .collection-progress progress {
    width:100%;
    max-width:100%;
    height:5px;
    margin:9px 0 0
  }
}
@media(max-width:360px) {
  .workshop-heading {
    grid-template-columns:minmax(0,1fr) 74px;
    gap:10px
  }
  .collection-progress {
    width:74px;
    padding:11px 7px
  }
  .collection-progress strong {
    font-size:18px;
    letter-spacing:-.6px
  }
  .collection-progress span {
    font-size:8px
  }
}
/* 모바일 터치: 반 화면 조작, 독립된 일시정지, 실제 동작만 강조 */
.mobile-playing .hud {
  z-index:7;
  pointer-events:none
}
.mobile-playing .hud .right {
  pointer-events:auto;
  gap:12px;
  padding:4px 6px 4px 12px
}
.mobile-playing #pause {
  width:52px;
  height:52px;
  flex:0 0 52px;
  font-size:22px;
  touch-action:none;
  position:relative
}
.mobile-playing #slide:disabled,.mobile-playing #jump:disabled {
  opacity:1
}
.mobile-playing #slide,.mobile-playing #jump {
  opacity:1;
  transition:opacity .12s ease
}
.mobile-playing #slide.input-active,.mobile-playing #jump.input-active {
  opacity:.45
}
.mobile-playing #pause:active {
  background:#ffffff66
}
/* 나가기는 좌측 아래쪽 상단 영역으로 분리하고 확인 후 종료합니다. */
.mobile-playing #mobile-exit {
  left:max(18px,env(safe-area-inset-left));
  right:auto;
  top:88px;
  min-width:100px;
  min-height:48px;
  padding:10px 18px;
  font-size:13px;
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:center;
  touch-action:none;
  border-radius:14px;
  background:#123750e6
}
.mobile-playing #mobile-exit>span {
  font-size:22px
}
#hearts {
  display:flex;
  gap:5px;
  align-items:center;
  white-space:nowrap;
  font-family:Arial,sans-serif
}
.life-heart {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#ff7189;
  line-height:1;
  font-size:28px;
  text-shadow:0 1px 2px #4d15234d
}
.life-heart.empty {
  color:#ffffff35;
  text-shadow:none
}
.mobile-playing #hearts {
  gap:7px
}
.mobile-playing .life-heart {
  font-size:34px;
  width:32px;
  height:40px
}
.mobile-playing .hud .right {
  gap:14px;
  padding:5px 6px 5px 12px;
  border-radius:18px
}
.mobile-playing #pause {
  background:#ffffff26;
  border:1px solid #ffffff40
}
#exit-dialog {
  width:min(460px,calc(100vw - 32px));
  max-height:calc(100dvh - 24px);
  overflow:auto;
  border:1px solid #d6e6f4;
  border-radius:24px;
  background:#fff;
  color:#123450;
  padding:26px;
  text-align:center;
  box-shadow:0 20px 80px #002d5255
}
#exit-dialog::backdrop {
  background:#06233d99;
  backdrop-filter:blur(5px)
}
#exit-dialog h2 {
  font-size:25px;
  letter-spacing:-1px;
  margin:12px 0
}
.exit-description {
  font-size:12px;
  color:#6a8296;
  line-height:1.6;
  margin:0 0 20px
}
.exit-records {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  padding:16px 10px;
  background:#edf6ff;
  border-radius:16px
}
.exit-records>div {
  min-width:0
}
.exit-records span {
  display:block;
  font-size:10px;
  color:#6a8296;
  margin-bottom:8px
}
.exit-records strong {
  font-size:21px;
  letter-spacing:-.7px;
  color:#0068b7;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere
}
.exit-actions {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:20px
}
.exit-actions button {
  min-height:48px;
  padding:12px 8px;
  border-radius:14px;
  touch-action:none;
  font-size:14px;
  font-weight:bold
}
#exit-cancel {
  background:#0068b7;
  color:white
}
#exit-confirm {
  background:#edf2f7;
  color:#4e697e;
  border:1px solid #d6e6f4
}
@media(max-height:420px) {
  #exit-dialog {
    padding:18px 24px
  }
  #exit-dialog h2 {
    margin:8px 0;
    font-size:23px
  }
  .exit-description {
    margin-bottom:12px
  }
  .exit-records {
    padding:12px 8px
  }
  .exit-actions {
    margin-top:14px
  }
}
/* 세로 기기에서는 게임 좌표계를 90도 회전: 화면 위쪽=게임 왼쪽. */
.mobile-playing.mobile-portrait #game, .mobile-playing.mobile-portrait #game:fullscreen {
  inset:auto;
  left:50%;
  top:50%;
  width:100dvh;
  height:100vw;
  max-height:none;
  transform:translate(-50%,-50%) rotate(90deg);
  transform-origin:center
}
.mobile-portrait #rotate-guide {
  display:none
}
.mobile-playing.mobile-portrait .panel {
  max-height:calc(100vw - 24px)
}
/* dialog는 브라우저 top layer에 표시되므로 별도로 회전합니다. */
.mobile-playing.mobile-portrait #exit-dialog {
  position:fixed;
  inset:0;
  margin:auto;
  width:min(460px,calc(100dvh - 32px));
  max-width:none;
  max-height:calc(100vw - 24px);
  transform:rotate(90deg);
  padding:16px 24px
}
#start-countdown {
  position:absolute;
  inset:0;
  z-index:30;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#08355580;
  backdrop-filter:blur(3px);
  color:white;
  font-size:clamp(64px,16vh,110px);
  font-weight:900;
  text-shadow:0 6px 20px #00376380;
  touch-action:none
}
#start-countdown[hidden] {
  display:none
}
/* 실물 제공과 구분되는 상시 컬렉션 안내 */
.virtual-notice {
  background:#edf6ff;
  border:1px solid #c5def3;
  border-radius:12px;
  color:#244d70;
  line-height:1.6;
  overflow-wrap:anywhere
}
.panel .start-notice {
  font-size:12px;
  padding:8px 10px;
  margin:10px 0
}
.collection-disclaimer {
  font-size:13px;
  padding:12px 14px;
  margin:8px 0 16px
}
.virtual-notice strong {
  color:#005a9e
}
/* 모바일 시작 화면은 안내 내용 높이에 맞춰 확장해 내부 스크롤을 없앱니다. */
@media(max-width:700px) {
  body:not(.mobile-playing) #game:has(#overlay:not(.hidden)) {
    height:auto;
    aspect-ratio:auto;
    min-height:320px
  }
  body:not(.mobile-playing) #overlay:not(.hidden) {
    position:relative;
    min-height:312px;
    padding:12px
  }
  body:not(.mobile-playing) .panel {
    max-height:none;
    overflow:visible;
    padding:16px 14px
  }
  body:not(.mobile-playing) .panel h2 {
    font-size:23px;
    line-height:1.25;
    margin:8px 0
  }
  body:not(.mobile-playing) .panel p {
    margin:8px 0;
    line-height:1.55
  }
  body:not(.mobile-playing) .panel .start-notice {
    padding:5px 8px;
    margin:6px 0;
    font-size:10px;
    line-height:1.4;
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%
  }
  body:not(.mobile-playing) .panel .start-notice strong {
    font-size:inherit;
    font-weight:600
  }
  body:not(.mobile-playing) .panel .browser-guide {
    margin:8px auto 0
  }
}
/* 시간 표시 추가: 작은 화면의 점수판은 두 열로 배치 */
#elapsed {
  white-space:nowrap;
  font-variant-numeric:tabular-nums
}
@media(max-width:700px) {
  body:not(.mobile-playing) .stats {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px 12px
  }
}
.mobile-playing .stats {
  gap:12px
}

/* 지상 장애물은 러너(z-index:3) 뒤, 슬라이드 장애물 분할 레이어는 유지 */
.entity.ground-obstacle{z-index:auto}

/* 플레이 중 회전 팝업의 컬렉션 안내 가독성 */
.mobile-playing .panel .start-notice {
  font-size:15px;
  line-height:1.5;
  padding:10px 14px;
  margin:10px 0;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%
}
.mobile-playing .panel .start-notice strong {
  font-size:inherit
}
