/* ==============================
   頂戴いたしますアベニュー - スタイル v2
   ============================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "Hiragino Kaku Gothic Pro", "Meiryo", sans-serif;
  background: #0a0a1a;
  color: #eee;
  min-height: 100vh;
}

#app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px;
}

.hidden {
  display: none !important;
}

/* ===== ロビー ===== */

#lobby {
  text-align: center;
  padding-top: 60px;
}

#lobby h1 {
  font-size: 2.8rem;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.5));
  margin-bottom: 8px;
}

.subtitle {
  font-size: 1.1rem;
  color: #888;
  margin-bottom: 40px;
}

.lobby-panel {
  background: linear-gradient(180deg, #16213e, #0f1a30);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 16px;
  padding: 28px 36px;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.lobby-panel h2 {
  font-size: 1rem;
  color: #ffd700;
  margin: 16px 0 8px;
  text-align: left;
  letter-spacing: 1px;
}

#map-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,215,0,0.3);
  background: #0f3460;
  color: #eee;
  font-size: 1rem;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.player-row label {
  width: 30px;
  font-weight: bold;
  color: #ffd700;
}

.player-row input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #0f3460;
  color: #eee;
  font-size: 0.9rem;
}

.player-row select {
  width: 80px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #0f3460;
  color: #eee;
  font-size: 0.9rem;
}

.btn-primary {
  display: inline-block;
  margin-top: 24px;
  padding: 14px 48px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #1a1a2e;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 1px;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* --- キャラクター選択 --- */
.char-select {
  width: 110px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #0f3460;
  color: #eee;
  font-size: 0.85rem;
}

.char-preview {
  background: linear-gradient(135deg, #0f3460, #16213e);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 12px;
  animation: fadeIn 0.2s ease;
}

.cp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.cp-emoji {
  font-size: 1.6rem;
}

.cp-name {
  font-size: 1.1rem;
  font-weight: bold;
  color: #ffd700;
}

.cp-desc {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 10px;
}

.cp-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

.cp-stat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}

.cp-stat-label {
  width: 52px;
  color: #888;
  flex-shrink: 0;
}

.cp-stat-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.cp-stat-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.cp-stat-val {
  width: 16px;
  text-align: right;
  color: #ffd700;
  font-weight: bold;
  font-size: 0.75rem;
}

.btn-secondary {
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: bold;
  color: #ffd700;
  background: transparent;
  border: 2px solid #ffd700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: rgba(255,215,0,0.1);
}

/* ===== ゲーム画面 ===== */

#game {
  display: flex;
  gap: 12px;
  height: calc(100vh - 24px);
}

#board-area {
  flex-shrink: 0;
  position: relative;
}

#board-canvas {
  background: #0a1628;
  border-radius: 12px;
  border: 2px solid rgba(255,215,0,0.3);
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

/* --- マス ツールチップ --- */
.square-tooltip {
  position: absolute;
  z-index: 200;
  pointer-events: none;
  background: rgba(10, 16, 36, 0.95);
  border: 1px solid rgba(255,215,0,0.5);
  border-radius: 8px;
  padding: 10px 14px;
  color: #eee;
  font-size: 0.82rem;
  line-height: 1.5;
  min-width: 160px;
  max-width: 260px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  white-space: nowrap;
}
.square-tooltip.hidden { display: none; }
.sq-tip-name { font-weight: bold; font-size: 0.95rem; color: #ffd700; margin-bottom: 4px; }
.sq-tip-row { display: flex; justify-content: space-between; gap: 12px; }
.sq-tip-label { color: #aaa; }
.sq-tip-value { font-weight: bold; }
.sq-tip-owner { color: #2ecc71; }
.sq-tip-fee { color: #ff6b6b; font-weight: bold; }

#hud {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 280px;
  max-width: 340px;
  overflow-y: auto;
}

/* --- ターン情報 --- */
#turn-info {
  background: linear-gradient(135deg, #16213e, #1a2a4a);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,215,0,0.15);
}

.turn-header {
  font-size: 1.1rem;
  font-weight: bold;
}

.turn-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.85rem;
  color: #888;
}

.phase-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,215,0,0.15);
  color: #ffd700;
  font-size: 0.75rem;
  font-weight: bold;
}

