/* 夜間保守。2000年ごろの業務パソコン：灰色のウィンドウ・細かいドット文字・黒地に緑の端末。少しにじむ画面 */
* {
  box-sizing: border-box;
}

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

body {
  background: #0c0e10;
  color: #d0d4d0;
  font-family: "MS PGothic", "MS Gothic", "Osaka", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.15em;
}

button {
  padding: 0.3em 1.1em;
  border: 2px outset #e0e0e0;
  background: #c0c0c0;
  color: #000;
  font: inherit;
  cursor: pointer;
}

button:active:not(:disabled) {
  border-style: inset;
}

button:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

button:disabled {
  color: #808080;
  cursor: default;
}

canvas {
  display: block;
}

/* 画面いっぱいの画面（タイトル・注意書き・文・一時停止・報告・エンディング） */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: 1.4rem;
  padding: 1rem;
  background: #0c0e10;
  text-align: center;
  overflow-y: auto;
}

#paused {
  z-index: 40;
  background: rgb(0 0 0 / 82%);
}

.title {
  margin: 0;
  color: #9adf9a;
  font-family: "MS Gothic", "Osaka-Mono", monospace;
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-shadow: 0 0 6px rgb(120 255 120 / 45%);
}

.status,
.note {
  margin: 0;
  color: #8a908a;
  line-height: 1.8;
}

.status {
  letter-spacing: 0.3em;
}

.error {
  color: #e08a7a;
}

/* タイトル：晩を選ぶボタン。まだ選べない晩は鍵の絵 */
.nights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.night {
  display: inline-flex;
  gap: 0.5em;
  align-items: center;
  justify-content: center;
  min-width: 8rem;
  min-height: 2.4rem;
  letter-spacing: 0.15em;
}

.night-lock {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.night-locked:disabled {
  opacity: 0.7;
}

#caution-text {
  white-space: pre-line;
}

.controls {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.35em 1.6em;
  margin: 0;
  color: #a8aea8;
  text-align: left;
}

.controls dd {
  margin: 0;
}

#volume label {
  display: inline-flex;
  gap: 0.5em;
  align-items: center;
  margin-left: 1em;
}

.sound-test {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  max-width: 44rem;
}

#words-lines p,
#ending-lines p,
#ending-after p {
  margin: 0 0 0.6em;
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  font-size: 1.05rem;
  line-height: 2.2;
}

/* --- デスクトップ --- */
.desktop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  /* 少しくすんだ、昔の青緑の壁紙 */
  background: #2a6464;
  /* 古いブラウン管の、うっすらしたにじみ */
  filter: blur(0.25px) contrast(1.05);
}

.desktop::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 30;
  background: repeating-linear-gradient(to bottom, rgb(0 0 0 / 0%) 0 2px, rgb(0 0 0 / 10%) 2px 3px);
  pointer-events: none;
}

