.home {
width: 100%;
min-height: 100vh;
overflow: hidden;

background-image: url(/assets/background-0aed50b7b0c66c34ea650d11606e5c1f3f5282913f08d3ff3a97b8061aea522b.png);
background-size: cover;
background-position: center;
background-repeat: no-repeat;

color: #fff;
font-family: "Courier New", monospace;
}

/* --------------------------------
ゲーム画面
-------------------------------- */

.home-screen {
position: relative;
width: 100%;
height: 100vh;
min-height: 560px;
overflow: hidden;
}

/* --------------------------------
帽子
-------------------------------- */
.hat-area {
  position: absolute;

  top: 15%;
  left: 50%;

  width: 100%;
  height: 60%;

  transform: translateX(-50%);

  display: flex;
  justify-content: center;
  align-items: center;
}

.hat-image {
  width: 900px;
  height: 900px;

  background-image: url(/assets/kumiwakebousi-e3b6f57035e85af03d6d2d04f97435ba19231dd213bd9408d67a47c98c116deb.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  filter: drop-shadow(4px 6px 4px rgba(0, 0, 0, 0.7));
}
/* --------------------------------
下部コマンドエリア
-------------------------------- */

.command-area {
position: absolute;

left: 3%;
right: 3%;
bottom: 3%;

height: 25%;

display: grid;
grid-template-columns: 2fr 1fr;

gap: 15px;
}

/* --------------------------------
共通のゲーム風枠
-------------------------------- */

.message-box,
.menu-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 25px 35px;

background: rgba(0, 0, 0, 0.78);

border: 3px solid #fff;

border-radius: 4px;

box-shadow:
0 0 0 2px #222,
0 5px 12px rgba(0, 0, 0, 0.7);

box-sizing: border-box;
}

/* --------------------------------
   セリフ
-------------------------------- */

.message-box {
  position: relative;

  display: flex;
  align-items: center;

  padding: 25px 35px;

  font-size: clamp(16px, 2vw, 24px);
  line-height: 1.8;
  letter-spacing: 0.08em;
}

.message-box p {
  margin: 0;
}


/* --------------------------------
   スキップボタン
-------------------------------- */

.skip-button {
  position: absolute;

  right: 12px;
  bottom: 8px;

  padding: 3px 10px;

  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 3px;

  color: rgba(255, 255, 255, 0.7);

  font-family: "Courier New", monospace;
  font-size: 12px;

  cursor: pointer;
}

.skip-button:hover {
  color: #fff;
  border-color: #fff;
}


/* --------------------------------
   選択肢
-------------------------------- */

