:root {
  --main-bg: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 50%, #0f0f0f 100%);
  --card-bg: linear-gradient(145deg, #242424 0%, #2a2a2a 100%);
  --accent: linear-gradient(135deg, #3eb489 0%, #2d9476 100%);
  --accent-hover: linear-gradient(135deg, #2d9476 0%, #236b5a 100%);
  --text-light: #fafafa;
  --text-secondary: #b0b0b0;
  --money: #96d45b;
  --cash: #ffd700;
  --shadow-light: rgba(62, 180, 137, 0.2);
  --shadow-dark: rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

/* 공통 Button 스타일 */
button {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: var(--text-light);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow-light);
}

button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-light);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px var(--shadow-light);
}

button:disabled {
  background: #555;
  color: #999;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 공통 Input 스타일 */
input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(62, 180, 137, 0.3);
  border-radius: 6px;
  color: var(--text-light);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  transition: all 0.3s ease;
  width: 100%;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(62, 180, 137, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

input::placeholder {
  color: var(--text-secondary);
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 공통 스크롤바 스타일 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}
html { 
    background: var(--main-bg);
}
body {
  cursor: url(cursor.png) 2 2, auto;
  background: var(--main-bg);
  background-attachment: fixed;
  color: var(--text-light);
  font-family: 'Noto Sans KR', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

header {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(62, 180, 137, 0.1);
  box-shadow: 0 4px 20px var(--shadow-dark);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  background: linear-gradient(135deg, #3eb489, #96d45b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px var(--shadow-dark);
}

.money-display {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.resources {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
}

.resources > div {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(62, 180, 137, 0.2);
  font-weight: 600;
  transition: all 0.3s ease;
}

.resources > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-light);
}

.header-buttons {
  display: flex;
  gap: 1rem;
}

.header-buttons button {
  background: var(--accent);
  color: var(--text-light);
  border: none;
  border-radius: 1.2rem;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow-light);
  position: relative;
  overflow: hidden;
}

.header-buttons button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.header-buttons button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-light);
}

.header-buttons button:hover::before {
  left: 100%;
}

.money-display span:last-child {
  color: var(--money);
  font-weight: 700;
  text-shadow: 0 1px 2px var(--shadow-dark);
}

main {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

section {
  background: var(--card-bg);
  border: 1px solid rgba(62, 180, 137, 0.1);
  border-radius: 1.5rem;
  padding: 2rem;
  flex: 1;
  min-width: 280px;
  box-shadow: 0 8px 32px var(--shadow-dark);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3eb489, #96d45b, #3eb489);
  opacity: 0.6;
}

section:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow-dark);
  border-color: rgba(62, 180, 137, 0.3);
}

h1, h2 {
  margin: 0 0 1.5rem;
  font-weight: 700;
}

h2 {
  color: var(--text-light);
  font-size: 1.4rem;
  text-align: center;
  position: relative;
  padding-bottom: 0.5rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #3eb489, #96d45b);
  border-radius: 1px;
}

.process {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#process-btn {
  background: var(--accent);
  color: var(--text-light);
  padding: 1.2rem 2.5rem;
  margin-top: 1.5rem;
  font-size: 1.3rem;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px var(--shadow-light);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#process-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s;
}

#process-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px var(--shadow-light);
}

#process-btn:hover::before {
  left: 100%;
}

#process-btn:active {
  transform: translateY(-1px) scale(0.98);
}

.progress-bar-bg {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(62, 180, 137, 0.2);
  border-radius: 1.5rem;
  height: 1.5rem;
  margin-bottom: 1.5rem;
  margin-top: 1rem;
  overflow: hidden;
  position: relative;
}

.progress-bar-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 25%, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.05) 50%, transparent 50%, transparent 75%, rgba(255,255,255,0.05) 75%);
  background-size: 20px 20px;
  animation: progress-stripes 1s linear infinite;
}

.progress-bar {
  background: linear-gradient(135deg, #96d45b 0%, #3eb489 50%, #96d45b 100%);
  height: 100%;
  width: 0%;
  border-radius: 1.5rem;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-stripes {
  0% { background-position: 0 0; }
  100% { background-position: 20px 0; }
}

@keyframes progress-shine {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

#stage-description {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
}

.upgrades {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upgrade-info {
  width: 100%;
  margin-bottom: 2rem;
}

.upgrade-level {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(62, 180, 137, 0.2);
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.upgrade-level:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-light);
  border-color: rgba(62, 180, 137, 0.4);
}

.upgrade-description {
  background: rgba(62, 180, 137, 0.1);
  padding: 0.8rem 1.2rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(62, 180, 137, 0.2);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

.upgrade-action {
  width: 100%;
  display: flex;
  justify-content: center;
}

.upgrade-btn {
  background: var(--accent);
  color: var(--text-light);
  border: none;
  border-radius: 1.5rem;
  padding: 1rem 2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px var(--shadow-light);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1rem;
}

.upgrade-btn .btn-icon {
  font-size: 1.2rem;
}

.upgrade-btn .btn-cost {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.3rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--money);
}

.upgrade-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.upgrade-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 24px var(--shadow-light);
}

.upgrade-btn:hover::before {
  left: 100%;
}

/* 아이템 구매 섹션 */
.items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.item-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(62, 180, 137, 0.2);
  border-radius: 1.2rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.item-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(135deg, rgba(62, 180, 137, 0.1) 0%, rgba(62, 180, 137, 0.05) 100%);
  border-radius: 12px;
  z-index: -1;
}

