/* ============================================================
   Chat minigame — window styling
   Uses the same CSS custom properties defined in style.css
   (--navy, --teal, --gray, --border, --font, etc.)
   ============================================================ */

#win-chat {
  width: 480px;
  max-width: 90vw;
}

#win-chat .win-body {
  padding: 0;
}

.chat-app {
  display: flex;
  height: 360px;
  max-height: 60vh;
}

/* ---------- Left rail: day list + testing controls ---------- */
.chat-rail {
  flex: 0 0 130px;
  border-right: 1px solid var(--border);
  background: var(--gray);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-days {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-day-btn {
  text-align: left;
  background: var(--gray);
  border: 1px solid var(--border);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #7a7a7a;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  padding: 6px 8px;
  cursor: pointer;
}

.chat-day-btn:hover {
  background: #b3b3b3;
}

.chat-day-btn.active {
  background: var(--navy);
  color: var(--white);
  box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #7a7a7a;
}

.chat-day-btn.done:not(.active)::after {
  content: "";
}

.chat-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 4px;
  margin: 0;
}

/* ---------- Right side: message log + choice buttons ---------- */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--white);
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 50px 16px; /* 50px bottom padding creates a gap the height of the choice buttons */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Windows 95 Chunky Scrollbar Styling */
.chat-log::-webkit-scrollbar {
  width: 18px;
}

.chat-log::-webkit-scrollbar-track {
  background: var(--gray);
  border-left: 1px solid var(--border);
}

.chat-log::-webkit-scrollbar-thumb {
  background: var(--gray);
  border: 1px solid var(--border);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #7a7a7a;
}

.chat-log::-webkit-scrollbar-thumb:hover {
  background: #b3b3b3;
}

.chat-line {
  max-width: 80%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.4;
}

.chat-line.bot {
  align-self: flex-start;
  background: var(--gray);
}

.chat-line.user {
  align-self: flex-end;
  background: var(--teal);
  color: var(--white);
}

.chat-line.system {
  align-self: center;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-choices {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--gray);
}

.chat-choice-btn {
  flex: 1;
}

/* TESTING ONLY — remove this rule along with the button in index.html */
.chat-debug-nav {
  display: flex;
  gap: 4px;
  padding: 6px;
  border-top: 1px solid var(--border);
  background: var(--gray);
}

.chat-debug-nav .btn {
  flex: 1;
  padding: 4px 0;
  font-size: 11px;
}

/* Mobile responsive layout adjustment */
@media (max-width: 767px) {
  .chat-debug-nav {
    border-top: none;
    border-left: 1px solid var(--border);
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  .chat-app {
    flex-direction: column;
    height: 100%;
  }

  .chat-rail {
    flex: none;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .chat-days {
    flex: 1;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .chat-day-btn {
    flex: none;
    white-space: nowrap;
  }

  .chat-debug-skip {
    flex: none;
    width: auto;
  }
}
