body {
  background: #08080f;
  overflow: hidden;
}

/* ════════════════════════════════════════════════════
   DEV PANEL — ?dev=1 일 때만 표시
════════════════════════════════════════════════════ */
#dev-panel {
  position: fixed;
  left: 12px;
  top: 12px;
  transform: none;
  width: auto;
  max-height: none;
  overflow: visible;
  background: rgba(8, 10, 18, 0.96);
  border: 1px solid rgba(255, 200, 60, 0.35);
  border-radius: 999px;
  padding: 8px 12px;
  z-index: 9999;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  font-size: 11px;
  color: #ccc;
  pointer-events: none;
}

.dev-title {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #ffc83c;
  padding-bottom: 0;
  border-bottom: none;
}

.dev-section {
  position: fixed;
  left: 18px;
  top: 56px;
  width: 228px;
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(8, 10, 18, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  z-index: 10020;
}

.dev-section.position-editor {
  width: 286px;
}

.dev-section.narration-editor {
  width: 320px;
}

.dev-section.event-replay {
  width: 280px;
}

.dev-section.state-dump {
  width: 240px;
}

.dev-section.market-overview {
  width: 384px;
}

.dev-window-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dev-window-handle {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f3f3f3;
  text-transform: uppercase;
  cursor: grab;
  user-select: none;
}

.dev-section.is-window-dragging .dev-window-handle {
  cursor: grabbing;
}

.dev-window-toggle {
  flex: 0 0 auto;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #d8d8d8;
  cursor: pointer;
}

.dev-window-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.dev-window-toggle-meta {
  font-size: 9px;
  color: inherit;
}

.dev-section-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  overflow: auto;
  max-height: calc(min(72vh, 560px) - 44px);
}

.dev-section.is-collapsed .dev-section-body {
  display: none;
}

.dev-section.days .dev-section-body {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
}

.dev-day-btn {
  width: 28px;
  height: 22px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #bbb;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.dev-day-btn:hover {
  background: rgba(255, 200, 60, 0.18);
  border-color: rgba(255, 200, 60, 0.5);
  color: #ffc83c;
}

.dev-day-btn.active {
  background: rgba(255, 200, 60, 0.28);
  border-color: #ffc83c;
  color: #ffc83c;
}

.dev-stat-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.dev-stat-row span {
  width: 36px;
  flex-shrink: 0;
  color: #aaa;
  font-size: 10px;
}

.dev-stat-row input[type="number"] {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  color: #f0f0f0;
  font-size: 10px;
  padding: 2px 4px;
  text-align: right;
}

.dev-stat-row button {
  font-size: 9px;
  padding: 2px 5px;
  background: rgba(255, 200, 60, 0.2);
  border: 1px solid rgba(255, 200, 60, 0.4);
  border-radius: 3px;
  color: #ffc83c;
  cursor: pointer;
  white-space: nowrap;
}

.dev-stat-row button:hover {
  background: rgba(255, 200, 60, 0.35);
}

.dev-stat-row button:disabled,
.dev-editor-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#dev-phone-toggle {
  width: 100%;
  padding: 3px 6px;
  font-size: 10px;
  background: rgba(100, 160, 255, 0.15);
  border: 1px solid rgba(100, 160, 255, 0.35);
  border-radius: 3px;
  color: #8ab4ff;
  cursor: pointer;
}

#dev-phone-toggle:hover {
  background: rgba(100, 160, 255, 0.28);
}

#dev-state-dump {
  font-size: 9px;
  line-height: 1.6;
  color: #888;
  white-space: pre;
}

.dev-position-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.dev-editor-btn {
  font-size: 9px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #d9d9d9;
  cursor: pointer;
}

.dev-editor-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.dev-editor-btn.is-active {
  background: rgba(255, 200, 60, 0.26);
  border-color: rgba(255, 200, 60, 0.55);
  color: #ffc83c;
}

.dev-editor-btn.single {
  grid-column: 1 / -1;
}

.dev-editor-line,
.dev-editor-status,
.dev-editor-note {
  font-size: 9px;
  line-height: 1.5;
  color: #9a9a9a;
}

.dev-section.location-nav .dev-section-body {
  max-height: 200px;
}

