* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #243142;
  color: #ddd;
  font-family: 'Segoe UI', 'Malgun Gothic', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  /* Prevent body scroll */
}

#app {
  width: 100%;
  max-width: 720px;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: rgba(26, 35, 48, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.52);
  position: relative;
}

/* 배경 레이어 (모바일 fixed 버그 방지) */
#bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: -1;
  background: #243142;
  filter: none;
  transition: none;
}

/* 상단 스테이터스 바 */
#status-bar {
  background: rgba(33, 48, 68, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  border-bottom: 1px solid rgba(230, 194, 0, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  display: none;
  flex-shrink: 0;
}

#status-bar .name-level {
  color: #e6c200;
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 6px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}

.bar-label {
  width: 28px;
  font-weight: bold;
}

.bar-container {
  flex: 1;
  height: 16px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.bar-hp {
  background: linear-gradient(90deg, #e74c3c, #2ecc71);
}


.bar-text {
  position: absolute;
  right: 6px;
  top: 0;
  line-height: 16px;
  font-size: 11px;
  color: #fff;
  text-shadow: 1px 1px 1px #000;
}

.bar-exp {
  background: #f39c12;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #aaa;
  margin-top: 4px;
}

.gold-display {
  color: #f1c40f;
  font-weight: bold;
}

/* 메인 콘텐츠 영역 (게임+HTML) */
#main-content {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 0;
  /* Important for flex overflow */
  display: flex;
}

/* 게임 화면 */
#game-screen {
  flex: 1;
  padding: 20px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  padding-bottom: 32px;
  /* 여유 공간 */
  overflow-y: auto;
  z-index: 10;
  position: relative;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
}

#game-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18, 26, 37, 0.08), rgba(18, 26, 37, 0.18));
  pointer-events: none;
  z-index: -1;
}

#game-screen::-webkit-scrollbar {
  width: 6px;
}

#game-screen::-webkit-scrollbar-thumb {
  background: rgba(230, 194, 0, 0.5);
  border-radius: 4px;
}

/* 반투명 패널 (인벤토리, 상점 등) */
.glass-panel {
  background: rgba(15, 20, 30, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  margin-bottom: 16px;
}

.screen-title {
  color: #e6c200;
  font-size: 19px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(230, 194, 0, 0.3);
}

.screen-desc {
  color: #aaa;
  text-align: center;
  margin-bottom: 10px;
  font-size: 13px;
}

/* 메시지 영역 */
#message-area {
  padding: 10px 16px;
  min-height: 40px;
  z-index: 20;
  pointer-events: none;
}

.msg-text {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: #f1c40f;
  font-size: 14px;
  text-align: center;
  padding: 8px;
  border-radius: 20px;
  animation: fadeIn 0.3s;
  width: fit-content;
  margin: 0 auto;
  border: 1px solid rgba(241, 196, 15, 0.3);
  pointer-events: auto;
}

.msg-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.msg-retry-btn {
  background: rgba(230, 194, 0, 0.14);
  color: #f8df82;
  border: 1px solid rgba(230, 194, 0, 0.35);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.msg-retry-btn:hover {
  background: rgba(230, 194, 0, 0.22);
}

.msg-text.msg-error {
  color: #ffb3a8;
  border-color: rgba(231, 76, 60, 0.35);
  background: rgba(52, 12, 12, 0.76);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 전투 로그 */
#combat-log {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  margin: auto 0 8px 0;
  /* Push to bottom of screen naturally */
  max-height: 200px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

#combat-log .log-line {
  color: #bbb;
}

#combat-log .log-line.dmg {
  color: #e74c3c;
}

#combat-log .log-line.heal {
  color: #2ecc71;
}

#combat-log .log-line.info {
  color: #3498db;
}

#combat-log .log-line.turn-sep {
  color: #e6c200;
  font-weight: bold;
}

#combat-log .log-line.result {
  color: #f1c40f;
  font-weight: bold;
}

