@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Noto+Serif+JP:wght@400;500;600&display=swap');


/* =========================================================
   CASE FILE 専用設定
   ========================================================= */


/* =========================================================
   背景
   ========================================================= */

/*
  story.js

  background: "police-department"

  ↓

  .scene-police-department

  ↓

  police_department.png
*/

.scene-police-department {
  background-image:
    linear-gradient(
      90deg,
      rgba(4, 9, 14, .18),
      rgba(7, 12, 17, .04) 50%,
      rgba(4, 9, 14, .22)
    ),
    url("../image/police_department.png");
}


/* 事務・庶務側 */
.scene-office {
  background-image:
    linear-gradient(
      90deg,
      rgba(4, 9, 14, .18),
      rgba(7, 12, 17, .04) 50%,
      rgba(4, 9, 14, .22)
    ),
    url("../image/police_office.png");
}


/* 休憩スペース */
.scene-breakroom {
  background-image:
    linear-gradient(
      90deg,
      rgba(4, 9, 14, .18),
      rgba(7, 12, 17, .04) 50%,
      rgba(4, 9, 14, .22)
    ),
    url("../image/police_breakroom.png");
}


/* =========================================================
   キャラクター画像
   ========================================================= */

/*
  game.js が

  active: "makabe"

  を受け取った場合、

  ../image/makabe.png

  を表示します。

  active: "sakuma"

  なら、

  ../image/sakuma.png

  です。
*/


.character-portrait.makabe {
  background-image: url("../image/makabe.png");
}


.character-portrait.sakuma {
  background-image: url("../image/sakuma.png");
}


.character-portrait.takahashi {
  background-image: url("../image/takahashi.png");
}


.character-portrait.kobayashi {
  background-image: url("../image/kobayashi.png");
}



/* =========================================================
   基本設定
   ========================================================= */

:root {

  --paper: #eee9dd;

  --ink: #262727;

  --night: #10161d;

  --blue: #263b4d;

  --gold: #c3a078;

  --line: rgba(238, 233, 221, .38);

  --panel: rgba(8, 14, 20, .88);

}


* {
  box-sizing: border-box;
}


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


body {

  color: var(--paper);

  background: var(--night);

  font-family:
    "Noto Serif JP",
    serif;

}


button {

  font: inherit;

  cursor: pointer;

}


button:focus-visible,
a:focus-visible {

  outline: 2px solid #d8b58a;

  outline-offset: 3px;

}


.title-screen[hidden],
.novel-screen[hidden],
.ending-screen[hidden] {

  display: none;

}



/* =========================================================
   GAME SHELL
   ========================================================= */

.game-shell {

  min-height: 100vh;

  max-width: 1500px;

  margin: 0 auto;

  position: relative;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 66% 20%,
      #344b63 0,
      #192939 35%,
      #101923 80%
    );

}



/* =========================================================
   HEADER
   ========================================================= */

.game-header {

  position: absolute;

  z-index: 20;

  top: 0;

  left: 0;

  width: 100%;

  padding:
    18px
    28px;

  display: flex;

  justify-content: space-between;

  align-items: center;

  color: #e1ddd4;

  font:
    12px
    "DM Mono",
    monospace;

  letter-spacing: .08em;

  pointer-events: none;

}


.game-header a {

  color: inherit;

  text-decoration: none;

  pointer-events: auto;

}


.game-header p {

  margin: 0;

}



/* =========================================================
   TITLE SCREEN
   ========================================================= */

.title-screen {

  width:
    min(
      760px,
      calc(100% - 40px)
    );

  min-height: 100vh;

  margin: auto;

  padding:
    15vh
    0
    80px;

  display: flex;

  flex-direction: column;

  align-items: flex-start;

  justify-content: center;

}


.title-screen > p:first-child,
.ending-screen > p:first-child {

  color: #c3a17b;

  font:
    12px
    "DM Mono",
    monospace;

  letter-spacing: .12em;

}