.menu-item {
  display: block;

  padding: 8px 12px;

  background: transparent;
  border: none;

  color: #fff;

  font-family: inherit;
  font-size: 18px;

  text-align: left;

  cursor: pointer;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.menu-item .cursor {
  display: inline-block;
  width: 20px;

  opacity: 0;
}

.menu-item:hover .cursor {
  opacity: 1;
}

/* --------------------------------
スマートフォン用配置
-------------------------------- */

@media (max-width: 700px) {
.hat-area {
top: 15%;
height: 60%;
}

.hat-image {
width: 1220px;
height: 1220px;
}

.command-area {
left: 2%;
right: 2%;
bottom: 2%;

height: 32%;

grid-template-columns: 1fr;
grid-template-rows: 1fr 1fr;

gap: 8px;

}

.message-box {
padding: 12px 18px;
}

.menu-box {
padding: 8px 18px;
}
}

/* ｰｰｰｰｰｰｰｰｰｰｰｰｰ
組み分け画面 
ｰｰｰｰｰｰｰｰｰｰｰｰｰ*/

.kumiwake {
  width: 100vw;
  height: 100vh;
  overflow: hidden;

  background-image: url(/assets/kumiwake-background-fcb2473927cb501cec3edac4d71bfa096ff9f75f0e5b31e438fa5743b12eb41d.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  color: #fff;
  font-family: "Courier New", monospace;
}
/* ========================================
   名簿入力画面
======================================== */

.kumiwake-input {
  width: 100vw;
  height: 100vh;

  display: flex;
  justify-content: center;
  align-items: center;

  overflow: hidden;

  background-image: url(/assets/kumiwake-background-fcb2473927cb501cec3edac4d71bfa096ff9f75f0e5b31e438fa5743b12eb41d.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  color: #222;
  font-family: "Courier New", monospace;
}

/* ========================================
   名簿入力パネル
======================================== */

.kumiwake-input-panel {
  position: relative;

  width: min(75vw, 500px);
  aspect-ratio: 2 / 3;

  padding: 50px 45px 40px;

  box-sizing: border-box;

  background: transparent;

  border: none;

  box-shadow: none;

  overflow-y: hidden;
}

/* ========================================
   パネル内の背景画像
======================================== */

.kumiwake-input-panel::before {
  content: "";

  position: absolute;
  inset: 0;

  background-image: url(/assets/input-background-f002ea682043f5c8c55009bb595f0d48555764f5881bb3ae682555dab1de03fc.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  opacity: 0.9;

  z-index: 0;
}

/* ========================================
   背景画像より内容を前に出す
======================================== */

.kumiwake-input-panel > * {
  position: relative;

  z-index: 1;
}


/* ========================================
   タイトル
======================================== */

.kumiwake-input-panel h2 {
  margin: 0 0 10px;

  text-align: center;

  font-size: 26px;

  color: #222;
}


/* ========================================
   説明文
======================================== */

.input-message {
  margin: 0 0 20px;

  text-align: center;

  font-size: 18px;

  line-height: 1.6;

  color: #222;
}


/* ========================================
   名前入力欄
======================================== */

.name-inputs {
  width: 100%;
}

.name-input-list {
  display: flex;
  flex-direction: column;

  gap: 9px;

  width: 100%;

  height: 410px;

  overflow-y: auto;

  padding-right: 8px;

  box-sizing: border-box;

   /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 40, 20, 0.35) transparent;

}

/* 1つの入力欄 */

.name-input-row {
  display: flex;

  align-items: center;

  gap: 10px;

  width: 80%;

  margin: 0 auto;
}

/* 番号 */

.name-input-row span {
  width: 35px;

  flex-shrink: 0;

  text-align: right;

  font-size: 16px;

  color: #222;
}


/* 名前入力 */

.name-input-row input {
  flex: 1;

  width: 100%;
  min-width: 0;

  padding: 8px 10px;

  box-sizing: border-box;

  background: transparent;

  border: none;
  border-bottom: 1px solid rgba(60, 40, 20, 0.6);
  border-radius: 0;

  color: #222;

  font-family: "Courier New", monospace;
  font-size: 15px;

  outline: none;
}


.name-input-row input:focus {
  background: transparent;

  border-bottom-color: #222;

  box-shadow: none;
}


/* ========================================
   下部ボタン
======================================== */

.input-buttons {
  display: flex;

  justify-content: center;

  gap: 30px;

  margin-top: 20px;

  transform: translateX(-30px);
}


/* 共通ボタン */

.input-buttons button {
  padding: 10px 15px;

  background: transparent;

  border: 2px solid #222;

  border-radius: 3px;

  color: #222;

  font-family: "Courier New", monospace;

  font-size: 15px;

  cursor: pointer;
}


/* マウスを乗せたとき */

.input-buttons button:hover {
  background: rgba(255, 255, 255, 0.12);
}


/* ========================================
   以下　スマートフォン用配置
======================================== */
@media (max-width: 700px) {

  /* ========================================
     パネル
  ======================================== */

  .kumiwake-input-panel {
    width: 95%;
    height: 80%;

    padding: 110px 30px 25px;

    box-sizing: border-box;
    
  }


  /* ========================================
     羊皮紙の背景
  ======================================== */

  .kumiwake-input-panel::before {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
  }


  /* ========================================
     タイトル
  ======================================== */

  .kumiwake-input-panel h2 {
    font-size: 22px;

    margin-bottom: 6px;
  }


  /* ========================================
     説明文
  ======================================== */

  .input-message {
    font-size: 14px;

    margin-bottom: 10px;
  }


  /* ========================================
     名前入力エリア
  ======================================== */

  .name-input-list {
    width: 100%;

    height: 350px;

    overflow-y: auto;

    padding-right: 5px;
  }


  /* ========================================
     名前入力行
  ======================================== */

  .name-input-row {
    width: 85%;

    margin: 0 auto;

    gap: 6px;
  }


  .name-input-row span {
    width: 25px;

    font-size: 13px;
  }


  .name-input-row input {
    font-size: 13px;

    padding: 5px 6px;
  }


  /* ========================================
     ボタン
  ======================================== */

  .input-buttons {
    display: flex;

    flex-direction: row;

    justify-content: center;

    align-items: center;

    gap: 12px;

    margin-top: 1px;

    transform: none;
  }


  .input-buttons button {
    width: auto;

    min-width: 80px;

    padding: 7px 9px;

    font-size: 13px;
  }

.group-count-input {
  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 15px;

  color: #222;
}


.group-count-description {
  margin: 0;

  font-size: 20px !important;

  text-align: center;

  line-height: 1.6;
}

#group-count-value {
  width: 140px;

  padding: 10px;

  box-sizing: border-box;

  background: transparent;

  border: 1px solid #555;

  border-radius: 3px;

  color: #222;

  font-family: "Courier New", monospace;

  font-size: 22px;

  text-align: center;
}

.group-count-submit {
  padding: 10px 30px;

  background: transparent;

  border: 1px solid #555;

  border-radius: 3px;

  color: #222;

  font-family: "Courier New", monospace;

  font-size: 18px;

  cursor: pointer;
}

/* ========================================
   組名入力
======================================== */

.group-name-input {
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;

  color: #222;
}

.group-name-description {
  margin: 0 0 15px;

  text-align: center;

  font-size: 16px;
}

.group-name-list {
  width: 80%;

  display: flex;
  flex-direction: column;

  gap: 10px;

  overflow-y: auto;
}

.group-name-row {
  display: flex;

  align-items: center;

  gap: 10px;

  width: 100%;
}

.group-name-row span {
  width: 25px;

  text-align: right;

  font-size: 16px;
}

.group-name-row input {
  flex: 1;

  padding: 8px;

  box-sizing: border-box;

  background: rgba(255, 255, 255, 0.25);

  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);

  color: #222;

  font-family: "Courier New", monospace;

  font-size: 18px;

  outline: none;
}

.group-name-row input::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

.group-name-row input:focus {
  border-bottom-color: #222;
}

.group-name-submit {
  margin-top: 15px;

  padding: 8px 25px;

  background: transparent;

  border: 1px solid #555;

  border-radius: 3px;

  color: #222;

  font-family: "Courier New", monospace;

  font-size: 16px;

  cursor: pointer;
}
}
/* 舞台側だけに重ねる演出用ライト。会話枠と選択肢は前面に残す。 */
.kumiwake .home-screen.is-ceremony::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.56);
}

