
body {
  font-family: "Noto Sans JP", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f6f8;
  color: #333;
}

header {
  background-color: #0077cc;
  color: white;
  padding: 10px;
  text-align: center;
  font-size: 1.4em;
}

.container {
  max-width: 960px;
  margin: auto;
  padding: 20px;
  background: white;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  margin-top: 30px;
}

input, select, button {
  font-size: 16px;
  padding: 8px;
  margin: 5px 0;
  border-radius: 6px;
  border: 1px solid #ccc;
  /*width: 100%;*/
  box-sizing: border-box;
}

button {
  background-color: #0077cc;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover {
  background-color: #005fa3;
}

.card {
  width: 120px;
  height: 169.4px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  margin: 5px;
  cursor: pointer;
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.card.selected {
  border: 7px solid #0077cc;
}

/* 横並びレイアウト用 */
.card-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.card.fade-out {
  opacity: 0;
  transform: scale(0.8); /* 少し縮小すると自然 */
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* 対話フェーズ中（evaluation-modeクラスがbodyに付与される） */
body.evaluation-mode .card-row {
  display: block;
}

.card.opacity-low {
  opacity: 0.5;
}

/* 対話フェーズで slider-group を縦並びにする */
body.evaluation-mode #hand {
  display: flex;
  flex-direction: column;  /* 縦方向に並べる */
  gap: 30px;               /* プレイヤー間の間隔を広めに */
  align-items: center;     /* 中央揃え（必要に応じて） */
}

/* 各プレイヤーブロックのスタイル */
body.evaluation-mode .slider-group {
  display: flex;
  flex-direction: row;     /* カードは横並びのまま */
  gap: 20px;
  padding: 10px;
  border: 1px solid #ccc;  /* 各ブロックの枠線（任意） */
  border-radius: 8px;
  background-color: #f9f9f9;
}

#sliderRowFinal {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 24px;
}

.slider-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.slider-group {
  display: flex; /* ← 横並びを解除 */
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  align-items: center;  /* ✅ 中央揃え */
  justify-content: center;
}
.slider-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 4px 8px;
}
@keyframes drawCard {
  0% {
    transform: translateY(-30px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.card.newly-drawn {
  animation: drawCard 0.4s ease-out;
}
@keyframes flash {
  from { transform: scale(1.3); opacity: 0.5; }
  to { transform: scale(1); opacity: 1; }
}

input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(145deg, #ffffff, #d0d0d0);
  border: 2px solid #0077cc;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -6px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.8);
  transition: background 0.3s, transform 0.2s;
}

input[type=range]:hover::-webkit-slider-thumb {
  transform: scale(1.1);
  background: linear-gradient(145deg, #f0f0f0, #c0c0c0);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* トラックの見た目 */
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: #ccc;
  border-radius: 3px;
}

/* サム（つまみ）の見た目と位置調整 */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #3399ff;
  border-radius: 50%;
  margin-top: -5px; /* トラック中央に揃える */
  cursor: pointer;
  position: relative;
}

/* Firefox用 */
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #3399ff;
  border-radius: 50%;
  cursor: pointer;
}


/* 横並びカード対応 */
.other-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}
.other-player-hand {
  display: block;       /* プレイヤーごとに縦方向に並ぶ */
  margin-bottom: 12px;  /* プレイヤーごとの間隔 */
}

/* 手札のカードは従来通り横並び */
.other-player-hand img,
.other-player-hand .card {
  display: inline-block;
  margin-right: 4px;    /* カード間隔 */
}
.player-cards {
  display: flex;
  flex-direction: row;
  gap: 6px;
  margin-top: 4px;
}

.reaction-popup {
  font-size: 22px;
  margin-top: 4px;
  text-align: center;
  animation: fadeIn 0.3s ease-in-out;
}

.reaction-popups {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  justify-content: center;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8); }
}

.emoji-container {
  position: relative;
  display: inline-block;
  margin-top: 6px;
}

.emoji-toggle {
  cursor: pointer;
  font-size: 20px;
  text-align: center;
}

.emoji-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #ccc;
  padding: 4px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 10;
}

.emoji-container:hover .emoji-list {
  display: flex;
  gap: 4px;
}

.emoji-btn {
  display: inline-block;
  width: 40px;             /* 固定幅でコンパクト */
  height: 40px;
  margin: 4px;
  font-size: 20px;
  text-align: center;
  cursor: pointer;

  background-color: #ffffff;
  border: 2px solid #ccc;
  border-radius: 8px;

  transition: all 0.2s ease-in-out;
}

.emoji-btn:hover {
  background-color: #f0f0f0;
  transform: scale(1.1);   /* ホバーで少し拡大して目立たせる */
  border-color: #0077cc;
}

.emoji-btn:active {
  transform: scale(0.95);
  background-color: #e0e0e0;
}

.main-btn {
  display: block;
  padding: 10px 20px;
  margin: 6px;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  background-color: #0077cc;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.main-btn:hover {
  background-color: #005fa3;
  transform: scale(1.05);
}

.main-btn:active {
  transform: scale(0.95);
  background-color: #004a80;
}

.button-container {
  display: flex;
  justify-content: center;  /* 横方向中央 */
  gap: 12px;                /* ボタン間の間隔 */
  margin: 20px 0;
}

/* 捨て場のカードを横並び＋中央寄せ */
#trashArea {
  display: flex;
  flex-wrap: wrap;            /* 折り返し対応 */
  justify-content: center;    /* 中央揃え */
  gap: 10px;                  /* カード間の余白 */
  margin: 20px auto;
  text-align: center;
}