.items-slider-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.items-slider {
  flex: 1;
  overflow: hidden;
  border-radius: 12px;
}

.items-slide {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.items-slide.active {
  display: grid;
}

.item-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--shadow-light);
  min-height: 180px;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow-dark);
  border-color: var(--accent);
}

.item-info {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.item-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(62, 180, 137, 0.1);
  border-radius: 8px;
}

.item-details {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-size: 1rem;
  line-height: 1.2;
}

.item-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.buy-item-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-top: auto;
}

.buy-item-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.slider-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.slider-btn:hover:not(:disabled) {
  background: var(--accent);
  color: white;
  transform: scale(1.1);
}

.slider-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow-dark);
  border-color: var(--accent);
}

.item-info {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.item-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(62, 180, 137, 0.1);
  border-radius: 8px;
}

.item-details {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  line-height: 1.2;
}

.item-description {
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.buy-item-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  margin-top: auto;
}

.buy-item-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.stage-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.3rem 0.8rem;
  border-radius: 0.8rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--money);
}

.buy-item-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.buy-item-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-light);
}

.buy-item-btn:hover::before {
  left: 100%;
}

/* 인벤토리 섹션 */
.inventory-section {
  margin-top: 2rem;
  border-top: 1px solid rgba(62, 180, 137, 0.2);
}

.inventory-section h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 1rem;
  text-align: center;
  position: relative;
}

.inventory-section h3::after {
  content: '';
  position: absolute;
  bottom: -0.3rem;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, #3eb489, #96d45b);
  border-radius: 1px;
}

#item-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  min-height: 60px;
  max-height: 200px;           /* 높이 제한 */
  overflow-x: clip;            /* 가로 스크롤 */
  overflow-y: auto;            /* 세로 스크롤 */
  scrollbar-width: thin;       /* 파이어폭스 심플 스크롤 */
  scrollbar-color: #3eb489 #212121;
  /* 윗줄의 #3eb489 (메인포인트)와 #212121(배경)*/
}

/* 크롬 계열 브라우저용 */
#item-list::-webkit-scrollbar {
  width: 7px;
  background: #212121;       
  border-radius: 8px;
}
#item-list::-webkit-scrollbar-thumb {
  background: #3eb489b0; /* 채도 낮춘 포인트 컬러 */
  border-radius: 8px;
}
/* 스크롤 끝도 조금 밝게 */
#item-list::-webkit-scrollbar-thumb:hover {
  background: #59cfaa;
}


#item-list li {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.8rem 1.2rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(62, 180, 137, 0.2);
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

#item-list li::before {
  content: '📦';
  margin-right: 0.8rem;
  font-size: 1.1rem;
}

#item-list li:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px var(--shadow-light);
  border-color: rgba(62, 180, 137, 0.4);
}

.sell-btn {
  background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
  color: #000;
  border: none;
  border-radius: 1.2rem;
  padding: 1rem 2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
  font-size: 1rem;
}

.sell-btn .btn-icon {
  font-size: 1.2rem;
}