/* --- プレイヤーカード --- */
#players-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-card {
  background: linear-gradient(135deg, #16213e, #1a2a4a);
  border-radius: 8px;
  padding: 8px 12px;
  border-left: 4px solid #888;
  transition: box-shadow 0.2s;
}

.player-card.current {
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
  border-left-width: 6px;
}

.player-card.bankrupt {
  opacity: 0.4;
}

.pc-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pc-name {
  font-weight: bold;
  font-size: 0.95rem;
}

.pc-char-emoji {
  font-size: 1.1rem;
}

.pc-type {
  font-size: 0.8rem;
}

.pc-bankrupt {
  font-size: 0.75rem;
  color: #e74c3c;
  font-weight: bold;
}

.pc-gold {
  font-size: 1rem;
  font-weight: bold;
  color: #ffd700;
  margin: 2px 0;
  transition: color 0.3s;
}

.pc-total-assets {
  font-size: 0.95rem;
  font-weight: bold;
  color: #66d9ef;
  background: rgba(102, 217, 239, 0.08);
  border-radius: 4px;
  padding: 1px 6px;
  margin: 2px 0;
  letter-spacing: 0.5px;
}

.gold-diff {
  font-size: 0.8rem;
  font-weight: bold;
  margin-left: 4px;
  animation: goldDiffFade 1.5s ease-out forwards;
}
.gold-up { color: #2ecc71; }
.gold-down { color: #e74c3c; }
@keyframes goldDiffFade {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

.pc-details {
  font-size: 0.8rem;
  color: #999;
  display: flex;
  gap: 10px;
}

.pc-suits {
  font-size: 1.1rem;
  margin-top: 2px;
  letter-spacing: 2px;
}

/* --- 株価情報 --- */
.stock-info-panel {
  background: linear-gradient(135deg, #16213e, #1a2a4a);
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.stock-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 0.82rem;
}

.si-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.si-name {
  flex: 1;
  color: #ccc;
}

.si-price {
  color: #ffd700;
  font-weight: bold;
}

/* --- アクションパネル --- */
#action-panel {
  background: linear-gradient(135deg, #1a2a4a, #16213e);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid rgba(255,215,0,0.2);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.square-info {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.direction-label {
  font-size: 0.9rem;
  color: #ffd700;
  margin-bottom: 8px;
  font-weight: bold;
}

.dice-result-small {
  font-size: 0.8rem;
  color: #777;
  padding: 4px;
}

#action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#action-buttons button {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
}

#action-buttons button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-action-buy {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #fff;
}

.btn-action-buy:hover:not(:disabled) {
  box-shadow: 0 3px 12px rgba(40, 167, 69, 0.4);
  transform: translateY(-1px);
}

.btn-action-decline {
  background: #4a5568;
  color: #ddd;
}

.btn-action-decline:hover {
  background: #5a6578;
}

.btn-action-dice {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a2e;
  font-size: 1.1rem;
  padding: 12px 28px;
  width: 100%;
}

.btn-action-dice:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.5);
  transform: translateY(-2px);
}

.btn-action-force {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
}

.btn-action-force:hover:not(:disabled) {
  box-shadow: 0 3px 12px rgba(231, 76, 60, 0.4);
  transform: translateY(-1px);
}

.btn-action-invest {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: #fff;
}

.btn-action-invest:hover:not(:disabled) {
  box-shadow: 0 3px 12px rgba(52, 152, 219, 0.4);
  transform: translateY(-1px);
}

.btn-direction {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  flex: 1;
  min-width: 120px;
}

.btn-direction:hover {
  box-shadow: 0 3px 12px rgba(108, 92, 231, 0.4);
  transform: translateY(-1px);
}

/* --- 株パネル --- */
#stock-panel {
  background: linear-gradient(135deg, #1a2a4a, #16213e);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid rgba(255,215,0,0.2);
  animation: fadeIn 0.2s ease;
}

