/* ==========================================================================
   play.css：対戦画面レイアウト・操作パネル・色選択・重ね出し全統合版
   ========================================================================== */
#プレイ画面 {
  justify-content: space-between;
}

/* 1. プレイ画面最上部バー */
.play-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.back-btn:active {
  transform: scale(0.95);
  background: rgba(255, 50, 50, 0.5);
}

.room-indicator {
  font-size: 12px;
  color: #ffcc00;
  font-weight: bold;
}

/* 2. 対戦相手エリア（2人時は中央寄せ） */
.opponents-area {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.25);
  min-height: 64px;
  align-items: center;
}

.opponents-area.two-players {
  justify-content: center;
}

.opponent-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  min-width: 140px;
  transition: all 0.3s;
}

.opponents-area.two-players .opponent-box {
  min-width: 170px;
}

.opponent-box.reach {
  border-color: #ff3333;
  background: rgba(255, 0, 0, 0.2);
  box-shadow: 0 0 12px rgba(255, 50, 50, 0.6);
  animation: 警告アニメーション 1s infinite alternate;
}

@keyframes 警告アニメーション {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

.opp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.count-text.normal { font-size: 12px; color: #ffcc00; }
.count-text.reach-text { font-size: 12px; color: #ff5555; font-weight: bold; }

.opp-cards-visual {
  display: flex;
  margin-left: 6px;
  height: 28px;
  align-items: center;
}

.mini-card-back {
  width: 18px;
  height: 26px;
  background: #111;
  border: 1.5px solid #fff;
  border-radius: 3px;
  margin-left: -10px;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
.mini-card-back:first-child { margin-left: 0; }

/* 3. 中央テーブル */
.table-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.status-badge {
  font-size: 14px;
  background: rgba(0,0,0,0.65);
  padding: 6px 18px;
  border-radius: 16px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.3s;
}

/* ワイルド指定色バッジ */
.current-color-badge {
  display: none;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: 14px;
  border: 2px solid #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}
.current-color-badge.red { background: var(--uno-赤); display: block; }
.current-color-badge.blue { background: var(--uno-青); display: block; }
.current-color-badge.green { background: var(--uno-緑); display: block; }
.current-color-badge.yellow { background: var(--uno-黄); display: block; color: #111; text-shadow: none; }

/* ドロー攻撃残数バッジ */
.draw-penalty-badge {
  background: linear-gradient(135deg, #ff0000, #990000);
  border: 2px solid #ffcc00;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 16px;
  border-radius: 12px;
  box-shadow: 0 0 14px rgba(255, 0, 0, 0.8);
  animation: ドロー点滅 0.8s infinite alternate;
}

@keyframes ドロー点滅 {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.table-cards {
  display: flex;
  gap: 36px;
  align-items: center;
}

/* 4. 下部操作エリア */
.my-area {
  background: rgba(0, 0, 0, 0.45);
  padding: 10px 0 20px 0;
}

.my-control-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 8px 16px;
}

.my-info {
  font-size: 14px;
  font-weight: bold;
}

.action-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.draw-button {
  background: linear-gradient(135deg, #2b6cb0, #1a365d);
  color: #fff;
  border: 2px solid #63b3ed;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.draw-button.must-draw {
  background: linear-gradient(135deg, #e53e3e, #dd6b20);
  border-color: #ffeb3b;
  box-shadow: 0 0 16px 4px #ff5722;
  animation: 引くボタンアピール 0.8s infinite alternate;
}

@keyframes 引くボタンアピール {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.uno-button {
  background: linear-gradient(135deg, #cc0000, #ff4400);
  color: #fff;
  border: 3px solid #fff;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 15px;
  font-weight: 900;
  font-style: italic;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  transition: all 0.2s;
}

.uno-button.ready {
  background: linear-gradient(135deg, #ff0000, #ffff00);
  color: #111;
  border-color: #ffff00;
  box-shadow: 0 0 20px 6px #ff3300;
  animation: 発光シェイク 0.6s infinite alternate;
}

@keyframes 発光シェイク {
  0% { transform: scale(1); }
  100% { transform: scale(1.1) rotate(-3deg); }
}

.hand-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 24px 16px 10px 16px;
}

/* 5. 手札右上の「x2」重ね出しバッジ */
.card-duplicate-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff0000;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 900;
  padding: 1px 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.6);
  z-index: 10;
}

/* 6. 重ね出し選択ダイアログ（初期非表示） */
.stack-choice-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  justify-content: center;
  align-items: center;
  z-index: 350;
  padding: 20px;
}

.stack-choice-dialog {
  background: #1e1e1e;
  border: 3px solid #ffcc00;
  border-radius: 18px;
  padding: 18px 16px;
  width: 100%;
  max-width: 290px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.9);
}

.stack-title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 14px;
  color: #ffea00;
}

.stack-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack-btn {
  padding: 11px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  border: 2px solid #fff;
}

.stack-btn.single {
  background: #3182ce;
  color: #fff;
}

.stack-btn.multi {
  background: linear-gradient(135deg, #e53e3e, #dd6b20);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 80, 0, 0.6);
}

.stack-btn.cancel {
  background: transparent;
  border-color: #666;
  color: #bbb;
  font-size: 12px;
  padding: 6px;
}

/* 7. 色選択モーダル（初期非表示） */
.color-modal-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 400;
  padding: 20px;
}

.color-modal-dialog {
  background: #222;
  border: 3px solid #fff;
  border-radius: 20px;
  padding: 22px 18px;
  width: 100%;
  max-width: 280px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.9);
}

.color-modal-title {
  font-size: 16px;
  margin-bottom: 18px;
  letter-spacing: 0.5px;
}

.color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.color-choice-btn {
  height: 75px;
  border: 3px solid #ffffff;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 2px rgba(0,0,0,0.6);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  transition: transform 0.15s;
}

.color-choice-btn:active { transform: scale(0.92); }
.color-choice-btn.red-btn { background: var(--uno-赤); }
.color-choice-btn.blue-btn { background: var(--uno-青); }
.color-choice-btn.green-btn { background: var(--uno-緑); }
.color-choice-btn.yellow-btn { background: var(--uno-黄); color: #111; text-shadow: none; }

/* 8. 退室確認モーダル（初期非表示） */
.modal-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  justify-content: center;
  align-items: center;
  z-index: 300;
  padding: 20px;
}

.modal-dialog {
  background: #222;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 300px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.8);
}

.modal-title { font-size: 16px; margin-bottom: 8px; }
.modal-desc { font-size: 12px; color: #ccc; margin-bottom: 18px; line-height: 1.4; }
.modal-actions { display: flex; gap: 10px; }
.modal-btn { flex: 1; padding: 9px; border-radius: 10px; font-size: 13px; font-weight: bold; cursor: pointer; }
.modal-btn.cancel { background: rgba(255, 255, 255, 0.15); border: 1px solid #777; color: #fff; }
.modal-btn.confirm { background: #ea2b2b; border: 1px solid #ff7777; color: #fff; }