
/* ===================================
   基本設定
=================================== */

* {
  box-sizing: border-box;
}

:root {
  --pink: #e99abd;
  --pink-dark: #ce79a5;
  --pink-light: #fff0f6;
  --lavender: #c5a9e8;
  --lavender-light: #f5efff;
  --gold: #d9b96e;
  --gold-light: #fff3d5;
  --text: #76566f;
  --text-light: #a88ba8;
  --white: #ffffff;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Yu Gothic", "Meiryo", sans-serif;
  color: var(--text);
  padding: 30px 16px;

  background:
    radial-gradient(circle at 10% 15%, rgba(255,255,255,0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 85% 25%, rgba(255,255,255,0.8) 0 3px, transparent 4px),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.8) 0 2px, transparent 3px),
    linear-gradient(135deg, #ffeaf3, #f0e7ff 55%, #fff5e9);
  background-size: 130px 130px, 180px 180px, 150px 150px, auto;
}


/* ===================================
   メイン画面
=================================== */

.start-screen,
.game-screen {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: 35px 25px;
  text-align: center;

  background: rgba(255, 255, 255, 0.94);
  border: 2px solid #f1d5e6;
  border-radius: 30px;

  box-shadow:
    0 10px 30px rgba(190, 140, 180, 0.16),
    0 0 0 5px rgba(255, 255, 255, 0.5);
}

h1 {
  color: #d77da9;
  font-size: clamp(28px, 5vw, 42px);
  margin: 10px 0;
  text-shadow: 2px 3px 0 #ffe3f0;
  letter-spacing: 1px;
}

h2 {
  color: #b47eb8;
}

h3 {
  color: #bd82a9;
}

.subtitle {
  color: var(--text-light);
  font-size: 15px;
  letter-spacing: 1px;
}

.game-decoration {
  margin: 18px 0;
  font-size: 25px;
  letter-spacing: 5px;
}

.board-description {
  margin: 25px 0 15px;
  color: var(--text-light);
  font-weight: bold;
}

.coming-soon {
  color: #d18caf;
  font-weight: bold;
  margin-top: 20px;
}


/* ===================================
   入力欄
=================================== */

input,
select {
  padding: 11px 15px;
  border: 1px solid #e8c6dc;
  border-radius: 14px;
  background: #fffafd;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: 0.2s;
}

input:focus,
select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(233, 154, 189, 0.18);
}