.title-screen h1,
.ending-screen h1 {

  margin:
    12px
    0;

  font-size:
    clamp(
      48px,
      9vw,
      102px
    );

  font-weight: 500;

  letter-spacing: .14em;

  line-height: 1.15;

}


.title-screen .subtitle {

  max-width: 34em;

  color: #d2d1c9;

  line-height: 2;

}


.title-screen dl {

  width:
    min(
      480px,
      100%
    );

  margin:
    34px
    0;

  padding:
    18px
    0;

  border-top:
    1px solid
    var(--line);

  border-bottom:
    1px solid
    var(--line);

}


.title-screen dl div {

  display: grid;

  grid-template-columns:
    5em
    1fr;

  gap: 15px;

  margin: 7px 0;

}


.title-screen dt {

  color: #bba184;

  font-size: 13px;

}


.title-screen dd {

  margin: 0;

}


.title-screen button {

  padding:
    15px
    20px;

  color: #211b17;

  border: 0;

  background: #d8bb95;

  transition:
    transform .2s,
    background .2s;

}


.title-screen button:hover {

  background: #e4caa7;

  transform:
    translateY(-2px);

}


.title-screen button span {

  margin-left: 24px;

}



/* =========================================================
   NOVEL SCREEN
   ========================================================= */

.novel-screen {

  width: 100%;

  min-height: 100vh;

  position: relative;

  overflow: hidden;

}



/* =========================================================
   背景
   ========================================================= */

.scene-backdrop {

  position: absolute;

  inset: 0;

  z-index: 0;

  width: 100%;

  height: 100%;

  background-position:
    center
    center;

  background-size: cover;

  background-repeat: no-repeat;

  background-color: #111820;

}


/*
  背景をほんの少しだけ暗くする。

  今回は背景そのものを
  「舞台」として見せたいので、
  暗くしすぎない。
*/

.scene-backdrop::after {

  content: "";

  position: absolute;

  inset: 0;

  pointer-events: none;

  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, .18) 0%,
      rgba(0, 0, 0, .02) 45%,
      rgba(0, 0, 0, .28) 100%
    );

}



/* =========================================================
   SCENE META
   ========================================================= */

.scene-meta {

  position: absolute;

  z-index: 10;

  top: 70px;

  left: 28px;

  display: flex;

  align-items: center;

  gap: 16px;

  color: #eee9df;

  font:
    11px
    "DM Mono",
    monospace;

  letter-spacing: .08em;

  text-shadow:
    0 1px 5px rgba(0, 0, 0, .8);

}


.scene-meta span:first-child {

  color: #d5b083;

}


.scene-location {

  opacity: .9;

}



/* =========================================================
   DIALOGUE AREA
   ========================================================= */

.dialogue-area {

  position: absolute;

  z-index: 15;

  left: 0;

  right: 0;

  bottom: 28px;

  width: min(
    1120px,
    calc(100% - 56px)
  );

  margin: 0 auto;

  display: flex;

  align-items: flex-end;

  gap: 18px;

}



/* =========================================================
   CHARACTER PORTRAIT
   ========================================================= */

.character-portrait {

  flex: 0 0 210px;

  width: 210px;

  height: 210px;

  position: relative;

  z-index: 2;

  opacity: 0;

  transform:
    translateY(12px)
    scale(.96);

  background-repeat: no-repeat;

  background-position:
    center
    bottom;

  background-size: contain;

  pointer-events: none;

  transition:
    opacity .22s ease,
    transform .22s ease;

  filter:
    drop-shadow(
      0 8px 12px
      rgba(0, 0, 0, .65)
    );

}


/*
  game.js が show() したとき
*/

.character-portrait.show {

  opacity: 1;

  transform:
    translateY(0)
    scale(1);

}



/* =========================================================
   DIALOGUE BOX
   ========================================================= */