#trashArea img.card {
  display: inline-block;
  width: 120px;
  height: auto;
}

/* 他プレイヤーエリアを中央寄せ */
#othersArea {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;                   /* プレイヤーごとの余白 */
  margin: 20px auto;
  text-align: center;
}

.other-player-hand {
  display: flex;               /* 横並び */
  justify-content: center;
  gap: 8px;
}

#hand-area {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px; /* 間隔調整 */
  margin-top: 20px;
}

#hand img {
  /*width: 100px;*/
  margin: 5px;
}

.deck {
  position: relative;
  width: 120px;
}

.deck-stack {
  width: 120px;
  height: 140px;
  background-color: #ccc;
  border: 1px solid #999;
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(5px, 5px);
  z-index: -1;
}


#discardArea h3,
#discardArea p {
  text-align: center;
}

.discard {
  border: 3px solid #e74c3c; /* 赤い枠線 */
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
}

.deck {
  position: relative;
  width: 120px;
  height: 160px;
  cursor: pointer;
  margin: 0 auto;
  opacity: 1;
  transition: opacity 0.6s ease;  /* フェード効果 */
}

#drawNewCardImg {
  position: absolute;
  top: 0;
  left: 0;
  width: 120px;
  height: 160px;
  z-index: 4;
  transition: transform 0.3s ease;
}
#drawNewCardImg:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 12px 16px rgba(0,0,0,0.2);
}

/* 山札の重なりカードを擬似的に作る */
.deck-stack {
  position: absolute;
  top: 0;
  left: 0;
  width: 97px;
  height: 160px;
  background-color: #f4f0e6;         /* 柔らかいベージュ系 */
  border: 2px solid #4da6a6;         /* 青緑系の枠線 */
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.deck-stack:nth-child(2) { top: 4px; left: 4px; z-index: 1; }
.deck-stack:nth-child(3) { top: 8px; left: 8px; z-index: 0; }

.deck.fade-out, .deck-stack.fade-out {
  opacity: 0;
}

.card-animate {
  animation: slideFadeIn 0.5s ease forwards;
}

@keyframes slideFadeIn {
  0% {
    opacity: 0;
    transform: translateX(50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ====== Start Screen Polish (prefix: vv-) ====== */
:root {
  --vv-bg: #f5f7fb;
  --vv-card: #ffffff;
  --vv-ink: #1d2a36;
  --vv-ink-sub: #5b6b78;
  --vv-primary: #0d7ae0;
  --vv-primary-dk: #0b64b6;
  --vv-warn: #e65100;
  --vv-ring: rgba(13,122,224,.25);
}

html, body {
  font-family: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background:
    radial-gradient(70rem 70rem at -10% -10%, #e8f2ff 0%, transparent 60%),
    radial-gradient(60rem 60rem at 120% -20%, #e6fff8 0%, transparent 60%),
    var(--vv-bg);
  color: var(--vv-ink);
}

/* ヘッダー */
.vv-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 20px; background: #fff; border-bottom: 1px solid #e9eef5;
}
.vv-brand { font-weight: 900; letter-spacing: .02em; color: var(--vv-primary); }
.vv-env {
  font-size: 12px; padding: 4px 8px; border-radius: 999px;
  background: #eef6ff; color: var(--vv-primary); border: 1px solid #d7e8fb;
}

/* ヒーロー */
.vv-hero {
  text-align: center; padding: 28px 16px 8px;
}
.vv-hero h1 {
  margin: 0; font-size: clamp(24px, 4vw, 34px); font-weight: 900; letter-spacing: .01em;
}
.vv-hero-sub { margin: 6px 0 0; color: var(--vv-ink-sub); font-size: 14px; }

/* 共通ラッパ */
.container { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* ステータス（参加人数・待機文言） */
.vv-status {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  margin: 10px auto 0;
}
.vv-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 12px; color: #14508d;
  background: #eaf3ff; border: 1px solid #d6e7ff; border-radius: 999px;
  padding: 6px 12px;
}
.vv-badge.vv-warn { color: #8d3a14; background: #fff1e6; border-color: #ffd9c2; }

/* 2カラムの並び（モバイルは1カラム） */
.vv-grid { display: grid; gap: 16px; margin-top: 18px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .vv-grid { grid-template-columns: 1fr 1fr; } }

/* カード（既存ブロックに class="panel" を付けるだけで適用） */
.panel {
  background: var(--vv-card);
  border: 1px solid #e7eef5;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(13, 122, 224, 0.06);
  padding: 16px 16px 18px;
}
.panel h2 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }

/* フォーム要素（既存 input を軽く強化） */
label { color: var(--vv-ink); font-weight: 600; }
input[type="text"], input[type="number"] {
  width: 100%;
  border: 1.5px solid #d7e3f0; border-radius: 10px; padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
}
input[type="text"]:focus, input[type="number"]:focus {
  outline: none; border-color: var(--vv-primary); box-shadow: 0 0 0 4px var(--vv-ring);
}

/* 主要ボタンにグラデを付与（既存の .main-btn があれば補強） */
.main-btn {
  border-radius: 10px; padding: 12px 18px; border: none; cursor: pointer;
  background: linear-gradient(180deg, var(--vv-primary), var(--vv-primary-dk));
  color: #fff; box-shadow: 0 6px 14px rgba(13, 122, 224, 0.25);
  transition: transform .12s ease, filter .12s ease;
}
.main-btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.main-btn:active { transform: translateY(0); }

/* 細かい余白 */
.button-container { margin-top: 10px; }
#turnInfo { margin-top: 10px; text-align: center; font-weight: 700; }