.sell-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.sell-btn:hover {
  background: linear-gradient(135deg, #b8941f 0%, #e6c200 100%);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.4);
}

.sell-btn:hover::before {
  left: 100%;
}

footer {
  background: var(--card-bg);
  border-top: 1px solid rgba(62, 180, 137, 0.1);
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.95rem;
  margin-top: auto;
  color: var(--text-secondary);
  box-shadow: 0 -4px 20px var(--shadow-dark);
}

/* 반응형: 모바일 */
@media (max-width: 800px) {
  main {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
  }
  section {
    padding: 1.5rem;
    min-width: unset;
  }
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .resources {
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
  }
  .header-buttons {
    justify-content: center;
  }
  #process-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }
  .item-info {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
  }
  .item-icon {
    align-self: center;
  }
  .upgrade-btn, .buy-item-btn, .sell-btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* 현금 색상 */
#cash {
  color: var(--cash) !important;
}

/* ----- 로그인/회원가입 팝업 ----- */
.popup-bg {
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(20,23,20,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
}
.popup {
  background: #242424;
  border-radius: 1.2rem;
  box-shadow: 0 4px 32px #000a;
  padding: 2rem 2.4rem 1.2rem 2.4rem;
  min-width: 320px;
  width: 92vw;
  max-width: 60vw;
  max-height: 80vh;
  overflow-y: auto;
  text-align: center;
  color: #fafafa;
}
.popup h2 {
  margin-top: 0;
  margin-bottom: 1.2rem;
  font-size: 1.5rem;
  color: #3eb489;
  letter-spacing: 0.05em;
}
.popup input[type="text"], .popup input[type="password"] {
  background: #1c1c1c;
  border: 1px solid #3eb489aa;
  border-radius: 1rem;
  color: #fff;
  font-size: 1.07rem;
  padding: 0.67rem 1.1rem;
  margin-bottom: 1rem;
  width: 90%;
  outline: none;
  transition: border 0.18s;
}
.popup input:focus {
  border-color: #3eb489;
}
.popup button {
  background: #3eb489;
  color: #fff;
  border: none;
  border-radius: 1.2rem;
  font-weight: 600;
  font-size: 1.08rem;
  padding: 0.55rem 1.6rem;
  margin: 0.5rem 0;
  cursor: pointer;
  transition: background 0.18s;
  display: inline-block;
}
.popup button:hover, .popup button:focus {
  background: #2d9476;
}
.popup form {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.2rem;
}
.popup p {
  color: #aaa;
  margin: 0.8rem 0 0.3rem;
  font-size: 0.99rem;
}
.popup .error-message {
  display: block;
  background: #862b2b;
  color: #fff0f3;
  padding: 0.5rem 1rem;
  border-radius: 0.8rem;
  margin-top: 0.75rem;
  font-size: 0.97rem;
  min-height: 1.3em;
}

/* 모바일 최적화 */
@media (max-width: 600px) {
  .popup {
    padding: 1.0rem 0.6rem 0.7rem 0.6rem;
    min-width: unset;
  }
  .popup input {
    font-size: 0.97rem;
    padding: 0.48rem 0.85rem;
  }
}

/* ----- 랭킹 팝업 ----- */
.ranking-popup {
  min-width: 400px;
  max-width: 500px;
  width: 95vw;
}

.ranking-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.ranking-tab {
  flex: 1;
  background: #1c1c1c;
  color: #aaa;
  border: 1px solid #3eb489aa;
  border-radius: 0.8rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.ranking-tab.active {
  background: #3eb489;
  color: #fff;
  border-color: #3eb489;
}

.ranking-tab:hover:not(.active) {
  background: #2a2a2a;
  color: #ccc;
}

.ranking-content {
  position: relative;
  min-height: 300px;
}

.ranking-list {
  display: none;
}

.ranking-list.active {
  display: block;
}

.ranking-loading {
  text-align: center;
  color: #aaa;
  padding: 2rem;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 0.8rem;
  margin-bottom: 0.5rem;
  background: #1c1c1c;
  border-radius: 0.8rem;
  border-left: 4px solid transparent;
}

.ranking-item.my-rank {
  background: #2d4a3e;
  border-left-color: #3eb489;
}

.ranking-item.top-3 {
  background: #3a2d1c;
  border-left-color: #d4af37;
}

.ranking-rank {
  font-size: 1.2rem;
  font-weight: bold;
  width: 2.5rem;
  text-align: center;
  color: #3eb489;
}

.ranking-rank.top-1 { color: #ffd700; }
.ranking-rank.top-2 { color: #c0c0c0; }
.ranking-rank.top-3 { color: #cd7f32; }

.ranking-info {
  flex: 1;
  margin-left: 1rem;
}

.ranking-nickname {
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.2rem;
}

.ranking-value {
  color: #96d45b;
  font-size: 0.9rem;
}

.close-popup-btn {
  background: #666;
  color: #fff;
  border: none;
  border-radius: 0.8rem;
  padding: 0.6rem 1.5rem;
  margin-top: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.close-popup-btn:hover {
  background: #777;
}

/* 모바일 최적화 */
@media (max-width: 600px) {
  .ranking-popup {
    min-width: unset;
    max-width: unset;
  }
  
  .ranking-tab {
    font-size: 0.8rem;
    padding: 0.5rem 0.7rem;
  }
  
  .ranking-item {
    padding: 0.6rem;
  }
  
  .ranking-rank {
    font-size: 1rem;
    width: 2rem;
  }
}
/* ----- 인력 투입 컨트롤 ----- */
.workforce-control {
  margin: 1.5rem 0;
  text-align: center;
}

.workforce-control h4 {
  color: var(--text-light);
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.workforce-input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.workforce-btn {
  background: var(--accent);
  color: var(--text-light);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow-light);
}

.workforce-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-light);
}

.workforce-btn:disabled {
  background: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#workforce-amount {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(62, 180, 137, 0.2);
  border-radius: 0.8rem;
  color: var(--text-light);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  width: 80px;
  height: 40px;
  outline: none;
}

#workforce-amount:focus {
  border-color: rgba(62, 180, 137, 0.5);
  box-shadow: 0 0 0 2px rgba(62, 180, 137, 0.2);
}

/* ----- 아이템 상세 팝업 ----- */
.item-detail-popup {
  width: 380px;
  height: 480px;
  max-width: 95vw;
  max-height: 95vh;
  overflow-y: auto;
}

.item-detail-info {
  margin: 1.5rem 0;
}

.item-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(62, 180, 137, 0.2);
}

.item-detail-row:last-child {
  border-bottom: none;
}

.item-detail-row .label {
  color: var(--text-secondary);
  font-weight: 600;
}

.item-detail-row .value {
  color: var(--text-light);
  font-weight: 700;
}

.item-detail-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.sell-individual-btn {
  flex: 1;
  background: var(--accent);
  color: var(--text-light);
  border: none;
  border-radius: 1rem;
  padding: 0.8rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow-light);
}

.sell-individual-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-light);
}