.dialogue-box {

  flex: 1;

  min-width: 0;

  min-height: 168px;

  position: relative;

  padding:
    34px
    58px
    26px
    30px;

  display: flex;

  flex-direction: column;

  justify-content: flex-start;

  color: #f3efe8;

  border:
    1px solid
    rgba(
      238,
      231,
      218,
      .62
    );

  background:
    rgba(
      7,
      13,
      19,
      .90
    );

  backdrop-filter:
    blur(7px);

  -webkit-backdrop-filter:
    blur(7px);

  text-align: left;

  box-shadow:
    0 12px 30px
    rgba(0, 0, 0, .28);

  transition:
    border-color .2s,
    background .2s;

}


.dialogue-box:hover {

  border-color:
    rgba(
      238,
      231,
      218,
      .82
    );

}



/* =========================================================
   SPEAKER
   ========================================================= */

.speaker {

  position: absolute;

  left: 20px;

  top: -15px;

  min-width: 100px;

  padding:
    4px
    12px;

  color: #e0bc91;

  border:
    1px solid
    rgba(
      215,
      180,
      138,
      .45
    );

  background:
    rgba(
      8,
      14,
      20,
      .97
    );

  font-size: 14px;

  line-height: 1.4;

  white-space: nowrap;

}



/* =========================================================
   LINE
   ========================================================= */

.line {

  display: block;

  margin: 0;

  font-size:
    clamp(
      17px,
      2vw,
      22px
    );

  line-height: 1.75;

  letter-spacing: .025em;

}



/* =========================================================
   NEXT MARK
   ========================================================= */

.next-mark {

  position: absolute;

  right: 20px;

  bottom: 17px;

  color: #c9a176;

  font-size: 12px;

  animation:
    blink
    1.3s
    infinite;

}


@keyframes blink {

  50% {
    opacity: .2;
  }

}



/* =========================================================
   NARRATION
   ========================================================= */

/*
  speaker がない地の文。

  game.js 側から
  dialogue-box.narration を
  付けなくても問題ないよう、
  空のspeakerを想定した
  基本デザイン。
*/

.dialogue-box.narration .speaker {

  display: none;

}


.dialogue-box.narration {

  padding-top: 28px;

}



/* =========================================================
   CHOICES
   ========================================================= */

.choices {

  position: absolute;

  z-index: 25;

  left: 50%;

  bottom: 225px;

  width:
    min(
      640px,
      calc(100% - 56px)
    );

  transform:
    translateX(-50%);

  display: grid;

  gap: 10px;

}


.choices button {

  padding:
    15px
    20px;

  color: #f3ede3;

  border:
    1px solid
    rgba(
      233,
      220,
      203,
      .65
    );

  background:
    rgba(
      10,
      18,
      25,
      .94
    );

  text-align: left;

  transition:
    background .2s,
    color .2s,
    transform .2s;

}


.choices button:hover {

  color: #1b1713;

  background: #ddc3a1;

  transform:
    translateY(-2px);

}



/* =========================================================
   ENDING
   ========================================================= */

.ending-screen {

  min-height: 100vh;

  padding:
    120px
    30px
    70px;

  text-align: center;

}


.ending-screen h1 {
  margin: 20px 0;

  color: #d8bb95;

  font-family: "DM Mono", monospace;
  font-size: 28px;
  font-weight: 500;

  letter-spacing: .18em;
  line-height: 1.3;
}


.ending-screen > p:nth-of-type(2) {

  max-width: 33em;

  margin:
    0
    auto;

  line-height: 1.8;

}


.ending-image {

  display: block;

  width:
    min(
      100%,
      900px
    );

  height: auto;

  margin:
    32px
    auto;

}


.ending-links {

  margin-top: 35px;

  display: flex;

  justify-content: center;

  flex-wrap: wrap;

  gap: 10px;

}


.ending-links button {

  padding:
    14px
    18px;

  color: #211b17;

  border: 0;

  background: #d8bb95;

}


.ending-links a {

  padding:
    14px
    18px;

  color: #eee7dc;

  border:
    1px solid
    rgba(
      238,
      233,
      221,
      .5
    );

  text-decoration: none;

  transition:
    background .2s,
    color .2s;

}


.ending-links a:hover {

  color: #211b17;

  background: #ddc3a1;

}



