:root {
  --bg: #000;
  --fg: #d8d8d8;
  --frame: #6b6b6b;          /* 入力ボックスの枠(グレー) */
  --field: rgba(110, 110, 110, .28); /* 入力部分(半透明) */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}

body { min-height: 100vh; transition: opacity .35s ease; }
body.leaving { opacity: 0; }

/* 背景画像:明度30% */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("../assets/bg.png") center / contain no-repeat;
  filter: brightness(.3);
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 48px 20px;
}

.content { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* 入力ボックス */
.kw {
  width: min(460px, 100%);
  padding: 0;
  background: transparent;        /* 枠の内側は透かす */
  border: 10px solid var(--frame); /* 枠だけグレー */
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 10px 30px rgba(0,0,0,.6);
}
.kw input {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 18px;
  letter-spacing: .08em;
  text-align: center;
  color: #f2f2f2;
  background: var(--field);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 3px;
  outline: none;
}
.kw input:focus { border-color: rgba(255,255,255,.45); }
.kw.miss { animation: shake .35s; }
@keyframes shake {
  20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}

/* 文章ページ */
.text-panel {
  width: min(640px, 100%);
  padding: 32px 36px;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255,255,255,.1);
  line-height: 2;
  letter-spacing: .06em;
}
.text-panel h1 { margin: 0 0 18px; font-size: 20px; font-weight: normal; letter-spacing: .2em; }
.text-panel p { margin: 0 0 1em; }

/* 画像ページ */
.picture {
  max-width: min(760px, 100%);
  max-height: 62vh;
  display: block;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 10px 40px rgba(0,0,0,.7);
}

/* カセットテープページ */
.tape { width: min(460px, 100%); text-align: center; }
.tape svg { width: 100%; height: auto; display: block; }
.tape .reel { transform-box: fill-box; transform-origin: center; animation: spin 3s linear infinite; animation-play-state: paused; }
.tape.playing .reel { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.tape button {
  margin-top: 16px;
  padding: 10px 34px;
  font: inherit;
  letter-spacing: .3em;
  color: var(--fg);
  background: rgba(60,60,60,.7);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 3px;
  cursor: pointer;
}
.tape button:hover { background: rgba(110,110,110,.7); }

/* 固定ページ */
.plain { text-align: center; letter-spacing: .15em; line-height: 2; }
.plain a { color: var(--fg); }

@media (max-width: 520px) {
  .text-panel { padding: 22px 20px; }
}