.cancel-btn {
  flex: 1;
  background: #666;
  color: var(--text-light);
  border: none;
  border-radius: 1rem;
  padding: 0.8rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cancel-btn:hover {
  background: #555;
  transform: translateY(-2px);
}

/* 인벤토리 아이템 리스트 CSS 수정 */
#item-list li {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.8rem 1.2rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(62, 180, 137, 0.2);
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#item-list li::before {
  content: '📦';
  margin-right: 0.8rem;
  font-size: 1.1rem;
}

#item-list li:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px var(--shadow-light);
  border-color: rgba(62, 180, 137, 0.4);
  background: rgba(62, 180, 137, 0.1);
}

#item-list li.selling {
  background: rgba(255, 165, 0, 0.2);
  border-color: rgba(255, 165, 0, 0.4);
  cursor: not-allowed;
}

#item-list li.selling::after {
  content: '판매중...';
  color: #ffa500;
  font-size: 0.8rem;
  font-weight: 600;
}

/* 모바일 최적화 */
@media (max-width: 600px) {
  .item-detail-popup {
    min-width: unset;
    width: 90vw;
  }
  
  .item-detail-actions {
    flex-direction: column;
  }
}


/* ----- 내 정보 섹션 ----- */
.my-info-section {
  background: var(--card-bg);
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
  border: 1px solid rgba(62, 180, 137, 0.2);
  box-shadow: 0 4px 20px var(--shadow-dark);
}

.my-info-section h3 {
  color: var(--text-light);
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0.8rem;
  border: 1px solid rgba(62, 180, 137, 0.1);
}

.info-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.info-value {
  color: var(--text-light);
  font-weight: 700;
}

.exp-bar-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  margin-left: 1rem;
}

.exp-bar {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
}

.exp-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.exp-text {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 50px;
}

.members-status {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.members-status .available {
  color: var(--money);
}

.members-status .working {
  color: #ffa500;
}

.members-status .separator {
  color: var(--text-secondary);
}

/* ----- 업그레이드 섹션 개선 ----- */
.upgrades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.upgrade-card {
  background: var(--card-bg);
  border-radius: 1.2rem;
  padding: 1.5rem;
  border: 1px solid rgba(62, 180, 137, 0.2);
  box-shadow: 0 4px 20px var(--shadow-dark);
  transition: all 0.3s ease;
}

.upgrade-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--shadow-light);
}

.upgrade-info {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.upgrade-icon {
  font-size: 2rem;
  background: rgba(62, 180, 137, 0.2);
  padding: 0.8rem;
  border-radius: 1rem;
  border: 1px solid rgba(62, 180, 137, 0.3);
}

.upgrade-details {
  flex: 1;
}

.upgrade-title {
  color: var(--text-light);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.upgrade-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.upgrade-level {
  color: var(--money);
  font-weight: 600;
  font-size: 0.9rem;
}

/* 모바일 최적화 */
@media (max-width: 600px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .upgrades-grid {
    grid-template-columns: 1fr;
  }
  
  .upgrade-info {
    flex-direction: column;
    text-align: center;
  }
}


/* ----- 암거래 팝업 ----- */
.black-market-popup {
  min-width: 500px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  width: 95vw;
}
/* 스크롤바 스타일은 공통 스타일 사용 */

.gold-display {
  text-align: center;
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 1rem;
  border: 1px solid rgba(255, 215, 0, 0.3);
  font-weight: 700;
  font-size: 1.1rem;
}

.black-market-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.market-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 1rem;
  border: 1px solid rgba(62, 180, 137, 0.2);
  transition: all 0.3s ease;
}

.market-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-light);
  border-color: rgba(62, 180, 137, 0.4);
}