.icons {
  position: absolute;
  top: 12px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.icon {
  width: 84px;
  padding: 40px 2px 4px;
  border: 1px dotted transparent;
  background:
    linear-gradient(#c0c0c0, #c0c0c0) center 6px / 30px 26px no-repeat,
    transparent;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.icon[data-window="term"] {
  background: linear-gradient(#000, #000) center 8px / 26px 20px no-repeat, linear-gradient(#c0c0c0, #c0c0c0) center 6px / 32px 26px no-repeat;
}

.icon[data-window="mail"] {
  background: linear-gradient(#f0f0e0, #f0f0e0) center 8px / 30px 20px no-repeat;
}

.icon[data-window="memo"] {
  background: linear-gradient(#fff, #fff) center 4px / 22px 30px no-repeat;
}

.icon[data-window="spec"] {
  background: linear-gradient(#e4e0d0, #e4e0d0) center 4px / 24px 30px no-repeat;
}

.icon:focus-visible,
.icon:hover {
  border-color: #fff;
}

/* 画面のふちの付箋 */
.stickies {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 150px;
}

.sticky {
  margin: 0;
  padding: 10px 8px;
  background: #e8dc70;
  color: #2a2a5a;
  box-shadow: 2px 2px 0 rgb(0 0 0 / 30%);
  font-family: "Yu Gothic", "Hiragino Sans", sans-serif;
  font-size: 12px;
  transform: rotate(-1.5deg);
}

.sticky:nth-child(even) {
  transform: rotate(1.8deg);
}

/* ウィンドウ（灰色・立体の枠・青い題の帯） */
.window {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 3px;
  border: 2px outset #e0e0e0;
  background: #c0c0c0;
  color: #000;
  box-shadow: 1px 1px 0 #000;
}

.window.front {
  z-index: 15;
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 3px 2px 6px;
  background: linear-gradient(to right, #808080, #b0b0b0);
  color: #e0e0e0;
  font-weight: bold;
}

.window.front .titlebar {
  background: linear-gradient(to right, #000080, #1084d0);
  color: #fff;
}

.close {
  padding: 0 0.4em;
  line-height: 1.1;
}

.win-term {
  top: 40px;
  left: 120px;
  width: min(760px, calc(100vw - 300px));
  height: calc(100vh - 100px);
}

.win-mail {
  top: 70px;
  left: 260px;
  width: min(720px, calc(100vw - 420px));
  height: min(520px, calc(100vh - 140px));
}

.win-memo {
  top: 110px;
  left: 300px;
  width: min(640px, calc(100vw - 460px));
  height: min(460px, calc(100vh - 180px));
}

.win-spec {
  top: 20px;
  left: 340px;
  width: min(500px, calc(100vw - 500px));
  height: calc(100vh - 70px);
}

/* 端末：黒地に緑 */
.term-screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px;
  border: 2px inset #e0e0e0;
  background: #050805;
  color: #8ee08e;
  font-family: "MS Gothic", "Osaka-Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.35;
  text-shadow: 0 0 3px rgb(120 255 120 / 55%);
}

.term-out p,
.term-line {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.term-cmd {
  color: #c8f0c8;
}

.term-notice {
  color: #e0d890;
}

.term-alert {
  color: #ff9a80;
}

.cursor {
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* メール */
.mail-body-wrap,
.memo-wrap {
  display: grid;
  flex: 1;
  grid-template-columns: 38% 1fr;
  gap: 3px;
  min-height: 0;
}

.mail-list,
.memo-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  border: 2px inset #e0e0e0;
  background: #fff;
}

.mail-item,
.memo-item {
  display: grid;
  padding: 3px 5px;
  border: 0;
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
  text-align: left;
}

.mail-item.unread .mail-item-subject {
  font-weight: bold;
}

.mail-item.alert .mail-item-subject {
  color: #a00000;
}

.mail-item.selected,
.memo-item.selected {
  background: #000080;
  color: #fff;
}

.mail-item.selected .mail-item-subject {
  color: #fff;
}

.mail-item-from,
.mail-item-at {
  color: #606060;
  font-size: 11px;
}

.mail-item.selected .mail-item-from,
.mail-item.selected .mail-item-at {
  color: #c0c0ff;
}

.mail-read {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 2px inset #e0e0e0;
  background: #fff;
}

.mail-head {
  padding: 4px 8px;
  border-bottom: 1px solid #c0c0c0;
  background: #f0f0f0;
}

.mail-head p {
  margin: 0;
}

.mail-text {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  line-height: 1.7;
}

.mail-text p {
  min-height: 1em;
  margin: 0;
}

.mail-actions {
  margin: 0;
  padding: 4px 8px;
  border-top: 1px solid #c0c0c0;
}

.memo-text {
  margin: 0;
  overflow: auto;
  padding: 6px 8px;
  border: 2px inset #e0e0e0;
  background: #fff;
  font-family: "MS Gothic", "Osaka-Mono", monospace;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* 仕様書（スキャン） */
.spec-canvas {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: contain;
  border: 2px inset #e0e0e0;
  background: #6a6a66;
}

.spec-pager {
  margin: 3px 0 0;
  text-align: center;
}

/* タスクバー（右下に時計） */
.taskbar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  gap: 12px;
  align-items: center;
  height: 28px;
  padding: 2px 4px;
  border-top: 2px outset #e0e0e0;
  background: #c0c0c0;
  color: #000;
}

.os-name {
  padding: 1px 8px;
  border: 2px outset #e0e0e0;
  font-weight: bold;
}

.host-name {
  flex: 1;
  color: #404040;
}

.mail-badge:not(:empty) {
  padding: 0 6px;
  background: #ffffc0;
  border: 1px solid #808080;
}

.clock {
  min-width: 5em;
  padding: 1px 8px;
  border: 1px inset #e0e0e0;
  text-align: center;
}

/* 朝の報告メール */
.report-sheet {
  display: flex;
  flex-direction: column;
  width: min(44rem, 94vw);
  padding: 3px;
  border: 2px outset #e0e0e0;
  background: #c0c0c0;
  color: #000;
  text-align: left;
}

.report-sheet h2 {
  padding: 2px 6px;
  background: linear-gradient(to right, #000080, #1084d0);
  color: #fff;
  font-weight: bold;
  letter-spacing: 0;
}

.report-sheet .mail-text {
  background: #fff;
}

/* 朝の振り返り：障害報告書（白い紙に、淡々とした報告の体裁） */
.review-sheet {
  width: min(48rem, 94vw);
  padding: 1rem 1.4rem;
  border: 1px solid #808080;
  background: #f4f4ee;
  color: #1a1a1a;
  font-family: "MS Gothic", "Osaka-Mono", monospace;
  text-align: left;
  line-height: 1.6;
}

.review-sheet h2 {
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #1a1a1a;
  font-weight: bold;
  letter-spacing: 0.1em;
}

.review-head {
  padding: 0.4rem 0;
  color: #505050;
  font-size: 12px;
}

.review-head p,
.review-item {
  margin: 0;
}

.review-incident {
  padding: 0.5rem 0;
  border-top: 1px solid #b0b0a8;
}

.review-incident h3,
.review-terms h3 {
  margin: 0 0 0.2rem;
  font-size: 13px;
}

.review-unsolved h3 {
  color: #a00000;
}

.review-label {
  color: #505050;
}

.review-misdeed {
  color: #8a1a10;
}

.review-misdeed .review-label {
  color: #8a1a10;
  font-weight: bold;
}

.review-terms {
  padding-top: 0.5rem;
  border-top: 2px solid #1a1a1a;
}

.review-terms dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.15rem 1rem;
  margin: 0;
  font-size: 12px;
}

.review-terms dd {
  margin: 0;
}

/* エンディング：メモの最後の一行 */
#ending {
  background: #000;
}

.ending-memo {
  width: min(40rem, 94vw);
  padding: 0.8rem 1rem;
  background: #050805;
  color: #8ee08e;
  font-family: "MS Gothic", "Osaka-Mono", monospace;
  text-align: left;
  text-shadow: 0 0 3px rgb(120 255 120 / 55%);
}

.ending-memo p {
  margin: 0 0 0.4em;
}

.ending-memo-name {
  color: #5a8a5a;
}

#debug {
  position: fixed;
  right: 0;
  bottom: 30px;
  z-index: 50;
  margin: 0;
  padding: 0.5em;
  background: rgb(0 0 0 / 70%);
  color: #fff;
  font-size: 0.75rem;
  white-space: pre;
}