.dev-location-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.dev-location-btn {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  padding: 4px 6px;
  background: #ffffff;
  color: #111111;
  font-size: 9px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dev-location-btn:hover {
  background: #e8f0fe;
  border-color: rgba(66, 133, 244, 0.55);
  color: #1a4bbf;
}

.dev-location-btn.is-current {
  background: #e8f0fe;
  border-color: #4285f4;
  color: #1a4bbf;
  font-weight: 700;
}

.dev-editor-status {
  color: #cdb06e;
}

.dev-editor-readout {
  margin: 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 9px;
  line-height: 1.6;
  color: #d3d3d3;
  white-space: pre-wrap;
}

.dev-editor-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.dev-editor-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 9px;
  color: #9a9a9a;
}

.dev-editor-field.full {
  margin-top: 4px;
}

.dev-editor-field input,
.dev-editor-field select,
.dev-editor-field textarea {
  min-width: 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  color: #f0f0f0;
  font-size: 10px;
  padding: 3px 4px;
}

.dev-editor-field textarea {
  resize: vertical;
  min-height: 76px;
  font-family: inherit;
  line-height: 1.5;
}

.dev-editor-code {
  min-height: 150px;
  font-family: Consolas, "Courier New", monospace;
}

.dev-market-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.dev-market-card,
.dev-market-preview,
.dev-market-news-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.dev-market-card {
  padding: 8px;
}

.dev-market-card-label,
.dev-market-preview-kicker,
.dev-market-news-kicker {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8ea1bf;
}

.dev-market-card-value {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #f2f4ff;
}

.dev-market-card-meta {
  margin-top: 3px;
  font-size: 9px;
  color: #97a0b5;
}

.dev-market-chip-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.dev-market-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.dev-market-chip-label {
  font-size: 9px;
  color: #97a0b5;
}

.dev-market-chip-value {
  font-size: 12px;
  color: #f2f4ff;
}

.dev-market-chip.is-up {
  border-color: rgba(70, 184, 120, 0.38);
  background: rgba(28, 78, 52, 0.28);
}

.dev-market-chip.is-down {
  border-color: rgba(219, 90, 90, 0.36);
  background: rgba(102, 34, 34, 0.26);
}

.dev-market-chip.is-neutral {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.dev-market-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.dev-market-turn {
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  opacity: 0.68;
}

.dev-market-turn.is-past {
  opacity: 0.45;
}

.dev-market-turn.is-current {
  border-color: rgba(255, 200, 60, 0.66);
  box-shadow: inset 0 0 0 1px rgba(255, 200, 60, 0.22);
  opacity: 1;
}

.dev-market-turn.is-up {
  background: rgba(36, 78, 56, 0.28);
}

.dev-market-turn.is-hot {
  background: rgba(102, 62, 18, 0.26);
}

.dev-market-turn.is-down {
  background: rgba(78, 38, 38, 0.26);
}

.dev-market-turn.is-neutral {
  background: rgba(39, 48, 70, 0.26);
}

.dev-market-turn-index {
  font-size: 11px;
  font-weight: 700;
  color: #f2f4ff;
}

.dev-market-turn-month,
.dev-market-turn-phase {
  font-size: 9px;
  color: #a8b0c4;
}

.dev-market-preview {
  padding: 10px;
}

.dev-market-preview-title {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #f2f4ff;
}

.dev-market-preview-body {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.5;
  color: #a8b0c4;
}

.dev-market-news-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dev-market-news-item {
  padding: 10px;
}

.dev-market-news-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.dev-market-news-title {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  color: #f2f4ff;
}

.dev-market-news-body {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.55;
  color: #a8b0c4;
}

/* ═══════════════════════════════════════════════════════
   #game: 720×480 뷰포트 비율 유지
   -- 씬이 전체를 채우고 HUD가 위에 float
═══════════════════════════════════════════════════════ */
#game {
  --gw: min(720px, 100vw, calc(100vh * 1.5));
  --phone-shell-width: clamp(220px, 20vw, 264px);
  --phone-panel-width: calc(var(--phone-shell-width) + 28px);
  width: var(--gw);
  height: calc(var(--gw) * 2 / 3);  /* 3:2 비율 */
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.95);
}

/* ── main-area: 씬 전체를 채움 ──────────────────── */
#main-area {
  position: absolute;
  inset: 0;
}

