/* PlayBook Moby Dick - DOS white terminal */

:root {
  --text: #c8c8c0;        /* DOS light grey */
  --bright: #ffffff;      /* DOS bright white */
  --grey: #7a7a72;        /* dim grey */
  --cyan: #56c8d8;        /* softened DOS cyan */
  --yellow: #e8d44d;      /* softened DOS yellow */
  --bg: #060606;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #000;
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
}

#crt {
  position: relative;
  max-width: 920px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 80px rgba(255, 255, 255, 0.05) inset;
  padding: 24px 28px 64px;
  overflow-x: hidden;
}

/* scanlines */
#crt::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.16) 3px
  );
  z-index: 10;
}

.screen { display: none; animation: flicker-in 0.25s; }
.screen.active { display: block; }

@keyframes flicker-in {
  0% { opacity: 0; }
  40% { opacity: 0.6; }
  60% { opacity: 0.3; }
  100% { opacity: 1; }
}

.hidden { display: none !important; }
.center { text-align: center; margin: 14px 0; }
.italic { font-style: italic; }
.dim { color: var(--grey); }

.blink { animation: blink 1.2s step-end infinite; color: var(--bright); }
@keyframes blink { 50% { opacity: 0.25; } }

/* the streaming cursor */
.cursor::after {
  content: "\2588";
  color: var(--bright);
  animation: blink 0.9s step-end infinite;
}

/* boot */
#boot-lines {
  color: var(--text);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.35);
  white-space: pre-wrap;
  line-height: 1.5;
  min-height: 300px;
}
#boot-continue { margin-top: 18px; }

/* title */
#title-art {
  color: var(--bright);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  font-size: clamp(5px, 1.55vw, 13px);
  line-height: 1.25;
  overflow-x: auto;
}
#whale-art { color: var(--cyan); font-size: 13px; line-height: 1.2; }

h2 {
  color: var(--bright);
  letter-spacing: 3px;
  margin: 18px 0;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}

/* character select */
#character-list { display: grid; gap: 12px; margin: 20px 0; }
.char-card {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--grey);
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  padding: 12px 16px;
  cursor: pointer;
}
.char-card:hover, .char-card:focus {
  border-color: var(--bright);
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}
.char-num { color: var(--yellow); }
.char-name { color: var(--bright); font-weight: bold; letter-spacing: 2px; }
.char-desc { display: block; margin-top: 6px; }
.char-quote { display: block; margin-top: 4px; color: var(--grey); font-style: italic; }

/* prose */
.prose {
  white-space: pre-wrap;
  line-height: 1.65;
  margin: 18px 0;
  max-width: 72ch;
}
.prose .flux { color: #b9a6e8; text-shadow: 0 0 8px rgba(185, 166, 232, 0.45); }

/* game chrome */
#status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  border-bottom: 1px solid var(--grey);
  padding-bottom: 8px;
  margin-bottom: 14px;
  color: var(--grey);
  font-size: 13px;
  letter-spacing: 1px;
}

#chapter-header {
  border: 1px double var(--grey);
  color: var(--cyan);
  text-align: center;
  padding: 8px;
  margin: 12px auto;
  max-width: 60ch;
  letter-spacing: 2px;
}

.beat {
  border-left: 3px solid var(--bright);
  color: var(--bright);
  padding: 6px 12px;
  margin: 14px 0;
  white-space: pre-wrap;
}

.freeform-response {
  border-left: 3px solid var(--cyan);
  color: var(--text);
  padding: 6px 12px;
  margin: 14px 0;
  white-space: pre-wrap;
  font-style: italic;
}

.choices-title { color: var(--bright); margin: 16px 0 10px; }
#choice-list { display: grid; gap: 8px; max-width: 72ch; }
.choice-btn {
  text-align: left;
  background: none;
  border: 1px solid transparent;
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  padding: 6px 10px;
  cursor: pointer;
}
.choice-btn:hover, .choice-btn:focus {
  border-color: var(--grey);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}
.choice-btn .key { color: var(--cyan); margin-right: 8px; }

/* the command line - speak and act in your own words */
#freeform-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 72ch;
  margin: 14px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}
#freeform-prompt { color: var(--bright); }
#freeform-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--bright);
  font-family: inherit;
  font-size: inherit;
  padding: 4px 2px;
  caret-color: var(--bright);
}
#freeform-input:focus { outline: none; }
#freeform-input::placeholder { color: var(--grey); font-style: italic; }

/* reflection */
#reflection-text {
  width: 100%;
  max-width: 72ch;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--grey);
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  padding: 10px;
  line-height: 1.5;
  margin: 12px 0;
}
#reflection-text:focus { border-color: var(--bright); outline: none; }

.button-row { display: flex; gap: 14px; flex-wrap: wrap; }
.action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bright);
  color: var(--bright);
  font-family: inherit;
  font-size: inherit;
  padding: 8px 18px;
  cursor: pointer;
  letter-spacing: 1px;
}
.action-btn:hover { background: rgba(255, 255, 255, 0.16); }
.dim-btn { border-color: var(--grey); color: var(--grey); background: none; }

/* ending */
#ending-title.canonical { color: var(--cyan); }
#ending-title.alternate { color: var(--bright); text-shadow: 0 0 10px rgba(255, 255, 255, 0.55); }

/* chrome */
#sound-toggle {
  position: fixed;
  top: 10px;
  right: 14px;
  color: var(--grey);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 1px;
  z-index: 20;
  user-select: none;
}
#sound-toggle.on { color: var(--bright); }

#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  color: #4a4a44;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.7);
  z-index: 20;
}

@media (max-width: 600px) {
  #crt { padding: 14px 12px 56px; }
  html, body { font-size: 14px; }
}