.market-item-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.market-item-icon {
  font-size: 2rem;
  background: rgba(62, 180, 137, 0.2);
  padding: 0.8rem;
  border-radius: 1rem;
  border: 1px solid rgba(62, 180, 137, 0.3);
}

.market-item-details {
  flex: 1;
}

.market-item-name {
  color: var(--text-light);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.market-item-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.market-buy-btn {
  background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
  color: #000;
  border: none;
  border-radius: 1rem;
  padding: 0.8rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 80px;
}

.market-buy-btn:hover {
  background: linear-gradient(135deg, #ffb347 0%, #ffa500 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
}

.market-buy-btn:disabled {
  background: #666;
  color: #999;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.market-buy-btn .btn-text {
  font-size: 0.9rem;
}

.market-buy-btn .btn-cost {
  font-size: 0.8rem;
  font-weight: 600;
}

/* 모바일 최적화 */
@media (max-width: 600px) {
  .black-market-popup {
    min-width: unset;
    width: 95vw;
  }
  
  .market-item {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .market-item-info {
    flex-direction: column;
    text-align: center;
  }
}


/* 설명서 팝업 스타일 */
.guide-popup {
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

.guide-content {
  padding: 1rem 0;
}

.guide-section {
  margin-bottom: 2rem;
}

.guide-section h3 {
  color: var(--accent);
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(62, 180, 137, 0.3);
  padding-bottom: 0.5rem;
}

.guide-section p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.guide-section ul,
.guide-section ol {
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 1.5rem;
}

.guide-section li {
  margin-bottom: 0.5rem;
}

.guide-section li strong {
  color: var(--text-light);
}

/* 스크롤바 스타일 */
.guide-popup::-webkit-scrollbar {
  width: 8px;
}

.guide-popup::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.guide-popup::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.guide-popup::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}


/* 아이템 슬라이더 스타일 */
.items-slider-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.items-slider {
  flex: 1;
  overflow: hidden;
  border-radius: 12px;
  background: var(--card-bg);
}

.items-slide {
  display: none;
  gap: 1rem;
  padding: 1rem;
}

.items-slide.active {
  display: flex;
}

.slider-btn {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--shadow-light);
}

.slider-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.1);
}

.slider-btn:disabled {
  background: #666;
  cursor: not-allowed;
  transform: none;
}