/* ════════════════════════════════════════════════════
   씬 레이어: 배경·건물·캐릭터
════════════════════════════════════════════════════ */
#bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  transition: background 0.4s ease;
  z-index: 0;
}

#bg.room {
  background:
    linear-gradient(180deg, rgba(24, 20, 18, 0.12) 0%, rgba(12, 10, 9, 0.42) 100%),
    linear-gradient(135deg, #5f4b3d 0%, #7b6652 42%, #9a8369 100%);
  transition: none;
}

#bg.day-1-room-01 {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0.18) 100%),
    url('../assets/days/day01/room-01.png') center / cover no-repeat;
  transition: none;
}

#bg.day-1-room-02 {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0.18) 100%),
    url('../assets/days/day01/room-02.png') center / cover no-repeat;
  transition: none;
}

#bg.day-1-room-04 {
  background:
    linear-gradient(180deg, rgba(24, 20, 18, 0.08) 0%, rgba(12, 10, 9, 0.24) 100%),
    linear-gradient(135deg, #5f4b3d 0%, #7b6652 42%, #9a8369 100%);
  transition: none;
}

#bg.day-1-cleanup {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.06) 100%),
    url('../assets/days/day01/cleanup.png') center / cover no-repeat;
  transition: none;
}

#bg.apartment-front {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0.18) 100%),
    linear-gradient(135deg, #74706b 0%, #90867a 48%, #b0a496 100%);
  transition: none;
}

#bg.custom-location-bg {
  transition: none;
}

#bg.morning {
  background: linear-gradient(180deg, #ff9a56 0%, #ffcc80 40%, #87ceeb 100%);
}
#bg.noon {
  background: linear-gradient(180deg, #87ceeb 0%, #b0e0ff 100%);
}
#bg.evening {
  background: linear-gradient(180deg, #ff6b35 0%, #f7931e 40%, #2c1654 100%);
}
#bg.night {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* 건물 실루엣 */
#buildings {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 110px;
  display: none;
  align-items: flex-end;
  gap: 3px;
  padding: 0 8px;
  z-index: 1;
}

.building {
  background: rgba(0, 0, 0, 0.55);
  border-radius: 2px 2px 0 0;
}

/* 알바 게시판 표지판 */
#outside-goal {
  display: none;
  position: absolute;
  right: calc(var(--phone-panel-width) + 10px);
  bottom: 120px;
  padding: 7px 10px;
  border-radius: 6px 6px 2px 2px;
  background: rgba(10, 12, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffe08a;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.04em;
  line-height: 1.45;
  max-width: 260px;
  white-space: normal;
  z-index: 6;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

#outside-goal.is-visible,
#game.room-mode #outside-goal,
#game.outside-mode #outside-goal,
#game.interactive-start-mode #outside-goal {
  opacity: 1;
  transform: translateY(0);
}

#game.phone-collapsed #outside-goal {
  right: 16px;
}

#actors-layer {
  position: absolute;
  top: 44px;
  left: 0;
  right: var(--phone-panel-width);
  bottom: 86px;
  z-index: 7;
  pointer-events: none;
  overflow: visible;
}

#actors-layer.has-interactive-actors {
  pointer-events: auto;
}

#actors-layer.dev-position-active {
  pointer-events: auto;
}

#game.phone-collapsed #actors-layer {
  right: 0;
}

#side-toolbar {
  position: absolute;
  top: 56px;
  right: calc(var(--phone-panel-width) + 12px);
  z-index: 12;
}

#game.phone-collapsed #side-toolbar {
  right: 12px;
}

#character-panel,
#inventory-panel,
#memory-panel {
  position: absolute;
  top: 56px;
  right: calc(var(--phone-panel-width) + 12px);
  width: min(320px, calc(100% - var(--phone-panel-width) - 24px));
  max-height: calc(100% - 72px);
  z-index: 13;
  overflow-y: auto;
}

#game.phone-collapsed #character-panel,
#game.phone-collapsed #inventory-panel,
#game.phone-collapsed #memory-panel {
  right: 12px;
}

#actors-layer.is-hidden {
  display: none;
}

