/* ====== ROOM MODE — MAS-STYLE ====== */

/* Room mode header override */
.screen.room-mode .header {
  background: linear-gradient(135deg, #3d2b5a 0%, #5a3d6e 100%);
}

[data-theme="dark"] .screen.room-mode .header {
  background: linear-gradient(135deg, #2a1d40 0%, #3d2855 100%);
}

/* Hide story-only elements in room mode (chat area stays visible) */
.screen.room-mode .affinity-panel { display: none !important; }
.screen.room-mode .vn-sprites { display: none !important; }
.screen.room-mode .story-choices { display: none !important; }
.screen.room-mode .word-picker { display: none !important; }

/* Room scene — compact sprite panel at top */
.room-scene {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
  height: 35vh;
  max-height: 350px;
  min-height: 200px;
  flex-shrink: 0;
}

/* Canvas — fills the sprite panel */
#masCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* Room input area styling */
.screen.room-mode .input-area {
  display: flex !important;
  border-top: 1px solid rgba(180, 140, 255, 0.2);
  background: var(--bg-primary, #fff);
}

.screen.room-mode .input-area textarea {
  background: var(--bg-secondary, #f5f5f5);
}

[data-theme="dark"] .screen.room-mode .input-area {
  border-top-color: rgba(180, 140, 255, 0.15);
}

/* Room mode loading state */
.room-loading-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(200, 160, 255, 0.8);
  font-size: 15px;
  text-align: center;
  pointer-events: none;
}

/* Mode toggle — three buttons */
.mode-toggle {
  display: flex;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--green-mid);
  margin-bottom: 16px;
}

.mode-toggle button {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  color: var(--green-mid);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.mode-toggle button.active {
  background: var(--green-mid);
  color: #fff;
}

.mode-toggle button:not(.active):hover {
  background: rgba(76, 175, 80, 0.1);
}

/* Room mode options in new chat screen */
#roomModeOptions {
  text-align: center;
}

#roomModeOptions .rel-display {
  margin-bottom: 12px;
}

/* Dark mode overrides */
[data-theme="dark"] .room-scene {
  background: #111;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .room-scene {
    height: 28vh;
    min-height: 160px;
    max-height: 260px;
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .room-scene {
    height: 32vh;
    max-height: 320px;
  }
}