/* 上の一点から下へ広がる、オレンジ色の光 */
.kumiwake .home-screen.is-ceremony::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: -200%;
  right: 0;
  left: 0;
  height: 300%;
  pointer-events: none;
  clip-path: polygon(
    50% 0,
    50% 0,
    calc(50% + 52.9vh) 100%,
    calc(50% - 52.9vh) 100%
  );
  background: linear-gradient(
    to bottom,
    rgba(255, 190, 105, 0.5) 0%,
    rgba(255, 153, 72, 0.3) 55%,
    rgba(255, 132, 54, 0.1) 100%
  );
  filter: blur(12px);
  transform-origin: 50% 0;
  animation: ceremony-spotlight-pulse 3.6s ease-in-out infinite alternate;
}

/* セリフ枠と選択肢はライトのレイヤーより前に置いて読みやすさを保つ */
.kumiwake .home-screen.is-ceremony .command-area {
  z-index: 5;
}

/* 帽子のキャラクターはライトより前に出し、光の色を重ねない */
.kumiwake .home-screen.is-ceremony .hat-area {
  z-index: 4;
}

/* 演出へ入る瞬間に2秒かけて暗くなり、細い光が広がる */
.kumiwake .home-screen.is-ceremony-entering::before {
  animation: ceremony-blackout 2s ease-in-out both;
}

.kumiwake .home-screen.is-ceremony-entering::after {
  animation: ceremony-spotlight-arrive 2s ease-out both;
}

