#page-wrapper,
body {
  min-height: 100vh;
}

#page-wrapper,
header {
  display: flex;
  flex-direction: column;
}

#page-content,
header {
  box-sizing: border-box;
}

#theme,
body {
  color: #f4edd0;
}

#theme,
footer {
  position: relative;
}

#empty-placeholder,
#final-message,
#locked-message,
#theme,
#transition-message,
#transition-sub,
#transition-title,
footer,
header {
  text-align: center;
}

body,
button,
h1,
input,
label,
p,
textarea {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Nunito, sans-serif;
}

body {
  background-color: #020513;
  padding: 0;
}

header {
  width: 100%;
  padding: 28px 0 25px;
  background: linear-gradient(
    to bottom,
    rgba(2, 5, 19, 0.92),
    rgba(10, 15, 30, 0.88)
  );
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  max-width: 100%;
  margin: 0 auto;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  animation: 0.8s forwards fadeSlideDown;
}

#page-content,
header .nav-content {
  width: 100%;
  display: flex;
  flex-direction: column;
}

header .nav-content {
  align-items: center;
  top: 0;
  left: 0;
  z-index: 1000;
  padding: 28px 0 7px;
}

header h1 {
  background: rgba(244, 237, 208, 0.07);
  border-radius: 40px;
  display: inline-block;
  padding: 6px 24px; /* wider padding */
  font-weight: 800;
  text-align: center;
  font-size: inherit; /* inherit from .site-title */
}

.site-title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: clamp(0.4rem, 1.2vw, 0.7rem);
  font-size: clamp(2.2rem, 6vw, 3.6rem); /* BUMPED UP */
  line-height: 1.1;
}

#page-content {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1px 16px 80px;
  margin-top: clamp(100px, 15vh, 140px);
  max-width: 100%;
  z-index: 0;
  align-items: center;
  flex: 1;
}

#theme,
body.night #theme {
  display: block;
}

#post-form,
#posts-feed {
  flex-direction: column;
  display: flex;
}

#theme {
  margin: clamp(20px, 2vh, 40px) 0 clamp(20px, 3vh, 50px);
  padding: 0 20px;
  font-size: 1.2rem;
  white-space: normal;
  z-index: 1;
  margin-bottom: 20px;
}

#submit-button,
#thought-input {
  font-size: clamp(0.9rem, 2vw, 1.2rem);
}

.theme-label {
  opacity: 0.8;
  letter-spacing: 1px;
  font-size: clamp(0.6rem, 2vw, 0.9rem);
  margin-bottom: 4px;
}

.theme-text {
  font-size: clamp(1rem, 3.5vw, 1.6rem);
  font-weight: 600;
  margin-top: 5px;
}

.theme-underline {
  width: clamp(150px, 50vw, 300px);
  height: 2px;
  background-color: rgba(255, 255, 255, 0.2);
  margin: 8px auto 20px;
  border-radius: 1px;
}

#post-form,
#posts-feed,
.content-wrapper,
.form-wrapper {
  margin: 0 auto;
  box-sizing: border-box;
}

#thought-input {
  width: clamp(280px, 80vw, 500px);
  min-height: clamp(100px, 20vh, 140px);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  resize: none;
  box-sizing: border-box;
  max-width: 100%;
}

#thought-input::placeholder {
  font-size: clamp(0.9rem, 2vw, 1.2rem);
}

#post-form {
  gap: 5px;
  background: 0 0;
  border: none;
  padding: 0;
}

#prompt-checkbox label {
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  opacity: 0.85;
  font-weight: 500;
}

#prompt-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 16px;
}

#submit-button {
  width: 100%;
  padding: clamp(9px, 2vh, 14px);
  border: none;
  background-color: #f4edd0;
  color: #0a0f2c;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
}

#posts-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #f4edd0;
  width: 100%;
  max-width: 800px;
  margin: 50px 0 20px;
}

#post-form,
#posts-feed,
.form-wrapper,
.post {
  max-width: 600px;
}

.posts-line {
  flex-grow: 1;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.15),
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.15),
    transparent
  );
  border-radius: 2px;
  min-width: 60px;
}

