/* HIDDEN PAGES
   1. Riddle door
   2. Saved chatroom
   3. Small-screen layout
   This is original code with visual references to late-1990s chat clients. */

/* 1. RIDDLE DOOR ------------------------------------------------------- */

.password-window {
  max-width: 650px;
  margin: 45px auto;
}

.puzzle-close {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid white;
  border-radius: 3px;
  background: linear-gradient(#e69c83, #bc4e2b);
  color: white;
  text-decoration: none;
  line-height: 1;
  font-size: 19px;
}

.password-content {
  padding: 36px 42px 30px;
  background: #f4f1e4;
}

.password-content .small-label {
  font-size: 9px;
  margin-bottom: 13px;
}

.password-content h1 {
  margin-bottom: 25px;
  font-size: 25px;
}

.riddle {
  padding: 22px 24px;
  background: #fffef9;
  border: 1px solid #b8c3d0;
  box-shadow: inset 1px 1px #e1e4e8;
  color: #253955;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.7;
}

.riddle em {
  font-style: italic;
  font-synthesis: style;
}

.riddle .cipher {
  margin: 23px 0 0;
  padding-top: 17px;
  border-top: 1px dashed #c7ced5;
  font-family: "Courier New", monospace;
  font-size: 16px;
}

.password-form {
  margin-top: 24px;
}

.password-form label {
  display: block;
  font-size: 12px;
  margin-bottom: 7px;
}

.password-entry {
  display: flex;
  gap: 10px;
}

.password-entry input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #7d8b9d;
  box-shadow: inset 1px 1px #d7d7d7;
  background: white;
}

.password-entry input:focus-visible {
  outline: 2px solid #245edb;
  outline-offset: 2px;
}

.password-entry input[aria-invalid="true"] {
  border-color: #ab2d2d;
}

.password-entry button {
  white-space: nowrap;
}

.password-error {
  min-height: 21px;
  margin: 8px 0 9px;
  font-size: 12px;
  color: #a92727;
}

.puzzle-return {
  font-size: 12px;
}

/* 2. AOL-STYLE SAVED CHATROOM ------------------------------------------- */

.story-locked #chat-window {
  display: none;
}

.chat-window {
  max-width: 1118px;
  margin: 0 auto;
  background: #d4d0c8;
}

.chat-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 8px 15px;
  border-bottom: 1px solid #989da4;
  box-shadow: inset 0 1px white;
  background: #ede9d9;
  font-size: 11px;
}

.chat-toolbar b {
  color: #164796;
}

.chat-room-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 23px;
  background: linear-gradient(110deg, #e7effc, #f7faff);
  border-bottom: 1px solid #9bacc4;
}

.room-icon {
  width: 46px;
  height: 46px;
  image-rendering: pixelated;
}

.chat-room-header h1 {
  margin: 0 0 4px;
  font-size: 23px;
  letter-spacing: -0.4px;
}

.chat-room-header p {
  margin: 0;
  font-size: 11px;
  color: #596e8b;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 222px;
  align-items: stretch;
  gap: 12px;
  padding: 15px;
}

.chat-main,
.chat-online {
  min-width: 0;
}

.chat-panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: #143875;
  background: #e8edf5;
  border: 1px solid #9da9ba;
  font-size: 10px;
}

.chat-panel-title h2 {
  margin: 0;
  font-size: 12px;
  color: inherit;
}

.chat-transcript {
  height: 427px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 22px;
  border: 2px inset #d4d0c8;
  background: white;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  scrollbar-color: #b6c4d9 #e9edf4;
}

.chat-transcript:focus-visible {
  outline: 2px solid #2b62b8;
  outline-offset: 1px;
}

.chat-line {
  margin: 0 0 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.speaker-other {
  color: #b22222;
}

.speaker-me {
  color: #164fc2;
}

.chat-narration {
  color: #737881;
  font-size: 12px;
  padding: 8px 0;
}

.chat-log-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  font-size: 11px;
}

.chat-log-controls .xp-button {
  padding: 5px 9px;
  font-size: 11px;
}