.combat-action-panel {
  background: rgba(8, 12, 18, 0.72);
  border: 1px solid rgba(230, 194, 0, 0.18);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.combat-action-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.combat-action-title {
  color: #f3d36b;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.combat-turn-badge {
  color: #8fa7bf;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.combat-action-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.combat-quick-btn {
  min-height: 60px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(37, 50, 68, 0.95), rgba(20, 28, 39, 0.95));
  color: #eef3f8;
  padding: 8px 8px;
  text-align: left;
  cursor: pointer;
}

.combat-quick-btn:hover {
  border-color: rgba(230, 194, 0, 0.45);
  transform: translateY(-1px);
}

.combat-quick-btn.danger {
  background: linear-gradient(180deg, rgba(122, 32, 32, 0.95), rgba(72, 16, 16, 0.95));
  border-color: rgba(231, 76, 60, 0.4);
}

.combat-quick-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.combat-btn-title {
  display: block;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
}

.combat-btn-detail {
  display: block;
  font-size: 10px;
  color: #97a6b5;
  line-height: 1.35;
}

.combat-subsection {
  margin-top: 10px;
}

.combat-subtitle {
  color: #9bb0c5;
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.combat-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.combat-card {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: left;
  color: #eef3f8;
}

.combat-card:hover {
  border-color: rgba(230, 194, 0, 0.4);
  background: rgba(230, 194, 0, 0.08);
}

.combat-card[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.combat-card-name {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #f5c86a;
}

.combat-card-meta {
  font-size: 10px;
  color: #98a8b8;
  line-height: 1.4;
}

.combat-empty-note {
  font-size: 12px;
  color: #79889a;
  padding: 10px 0 2px;
  text-align: center;
}

/* 버튼 */
.btn {
  background: rgba(44, 62, 109, 0.85);
  backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-family: inherit;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.btn:hover {
  background: rgba(61, 82, 145, 0.95);
  border-color: rgba(230, 194, 0, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #c9a800, #8a7500);
  color: #1a1a2e;
  border-color: #e6c200;
  font-weight: bold;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #e6c200, #c9a800);
  color: #1a1a2e;
}

.btn-danger {
  background: linear-gradient(180deg, #8a2020, #5a1010);
  border-color: #c0392b;
}

.btn-danger:hover {
  background: linear-gradient(180deg, #c0392b, #8a2020);
  border-color: #e74c3c;
}

.btn-success {
  background: linear-gradient(180deg, #1a6b3a, #0d4a25);
  border-color: #27ae60;
}

.btn-success:hover {
  background: linear-gradient(180deg, #27ae60, #1a6b3a);
  border-color: #2ecc71;
}

/* 액션 바 */
#action-bar {
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(29, 40, 56, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.4);
  z-index: 20;
  flex-shrink: 0;
  margin-top: auto;
}

.action-grid {
  display: grid;
  gap: 8px;
}

.action-grid.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.action-grid.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.action-grid.cols-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.action-grid.cols-1 {
  grid-template-columns: 1fr;
}

/* 아이템/리스트 */
.item-list {
  list-style: none;
}

.item-list li {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.item-list li:hover {
  border-color: rgba(230, 194, 0, 0.5);
  background: rgba(230, 194, 0, 0.1);
  transform: translateX(4px);
}

.item-name {
  font-size: 13px;
}

.item-detail {
  font-size: 11px;
  color: #888;
}

.item-price {
  color: #f1c40f;
  font-size: 13px;
}

/* 등급 색상 */
.grade-common {
  color: #aaa;
}

.grade-uncommon {
  color: #2ecc71;
}

.grade-rare {
  color: #3498db;
}

.grade-epic {
  color: #9b59b6;
}

.grade-legendary {
  color: #e67e22;
}

/* 몬스터 표시 */
.monster-display {
  text-align: center;
  margin: 16px auto;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(20, 10, 10, 0.6);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  max-width: 300px;
}

.monster-name {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 4px;
}

.monster-name.boss {
  color: #e74c3c;
  text-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
}

.monster-level {
  color: #888;
  font-size: 13px;
  margin-bottom: 8px;
}

.boss-intel {
  margin: 0 auto 14px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(78, 27, 27, 0.55);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: #e7d7d7;
  text-align: left;
}

.boss-intel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-weight: bold;
  color: #ffd7d0;
}

.boss-phase {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(231, 76, 60, 0.18);
  color: #ffb3a7;
}

.boss-intel-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #d7c7c7;
}

/* 메인 메뉴 */
.main-title {
  color: #e6c200;
  font-size: 32px;
  text-align: center;
  margin: 60px 0 8px;
  text-shadow: 0 0 20px rgba(230, 194, 0, 0.3);
  font-weight: bold;
}

.main-subtitle {
  color: #888;
  text-align: center;
  margin-bottom: 40px;
  font-size: 14px;
}

.main-input {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ddd;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 16px;
  width: 100%;
  margin-bottom: 12px;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.main-input:focus {
  border-color: #e6c200;
  box-shadow: 0 0 10px rgba(230, 194, 0, 0.3);
  background: rgba(0, 0, 0, 0.8);
}

.save-slot {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.save-slot:hover {
  border-color: rgba(230, 194, 0, 0.5);
  background: rgba(230, 194, 0, 0.1);
  transform: translateX(4px);
}

.save-slot.empty {
  color: #666;
}

.save-slot.auto-save {
  border-color: #3498db;
  background: rgba(52, 152, 219, 0.05);
}

.save-slot.auto-save:hover {
  background: rgba(52, 152, 219, 0.15);
}

.save-slot .slot-name {
  font-weight: bold;
}

.save-slot .slot-info {
  font-size: 12px;
  color: #888;
}

/* 스탯 표시 */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 0;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 13px;
}

.stat-label {
  color: #888;
}

.stat-value {
  color: #ddd;
  font-weight: bold;
}

/* 장비 슬롯 */
.equip-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  margin-bottom: 8px;
}

.equip-slot-name {
  color: #888;
  font-size: 12px;
  width: 60px;
}

.equip-slot-item {
  flex: 1;
  font-size: 14px;
}

.equip-slot-empty {
  color: #555;
  font-style: italic;
}

/* 탭 */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: rgba(26, 39, 68, 0.6);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: #888;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s;
}

.tab-btn.active {
  background: rgba(44, 62, 109, 0.9);
  color: #e6c200;
  border-color: rgba(230, 194, 0, 0.5);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

/* 인벤토리 그리드 및 툴팁 */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px;
  padding: 4px 0;
}

.inventory-item {
  position: relative;
  width: 64px;
  height: 64px;
  background: rgba(30, 40, 60, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-align: center;
  padding: 4px;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.inventory-item:hover {
  background: rgba(40, 50, 80, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.inventory-item.grade-common {
  border-bottom: 3px solid #b2bec3;
}

.inventory-item.grade-uncommon {
  border-bottom: 3px solid #2ecc71;
}

.inventory-item.grade-rare {
  border-bottom: 3px solid #3498db;
}

.inventory-item.grade-epic {
  border-bottom: 3px solid #9b59b6;
}

.inventory-item.grade-legendary {
  border-bottom: 3px solid #f1c40f;
}

.inv-item-name {
  font-size: 10px;
  color: #ddd;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: keep-all;
}

.inv-item-count {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  background: rgba(0, 0, 0, 0.5);
  padding: 0 3px;
  border-radius: 3px;
}

.inv-item-equipped {
  position: absolute;
  left: 4px;
  top: 2px;
  font-size: 10px;
  color: #e6c200;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;
  background: rgba(0, 0, 0, 0.5);
  padding: 0 3px;
  border-radius: 3px;
}

/* 강화 결과 */
.enhance-result {
  text-align: center;
  padding: 12px;
  border-radius: 4px;
  margin: 8px 0;
  font-weight: bold;
  animation: fadeIn 0.3s;
}

.enhance-success {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid #27ae60;
}

.enhance-fail {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border: 1px solid #c0392b;
}

.enhance-risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: bold;
  margin-left: 8px;
}

.enhance-risk-badge.safe,
.enhance-risk-badge.steady {
  background: rgba(46, 204, 113, 0.15);
  color: #7ddda1;
}

.enhance-risk-badge.risky {
  background: rgba(241, 196, 15, 0.15);
  color: #f4d35e;
}

.enhance-risk-badge.hazard {
  background: rgba(231, 76, 60, 0.18);
  color: #ff9b90;
}

.combat-result-summary {
  margin: 10px auto;
  max-width: 460px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(17, 27, 18, 0.62);
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.combat-result-summary.defeat {
  background: rgba(43, 20, 20, 0.58);
  border-color: rgba(231, 76, 60, 0.2);
}

.combat-result-title {
  font-weight: bold;
  margin-bottom: 8px;
  color: #f0f0f0;
}

.combat-result-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #cfcfcf;
  margin-bottom: 4px;
}

.combat-result-note {
  margin-top: 8px;
  font-size: 11px;
  color: #f7d98b;
  line-height: 1.35;
}

/* 로딩 */
.loading {
  text-align: center;
  color: #888;
  padding: 40px;
  font-size: 14px;
}

/* 자동 포션 */
.auto-potion-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}

.auto-potion-label {
  color: #aaa;
  cursor: pointer;
  white-space: nowrap;
}

.auto-potion-toggle {
  position: relative;
  width: 40px;
  height: 20px;
  background: #333;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.auto-potion-toggle.on {
  background: #27ae60;
}

.auto-potion-toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #ddd;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.auto-potion-toggle.on::after {
  transform: translateX(20px);
}

.auto-potion-range {
  flex: 1;
  min-width: 60px;
  accent-color: #e74c3c;
  cursor: pointer;
}

.auto-potion-value {
  color: #e74c3c;
  font-weight: bold;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* 자동 구매 설정 */
.auto-buy-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}

.auto-buy-bar select {
  background: #1a2744;
  color: #ddd;
  border: 1px solid #444;
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 12px;
  font-family: inherit;
}

.auto-buy-bar select:focus {
  outline: none;
  border-color: #e6c200;
}

.min-count-input {
  width: 42px;
  background: #1a2744;
  color: #f1c40f;
  border: 1px solid #444;
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 13px;
  text-align: center;
  font-family: inherit;
  font-weight: bold;
}

.min-count-input:focus {
  outline: none;
  border-color: #e6c200;
}

/* 자동 사냥 */
.auto-hunt-status {
  text-align: center;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid #e6c200;
  border-radius: 4px;
  background: rgba(230, 194, 0, 0.05);
}

.auto-hunt-status .status-title {
  color: #e6c200;
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 6px;
}

.auto-hunt-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 13px;
  color: #aaa;
  margin-top: 6px;
}

.auto-hunt-stats span {
  color: #ddd;
  font-weight: bold;
}

.pulse {
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@media (max-width: 640px) {
  #status-bar {
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
  }

  #game-screen {
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    padding-bottom: 24px;
  }

  #action-bar {
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .btn {
    padding: 10px 12px;
    font-size: 13px;
  }

  .action-grid {
    gap: 6px;
  }

  .combat-action-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .combat-quick-btn {
    min-height: 60px;
    padding: 9px 8px;
  }

  .tab-btn {
    padding: 10px 8px;
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .screen-title {
    font-size: 18px;
  }

  .screen-desc {
    font-size: 12px;
  }

  .action-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }

  .btn {
    padding: 9px 10px;
    font-size: 12px;
  }

  .combat-btn-detail {
    font-size: 10px;
  }
}

/* 광고 배너 */
#ad-banner {
  width: 100%;
  height: 50px;
  background: #2c3e50;
  color: #ecf0f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 20;
  display: none;
  /* 초기 상태 숨김 */
}