.posts-center {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  font-weight: 600;
  opacity: 0.9;
  white-space: nowrap;
}

.shooting-star {
  font-size: 1rem;
  opacity: 0.8;
}

#posts-feed {
  gap: clamp(18px, 3vw, 28px);
  width: 100%;
}

.content-wrapper {
  max-width: 600px;
  padding: 0 1rem;
}

#post-form,
.form-wrapper,
.post-form-wrapper,
textarea#thought-input {
  width: 100%;
  box-sizing: border-box;
}

.form-wrapper {
  padding: 0 1rem;
  width: 100%;
}

#post-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.form-wrapper,
.post-form-wrapper {
  display: flex;
  justify-content: center;
}

.post {
  background-color: rgba(244, 237, 208, 0.05);
  border: 2px solid rgba(244, 237, 208, 0.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  padding: clamp(8px, 1.5vw, 12px) clamp(12px, 2.5vw, 16px);
  backdrop-filter: blur(3px);
  width: 100%;
  font-size: 1.1rem;
  line-height: 1.7;
  box-sizing: border-box;
  overflow-wrap: break-word;
  animation: 0.8s forwards fadeInUp;
  animation-delay: var(--delay, 0s);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.post-divider,
footer::before {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.post-divider {
  border: none;
  margin-top: 3px;
  margin-bottom: 20px;
  margin-left: clamp(14px, 3vw, 18px);
  margin-right: clamp(14px, 3vw, 18px);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px clamp(14px, 3vw, 18px) 6px;
}

.post-theme {
  font-size: clamp(0.65rem, 1.5vw, 0.975rem);
  color: #bbb;
  font-weight: 400;
}

.post-time {
  margin-left: auto;
  font-size: 0.75rem;
  color: #bbb;
  font-weight: 500;
  white-space: nowrap;
}

.post-content {
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  color: #eee;
  padding: 0 clamp(14px, 3vw, 18px) clamp(14px, 3vw, 18px);
  line-height: clamp(1rem, 4vw, 1.5rem);
}

.site-icon {
  height: 1.1em; /* slightly larger icon */
  width: auto;
  vertical-align: middle;
}

#stars-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("stars.jpg") 0 0 / cover;
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
}

#final-message {
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  color: #aaa;
  opacity: 0;
  margin-top: 10px;
  transition: opacity 0.4s;
}

#final-message.show {
  opacity: 1;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 600;
  color: #f4edd0;
  text-align: center;
  margin-top: 16px;
  animation: 0.4s fadeInFinal;
}

@keyframes fadeInFinal {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.post-form-wrapper {
  position: relative;
  width: clamp(280px, 80vw, 500px);
}

#post-counter {
  position: absolute;
  top: -24px;
  right: 4px;
  font-size: 0.85rem;
  opacity: 0.7;
}

footer {
  margin-top: auto;
  font-size: 12px;
  color: #888;
  padding: 40px 0 20px;
}

footer::before {
  content: "";
  display: block;
  width: 60px;
  margin: 0 auto 10px;
  border-radius: 1px;
}

footer p {
  font-style: italic;
  font-size: 0.85rem;
  opacity: 0.65;
  letter-spacing: 0.5px;
}

@keyframes fadeSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUpScroll {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.post.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

body.day,
body.night #submit-button {
  background-color: #f4edd0;
  color: #0a0f2c;
}

body.day header {
  background: linear-gradient(
    to bottom,
    rgba(244, 237, 208, 0.92),
    rgba(240, 230, 200, 0.88)
  );
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.day header h1 {
  background: rgba(10, 15, 44, 0.07);
  color: #0a0f2c;
}

body.day #info-timer-wrapper,
body.day #posts-title,
body.day #theme,
body.day .post-content,
body.day .post-theme,
body.day .post-time,
body.day .posts-center,
body.day footer {
  color: #0a0f2c;
}

body.day .post {
  background-color: rgba(10, 15, 44, 0.05);
  border: 2px solid rgba(10, 15, 44, 0.1);
  color: #0a0f2c;
}

body.day #thought-input:disabled {
  background-color: #eee;
  color: #666;
  cursor: not-allowed;
}