.chat-window button:disabled {
  color: #707782;
  background: #dfded9;
  border-color: #a5a7a5;
  box-shadow: inset 1px 1px #f8f8f8;
}

.ending-options {
  margin: 0 0 12px;
  font-size: 12px;
}

.ending-options[hidden] {
  display: none;
}

.ending-options select {
  margin-left: 8px;
  padding: 4px;
  font: inherit;
  color: #27374d;
  background: white;
  border: 1px solid #949fac;
}

.chat-compose {
  padding: 10px;
  border: 1px solid #a3a5aa;
  box-shadow: inset 1px 1px #f6f5f1;
  background: #e9e7df;
}

.chat-compose > label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

.chat-compose-row {
  display: flex;
  gap: 9px;
}

.chat-compose textarea {
  min-width: 0;
  flex: 1;
  resize: none;
  padding: 10px;
  font:
    13px Tahoma,
    Verdana,
    sans-serif;
  background: #e4e4e4;
  color: #686868;
  -webkit-text-fill-color: #686868;
  opacity: 1;
  border: 2px inset #f8f8f8;
}

.chat-compose p {
  margin: 7px 0 0;
  color: #727473;
  font-size: 10px;
}

.chat-online {
  background: #f8f9fb;
  border: 1px solid #939ba8;
  display: flex;
  flex-direction: column;
}

.chat-online .chat-panel-title {
  border: 0;
  border-bottom: 1px solid #9da9ba;
}

.buddy-list {
  list-style: none;
  margin: 0;
  padding: 10px;
}

.buddy-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 4px;
  line-height: 1.3;
  font-size: 12px;
}

.buddy-list strong {
  display: block;
  overflow-wrap: anywhere;
}

.buddy-list small {
  display: block;
  margin-top: 4px;
  color: #737a87;
  font-size: 10px;
}

.buddy-list .guest-buddy {
  border-top: 1px solid #dce2ec;
  margin-top: 8px;
  padding-top: 17px;
}

.presence-dot {
  width: 9px;
  height: 9px;
  border: 1px solid #858585;
  flex-shrink: 0;
  box-shadow: inset 1px 1px #fff9;
}

.presence-dot.offline {
  background: #b6b7b9;
}

.presence-dot.online {
  background: #48a947;
  border-color: #3b7d39;
}

.room-details {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid #d6dce5;
  background: #edf1f7;
  font-size: 10px;
}

.room-details p {
  margin-bottom: 7px;
  color: #6e7b8d;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.room-details strong,
.room-details span {
  display: block;
}

.room-details span {
  margin-top: 5px;
  color: #6e7b8d;
}

.chat-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 15px;
  border-top: 1px solid #9fa4aa;
  background: #ece9d8;
  font-size: 10px;
  color: #666e7a;
}

.chat-status button {
  padding: 0;
  background: none;
  border: 0;
  text-decoration: underline;
  color: #164da4;
  font: inherit;
}

/* 3. SMALL SCREENS ----------------------------------------------------- */

@media (max-width: 680px) {
  .password-window {
    margin: 10px auto;
  }

  .password-content {
    padding: 26px 18px;
  }

  .riddle {
    padding: 17px 12px;
    font-size: 14px;
  }

  .riddle .cipher {
    font-size: 14px;
  }

  .chat-layout {
    grid-template-columns: minmax(0, 1fr) 133px;
    gap: 8px;
    padding: 10px;
  }

  .chat-room-header {
    padding: 16px;
  }

  .chat-room-header h1 {
    font-size: 20px;
  }

  .chat-transcript {
    padding: 15px;
  }

  .chat-log-controls {
    flex-wrap: wrap;
  }

  #chat-page-label {
    order: -1;
    width: 100%;
    text-align: center;
  }

  .chat-status {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .chat-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-transcript {
    height: 380px;
  }

  .buddy-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    padding: 8px;
    gap: 6px;
  }

  .buddy-list li,
  .buddy-list .guest-buddy {
    border: 0;
    margin: 0;
    padding: 7px 0;
    gap: 5px;
    font-size: 10px;
  }

  .room-details {
    display: none;
  }

  .chat-toolbar {
    flex-wrap: wrap;
    gap: 5px;
  }
}
