:root {
  --bg: #f6f4ef;
  --panel: #ffffff;
  --text: #2f2f2f;
  --muted: #7a7a7a;
  --border: rgba(0,0,0,0.12);
  --radius: 18px;

  --mint: #7fded0;
  --pink: #f4a6c8;
  --gold: #e6c36a;
}

/* ------------------ BASE ------------------ */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Comic Sans MS", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
}

.pageWrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 18px;
}

.hidden { display: none; }
.muted { color: var(--muted); }

/* ------------------ HEADER ------------------ */
h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0.5px;
}

/* ------------------ TOP INFO ROW ------------------ */
.topRow {
  display: flex;
  gap: 16px;
  margin: 16px 0;
}

.infoBox {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.imageBox {
  padding: 0;
  overflow: hidden;
  width: 150px;
  height: 150px;
}

.imageBox img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.envBox {
  flex: 1;
  background: linear-gradient(135deg, #ffffff, #f9f8f5);
}

/* ------------------ STORY ------------------ */
#storyBox {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}

#narrative {
  font-size: 18px;
  line-height: 1.6;
}

#choices {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.choice {
  background: linear-gradient(135deg, var(--mint), #b7f0e8);
  border: 2px solid rgba(0,0,0,0.15);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 16px;
  cursor: pointer;
}

.choice:hover {
  background: linear-gradient(135deg, var(--pink), #ffd1e3);
}

/* ------------------ THINKING ------------------ */
.thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 14px;
}

.thinking .dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}

/* ------------------ TABS ------------------ */
.tabBar {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

.tabBtn {
  background: #f0eee9;
  border: 2px solid var(--border);
  border-radius: 14px 14px 0 0;
  padding: 10px 16px;
  cursor: pointer;
}

.tabBtn.active {
  background: var(--panel);
  border-bottom-color: transparent;
}

/* ------------------ TAB CONTENT ------------------ */
#tabContent {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 0 18px 18px 18px;
  padding: 16px;
  min-height: 120px;
}

/* ------------------ LOG ------------------ */
.logEntry {
  background: #fdfdfc;
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}

/* ------------------ INVENTORY ------------------ */
.inventoryItem.selected {
  background: linear-gradient(135deg, var(--gold), #fff2c0);
  border-color: var(--gold);
}

/* ------------------ STATS ------------------ */
.statBubble {
  background: #f9f8f4;
  border: 2px solid var(--border);
}

.statBubble:hover {
  background: #fff3d6;
}

/* ------------------ ACTION BUTTONS ------------------ */
.bottomActions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

button {
  background: linear-gradient(135deg, var(--mint), #c9f4ee);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
  cursor: pointer;
}

button:hover {
  background: linear-gradient(135deg, var(--pink), #ffd1e3);
}

/* ------------------ MOBILE ------------------ */
@media (max-width: 768px) {
  .topRow { flex-direction: column; }
  .imageBox {
    width: 100%;
    height: 180px;
  }
}


/* ------------------ EXTRA ------------------ */
.tabBar {
  position: relative;
  z-index: 50;
}

#storyBox {
  position: relative;
  z-index: 1;
}

#choices {
  position: relative;
  z-index: 1;
}

