:root {
  --ink: #4a3b3b;
  --dim: #8c7478;
  --border: #d6c6cc;
  --paper: #fffdfd;
  --pink-bg: #fbecef;
  --pink-deep: #f5d7df;
  --sky: #eaf8ff;
  --grass: #d8f4c8;
  --flower: #ffd6e8;
  --hal3: #5a4040;
  --you: #48535a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "BIZ UDPGothic", "Yu Gothic", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  background: #05070a;
}

.hidden {
  display: none !important;
}

/* Boot screen keeps the previous dark terminal feeling */
.boot-screen {
  min-height: 100vh;
  padding: 44px;
  background: #05070a;
  color: #c9f6ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}

.boot-title {
  font-size: 22px;
  margin-bottom: 28px;
}

.boot-lines {
  font-size: 18px;
  line-height: 1.9;
}

/* Title screen */
.title-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, #fff7fa 0 12%, transparent 13%),
    radial-gradient(circle at 82% 72%, #ffe3ec 0 10%, transparent 11%),
    var(--pink-bg);
}

.title-card {
  width: min(720px, calc(100vw - 32px));
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: 8px 8px 0 rgba(160, 120, 130, 0.18);
}

.title-border {
  border: 2px double #c9aeb8;
  text-align: center;
  padding: 48px 24px;
}

.title-border h1 {
  margin: 0;
  font-size: 42px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.title-border h1 span,
.room-title span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 500;
}

.title-border h2 {
  margin: 18px 0 8px;
  font-size: 34px;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.version {
  margin: 18px 0 28px;
  color: var(--dim);
}

.subtitle {
  margin: 0 0 32px;
  color: var(--hal3);
}

.enter-button,
button {
  cursor: pointer;
  background: #fff8fa;
  color: var(--ink);
  border: 1px solid #bda7ae;
  padding: 10px 18px;
  font: inherit;
  box-shadow: 2px 2px 0 #d8c4cb;
}

button:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #d8c4cb;
}

/* Flower room */
.room-screen {
  min-height: 100vh;
  background:
    linear-gradient(to bottom, var(--sky) 0 46%, var(--grass) 46% 100%);
  position: relative;
  overflow: hidden;
  padding: 32px 16px;
}

.sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  background: rgba(255,255,255,0.82);
  border-radius: 999px;
  filter: blur(0.2px);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,0.82);
  border-radius: 999px;
}

.cloud-a {
  width: 140px;
  height: 44px;
  top: 70px;
  left: 8%;
}

.cloud-a::before {
  width: 60px;
  height: 60px;
  left: 18px;
  top: -26px;
}

.cloud-a::after {
  width: 72px;
  height: 72px;
  right: 20px;
  top: -34px;
}

.cloud-b {
  width: 180px;
  height: 50px;
  top: 130px;
  right: 10%;
}

.cloud-b::before {
  width: 70px;
  height: 70px;
  left: 28px;
  top: -32px;
}

.cloud-b::after {
  width: 86px;
  height: 86px;
  right: 28px;
  top: -42px;
}

.petals {
  position: absolute;
  left: -20%;
  top: 48%;
  color: #ff9fc3;
  font-size: 28px;
  opacity: 0.7;
  animation: petals 28s linear infinite;
  white-space: nowrap;
}

@keyframes petals {
  from { transform: translateX(0); }
  to { transform: translateX(140vw); }
}

.room-card {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  background: rgba(255,253,253,0.92);
  border: 1px solid var(--border);
  box-shadow: 6px 6px 0 rgba(140, 110, 120, 0.18);
  padding: 18px;
}

.room-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.room-title {
  font-size: 24px;
  font-weight: 700;
}

.room-subtitle {
  color: var(--dim);
  margin-top: 4px;
}

.room-status {
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--dim);
}

.diary-box {
  margin: 14px 0;
  padding: 12px;
  background: #fff8fa;
  border: 1px dashed #d8bcc6;
  color: var(--dim);
}

.diary-box div {
  font-weight: 700;
  color: var(--ink);
}

.diary-box p {
  margin: 6px 0 12px;
}

.log {
  min-height: 420px;
  max-height: 520px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,214,232,0.75) 0 12px, transparent 13px),
    radial-gradient(circle at 88% 82%, rgba(255,214,232,0.75) 0 10px, transparent 11px),
    #fffefd;
  border: 1px solid #ead8de;
  padding: 18px;
  white-space: pre-wrap;
}

.hal3,
.you {
  margin: 14px 0;
  line-height: 1.7;
}

.hal3 {
  color: var(--hal3);
}

.you {
  color: var(--you);
  text-align: right;
}

.input-area {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: stretch;
}

textarea {
  flex: 1;
  min-height: 78px;
  resize: vertical;
  background: #fffefd;
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 12px;
  font: inherit;
  line-height: 1.5;
}

.buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body.flashback .room-screen {
  background: #111;
}

body.flashback .room-card {
  filter: grayscale(1) contrast(1.4);
}