/* 후원 안내 스타일 */
.donation-notice {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border: 1px solid rgba(62, 180, 137, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.donation-notice p {
  margin: 0.3rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.donation-notice p:first-child {
  color: var(--accent);
  font-size: 1rem;
}

/* X 버튼 스타일 */
.close-x-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-x-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

/* 툴팁 스타일 */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: rgba(0, 0, 0, 0.9);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  z-index: 9999;
  top: -40px;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.8rem;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip .tooltiptext::after {
  content: "";
  bottom: -5px;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

.selling-item:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* 대금수령 상태 스타일 */
.ready-to-collect {
  border: 2px solid #10b981 !important;
  background: rgba(16, 185, 129, 0.1) !important;
  animation: pulse-green 2s infinite;
}

.ready-to-collect .selling-status {
  background: #10b981 !important;
  color: white !important;
}

@keyframes pulse-green {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
}

/* 판매중 아이템 스타일 */
.selling-item {
  color: #ffa500;
  font-style: italic;
}

.selling-item .tooltip {
  color: #ffa500;
}

/* 아이템 카드 반응형 조정 */
@media (max-width: 768px) {
  .items-slide {
    flex-direction: column;
  }
  
  .slider-btn {
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
  }
  
  .items-slider-container {
    gap: 0.5rem;
  }
}



/* 약탈 팝업 스타일 */
.raid-popup {
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  width: 90%;
}

.raid-info {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.raid-chances {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: bold;
  color: var(--accent);
}

.raid-workforce {
  display: flex;
  align-items: center;
  gap: 10px;
}

.raid-workforce label {
  font-weight: bold;
}

.raid-workforce input {
  width: 60px;
  padding: 5px;
  border: 1px solid #444;
  border-radius: 4px;
  background: #333;
  color: white;
  text-align: center;
}

.raid-percentage {
  color: var(--money);
  font-weight: bold;
}

.player-list h3 {
  margin-bottom: 15px;
  color: var(--text-light);
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-info {
  flex: 1;
}

.player-nickname {
  font-weight: bold;
  color: var(--text-light);
  margin-bottom: 4px;
}

.player-money {
  color: var(--money);
  font-size: 14px;
}

.raid-target-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.raid-target-btn:hover {
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
  transform: translateY(-1px);
}

.raid-target-btn:active {
  transform: translateY(0);
}


/* 약탈 버튼 그룹 */
.raid-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.raid-history-btn {
  background: var(--accent);
  flex: 1;
}

.raid-history-btn:hover {
  background: var(--accent-hover);
}

/* 약탈 히스토리 팝업 */
.raid-history-popup {
  min-width: 450px;
  max-width: 600px;
  width: 95vw;
  max-height: 80vh;
}

.raid-history-content {
  max-height: 400px;
  overflow-y: auto;
  margin: 16px 0;
}

.no-history {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
  font-size: 16px;
}

.raid-history-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(62, 180, 137, 0.2);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.raid-history-item:hover {
  border-color: rgba(62, 180, 137, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.raid-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(62, 180, 137, 0.2);
}

.raid-history-time {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.raid-history-type {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
  font-weight: 600;
}

.raid-history-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.raid-history-attacker,
.raid-history-amount {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.raid-history-details .label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.raid-history-details .value {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 600;
}

.raid-history-details .value.damage {
  color: #f87171;
}

.raid-history-message {
  margin-top: 8px;
  grid-column: 1 / -1; /* 두 열 전체 사용 */
}

.mock-message {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #ff6b6b;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}


/* 약탈 카운트다운 */
.raid-countdown {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

#countdown-timer {
  color: var(--accent);
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .raid-history-popup {
    min-width: 320px;
  }
  
  .raid-history-details {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .raid-buttons {
    flex-direction: column;
  }
}


/* 투자 팝업 디자인 개선 */
.investment-popup {
  min-width: 500px;
  max-width: 600px;
  width: 95vw;
  max-height: 80vh;
  overflow-y: auto;
}

.investment-popup h2 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
}

.investment-guide {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(62, 180, 137, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.investment-guide h3 {
  color: var(--accent);
  margin-bottom: 12px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.investment-guide p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 8px 0;
}

.investment-input-section {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(62, 180, 137, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.investment-input-section h3 {
  color: var(--text-light);
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
}

.investment-input-section p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.investment-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.investment-option {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(62, 180, 137, 0.2);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.investment-option:hover {
  border-color: rgba(62, 180, 137, 0.5);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.investment-option .option-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}

.investment-option .option-title {
  color: var(--text-light);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.investment-option .option-description {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.investment-option .option-return {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.investment-option .option-return.negative {
  color: #f87171;
}

.investment-option .option-return.positive {
  color: #4ade80;
}

.ongoing-investments {
  margin-top: 24px;
}

.ongoing-investments h3 {
  color: var(--text-light);
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
}

.no-investments {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(62, 180, 137, 0.1);
}

/* 진행중인 투자 정보 스타일 */
.investment-info {
  background: var(--card-bg);
  border: 1px solid rgba(62, 180, 137, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
  box-shadow: 0 4px 12px var(--shadow-dark);
  transition: all 0.3s ease;
}

.investment-info:hover {
  border-color: rgba(62, 180, 137, 0.5);
  box-shadow: 0 6px 16px var(--shadow-light);
  transform: translateY(-2px);
}

.investment-info .investment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(62, 180, 137, 0.2);
}

.investment-info .investment-type {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.investment-info .investment-type::before {
  content: "💰";
  font-size: 18px;
}

.investment-info .investment-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  background: rgba(62, 180, 137, 0.2);
  color: var(--accent);
  font-weight: 600;
}

.investment-info .investment-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.investment-info .investment-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.investment-info .investment-detail .label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.investment-info .investment-detail .value {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 600;
}

.investment-info .investment-detail .value.amount {
  color: var(--cash);
}

.investment-info .investment-detail .value.positive {
  color: #4ade80;
}

.investment-info .investment-detail .value.negative {
  color: #f87171;
}

.investment-info .investment-progress {
  margin-top: 12px;
}

.investment-info .progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.investment-info .progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.investment-info .time-remaining {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.investment-info .collect-btn {
  width: 100%;
  margin-top: 12px;
  background: var(--accent);
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
}

.investment-info .collect-btn:disabled {
  background: #555;
  color: #999;
  cursor: not-allowed;
}

/* 투자 타입별 아이콘 */
.investment-info[data-type="bank"] .investment-type::before {
  content: "🏦";
}

.investment-info[data-type="stock"] .investment-type::before {
  content: "📈";
}

.investment-info[data-type="crypto"] .investment-type::before {
  content: "₿";
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .investment-popup {
    min-width: 320px;
  }
  
  .investment-options {
    grid-template-columns: 1fr;
  }
  
  .investment-info .investment-details {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .investment-info .investment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* 헤더 버튼 활성화 스타일 */
.header-buttons button.active {
    background: var(--accent);
    color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-light);
}

/* ===== 광산 시스템 스타일링 ===== */

/* 광산 팝업 기본 스타일 */
.mining-popup {
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* 채굴업체 정보 섹션 */
.mining-company-info {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.company-level-section {
  margin-bottom: 16px;
}

.company-level-display {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.level-label {
  font-weight: 600;
  color: var(--text-light);
}

.level-value {
  font-weight: 700;
  color: var(--accent);
  font-size: 18px;
}

.company-exp-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-exp-section .exp-bar-container {
  flex: 1;
}

.levelup-btn {
  white-space: nowrap;
  min-width: 120px;
}

.levelup-btn .btn-text {
  display: block;
}

.levelup-btn .btn-cost {
  display: block;
  font-size: 12px;
  opacity: 0.8;
}

/* 보유 광물 섹션 */
.minerals-section {
  margin-bottom: 20px;
}

.minerals-section h3 {
  margin-bottom: 12px;
  color: var(--text-light);
  font-size: 16px;
}

.minerals-scroll-container {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
}

.minerals-list {
  display: flex;
  gap: 12px;
  min-width: max-content;
  padding-bottom: 4px;
}

.mineral-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.mineral-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.mineral-item.has-minerals {
  border-color: rgba(62, 180, 137, 0.5);
}

.mineral-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.mineral-name {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 4px;
  font-weight: 500;
}

.mineral-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* 광산 목록 섹션 */
.mines-section h3 {
  margin-bottom: 16px;
  color: var(--text-light);
  font-size: 16px;
}

.mines-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.mine-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 16px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.mine-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(62, 180, 137, 0.3);
}

.mine-item.active {
  border-color: var(--accent);
  background: rgba(62, 180, 137, 0.1);
}

.mine-item.disabled {
  opacity: 0.6;
}

.mine-info {
  flex: 1;
}

.mine-number {
  font-weight: 600;
  color: var(--text-light);
  font-size: 16px;
  margin-bottom: 4px;
}

.mine-cost {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.mine-status {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.mine-status.available {
  background: rgba(46, 160, 67, 0.2);
  color: #4ade80;
}

.mine-status.rented {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
}

.mine-status.disabled {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.mine-status.collecting {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.mine-timer {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
}

.mine-action-btn {
  min-width: 100px;
  white-space: nowrap;
}

.mine-action-btn:disabled {
  cursor: not-allowed;
}

.mine-action-btn.collect {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.mine-action-btn.collect:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

/* 광물 경험치 전환 팝업 */
.mineral-convert-popup {
  width: 400px;
  max-width: 90vw;
}

.convert-info {
  text-align: center;
  margin-bottom: 24px;
}

.mineral-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.mineral-icon-large {
  font-size: 48px;
  margin-bottom: 8px;
}

.mineral-name-large {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-light);
}

.convert-details {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.detail-row:last-child {
  margin-bottom: 0;
}

.detail-row .label {
  color: var(--text-secondary);
}

.detail-row .value {
  color: var(--text-light);
  font-weight: 600;
}

.convert-input-section {
  margin-bottom: 20px;
}

.convert-input-section label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-light);
  font-weight: 500;
}

.convert-input-section input {
  margin-bottom: 12px;
}

.total-exp {
  text-align: center;
  padding: 12px;
  background: rgba(62, 180, 137, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(62, 180, 137, 0.3);
}

.exp-value {
  font-weight: 700;
  color: var(--accent);
  font-size: 18px;
}

.convert-actions {
  display: flex;
  gap: 12px;
}

.convert-actions button {
  flex: 1;
}

.confirm-btn {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.confirm-btn:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

.cancel-btn {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.cancel-btn:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .mining-popup {
    width: 95vw;
    padding: 16px;
  }
  
  .company-exp-section {
    flex-direction: column;
    gap: 8px;
  }
  
  .levelup-btn {
    width: 100%;
  }
  
  .minerals-list {
    gap: 8px;
  }
  
  .mineral-item {
    min-width: 70px;
    padding: 8px 6px;
  }
  
  .mineral-icon {
    font-size: 20px;
  }
  
  .mine-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .mine-action-btn {
    width: 100%;
  }
  
  .mineral-convert-popup {
    width: 95vw;
  }
  
  .convert-actions {
    flex-direction: column;
  }
}

/* 스크롤바 스타일 (광물 리스트용) */
.minerals-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.minerals-scroll-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.minerals-scroll-container::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.mines-list::-webkit-scrollbar {
  width: 6px;
}

.mines-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.mines-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}


/* ===== 시설 시스템 스타일링 ===== */

/* 시설 팝업 기본 스타일 */
.facility-popup {
  width: 420px;
  max-height: 600px;
  overflow-y: auto;
}

.facility-ability-popup,
.facility-attack-popup,
.facility-bid-popup {
  width: 380px;
  max-height: 480px;
}

/* 시설 섹션 */
.owned-facilities-section,
.available-facilities-section {
  margin-bottom: 20px;
}

.owned-facilities-section h3,
.available-facilities-section h3 {
  color: var(--accent);
  margin-bottom: 12px;
  font-size: 16px;
  border-bottom: 1px solid rgba(62, 180, 137, 0.3);
  padding-bottom: 6px;
}

/* 시설 목록 */
.facilities-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.no-facilities {
  text-align: center;
  color: var(--text-secondary);
  padding: 20px;
  font-style: italic;
}

/* 시설 카드 */
.facility-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(62, 180, 137, 0.2);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.3s ease;
}

.facility-card:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.facility-card.owned {
  border-color: var(--accent);
  background: rgba(62, 180, 137, 0.1);
}

.facility-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.facility-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-light);
}

.facility-type {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.facility-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.facility-owner,
.facility-status,
.facility-hp,
.facility-rental-time {
  font-size: 14px;
  color: var(--text-secondary);
}

.facility-owner .value,
.facility-status .value,
.facility-hp .value {
  color: var(--text-light);
  font-weight: 500;
}

.facility-hp .value.low {
  color: #ff6b6b;
}

.facility-hp .value.medium {
  color: #ffd93d;
}

.facility-hp .value.high {
  color: var(--money);
}

/* 시설 액션 버튼들 */
.facility-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.facility-btn {
  flex: 1;
  min-width: 80px;
  padding: 8px 12px;
  font-size: 12px;
}

.use-ability-btn {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.use-ability-btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
}

.attack-btn {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.attack-btn:hover {
  background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
}

.bid-btn {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.bid-btn:hover {
  background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%);
}

.facility-btn:disabled {
  background: #555;
  color: #999;
  cursor: not-allowed;
}

/* 입찰 참가자 표시 */
.bid-participants {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.bid-participants-count {
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.bid-participants-list {
  display: flex;
  gap: 4px;
}

.bid-participant {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  font-weight: 600;
}

/* 시설 능력 사용 팝업 */
.facility-ability-info {
  margin-bottom: 20px;
}

.facility-ability-description {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  color: var(--text-light);
  line-height: 1.4;
}

.facility-ability-cooldown {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.facility-ability-cooldown.active {
  color: #ff6b6b;
  font-weight: 600;
}

/* 대상 선택 */
.target-selection {
  margin-bottom: 20px;
}

.target-selection h4 {
  color: var(--accent);
  margin-bottom: 12px;
  font-size: 14px;
}

.target-players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.target-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.target-player:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
}

.target-player.selected {
  background: rgba(62, 180, 137, 0.2);
  border-color: var(--accent);
}

.target-player-name {
  color: var(--text-light);
  font-weight: 500;
}

.target-player-info {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 인력소 버프 */
.workforce-buff {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  margin-bottom: 20px;
}

.workforce-buff p {
  color: var(--text-light);
  margin: 0;
  font-weight: 500;
}

/* 시설 공격 팝업 */
.facility-attack-info {
  margin-bottom: 20px;
}

.facility-info {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.facility-info .facility-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}

.facility-info .facility-owner,
.facility-info .facility-hp {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.attack-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attack-input label {
  color: var(--text-light);
  font-weight: 500;
}

.attack-input input {
  width: 100%;
}

.attack-damage {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.attack-damage span {
  color: #ff6b6b;
  font-weight: 600;
}

/* 시설 입찰 팝업 */
.facility-bid-info {
  margin-bottom: 20px;
  text-align: center;
}

.facility-status {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.bid-participants {
  font-size: 14px;
  color: var(--text-secondary);
}

.bid-input {
  margin-bottom: 20px;
}

.bid-input label {
  display: block;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 8px;
}

.bid-notice {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* 액션 버튼 그룹 */
.facility-ability-actions,
.facility-attack-actions,
.facility-bid-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.facility-ability-actions button,
.facility-attack-actions button,
.facility-bid-actions button {
  flex: 1;
  max-width: 120px;
}

/* 시설 상태 표시 */
.facility-status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.facility-status-indicator.active {
  background: var(--money);
  box-shadow: 0 0 6px var(--money);
}

.facility-status-indicator.auction {
  background: #ff9800;
  box-shadow: 0 0 6px #ff9800;
}

.facility-status-indicator.cooldown {
  background: #ff6b6b;
  box-shadow: 0 0 6px #ff6b6b;
}

/* 반응형 디자인 */
@media (max-width: 480px) {
  .facility-popup {
    width: 95vw;
    max-width: 380px;
  }
  
  .facility-ability-popup,
  .facility-attack-popup,
  .facility-bid-popup {
    width: 95vw;
    max-width: 350px;
  }
  
  .facility-actions {
    flex-direction: column;
  }
  
  .facility-btn {
    min-width: auto;
  }
}