body.day #prompt-checkbox input:disabled + label {
  opacity: 0.6;
}

body.night #thought-input:disabled {
  background-color: #0a0f2c;
  color: #f4edd0;
  cursor: text;
}

body.night #submit-button:disabled {
  background-color: #f4edd0;
  color: #0a0f2c;
  cursor: pointer;
}

body.night #prompt-checkbox input:disabled + label {
  color: #f4edd0;
  opacity: 1;
  cursor: pointer;
}

body.day #thought-input {
  background-color: #eee;
  color: #666;
  border: 1px solid #bbb;
  cursor: not-allowed;
}

body.day #thought-input::placeholder {
  color: #aaa;
}

body.day #submit-button:disabled {
  background-color: #ccc;
  color: #666;
  font-weight: 700;
  cursor: not-allowed;
}

body.day #prompt-checkbox input:disabled + label {
  color: #666;
  cursor: not-allowed;
  opacity: 0.7;
}

body.night #thought-input {
  background-color: rgba(20, 25, 50, 0.85);
  color: #f4edd0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.night #thought-input::placeholder {
  color: #ddd;
}

body.night #prompt-checkbox label {
  color: #f4edd0;
}

body.day.form-locked #post-form {
  background-color: rgba(0, 0, 0, 0.04);
  padding: 26px 22px;
  border-radius: 16px;
  border: 1px dashed #aaa;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.night #post-form.post-limit-locked {
  background-color: rgba(255, 255, 255, 0.035);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(2px);
  border-radius: 16px;
  padding: 26px 22px;
}

body.night #post-form.post-limit-locked button,
body.night #post-form.post-limit-locked label,
body.night #post-form.post-limit-locked textarea {
  opacity: 0.45;
}

#submit-button:disabled:hover {
  cursor: not-allowed;
}

body.day .posts-line {
  background: linear-gradient(
    to right,
    transparent,
    rgba(10, 15, 44, 0.15),
    rgba(10, 15, 44, 0.3),
    rgba(10, 15, 44, 0.15),
    transparent
  );
}

#prompt-checkbox input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #0a0f2c;
  cursor: pointer;
}

body.day #prompt-checkbox input[type="checkbox"] {
  accent-color: #0a0f2c;
}

body.night #prompt-checkbox input[type="checkbox"] {
  accent-color: #bfb89a;
}

#locked-message {
  margin-top: 15px;
  margin-bottom: 5px;
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  opacity: 0.8;
}

@media (min-width: 1000px) {
  #post-form,
  #submit-button,
  #thought-input {
    max-width: 650px;
  }
}

body.day .post-divider {
  background: rgba(10, 15, 44, 0.25);
}

#transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 5, 15, 0.8);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: "Lexend Deca", sans-serif;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 9999;
}

#transition-overlay.show {
  opacity: 1;
  pointer-events: all;
}

#sky-orb {
  font-size: 4rem;
  margin-bottom: 1rem;
}

#transition-title {
  font-size: 2.4rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--cream);
}

#transition-sub {
  font-size: 1.2rem;
  font-weight: 400;
  opacity: 0.8;
}

#transition-message {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 600;
  color: #f4edd0;
  margin-top: 1rem;
  line-height: 1.5;
}

#transition-title,
.transition-line1 {
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #f4edd0;
}

.transition-line1 {
  font-size: clamp(2.8rem, 8vw, 4.8rem);
}

.transition-line2 {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 600;
  opacity: 0.95;
}

#empty-placeholder {
  display: none;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-style: italic;
  opacity: 0.8;
  margin-top: 50px;
  font-weight: 500;
  line-height: 1.5;
}

body,
html {
  height: 100%;
  margin: 0;
}

.read-more {
  color: #aaa;
  cursor: pointer;
  font-style: italic;
  font-size: 0.95rem;
  margin-left: 4px;
  opacity: 0.8;
  text-decoration: underline;
}

#stars-background,
#moon {
  z-index: -1;
}

#stars-background {
  pointer-events: none;
}