@keyframes ceremony-spotlight-pulse {
  from { opacity: 0.76; }
  to { opacity: 1; }
}

@keyframes ceremony-blackout {
  0% { background-color: rgba(0, 0, 0, 0); }
  100% { background-color: rgba(0, 0, 0, 0.94); }
}

@keyframes ceremony-spotlight-arrive {
  0% {
    clip-path: polygon(
      50% 0,
      50% 0,
      calc(50% + 2vh) 100%,
      calc(50% - 2vh) 100%
    );
    opacity: 0.35;
  }
  100% {
    clip-path: polygon(
      50% 0,
      50% 0,
      calc(50% + 52.9vh) 100%,
      calc(50% - 52.9vh) 100%
    );
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kumiwake .home-screen.is-ceremony::after,
  .kumiwake .home-screen.is-ceremony-entering::before,
  .kumiwake .home-screen.is-ceremony-entering::after {
    animation: none;
  }
}
/* ========================================
   組名入力画面
======================================== */

.kumiwake-group-names {
  width: 100vw;
  height: 100vh;

  display: flex;
  justify-content: center;
  align-items: center;

  overflow: hidden;

  background-image: url(/assets/kumiwake-background-fcb2473927cb501cec3edac4d71bfa096ff9f75f0e5b31e438fa5743b12eb41d.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  color: #222;
  font-family: "Courier New", monospace;
}


/* ========================================
   羊皮紙パネル
======================================== */

.kumiwake-group-names-panel {
  position: relative;

  width: min(75vw, 500px);
  aspect-ratio: 2 / 3;

  padding: 50px 45px 40px;

  box-sizing: border-box;

  background: transparent;

  border: none;

  box-shadow: none;

  overflow: hidden;
}


/* ========================================
   羊皮紙背景
======================================== */

.kumiwake-group-names-panel::before {
  content: "";

  position: absolute;
  inset: 0;

  background-image: url(/assets/input-background-f002ea682043f5c8c55009bb595f0d48555764f5881bb3ae682555dab1de03fc.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  opacity: 0.9;

  z-index: 0;
}


/* ========================================
   内容を背景より前へ
======================================== */

.kumiwake-group-names-panel > * {
  position: relative;

  z-index: 1;
}


/* ========================================
   タイトル
======================================== */

.kumiwake-group-names-panel h2 {
  margin: 0 0 10px;

  text-align: center;

  font-size: 26px;

  color: #222;
}


/* ========================================
   説明文
======================================== */

.group-name-description,
.group-name-limit {
  margin: 0;

  text-align: center;

  font-size: 17px;

  line-height: 1.6;

  color: #222;
}

.group-name-description {
  margin-bottom: 4px;
}

.group-name-limit {
  margin-bottom: 20px;

  font-size: 15px;
}


/* ========================================
   組名入力エリア
======================================== */

.group-name-list {
  display: flex;

  flex-direction: column;

  gap: 12px;

  width: 100%;

  height: 360px;

  overflow-y: auto;

  padding-right: 8px;

  box-sizing: border-box;

  scrollbar-width: thin;
  scrollbar-color: rgba(60, 40, 20, 0.35) transparent;
}


/* ========================================
   1つの組名入力行
======================================== */

.group-name-row {
  display: flex;

  align-items: center;

  gap: 10px;

  width: 80%;

  margin: 0 auto;
}


/* ========================================
   番号
======================================== */

.group-name-row span {
  width: 35px;

  flex-shrink: 0;

  text-align: right;

  font-size: 16px;

  color: #222;
}


/* ========================================
   組名入力欄
======================================== */

.group-name-row input {
  flex: 1;

  width: 100%;
  min-width: 0;

  padding: 8px 10px;

  box-sizing: border-box;

  background: transparent;

  border: none;

  border-bottom: 1px solid rgba(60, 40, 20, 0.6);

  border-radius: 0;

  color: #222;

  font-family: "Courier New", monospace;

  font-size: 15px;

  outline: none;
}


/* フォーカス時 */

.group-name-row input:focus {
  background: transparent;

  border-bottom-color: #222;

  box-shadow: none;
}


/* ========================================
   ＋ − ボタン
======================================== */

.group-name-submit {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}


/* ========================================
   ＋ − 決定ボタン
======================================== */

.group-name-controls {
  display: flex;

  justify-content: center;

  align-items: center;

  gap: 20px;

  margin-top: 20px;
}


/* 共通ボタン */

.group-name-controls button {
  padding: 9px 16px;

  background: transparent;

  border: 2px solid #222;

  border-radius: 3px;

  color: #222;

  font-family: "Courier New", monospace;

  font-size: 15px;

  cursor: pointer;
}


/* ＋ − ボタン */

.group-name-controls button:first-child,
.group-name-controls button:nth-child(2) {
  width: 42px;

  padding: 8px 0;

  font-size: 20px;
}


/* ホバー */

.group-name-controls button:hover {
  background: rgba(255, 255, 255, 0.12);
}


/* ========================================
   決定ボタン
======================================== */

.group-name-submit {
  display: flex;

  justify-content: center;

  margin-top: 20px;
}


.group-name-submit button {
  padding: 10px 25px;

  background: transparent;

  border: 2px solid #222;

  border-radius: 3px;

  color: #222;

  font-family: "Courier New", monospace;

  font-size: 15px;

  cursor: pointer;
}


.group-name-submit button:hover {
  background: rgba(255, 255, 255, 0.12);
}


/* ========================================
   スマートフォン
======================================== */

@media (max-width: 700px) {

  /* ========================================
     パネル
  ======================================== */

  .kumiwake-group-names-panel {
    width: 95%;

    height: 80%;

    padding: 110px 30px 25px;

    box-sizing: border-box;
  }


  /* ========================================
     羊皮紙
  ======================================== */

  .kumiwake-group-names-panel::before {
    background-size: contain;

    background-position: center;

    background-repeat: no-repeat;
  }


  /* ========================================
     タイトル
  ======================================== */

  .kumiwake-group-names-panel h2 {
    font-size: 22px;

    margin-bottom: 6px;
  }


  /* ========================================
     説明文
  ======================================== */

  .group-name-description {
    font-size: 14px;

    margin-bottom: 4px;
  }


  .group-name-limit {
    font-size: 13px;

    margin-bottom: 10px;
  }


  /* ========================================
     組名入力エリア
  ======================================== */

  .group-name-list {
    width: 100%;

    height: 350px;

    gap: 9px;

    overflow-y: auto;

    padding-right: 5px;
  }


  /* ========================================
     入力行
  ======================================== */

  .group-name-row {
    width: 85%;

    margin: 0 auto;

    gap: 6px;
  }


  .group-name-row span {
    width: 25px;

    font-size: 13px;
  }


  .group-name-row input {
    font-size: 13px;

    padding: 5px 6px;
  }


  /* ========================================
     ＋ −
  ======================================== */

 @media (max-width: 700px) {

  .group-name-controls {
    gap: 12px;

    margin-top: 10px;
  }

  .group-name-controls button {
    padding: 7px 12px;

    font-size: 13px;
  }

  .group-name-controls button:first-child,
  .group-name-controls button:nth-child(2) {
    width: 36px;

    padding: 6px 0;

    font-size: 18px;
  }

}

}
/* ========================================
   組み分け履歴画面
======================================== */

.kumiwake-history {
  width: 100vw;
  height: 100vh;

  display: flex;
  justify-content: center;
  align-items: center;

  overflow: hidden;

  background-image: url(/assets/kumiwake-background-fcb2473927cb501cec3edac4d71bfa096ff9f75f0e5b31e438fa5743b12eb41d.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  color: #222;
  font-family: "Courier New", monospace;
}


/* ========================================
   羊皮紙パネル
======================================== */

.kumiwake-history-panel {
  position: relative;

  width: min(75vw, 500px);
  aspect-ratio: 2 / 3;

  padding: 65px 45px 35px;

  box-sizing: border-box;

  background: transparent;

  border: none;

  box-shadow: none;

  overflow: hidden;
}


/* ========================================
   羊皮紙背景
======================================== */

.kumiwake-history-panel::before {
  content: "";

  position: absolute;

  inset: 0;

  background-image: url(/assets/input-background-f002ea682043f5c8c55009bb595f0d48555764f5881bb3ae682555dab1de03fc.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  opacity: 0.9;

  z-index: 0;
}


/* ========================================
   内容を背景より前へ
======================================== */

.kumiwake-history-panel > * {
  position: relative;

  z-index: 1;
}


/* ========================================
   タイトル
======================================== */

.kumiwake-history-panel h1 {
  margin: 5px 0 20px;

  text-align: center;

  font-size: 26px;

  color: #222;
}


/* ========================================
   履歴スクロール部分
======================================== */

.history-scroll {
  width: 100%;

  height: 390px;

  overflow-y: auto;

  padding: 0 12px 10px 8px;

  box-sizing: border-box;

  scrollbar-width: thin;
  scrollbar-color: rgba(60, 40, 20, 0.35) transparent;
}


/* ========================================
   履歴がない場合のメッセージ
======================================== */

.no-history {
  width: 100%;

  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;

  font-size: 16px;

  color: #666;
}


/* ========================================
   1つの履歴アイテム（1回分の結果）
======================================== */

.history-item {
  width: 85%;

  margin: 0 auto 20px;

  padding: 10px 10px 15px;

  border: 1px solid rgba(60, 40, 20, 0.2);

  border-radius: 3px;

}


/* ========================================
   履歴アイテムの回数タイトル
======================================== */

.history-item h2 {
  margin: 0 0 10px;

  text-align: left;

  font-size: 18px;

  color: #222;

  font-weight: bold;
}


/* ========================================
   履歴内の組
======================================== */

.history-group {
  width: 95%;

  margin: 0 auto 8px;
}


/* ========================================
   履歴内の組名
======================================== */

.history-group h3 {
  margin: 0 0 5px;

  text-align: left;

  font-size: 15px;

  color: #333;

  font-weight: bold;
}


/* ========================================
   履歴内の名前
======================================== */

.history-group p {
  margin: 2px 0;

  padding: 2px 5px 2px 10px;

  text-align: center;

  font-size: 14px;

  line-height: 1.3;

  color: #222;

  border-bottom: 1px solid rgba(60, 40, 20, 0.15);
}


/* ========================================
   下部ボタンエリア
======================================== */

.history-menu {
  position: absolute;

  left: 45pcx;
  right: 45px;
  bottom: 85px;

  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: 12px;

  margin-right: 25%;

}


/* ========================================
   戻るボタン
======================================== */

.history-menu a {
   width: 100%;

  box-sizing: border-box;

  padding: 10px 10px;

  background: transparent;

  border: 2px solid #222;

  border-radius: 3px;

  color: #222;

  font-family: "Courier New", monospace;

  font-size: 12px;

  text-align: center;

  text-decoration: none;

  cursor: pointer;
  
  justify-content: center;
}


/* ========================================
   戻るボタンのホバー
======================================== */

.history-menu a:hover {
  background: rgba(255, 255, 255, 0.12);
}


/* ========================================
   スマートフォン
======================================== */

@media (max-width: 700px) {

  /* ========================================
     パネル
  ======================================== */

  .kumiwake-history-panel {
    width: 95%;

    height: 80%;

    padding: 105px 30px 25px;

    box-sizing: border-box;
  }


  /* ========================================
     羊皮紙
  ======================================== */

  .kumiwake-history-panel::before {
    opacity: 0.85;
  }


  /* ========================================
     スクロール部分の高さ
  ======================================== */

  .history-scroll {
    height: 350px;
  }


  /* ========================================
     下部ボタンの位置
  ======================================== */

  .history-menu {
    left: 45px;
    right: 30px;
    bottom: 55px;
  }


  /* ========================================
     戻るボタンの幅
  ======================================== */

  .history-menu a {
    width: 70%;
  }

}
/* ========================================
   組み分け結果画面
======================================== */

.kumiwake-result {
  width: 100vw;
  height: 100vh;

  display: flex;
  justify-content: center;
  align-items: center;

  overflow: hidden;

  background-image: url(/assets/kumiwake-background-fcb2473927cb501cec3edac4d71bfa096ff9f75f0e5b31e438fa5743b12eb41d.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  color: #222;
  font-family: "Courier New", monospace;
}


/* ========================================
   羊皮紙パネル
======================================== */

.kumiwake-result-panel {
  position: relative;

  width: min(75vw, 500px);
  aspect-ratio: 2 / 3;

  padding: 65px 45px 35px;

  box-sizing: border-box;

  background: transparent;

  border: none;

  box-shadow: none;

  overflow: hidden;
}


/* ========================================
   羊皮紙背景
======================================== */

.kumiwake-result-panel::before {
  content: "";

  position: absolute;

  inset: 0;

  background-image: url(/assets/input-background-f002ea682043f5c8c55009bb595f0d48555764f5881bb3ae682555dab1de03fc.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  opacity: 0.9;

  z-index: 0;
}


/* ========================================
   内容を背景より前へ
======================================== */

.kumiwake-result-panel > * {
  position: relative;

  z-index: 1;
}


/* ========================================
   タイトル
======================================== */

.kumiwake-result-panel h1 {
  margin: 5px 0 20px;

  text-align: center;

  font-size: 26px;

  color: #222;
}


/* ========================================
   組み分け結果スクロール部分
======================================== */

.group-results-scroll {
  width: 100%;

  height: 390px;

  overflow-y: auto;

  padding: 0 12px 10px 8px;

  box-sizing: border-box;

  scrollbar-width: thin;
  scrollbar-color: rgba(60, 40, 20, 0.35) transparent;
}


/* ========================================
   1つの組
======================================== */

.group-result {
  width: 85%;

  margin: 0 auto 25px;
}


/* ========================================
   組名
======================================== */

.group-result h2 {
  margin: 0 0 8px;

  text-align: left;

  font-size: 21px;

  color: #222;
}


/* ========================================
   名前
======================================== */

.group-result p {
  margin: 5px 0;

  padding: 5px 10px 5px 15px;

  text-align: center;

  font-size: 18px;

  line-height: 1.5;

  color: #222;

  border-bottom: 1px solid rgba(60, 40, 20, 0.25);
}


/* ========================================
   下部ボタンエリア
======================================== */

.result-menu {
  position: absolute;

  left: 55%px;
  right: 70px;
  bottom: 85px;

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 12px 15px;

  justify-times: stretch;
  align-items: stretch;

  margin-right: 22%;

}


/* ========================================
   ボタンを入れている form
======================================== */

.result-menu form {
  margin: 0;

  width: 100%;
}


/* ========================================
   共通ボタン
======================================== */

.result-menu button,
.result-menu a {
  width: 100%;

  box-sizing: border-box;

  padding: 9px 5px;

  background: transparent;

  border: 2px solid #222;

  border-radius: 3px;

  color: #222;

  font-family: "Courier New", monospace;

  font-size: 13px;

  text-align: center;

  text-decoration: none;

  cursor: pointer;
}


/* ========================================
   終わるボタン
======================================== */

.result-menu .finish-button {
  transform: none;
}


/* ========================================
   履歴ボタン
======================================== */

.result-menu .history-button {
  grid-column: auto;

  transform: none;
}


/* ========================================
   ボタンのホバー
======================================== */

.result-menu button:hover,
.result-menu a:hover {
  background: rgba(255, 255, 255, 0.12);
}


/* ========================================
   CSVボタン
======================================== */

.result-menu .csv-button {
  grid-column: auto;

  width: 100%;

  justify-self: stretch;
}


/* ========================================
   スマートフォン
======================================== */

@media (max-width: 700px) {

  /* ========================================
     パネル
  ======================================== */

  .kumiwake-result-panel {
    width: 95%;

    height: 80%;

    padding: 105px 30px 25px;

    box-sizing: border-box;
  }


  /* ========================================
     羊皮紙
  ======================================== */

  .kumiwake-result-panel::before {
    background-size: contain;

    background-position: center;

    background-repeat: no-repeat;
  }


  /* ========================================
     タイトル
  ======================================== */

  .kumiwake-result-panel h1 {
    margin: 5px 0 12px;

    font-size: 22px;
  }


  /* ========================================
     結果スクロール部分
  ======================================== */

  .group-results-scroll {
    width: 100%;

    height: 330px;

    padding: 0 5px 10px;

    overflow-y: auto;
  }


  /* ========================================
     組
  ======================================== */

  .group-result {
    width: 85%;

    margin: 0 auto 20px;
  }


  /* ========================================
     組名
  ======================================== */

  .group-result h2 {
    margin-bottom: 6px;

    font-size: 18px;

    text-align: left;
  }


  /* ========================================
     名前
  ======================================== */

  .group-result p {
    margin: 4px 0;

    padding-left: 12px;

    font-size: 14px;

    line-height: 1.5;

    text-align: left;
  }


  /* ========================================
     下部ボタン
  ======================================== */

  .result-menu {
    left: 30px;

    right: 30px;

    bottom: 25px;

    grid-template-columns: 1fr 1fr;

    gap: 8px 10px;
  }


  .result-menu button,
  .result-menu a {
    padding: 7px 5px;

    font-size: 13px;
  }


  /* ========================================
     CSV
  ======================================== */

  .result-menu .csv-button {
    grid-column: 1 / 3;

    width: 65%;

    justify-self: center;
  }

}
.splash-screen {
  display: grid;
  width: 100%;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(97, 71, 42, 0.18), transparent 48%),
    linear-gradient(180deg, rgba(14, 18, 25, 0.2), rgba(8, 11, 16, 0.78)),
    url(/assets/background-0aed50b7b0c66c34ea650d11606e5c1f3f5282913f08d3ff3a97b8061aea522b.png) center / cover no-repeat;
  color: #fff7e8;
  text-align: center;
  font-family: "Courier New", monospace;
}

.splash-frame {
  display: grid;
  width: 100%;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 40px;
  place-items: center;
}

.splash-content {
  width: min(90%, 660px);
  padding: 30px 24px;
  animation: splash-arrive 900ms ease-out both;
}

.splash-logo {
  display: block;
  width: min(100%, 940px);
  object-fit: contain;
  margin: 0 auto;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.65));
}

.splash-caption {
  margin: 12px 0 34px;
  color: rgba(255, 247, 232, 0.88);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(14px, 2.2vw, 18px);
  letter-spacing: 0.18em;
}

.splash-start {
  display: inline-block;
  min-width: 220px;
  box-sizing: border-box;
  padding: 15px 30px;
  border: 1px solid #e5c88d;
  border-radius: 2px;
  background: rgba(18, 20, 23, 0.72);
  color: #fff7e8;
  font: inherit;
  font-size: 18px;
  letter-spacing: 0.2em;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.splash-start span {
  margin-right: 10px;
  color: #e5c88d;
  font-size: 13px;
}

.splash-start:hover,
.splash-start:focus-visible {
  transform: translateY(-2px);
  background: #e5c88d;
  color: #1b1b1a;
  outline: none;
}

.splash-start:hover span,
.splash-start:focus-visible span {
  color: #1b1b1a;
}

.splash-hint {
  margin: 16px 0 0;
  color: rgba(255, 247, 232, 0.55);
  font-size: 11px;
  letter-spacing: 0.12em;
}

@keyframes splash-arrive {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .splash-frame { padding: 24px; }
  .splash-logo { max-height: 36vh; }
}
/*




*/

/* ========================================
   共通設定
======================================== */

html,
body {
  margin: 0;
  padding: 0;

  width: 100%;
  min-height: 100%;
}

body {
  overflow-x: hidden;
}
.bgm-controls {
  position: fixed;
  z-index: 1000;
  top: 16px;
  right: 16px;
  display: grid;
  justify-items: stretch;
  gap: 6px;
  width: 144px;
}

.bgm-switch {
  box-sizing: border-box;
  width: 90%;
  padding: 9px 13px;
  border: 1px solid rgba(229, 200, 141, 0.8);
  border-radius: 3px;
  background: rgba(18, 20, 23, 0.86);
  color: #fff7e8;
  font: 600 12px "Courier New", monospace;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.bgm-switch.is-on {
  background: #e5c88d;
  color: #1b1b1a;
}

.bgm-switch:focus-visible {
  outline: 2px solid #fff7e8;
  outline-offset: 3px;
}

.bgm-volume {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 90%;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(229, 200, 141, 0.55);
  border-radius: 3px;
  background: rgba(18, 20, 23, 0.86);
  color: #fff7e8;
  font: 11px "Courier New", monospace;
}

.bgm-volume input {
  flex: 1;
  min-width: 0;
  accent-color: #e5c88d;
}