/* 캐릭터 */
#character {
  position: absolute;
  bottom: 120px;  /* 텍스트박스 위 */
  left: calc(50% - (var(--phone-panel-width) / 2));
  transform: translateX(-50%);
  font-size: 68px;
  z-index: 5;
  transition: left 0.25s ease, transform 0.1s ease;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.8));
}

#game.phone-collapsed #character {
  left: 50%;
}

/* 돈 효과 */
#money-effect {
  position: absolute;
  z-index: 50;
  font-size: 20px;
  font-weight: bold;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  opacity: 0;
}

#trash-game-layer {
  position: absolute;
  top: 44px;
  left: 0;
  right: var(--phone-panel-width);
  bottom: 112px;
  z-index: 13;
  pointer-events: none;
}

#trash-game-layer.is-hidden {
  display: none;
}

#game.phone-collapsed #trash-game-layer {
  right: 0;
}

#job-minigame-layer {
  position: absolute;
  top: 44px;
  left: 0;
  right: var(--phone-panel-width);
  bottom: 112px;
  z-index: 13;
  pointer-events: none;
}

#job-minigame-layer.is-hidden {
  display: none;
}

#game.phone-collapsed #job-minigame-layer {
  right: 0;
}

#trash-game-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 18, 28, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

#trash-game-title {
  color: #f5f5f5;
  font-size: 11px;
  font-weight: 700;
}

#trash-remaining {
  color: #ffd98a;
  font-size: 11px;
  font-weight: 700;
}

#trash-items {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

#trash-items.dev-position-active {
  pointer-events: auto;
}

/* ════════════════════════════════════════════════════
   HUD 레이어: 플로팅 상태 / 헤드라인 / 텍스트박스 / 선택지
   모두 씬 위에 float, 폰 패널 폭만큼 피해서 배치
════════════════════════════════════════════════════ */

/* 1-L. 좌상단 HUD: 일차 · 시간 */
#hud-left {
  position: absolute;
  top: 10px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(8, 10, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  z-index: 20;
  pointer-events: none;
}

/* 1-R. 우상단 HUD: 현금 / 체력 / 에너지 */
#hud-right {
  position: absolute;
  top: 10px;
  right: calc(var(--phone-panel-width) + 12px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(8, 10, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  z-index: 20;
  pointer-events: none;
}

#game.phone-collapsed #hud-right {
  right: 12px;
}

/* 2. 헤드라인: 텍스트박스 바로 위 floating */
#headline-strip {
  position: absolute;
  top: 52px;
  left: 18px;
  right: auto;
  max-width: min(520px, calc(100% - var(--phone-panel-width) - 36px));
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(8, 11, 20, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.22);
  z-index: 15;
}

#headline-strip.is-hidden {
  display: none;
}

#game.phone-collapsed #headline-strip {
  max-width: min(520px, calc(100% - 36px));
}

#gameplay-feedback {
  position: absolute;
  left: 18px;
  right: calc(var(--phone-panel-width) + 20px);
  bottom: 126px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 16;
  pointer-events: none;
}

#game.phone-collapsed #gameplay-feedback {
  right: 18px;
}

.gameplay-feedback-card {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(8, 11, 20, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.24);
}

.gameplay-feedback-card.is-up,
.gameplay-feedback-card.is-success {
  border-color: rgba(77, 213, 153, 0.42);
}

.gameplay-feedback-card.is-warning {
  border-color: rgba(255, 196, 97, 0.5);
}

.gameplay-feedback-card.is-danger {
  border-color: rgba(255, 117, 117, 0.52);
}

.gameplay-feedback-title {
  color: #f7fbff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.gameplay-feedback-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gameplay-feedback-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #edf4ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.gameplay-feedback-chip.is-up {
  color: #9df4c7;
  border-color: rgba(77, 213, 153, 0.28);
  background: rgba(77, 213, 153, 0.12);
}

.gameplay-feedback-chip.is-down {
  color: #ffb4b4;
  border-color: rgba(255, 117, 117, 0.26);
  background: rgba(255, 117, 117, 0.12);
}

.gameplay-feedback-chip.is-warning {
  color: #ffd890;
  border-color: rgba(255, 196, 97, 0.28);
  background: rgba(255, 196, 97, 0.12);
}

.gameplay-feedback-chip.is-info {
  color: #b8d8ff;
  border-color: rgba(116, 174, 255, 0.22);
  background: rgba(116, 174, 255, 0.1);
}

