/* THE REST STOP: terminal-green page around the ASCII campfire (matches approved-page-mockup.html). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: #050805;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 16px;
  background: #050805;
  color: #6dff8a;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

header,
main {
  max-width: 860px;
  margin: 0 auto;
  border: 1px solid #1d3a22;
}

/* ---- top bar ---- */

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  padding: 10px 14px;
  border-radius: 6px 6px 0 0;
  border-bottom: none;
}

header h1 {
  margin: 0;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.08em;
  color: #a8ffb8;
}

header .tagline {
  margin: 0;
  font-size: 12px;
  color: #4fd16a;
}

main {
  border-radius: 0 0 6px 6px;
  overflow: hidden;
}

/* ---- the scene ---- */

#scene {
  position: relative;
  height: 380px;
  overflow: hidden;
  border-top: 1px solid #1d3a22;
  font-size: 12px;
  line-height: 1.4;
}

#grid {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  font-family: inherit;
  font-size: 12px;
  line-height: 12px;
  letter-spacing: 1px;
  white-space: pre;
  color: #6dff8a;
}

.sign {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 2;
  max-width: calc(100% - 24px);
  padding: 6px 12px;
  border: 1px solid #2e6b3a;
  background: rgba(5, 8, 5, 0.85);
  color: #8dffa3;
  text-align: center;
  white-space: nowrap;
}

.sign p {
  margin: 0;
}

.sign p + p {
  color: #4fd16a;
}

#bubbles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.bubble {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.bubble .tb {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 8px;
  border: 1px solid #2e6b3a;
  background: rgba(5, 8, 5, 0.85);
  color: #8dffa3;
  animation: bob 5s ease-in-out infinite alternate;
}

.bubble.mine .tb {
  border-color: #6dff8a;
}

.bubble .you {
  margin-left: 6px;
  color: #ffb444;
}

.bubble.more .tb {
  color: #4fd16a;
  border-style: dashed;
}

@keyframes bob {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-8px);
  }
}

#log-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  z-index: 2;
  text-align: center;
  color: #ffb444;
}

#counts {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 28px;
}

#counts p {
  margin: 0;
}

#counts p + p {
  color: #6c7a6e;
}

/* ---- sections under the scene ---- */

#you,
#trail,
#guestbook,
#tip,
#for-agents {
  border-top: 1px solid #1d3a22;
  padding: 12px 14px 14px;
}

#you {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
}

#you p {
  margin: 0;
}

#you strong {
  color: #a8ffb8;
  font-weight: normal;
}

#you form {
  margin: 0;
}

h2 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: normal;
  color: #4fd16a;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#trail li {
  color: #8dffa3;
}

#trail p {
  margin: 8px 0 0;
  color: #4fd16a;
}

#guestbook .notes-are {
  margin: 0 0 8px;
  color: #3c6b46;
}

#notes li {
  padding: 3px 0;
  color: #8dffa3;
}

#notes .when {
  color: #3c6b46;
}

#notes .who {
  color: #ffb444;
}

#notes .keeper .who {
  color: #a8ffb8;
}

#notes .ember::after {
  content: ' *';
  color: #ff9d2a;
}

button {
  font: inherit;
  color: #6dff8a;
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
  text-align: left;
}

button:hover,
button:focus-visible {
  color: #a8ffb8;
  text-decoration: underline;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

#guestbook form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  margin-top: 12px;
}

#guestbook textarea {
  flex: 1 1 240px;
  min-width: 0;
  max-width: 100%;
  font: inherit;
  color: #6dff8a;
  background: #050805;
  border: 1px solid #2e6b3a;
  padding: 6px 8px;
  resize: vertical;
}

#guestbook textarea:focus {
  outline: 1px solid #6dff8a;
}

.form-msg {
  flex-basis: 100%;
  margin: 0;
  color: #ffb444;
}

.form-msg:empty {
  display: none;
}

#tip p {
  margin: 0 0 6px;
}

a {
  color: #8dffa3;
}

a:hover,
a:focus-visible {
  color: #a8ffb8;
}

.dim,
.dim h2 {
  color: #3c6b46;
}

.dim p {
  margin: 6px 0 0;
}

.scene-text {
  margin: 0;
  font-family: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

code {
  font-family: inherit;
  color: #4fd16a;
}

/* ---- phones ---- */

@media (max-width: 599px) {
  #scene {
    height: 300px;
  }

  .sign {
    top: 8px;
    width: calc(100% - 24px);
    padding: 4px 8px;
    white-space: normal;
  }

  #counts {
    gap: 0 14px;
  }

  .bubble .tb {
    max-width: 130px;
    padding: 2px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bubble .tb {
    animation: none;
  }
}