#stock-panel h3 {
  color: #ffd700;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.stock-area-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.sa-color {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stock-area-row .area-name {
  width: 70px;
  font-weight: bold;
}

.stock-area-row .price {
  width: 65px;
  text-align: right;
  color: #ffd700;
}

.sa-holding {
  width: 60px;
  color: #aaa;
  font-size: 0.8rem;
}

.sa-controls {
  display: flex;
  gap: 4px;
  align-items: center;
}

.stock-input {
  width: 42px;
  padding: 4px;
  text-align: center;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
  background: #0f3460;
  color: #eee;
  font-size: 0.8rem;
}

.sa-controls button {
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.15s;
}

.sa-controls button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-stock-buy {
  background: #28a745;
  color: #fff;
}

.btn-stock-sell {
  background: #dc3545;
  color: #fff;
}

/* --- メッセージログ --- */
#message-log {
  background: linear-gradient(135deg, #0d1117, #10151e);
  border-radius: 8px;
  padding: 8px 12px;
  max-height: 180px;
  overflow-y: auto;
  flex: 1;
  border: 1px solid rgba(255,255,255,0.05);
}

#messages {
  font-size: 0.8rem;
  line-height: 1.7;
}

#messages .msg {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  animation: msgIn 0.2s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.msg-salary { color: #ffd700; }
.msg-fee { color: #e74c3c; }
.msg-buy { color: #2ecc71; }
.msg-force { color: #ff6b6b; }
.msg-suit { color: #a29bfe; }
.msg-chance { color: #e67e22; }
.msg-stock { color: #9b59b6; }
.msg-invest { color: #3498db; }
.msg-bankrupt { color: #e74c3c; font-weight: bold; }
.msg-gameover { color: #ffd700; font-weight: bold; font-size: 0.95rem; }

/* --- ゲームオーバー --- */
.game-over-panel {
  text-align: center;
  padding: 16px;
}

.game-over-panel h2 {
  color: #ffd700;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.winner-name {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 16px;
}

.rankings {
  margin: 12px 0;
}

.rank-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
}

.rank {
  color: #ffd700;
  font-weight: bold;
  width: 40px;
}

.rank-gold {
  color: #ffd700;
}

/* --- プレイヤーカラー --- */
.color-p1 { border-color: #ff6b6b; }
.color-p2 { border-color: #4ecdc4; }
.color-p3 { border-color: #45b7d1; }
.color-p4 { border-color: #f9ca24; }

/* --- スクロールバー --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,215,0,0.2);
  border-radius: 3px;
}

/* --- レスポンシブ --- */
@media (max-width: 960px) {
  #game {
    flex-direction: column;
    height: auto;
  }
  #board-canvas {
    width: 100%;
    height: auto;
  }
  #hud {
    max-width: none;
  }
}

/* ===== チャンスカードモーダル ===== */
.chance-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.chance-modal-inner {
  background: linear-gradient(135deg, #1a2a4a, #0f1a30);
  border: 2px solid rgba(255,215,0,0.4);
  border-radius: 16px;
  padding: 24px 28px;
  text-align: center;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  max-width: 400px;
  width: 90%;
}

.chance-modal-inner h3 {
  color: #ffd700;
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.chance-hint {
  color: #aaa;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.chance-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.chance-card {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #d35400, #e67e22);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid rgba(255,255,255,0.15);
  font-size: 1.4rem;
}

.chance-card:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(230, 126, 34, 0.5);
  border-color: rgba(255,215,0,0.6);
}

.chance-card-face {
  pointer-events: none;
}

.chance-card-selected {
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255,215,0,0.5);
  transform: scale(1.12);
}

.chance-card-revealed {
  background: linear-gradient(135deg, #16213e, #1a2a4a);
  border-color: #ffd700;
  animation: cardFlip 0.4s ease;
}

.chance-card-content {
  font-size: 0.65rem;
  color: #fff;
  padding: 4px;
  line-height: 1.3;
  font-weight: bold;
  pointer-events: none;
}

@keyframes cardFlip {
  0% { transform: scale(1.12) rotateY(0deg); }
  50% { transform: scale(1.12) rotateY(90deg); }
  100% { transform: scale(1.12) rotateY(0deg); }
}

/* --- チャンスカード 大ポップアップ --- */
.chance-big-popup {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  animation: fadeIn 0.3s ease;
  pointer-events: none;
  transition: opacity 0.4s;
}
.chance-big-popup.chance-big-fadeout {
  opacity: 0;
}
.chance-big-card {
  background: linear-gradient(135deg, #d35400, #e67e22);
  border: 3px solid rgba(255,215,0,0.7);
  border-radius: 20px;
  padding: 36px 48px;
  text-align: center;
  box-shadow: 0 12px 60px rgba(211,84,0,0.5), 0 0 40px rgba(255,215,0,0.2);
  animation: chanceBigPop 0.5s ease-out;
  max-width: 440px;
}
.chance-big-number {
  font-size: 1rem;
  color: rgba(255,255,255,0.6);
  font-weight: bold;
  margin-bottom: 10px;
  letter-spacing: 2px;
}
.chance-big-desc {
  font-size: 1.6rem;
  font-weight: bold;
  color: #fff;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
@keyframes chanceBigPop {
  0% { transform: scale(0.3) rotate(-5deg); opacity: 0; }
  50% { transform: scale(1.08) rotate(1deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ===== 汎用ゲームモーダル ===== */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.game-modal-inner {
  background: linear-gradient(135deg, #1a2a4a, #0f1a30);
  border: 2px solid rgba(255,215,0,0.4);
  border-radius: 16px;
  padding: 24px 28px;
  text-align: center;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  max-width: 480px;
  width: 90%;
}

/* --- 物件アクションモーダル --- */
.shop-modal-inner h3 {
  color: #ffd700;
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.shop-modal-info {
  color: #ccc;
  font-size: 0.9rem;
  margin-bottom: 12px;
  line-height: 1.5;
}

.shop-modal-info .shop-price {
  color: #ffd700;
  font-weight: bold;
  font-size: 1.1rem;
}

.shop-modal-info .shop-fee {
  color: #ff6b6b;
  font-weight: bold;
}

.shop-modal-info .shop-owner-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  margin-left: 4px;
}

.shop-modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.shop-modal-buttons button {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
}

.shop-modal-buttons button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.shop-modal-buttons button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- 増資スライダー --- */
.invest-slider-area {
  margin: 16px 0 8px;
  text-align: left;
}

.invest-slider-area label {
  color: #ccc;
  font-size: 0.85rem;
}

.invest-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.invest-slider-row input[type="range"] {
  flex: 1;
  accent-color: #ffd700;
}

.invest-slider-row input[type="number"] {
  width: 80px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,215,0,0.3);
  background: #0f3460;
  color: #ffd700;
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
}

.invest-preview {
  color: #3498db;
  font-size: 0.82rem;
  margin-top: 6px;
}

/* --- 買い物料ポップアップ --- */
.fee-popup-inner {
  max-width: 400px;
}

.fee-popup-transfer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.fee-player-tag {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.fee-arrow {
  font-size: 2rem;
  color: #ffd700;
  font-weight: bold;
  animation: arrowPulse 0.8s ease-in-out infinite alternate;
}

@keyframes arrowPulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.2); opacity: 1; }
}

.fee-shop-name {
  color: #ccc;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.fee-amount-display {
  font-size: 2.5rem;
  font-weight: bold;
  color: #e74c3c;
  animation: feeZoomIn 0.5s ease;
  margin: 16px 0;
}

@keyframes feeZoomIn {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* --- 配当（買い物料ポップアップ内） --- */
.fee-dividend-divider {
  border-top: 1px solid rgba(255,215,0,0.25);
  margin: 12px 0;
}

.dividend-header {
  font-size: 1.3rem;
  font-weight: bold;
  color: #ffd700;
  margin-bottom: 14px;
}

.dividend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dividend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dividend-amount {
  font-size: 1.3rem;
  font-weight: bold;
  color: #2ecc71;
}

.dividend-detail {
  font-size: 0.85rem;
  color: #aaa;
}

.fee-detail {
  color: #ccc;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.fee-force-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.fee-force-section p {
  color: #aaa;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

/* --- 株価変動オーバーレイ --- */
#overlay-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2000;
}

.stock-change-overlay {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  font-weight: bold;
  padding: 8px 20px;
  border-radius: 10px;
  background: rgba(0,0,0,0.8);
  border: 2px solid;
  animation: stockFloat 2s ease forwards;
  white-space: nowrap;
}

.stock-change-overlay.up {
  color: #2ecc71;
  border-color: #2ecc71;
}

.stock-change-overlay.down {
  color: #e74c3c;
  border-color: #e74c3c;
}

@keyframes stockFloat {
  0% { opacity: 0; transform: translateX(-50%) translateY(0); }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-60px); }
}

/* --- 株取引モーダル --- */
.stock-modal-inner {
  max-width: 720px;
}

.stock-modal-body {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  text-align: left;
}

.stock-minimap-area {
  flex-shrink: 0;
}

.stock-minimap-area canvas {
  border-radius: 8px;
  border: 1px solid rgba(255,215,0,0.2);
  background: #0a1628;
}

.stock-selection-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stock-areas-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.stock-area-card {
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 10px 12px;
  border: 2px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.stock-area-card:hover {
  border-color: rgba(255,215,0,0.3);
}

.stock-area-card.selected {
  border-color: #ffd700;
  background: rgba(255,215,0,0.08);
}

.stock-area-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.stock-area-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stock-area-name {
  font-weight: bold;
  font-size: 0.95rem;
  color: #eee;
}

.stock-area-price {
  margin-left: auto;
  font-weight: bold;
  color: #ffd700;
  font-size: 1rem;
}

.stock-area-holding {
  font-size: 0.82rem;
  color: #aaa;
}

.stock-area-owners {
  font-size: 0.78rem;
  color: #999;
}

/* 数量行 */
.stock-qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.95rem;
  color: #ccc;
}
.stock-qty-row label {
  font-weight: bold;
  color: #eee;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255,215,0,0.3);
  background: #0f3460;
  color: #ffd700;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.qty-btn:hover { background: #1a4a7a; }
.qty-display {
  font-size: 1.3rem;
  font-weight: bold;
  color: #ffd700;
  min-width: 30px;
  text-align: center;
}
.qty-cost {
  margin-left: auto;
  font-weight: bold;
  color: #ffd700;
  font-size: 0.95rem;
}

/* アクションバー */
.stock-action-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.btn-stock-action {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-stock-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn-stock-action:not(:disabled):hover {
  transform: translateY(-1px);
}
.btn-stock-buy-main {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #fff;
}
.btn-stock-sell-main {
  background: linear-gradient(135deg, #dc3545, #e0245e);
  color: #fff;
}
.btn-stock-skip {
  background: rgba(255,255,255,0.1);
  color: #aaa;
}

/* --- ダイスアニメーション --- */
#dice-anim-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  pointer-events: none;
  background: rgba(0,0,0,0.35);
  transition: opacity 0.3s;
}
#dice-anim-overlay.hidden { opacity: 0; pointer-events: none; }
#dice-anim-overlay.active { opacity: 1; }

.dice-anim-box {
  width: 110px;
  height: 110px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: bold;
  box-shadow: 0 6px 30px rgba(0,0,0,0.6);
}
.dice-anim-box.rolling {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 3px solid rgba(255,215,0,0.4);
  animation: diceShake 0.08s ease-in-out;
}
.dice-anim-box.final {
  background: linear-gradient(135deg, #ffd700, #f0a500);
  border: 3px solid #fff;
  animation: dicePop 0.35s ease;
}
.dice-anim-num { color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.dice-anim-box.final .dice-anim-num { color: #1a1a2e; text-shadow: none; }

@keyframes diceShake {
  0% { transform: rotate(-5deg) scale(0.95); }
  50% { transform: rotate(5deg) scale(1.05); }
  100% { transform: rotate(0) scale(1); }
}
@keyframes dicePop {
  0% { transform: scale(0.6); opacity: 0.5; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* --- レベルアップオーバーレイ --- */
.levelup-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3100;
  pointer-events: none;
  background: rgba(0,0,0,0.4);
  transition: opacity 0.3s;
}
.levelup-overlay.hidden { opacity: 0; }
.levelup-overlay.active { opacity: 1; }
.levelup-box {
  text-align: center;
  animation: levelUpPop 0.5s ease-out;
}
.levelup-icon {
  font-size: 3rem;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255,215,0,0.6);
  animation: levelUpBounce 0.6s ease-out;
}
.levelup-level {
  font-size: 3.5rem;
  font-weight: bold;
  text-shadow: 0 0 30px rgba(255,215,0,0.5);
}
.levelup-name {
  font-size: 1.3rem;
  font-weight: bold;
  margin-top: 4px;
}
.levelup-salary {
  font-size: 2rem;
  font-weight: bold;
  color: #44dd66;
  margin-top: 8px;
  text-shadow: 0 0 15px rgba(68,221,102,0.5);
}
@keyframes levelUpPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes levelUpBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

/* --- マーク獲得: 駒の上にポコッとポップ --- */
.suit-piece-pop {
  position: absolute;
  z-index: 100;
  font-size: 2rem;
  pointer-events: none;
  transform: translate(-50%, -50%);
  text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
  animation: suitPiecePop 1.1s ease-out forwards;
}
@keyframes suitPiecePop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
  30%  { transform: translate(-50%, -50%) scale(1.0); }
  70%  { opacity: 1; transform: translate(-50%, -80%) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(0.8); }
}

/* --- チャンスカード: 引かれた位置 --- */
.chance-card.chance-card-drawn {
  background: rgba(100,100,100,0.2);
  border-color: rgba(100,100,100,0.3);
  cursor: default;
  opacity: 0.5;
}
.chance-card.chance-card-drawn .chance-card-face {
  color: #888;
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0.5px;
}

/* ============================================
   格ゲー風キャラクター選択画面
   ============================================ */
#char-select-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: linear-gradient(160deg, #0a0a1a 0%, #0d1b2a 40%, #1b2838 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#char-select-screen.hidden { display: none; }

/* ヘッダー */
.cs-header {
  text-align: center;
  padding: 14px 0 8px;
  flex-shrink: 0;
}
.cs-header h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 8px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffd700 0%, #ff8c00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 6px rgba(255,215,0,0.3));
  margin: 0;
}

/* メインレイアウト */
.cs-main {
  flex: 1;
  display: flex;
  gap: 0;
  min-height: 0;
  padding: 0 12px;
}

/* サイド (左右のプレイヤーパネル) */
.cs-side {
  width: 220px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px;
}

/* スロット共通 */
.cs-slot {
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(15,20,40,0.9) 0%, rgba(10,15,30,0.95) 100%);
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.cs-slot:hover { border-color: rgba(255,215,0,0.3); }
.cs-slot.cs-active {
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255,215,0,0.25), inset 0 0 20px rgba(255,215,0,0.05);
}
.cs-slot.cs-selected {
  border-color: var(--slot-color, #4dabf7);
  box-shadow: 0 0 12px color-mix(in srgb, var(--slot-color, #4dabf7) 40%, transparent);
}

.cs-slot-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255,215,0,0.6);
  margin-bottom: 6px;
}
.cs-active .cs-slot-label {
  color: #ffd700;
}

/* 大スロット */
.cs-slot-big {
  flex: 1;
}
.cs-slot-portrait {
  text-align: center;
  margin: 8px 0;
}
.cs-slot-portrait .cs-slot-emoji {
  font-size: 3.5rem;
  display: block;
  transition: transform 0.3s;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}
.cs-selected .cs-slot-portrait .cs-slot-emoji {
  animation: csCharPop 0.35s ease-out;
}
.cs-slot-name {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: #c0c0c0;
  margin-bottom: 4px;
}
.cs-selected .cs-slot-name {
  color: var(--slot-color, #fff);
}
.cs-slot-desc {
  text-align: center;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 8px;
  min-height: 1.2em;
}
.cs-slot-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 10px;
}
.cs-stat-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
}
.cs-stat-label {
  width: 44px;
  color: #666;
  flex-shrink: 0;
  font-size: 0.65rem;
}
.cs-stat-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.cs-stat-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.35s ease;
}

/* 小スロット */
.cs-slot-small {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}
.cs-slot-portrait-sm {
  flex-shrink: 0;
}
.cs-slot-portrait-sm .cs-slot-emoji {
  font-size: 1.8rem;
}
.cs-slot-small .cs-slot-name {
  font-size: 0.9rem;
  text-align: left;
}
.cs-slot-small .cs-slot-label {
  margin-bottom: 2px;
}

/* 中央エリア */
.cs-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  min-width: 0;
  position: relative;
}

/* キャラグリッド */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 480px;
  width: 100%;
}

.cs-cell {
  aspect-ratio: 1;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: linear-gradient(135deg, #0f1a30 0%, #162038 100%);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.cs-cell:hover {
  border-color: rgba(255,215,0,0.5);
  background: linear-gradient(135deg, #162040 0%, #1a2848 100%);
  transform: scale(1.05);
  z-index: 2;
}
.cs-cell .cs-cell-emoji {
  font-size: 2rem;
  transition: transform 0.15s;
}
.cs-cell:hover .cs-cell-emoji {
  transform: scale(1.15);
}
.cs-cell .cs-cell-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #aaa;
}
.cs-cell:hover .cs-cell-name {
  color: #fff;
}

/* 選択済みセルのカラー枠 */
.cs-cell.cs-cell-taken {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.cs-cell.cs-cell-taken::after {
  content: "✔";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.8rem;
  color: #ffd700;
}
/* セルホバー中 */
.cs-cell.cs-cell-hover-active {
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255,215,0,0.3);
}

/* 中央下のアクションボタン */
.cs-center-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.cs-action-btn {
  padding: 8px 20px;
  font-size: 0.9rem;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  background: rgba(15,20,40,0.8);
  color: #c0c0c0;
  cursor: pointer;
  transition: all 0.15s;
}
.cs-action-btn:hover {
  border-color: rgba(255,215,0,0.5);
  color: #ffd700;
  background: rgba(25,35,60,0.9);
}

/* ホバープレビュー */
.cs-hover-preview {
  margin-top: 10px;
  text-align: center;
  transition: opacity 0.15s;
  min-height: 60px;
}
.cs-hover-preview.hidden { opacity: 0; }
.cs-hover-emoji { font-size: 1.6rem; margin-right: 6px; vertical-align: middle; }
.cs-hover-name { font-size: 1rem; font-weight: 700; color: #ffd700; }
.cs-hover-desc { display: block; font-size: 0.8rem; color: #888; margin-top: 4px; }

/* フッター */
.cs-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 24px 16px;
  flex-shrink: 0;
}
.cs-footer-btn {
  padding: 12px 36px;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(15,20,40,0.8);
  color: #c0c0c0;
  cursor: pointer;
  transition: all 0.15s;
}
.cs-footer-btn:hover { border-color: rgba(255,215,0,0.5); color: #fff; }
.cs-start-btn {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a2e;
  border: none;
  letter-spacing: 1px;
}
.cs-start-btn:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}
.cs-start-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,215,0,0.4);
}

/* 選択確定アニメーション */
@keyframes csCharPop {
  0% { transform: scale(0.5); opacity: 0.5; }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes csFlash {
  0% { opacity: 0; }
  20% { opacity: 0.7; }
  100% { opacity: 0; }
}
.cs-slot.cs-flash::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,215,0,0.6) 0%, transparent 70%);
  border-radius: 10px;
  animation: csFlash 0.5s ease-out forwards;
  pointer-events: none;
}