/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

  .dialogue-area {

    width:
      calc(
        100% - 36px
      );

    gap: 12px;

  }


  .character-portrait {

    flex-basis: 175px;

    width: 175px;

    height: 175px;

  }


  .dialogue-box {

    min-height: 155px;

    padding:
      30px
      50px
      22px
      24px;

  }


  .line {

    font-size: 18px;

  }

}



/* =========================================================
   SMARTPHONE
   ========================================================= */

@media (max-width: 650px) {

  html,
  body {

    width: 100%;

    height: 100%;

    overflow: hidden;

  }


  .game-shell {

    width: 100%;

    height: 100svh;

    min-height: 100svh;

  }


  .novel-screen {

    width: 100%;

    height: 100svh;

    min-height: 100svh;

    overflow: hidden;

  }


  .scene-backdrop {

    width: 100%;

    height: 100svh;

    min-height: 100svh;

    background-position:
      center
      center;

  }


  /* --------------------------------------
     HEADER
  -------------------------------------- */

  .game-header {

    padding:
      13px
      14px;

    font-size: 9px;

  }


  /* --------------------------------------
     META
  -------------------------------------- */

  .scene-meta {

    top: 53px;

    left: 14px;

    gap: 10px;

    font-size: 9px;

  }


  /* --------------------------------------
     DIALOGUE AREA
  -------------------------------------- */

  .dialogue-area {

    left: 10px;

    right: 10px;

    bottom: 10px;

    width: auto;

    margin: 0;

    display: flex;

    align-items: flex-end;

    gap: 8px;

  }


  /* --------------------------------------
     PORTRAIT
  -------------------------------------- */

  .character-portrait {

    flex:
      0 0
      105px;

    width: 105px;

    height: 105px;

  }


  /* --------------------------------------
     DIALOGUE
  -------------------------------------- */

  .dialogue-box {

    width: auto;

    min-height: 145px;

    padding:
      29px
      36px
      18px
      15px;

  }


  .speaker {

    left: 10px;

    top: -12px;

    min-width: auto;

    padding:
      2px
      8px;

    font-size: 12px;

  }


  .line {

    font-size: 15px;

    line-height: 1.65;

  }


  .next-mark {

    right: 12px;

    bottom: 12px;

  }


  /* --------------------------------------
     CHOICES
  -------------------------------------- */

  .choices {

    left: 10px;

    bottom: 165px;

    width:
      calc(
        100% - 20px
      );

    transform: none;

  }


  .choices button {

    padding:
      12px
      14px;

    font-size: 14px;

  }


  /* --------------------------------------
     TITLE
  -------------------------------------- */

  .title-screen {

    width:
      calc(
        100% - 30px
      );

    padding:
      90px
      0
      50px;

  }


  .title-screen h1 {

    font-size:
      clamp(
        40px,
        13vw,
        70px
      );

  }


  .title-screen .subtitle {

    font-size: 14px;

    line-height: 1.8;

  }


  /* --------------------------------------
     ENDING
  -------------------------------------- */

  .ending-screen {

    padding:
      90px
      15px
      40px;

    overflow-y: auto;

  }

}



/* =========================================================
   VERY SMALL SMARTPHONE
   ========================================================= */

@media (max-width: 380px) {

  .game-header {

    padding:
      11px
      11px;

  }


  .scene-meta {

    top: 47px;

    left: 11px;

  }


  .dialogue-area {

    left: 7px;

    right: 7px;

    bottom: 7px;

    gap: 5px;

  }


  .character-portrait {

    flex-basis: 88px;

    width: 88px;

    height: 88px;

  }


  .dialogue-box {

    min-height: 138px;

    padding:
      27px
      30px
      15px
      13px;

  }


  .speaker {

    font-size: 11px;

  }


  .line {

    font-size: 14px;

    line-height: 1.6;

  }


  .next-mark {

    right: 9px;

    bottom: 9px;

  }


  .choices {

    bottom: 150px;

  }

}
/* =========================================================
   地の文：話者名がないときは名前欄を完全に消す
   ========================================================= */

.dialogue-box:has(.speaker:empty) .speaker {
  display: none;
}