/* 3. 텍스트박스: 반투명 RPG 대사창 */
#textbox {
  position: absolute;
  bottom: 20px;
  left: 18px;
  right: calc(var(--phone-panel-width) + 20px);
  width: auto;
  max-width: none;
  min-height: 0;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  padding: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

#game.phone-collapsed #textbox {
  right: 18px;
}

.textbox-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: min(100%, 760px);
  align-self: center;
  margin-bottom: 0;
}

/* 4. 선택지 바: 배경 없음, 버튼만 독립 float */
#choice-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: var(--phone-panel-width);
  height: 48px;
  background: transparent;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 0;
  z-index: 15;
}

#game.phone-collapsed #choice-bar {
  right: 0;
}

/* ════════════════════════════════════════════════════
   시작 화면 오버레이
════════════════════════════════════════════════════ */
#start-screen {
  position: absolute;
  inset: 0;
  background:
    var(--start-origin-screen-overlay, linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.62) 100%)),
    url('../assets/days/day00/intro.jpg') center / cover no-repeat;
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: clamp(24px, 6vw, 48px);
}

.start-version-badge {
  position: absolute;
  top: clamp(14px, 2vw, 22px);
  left: clamp(14px, 2vw, 22px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 12, 20, 0.56);
  color: rgba(244, 247, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

#start-screen[data-screen-mode="origin"] {
  background: #000;
  align-items: center;
}

#start-screen.is-hidden {
  display: none;
}

/* ════════════════════════════════════════════════════
   모바일: 세로 뷰포트 (≤ 600px 너비)
   폰 패널이 인게임 하단으로 이동
════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  #game {
    --gw: 100vw;
    --phone-shell-width: clamp(156px, 38vw, 188px);
    --phone-panel-width: calc(var(--phone-shell-width) + 18px);
    border-radius: 0;
    box-shadow: none;
  }

  /* 모바일: 폰 패널이 하단 → 텍스트박스/선택지 right: 0 */
  #textbox {
    bottom: 14px;
    left: 12px;
    right: calc(var(--phone-panel-width) + 14px);
  }

  #choice-bar {
    right: 0;
    bottom: 0;
    padding-right: calc(var(--phone-panel-width) + 12px);
    height: 48px;
  }

  #headline-strip {
    top: 44px;
    left: 12px;
    max-width: calc(100% - var(--phone-panel-width) - 26px);
  }

  #gameplay-feedback {
    left: 12px;
    right: calc(var(--phone-panel-width) + 14px);
    bottom: 108px;
  }

  .gameplay-feedback-card {
    width: 100%;
    max-width: 360px;
    gap: 8px;
    padding: 10px 12px;
  }

  .gameplay-feedback-title {
    font-size: 13px;
  }

  .gameplay-feedback-chip {
    min-height: 26px;
    font-size: 11px;
  }

  #trash-game-layer {
    right: 0;
    bottom: 106px;
  }

  #job-minigame-layer {
    right: 0;
    bottom: 106px;
  }

  #outside-goal {
    right: 16px;
    bottom: 120px;
  }

  #actors-layer {
    right: 0;
    bottom: 84px;
  }

  #side-toolbar {
    top: 56px;
    right: 12px;
    left: auto;
  }

  #character-panel,
  #inventory-panel,
  #memory-panel {
    top: 56px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100% - 160px);
  }

  #character {
    left: 50%;
    bottom: 120px;
    font-size: 52px;
  }

  #hud-right {
    right: 12px;
    max-width: calc(100% - 24px);
    font-size: 10px;
  }
}

@media (max-width: 600px) and (orientation: portrait) {
  #hud-right {
    top: calc(env(safe-area-inset-top, 0px) + 48px);
    right: calc(var(--phone-panel-width) + 14px);
    max-width: calc(100% - var(--phone-panel-width) - 26px);
  }

  #side-toolbar {
    top: calc(env(safe-area-inset-top, 0px) + 112px);
    z-index: 18;
  }

  #character-panel,
  #inventory-panel,
  #memory-panel {
    top: calc(env(safe-area-inset-top, 0px) + 112px);
    max-height: calc(100% - 216px);
    z-index: 19;
  }
}

#game {
  width: 100vw;
  width: 100svw;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
  box-shadow: none;
}