.player-input {
  margin: 12px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.player-input label {
  font-weight: bold;
  color: #a8799c;
}


/* ===================================
   ボタン
=================================== */

button {
  padding: 13px 30px;
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 30px;

  background: linear-gradient(135deg, #f3a8ca, #c9a5e8);
  color: white;

  font-size: 16px;
  font-weight: bold;
  cursor: pointer;

  box-shadow:
    0 5px 12px rgba(190, 140, 180, 0.22),
    inset 0 1px 2px rgba(255,255,255,0.5);

  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

button:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(190, 140, 180, 0.25);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}


/* ===================================
   プレイヤー情報カード
=================================== */

.player-summary {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 22px 0;
}

.player-summary > * {
  padding: 13px 18px;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff5fa, #f8f0ff);
  border: 1px solid #efd7e9;
  box-shadow: 0 4px 10px rgba(190, 140, 180, 0.1);
}

.player-card {
  min-width: 145px;
  border: 1px solid #efd7e9;
  transition: transform 0.2s;
}

.player-card:hover {
  transform: translateY(-3px);
}


/* ===================================
   ゲーム盤
=================================== */

.game-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(105px, auto));
  gap: 10px;

  width: 100%;
  max-width: 760px;
  margin: 25px auto;
  padding: 16px;

  border-radius: 26px;
  background: linear-gradient(135deg, #fff5fa, #f5efff);
  border: 2px solid #ead4ed;

  box-shadow:
    inset 0 0 15px rgba(255,255,255,0.8),
    0 6px 18px rgba(180, 140, 180, 0.12);
}

.board-cell {
  min-width: 0;
  min-height: 105px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;

  padding: 8px 4px;

  border: 1px solid #efd4e5;
  border-radius: 18px;

  background: linear-gradient(145deg, #ffffff, #fff0f6);

  box-shadow:
    0 3px 8px rgba(190, 140, 180, 0.12),
    inset 0 1px 3px white;

  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.board-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(190, 140, 180, 0.18);
}

/* マスごとの淡い色 */

.board-cell:nth-child(3n + 2) {
  background: linear-gradient(145deg, #fffaff, #f8efff);
}

.board-cell:nth-child(3n) {
  background: linear-gradient(145deg, #ffffff, #fff5ed);
}

.cell-number {
  font-size: 11px;
  color: #b58ab5;
  font-weight: bold;
}

.cell-emoji {
  font-size: 27px;
  filter: drop-shadow(0 2px 2px rgba(180, 140, 160, 0.15));
}

.cell-name {
  font-size: 12px;
  font-weight: bold;
  line-height: 1.4;
  overflow-wrap: anywhere;
  color: #856582;
}


/* ===================================
   START・GOAL
=================================== */

.start-cell {
  background: linear-gradient(145deg, #ffe4f0, #ffc9e0) !important;
  border: 2px solid #e99abd;
  box-shadow: 0 4px 12px rgba(233, 154, 189, 0.2);
}

.start-cell .cell-name {
  color: #c45f91;
}

.goal-cell {
  background: linear-gradient(145deg, #fff5d9, #ffe5a8) !important;
  border: 2px solid var(--gold);
  box-shadow: 0 4px 14px rgba(217, 185, 110, 0.25);
}

.goal-cell .cell-name {
  color: #a98737;
}


/* ===================================
   プレイヤーのティアラコマ
=================================== */

.player-pawns {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding: 3px;
}

.player-pawn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: 38px;
  height: 45px;

  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #f2d6e8;

  box-shadow:
    0 3px 7px rgba(180, 130, 170, 0.16),
    inset 0 1px 3px white;
}

.pawn-crown {
  font-size: 25px;
  line-height: 1.2;
  filter: drop-shadow(0 2px 2px rgba(180, 140, 160, 0.2));
}

.pawn-jewel {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 5px rgba(180, 140, 180, 0.5);
  margin-top: 1px;
}


/* ===================================
   サイコロ画面
=================================== */

#dicePanel {
  border: 2px solid #f0d4e7;
  box-shadow: 0 6px 18px rgba(190, 140, 180, 0.13);
}

#turnText {
  color: #c47da5;
}

#diceDisplay {
  color: #b58ab5;
  text-shadow: 0 4px 8px rgba(180, 140, 180, 0.15);
}

#resultText {
  color: #896b85;
  font-weight: bold;
  line-height: 1.7;
  white-space: pre-line;
}

#diceButton {
  background: linear-gradient(135deg, #f3a8ca, #c9a5e8);
}


/* ===================================
   結果発表
=================================== */

#finalResults {
  border: 2px solid var(--gold) !important;
  background: linear-gradient(145deg, #fff8fc, #fff3fa) !important;
  box-shadow: 0 8px 25px rgba(190, 140, 180, 0.18);
}

#finalResults h2 {
  color: #c47da5;
  font-size: 27px;
}

#finalResults h3 {
  color: #b47eb8;
}

#finalResults p {
  line-height: 1.7;
}

#finalResults button {
  background: linear-gradient(135deg, #f3a8ca, #c9a5e8) !important;
  border: 1px solid white !important;
  box-shadow: 0 5px 12px rgba(190, 140, 180, 0.22);
}


/* ===================================
   その他
=================================== */

.board-placeholder {
  padding: 30px;
  color: #b58ab5;
}

[hidden] {
  display: none !important;
}


/* ===================================
   スマートフォン対応
=================================== */

@media (max-width: 600px) {

  body {
    padding: 12px 6px;
  }

  .start-screen,
  .game-screen {
    padding: 22px 10px;
    border-radius: 22px;
  }

  .game-board {
    gap: 5px;
    padding: 7px;
    border-radius: 18px;
  }

  .board-cell {
    min-height: 82px;
    padding: 5px 2px;
    border-radius: 12px;
    gap: 4px;
  }

  .cell-emoji {
    font-size: 20px;
  }

  .cell-name {
    font-size: 10px;
  }

  .player-pawns {
    gap: 3px;
  }

  .player-pawn {
    width: 29px;
    height: 37px;
  }

  .pawn-crown {
    font-size: 20px;
  }

  .pawn-jewel {
    width: 8px;
    height: 8px;
  }

  .player-summary {
    gap: 8px;
  }

  .player-summary > * {
    padding: 9px 11px;
    min-width: 125px;
  }

  .player-input {
    flex-direction: column;
    gap: 7px;
  }

  .player-input input {
    width: min(100%, 260px);
  }

  button {
    max-width: 100%;
  }

}

/* ===================================
   サイコロ・コマの演出
=================================== */

/* サイコロがふわっと弾む */
#diceDisplay {
  display: inline-block;
  animation: diceFloat 1.5s ease-in-out infinite;
}

@keyframes diceFloat {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* コマが登場するときの演出 */
.player-pawn {
  animation: pawnAppear 0.4s ease-out;
}

@keyframes pawnAppear {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(8px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
