/* Reset and Basics */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  user-select: none;
}

#game-container {
  width: 1280px;
  height: 720px;
  background-color: #111;
  display: flex;
  box-shadow: 0 0 20px rgba(255, 0, 150, 0.3);
  position: relative;
  overflow: hidden;
  border: 2px solid #333;
}

/* --- Left Area (70%) --- */
#left-area {
  width: 70%;
  height: 100%;
  position: relative;
  background-color: #0b0c10;
  background-image: linear-gradient(180deg, #181923 0%, #0d0d12 100%);
  display: flex;
  flex-direction: column;
}

#background-layer {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  z-index: 1;
}

#character-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: pointer;
}
#character-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: drop-shadow(0 0 15px rgba(255, 100, 200, 0.2));
  transition: opacity 0.5s ease;
}
.fade-out { opacity: 0; }

#stats-hud {
  position: absolute;
  top: 0; left: 0;
  z-index: 3;
  color: #fff;
  background: rgba(10,10,15,0.7);
  padding: 10px 20px;
  border-bottom-right-radius: 12px;
  border: 1px solid rgba(255,100,200,0.3);
  border-top: none;
  border-left: none;
  backdrop-filter: blur(10px);
  display: flex;
  gap: 20px;
}
.stat-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.stat-item .label {
  font-size: 14px;
  color: #b0b0b0;
}
.stat-item .value {
  font-size: 20px;
  font-weight: 800;
  color: #ff007f;
  text-shadow: 0 0 8px rgba(255,0,127,0.7);
}

#story-window {
  position: absolute;
  bottom: 25px; left: 50%;
  transform: translateX(-50%);
  width: 85%; height: 110px;
  background: rgba(15, 10, 20, 0.85);
  border: 1px solid #ff007f;
  border-radius: 12px;
  z-index: 3;
  padding: 20px 30px;
  color: #fff;
  font-size: 20px;
  box-shadow: inset 0 0 15px rgba(255,0,153,0.3), 0 5px 25px rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.6;
  backdrop-filter: blur(5px);
  letter-spacing: 1px;
  transition: opacity 0.5s ease;
}
#story-window.fade-out { opacity: 0 !important; }
#story-window.visible { display: flex; }

/* click feedback animations */
.click-effect {
  position: absolute;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  pointer-events: none;
  animation: floatUp 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
  text-shadow: 0 0 8px #ff007f, 0 0 15px #ff007f;
  z-index: 10;
}
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(0.8); }
  50% { opacity: 0.9; transform: translateY(-30px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-60px) scale(1); }
}

/* --- Right Area (30%) --- */
#right-area {
  width: 30%;
  height: 100%;
  background-color: #1a1a1f;
  border-left: 2px solid #2a2a33;
  display: flex;
  flex-direction: column;
}

#tabs {
  display: flex;
  background: #111;
  border-bottom: 1px solid #333;
}
.tab-btn {
  flex: 1;
  padding: 16px 0;
  background: none; border: none; color: #777;
  font-size: 15px; font-weight: bold; cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease-in-out;
}
.tab-btn:hover { color: #ccc; background: #15151a; }
.tab-btn.active {
  color: #ff007f;
  border-bottom: 3px solid #ff007f;
  background: #1a1a1f;
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.tab-content h3 { color: #eee; margin-bottom: 18px; font-size: 18px; border-bottom: 1px solid #444; padding-bottom: 8px; letter-spacing: 0.5px;}

/* Items in tabs */
.buy-item {
  background: #25252c;
  border: 1px solid #3a3a44;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.buy-item:hover { background: #2d2d35; transform: translateY(-1px); border-color: #555; }
.buy-item.disabled { opacity: 0.5; pointer-events: none; filter: grayscale(0.8); }

.item-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.item-name { color: #fff; font-weight: bold; font-size: 17px; }
.item-count { color: #ff007f; font-size: 14px; font-weight: bold; background: rgba(255,0,127,0.1); padding: 2px 6px; border-radius: 4px;}
.item-desc { color: #b0b0b0; font-size: 13px; margin-bottom: 12px; line-height: 1.4; }
.item-buy-btn {
  background: #ff007f; color: white;
  border: none; border-radius: 6px;
  padding: 10px; font-weight: bold; cursor: pointer;
  transition: background 0.2s; font-size: 14px;
}
.item-buy-btn:hover { background: #ff3399; }
.item-buy-btn:active { background: #cc0066; transform: translateY(1px); }

#tab-events .buy-item { border-color: #ff8800; background: rgba(37,30,20,0.8); }
#tab-events .buy-item:hover { border-color: #ffaa00; background: rgba(45,38,25,0.9); }
#tab-events .item-buy-btn { background: #ff8800; }
#tab-events .item-buy-btn:hover { background: #ffaa00; }
#tab-events .item-count { color: #ffaa00; background: rgba(255,170,0,0.1); }

.setting-item { color: #fff; margin-bottom: 25px; background: #25252c; padding: 15px; border-radius: 8px;}
.setting-item label { display: block; font-size: 15px; color: #ddd; margin-bottom:0;}
.setting-item input[type=range] { width: 100%; accent-color: #ff007f; margin-top: 10px;}

/* scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1a1a1f; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #666; }
