/* 新しいミニゲーム用のCSS */

/* 4. 前回のルーレット (均等分割) */
#motion-roulette-classic .roulette-wheel {
  background: conic-gradient(
    #ff4757 0deg 60deg,
    #ffa502 60deg 120deg,
    #2ed573 120deg 180deg,
    #1e90ff 180deg 240deg,
    #9c88ff 240deg 300deg,
    #747d8c 300deg 360deg
  );
}

/* レース系共通のトラック */
.race-track {
  position: relative;
  width: 100%;
  height: 350px;
  background: #2ed573; /* 芝生 (競馬) */
  border: 4px solid #fff;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto;
}
.race-track.water { background: #1e90ff; height: 260px; /* 水面 (競艇) */ }
.race-track.asphalt { background: #57606f; height: 200px; /* アスファルト (カーレース) */ }
.race-track.asphalt::before {
  content: ''; position: absolute; top: 50%; left: 0; width: 100%; height: 4px;
  background: repeating-linear-gradient(90deg, #fff 0, #fff 20px, transparent 20px, transparent 40px);
}

/* ゴールライン */
.race-track::after {
  content: '';
  position: absolute;
  right: 20px; top: 0; bottom: 0; width: 10px;
  background: repeating-linear-gradient(0deg, #fff 0, #fff 10px, #000 10px, #000 20px);
  z-index: 1;
}

.racer {
  position: absolute;
  left: 0px;
  font-size: 24px;
  transition: transform 3s linear;
  z-index: 2;
  white-space: nowrap;
}
.horse-track .racer { font-size: 22px; }
.horse-player {
  background: #000080;
  color: #ffffff;
  padding: 0 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  font-weight: bold;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
  z-index: 10;
}
.horse-player .horse-name {
  font-size: 14px;
  margin-left: 5px;
}
.horse-track .racer-1 { top: 5px; }
.horse-track .racer-2 { top: 30px; }
.horse-track .racer-3 { top: 55px; }
.horse-track .racer-4 { top: 80px; }
.horse-track .racer-5 { top: 105px; }
.horse-track .racer-6 { top: 130px; }
.horse-track .racer-7 { top: 155px; }
.horse-track .racer-8 { top: 180px; }
.horse-track .racer-9 { top: 205px; }
.horse-track .racer-10 { top: 230px; }
.horse-track .racer-11 { top: 255px; }
.horse-track .racer-12 { top: 280px; }

.water-track .racer {
  font-size: 20px;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  font-weight: bold;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}
.boat-color-1 { background: #ffffff; color: #000; border: 1px solid #ccc; }
.boat-color-2 { background: #000000; color: #fff; }
.boat-color-3 { background: #e74c3c; color: #fff; }
.boat-color-4 { background: #3498db; color: #fff; }
.boat-color-5 { background: #f1c40f; color: #000; }
.boat-color-6 { background: #2ecc71; color: #fff; }

.boat-num { margin-right: 4px; font-size: 14px; }
.boat-name { font-size: 14px; margin-left: 5px; color: #ffffff; }

.water-track .racer-1 { top: 10px; }
.water-track .racer-2 { top: 50px; }
.water-track .racer-3 { top: 90px; }
.water-track .racer-4 { top: 130px; z-index: 10; }
.water-track .racer-5 { top: 170px; }
.water-track .racer-6 { top: 210px; }

.asphalt .racer { font-size: 40px; }
.asphalt .racer-1 { top: 20px; }
.asphalt .racer-2 { top: 80px; }
.asphalt .racer-3 { top: 140px; }

/* ⑥ 麻雀 */
.mahjong-table {
  position: relative;
  width: 100%; height: 250px;
  background: #178a3c; /* 雀卓のマット */
  border-radius: 10px;
  border: 8px solid #8B4513; /* 木枠 */
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.mahjong-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: nowrap;
  width: 100%;
}
.mahjong-hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: nowrap;
}
.tile {
  width: 22px; height: 32px;
  background: #fdf5e6;
  border-radius: 2px;
  border-bottom: 4px solid #f1c40f;
  border-right: 2px solid #bdc3c7;
  display: flex; justify-content: center; align-items: center;
  font-size: 15px; font-weight: bold;
  margin: 0 1px;
  box-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  color: #2c3e50;
  flex-shrink: 0;
}
.tile.blank { color: transparent; } /* 白 */
.tile.horizontal {
  width: 32px; height: 22px;
  border-bottom: 4px solid #f1c40f;
  border-right: 2px solid #bdc3c7;
  margin: 0 2px;
}
.tile.horizontal span {
  display: inline-block;
  transform: rotate(-90deg);
}
.mahjong-tsumo {
  margin-left: 10px;
  width: 32px; height: 42px;
  background: #fdf5e6;
  border-radius: 4px;
  display: flex; justify-content: center; align-items: center;
  font-size: 22px; font-weight: 900;
  box-shadow: 1px 1px 5px rgba(0,0,0,0.5);
  flex-shrink: 0;
}
.mahjong-tsumo.yakuman {
  box-shadow: 0 0 30px gold;
  animation: dropTile 0.3s ease-out, glowTile 1s infinite alternate;
}
.yakuman-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 50px;
  font-weight: 900;
  color: gold;
  text-shadow: 2px 2px 0 red, -2px -2px 0 red, 0 0 20px yellow;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.yakuman-text.show {
  animation: popYakuman 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes popYakuman {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* 咲風 劇的演出 */
.saki-slam {
  animation: sakiSlamAnim 0.3s cubic-bezier(0.5, 0, 1, 1) forwards;
  box-shadow: 0 0 50px white;
}
@keyframes sakiSlamAnim {
  0% { transform: translateY(-300px) scale(5) rotate(10deg); opacity: 0; filter: brightness(3); }
  80% { transform: translateY(-50px) scale(2) rotate(-5deg); opacity: 1; filter: brightness(2); }
  100% { transform: translateY(0) scale(1) rotate(0); opacity: 1; filter: brightness(1); box-shadow: 0 0 30px gold; }
}

.screen-shake {
  animation: screenShakeAnim 0.4s ease-out;
}
@keyframes screenShakeAnim {
  0% { transform: translate(15px, 15px) rotate(2deg); }
  20% { transform: translate(-15px, -10px) rotate(-2deg); }
  40% { transform: translate(10px, 15px) rotate(1deg); }
  60% { transform: translate(-10px, -5px) rotate(-1deg); }
  80% { transform: translate(5px, 5px) rotate(0deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.flash-bang {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: white;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
}
.flash-bang.fire {
  animation: flashAnim 0.8s ease-out;
}
@keyframes flashAnim {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.yakuman-text.saki-style {
  font-size: 70px;
  font-style: italic;
  transform: translate(-50%, -50%) scale(0) skewX(-15deg);
  text-shadow: 4px 4px 0 #000, -4px -4px 0 #000, 0 0 40px #ff0000;
}
.yakuman-text.saki-style.show {
  animation: sakiPop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes sakiPop {
  0% { transform: translate(-50%, -50%) scale(0) skewX(-20deg); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.2) skewX(-20deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) skewX(-20deg); opacity: 1; }
}

@keyframes dropTile {
  0% { transform: translateY(-100px) scale(1.5); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes glowTile {
  0% { box-shadow: 0 0 10px gold; }
  100% { box-shadow: 0 0 30px gold, 0 0 50px orange; }
}

/* 9. 宝箱 */
.treasure-chest-container {
  display: flex; justify-content: center; align-items: center;
  height: 200px;
}
.treasure-chest {
  font-size: 100px; cursor: pointer; text-align: center;
  transition: transform 0.1s;
}
.chest-shake { animation: shake 0.1s infinite; }
@keyframes shake {
  0% { transform: translate(2px, 1px) rotate(0deg); }
  25% { transform: translate(-1px, -2px) rotate(-5deg); }
  50% { transform: translate(-3px, 0px) rotate(5deg); }
  75% { transform: translate(2px, 2px) rotate(-5deg); }
  100% { transform: translate(1px, -1px) rotate(0deg); }
}
