/* ▼ ダブルタップでのズーム（拡大）を強力にブロックする魔法のコード ▼ */
body { 
  font-family: sans-serif; background-color: #1b5e20; color: #fff; margin: 0; padding: 0; 
  user-select: none; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; width: 100vw; 
  touch-action: manipulation; overscroll-behavior: none; 
}
h2 { margin: 5px 0; font-size: 20px; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); flex-shrink: 0; }

.board { width: 1000px; height: 800px; position: relative; background: radial-gradient(circle, #388e3c 0%, #1b5e20 100%); border-radius: 12px; box-shadow: inset 0 0 50px rgba(0,0,0,0.6), 0 10px 20px rgba(0,0,0,0.5); transform-origin: center center; flex-shrink: 0; overflow: hidden; z-index: 2147483640 !important; }

#volume-control { position: fixed; top: 15px; right: 15px; z-index: 2147483647 !important; display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,0.7); padding: 8px 15px; border-radius: 25px; border: 1px solid #777; box-shadow: 0 4px 6px rgba(0,0,0,0.5); }
#mute-btn { cursor: pointer; font-size: 24px; transition: 0.2s; user-select: none; }
#mute-btn:hover { transform: scale(1.2); }
#volume-slider { width: 80px; cursor: pointer; accent-color: #ffeb3b; }
.volume-btn { padding: 5px 10px; font-size: 13px; background-color: #555; }

.game-btn { background: #4caf50; color: #fff; border: none; padding: 10px 20px; font-size: 16px; border-radius: 5px; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.4); white-space: nowrap; flex-shrink: 0; touch-action: manipulation; }
.game-btn:hover { background: #388e3c; transform: scale(1.05); }

/* ▼ 中央ダッシュボードの拡張＆バッジのFlexbox化＆位置調整 ▼ */
.center-dashboard { 
  position: absolute; 
  top: 45%; 
  left: 50%; transform: translate(-50%, -50%); 
  width: 340px; height: 280px; 
  background: rgba(0,0,0,0.85); border: 2px solid #555; border-radius: 15px; color: #eee; z-index: 10; 
  box-shadow: inset 0 0 20px rgba(0,0,0,0.9), 0 8px 20px rgba(0,0,0,0.6); 
  display: grid; 
  grid-template-columns: 105px 130px 105px; 
  grid-template-rows: 75px 130px 75px; 
  align-items: center; justify-items: center; 
}
.score-pos { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; position: relative; padding: 2px 0; box-sizing: border-box; }
.status-badges { display: flex; gap: 4px; justify-content: center; align-items: center; margin-bottom: 2px; min-height: 18px; width: 100%; flex-wrap: wrap; }
.oya-indicator { color: #ffeb3b; font-size: 11px; font-weight: bold; background: #d32f2f; padding: 2px 5px; border-radius: 3px; box-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.yakitori-indicator { color: #fff; font-size: 11px; font-weight: bold; background: #e65100; padding: 2px 5px; border-radius: 3px; box-shadow: 0 0 4px #e65100; }
.wareme-indicator { color: #d32f2f; font-size: 11px; font-weight: bold; background: #ffeb3b; padding: 2px 5px; border-radius: 3px; box-shadow: 0 0 5px #d32f2f; }
.name-label { font-size: 13px; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; margin-bottom: 2px; }
.score-val { font-size: 18px; font-weight: bold; font-family: monospace; color: #fff; text-shadow: 1px 1px 2px #000; letter-spacing: 1px; }
.riichi-indicator { color: #ff5252; font-size: 11px; font-weight: bold; min-height: 14px; text-shadow: 0 0 5px #ff5252; }

.score-top { grid-column: 2; grid-row: 1; } .score-left { grid-column: 1; grid-row: 2; } .score-right { grid-column: 3; grid-row: 2; } .score-bottom { grid-column: 2; grid-row: 3; }
.center-info { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; }

.dash-tile { position: relative; width: 14px; height: 20px; border: 1px solid #aaa; border-right: 1px solid #777; border-bottom: 1px solid #555; border-radius: 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(to bottom, #fefefe 0%, #e0e0e0 100%); margin: 0 1px; }
.dash-facedown { width: 14px; height: 20px; background: linear-gradient(to bottom, #ffe082 0%, #ffca28 100%); border: 1px solid #fbc02d; border-right: 1px solid #f9a825; border-bottom: 1px solid #f57f17; border-radius: 2px; margin: 0 1px; }

#condition-display { font-size: 11px; color: #4caf50; font-weight: bold; margin-top: 2px; text-shadow: 1px 1px 2px #000; }

/* ▼ メッセージウィンドウを中央ダッシュボードのすぐ下に配置 ▼ */
#message { 
  position: absolute; 
  top: 515px; 
  left: 50%; 
  transform: translate(-50%, -50%); 
  width: fit-content; 
  min-width: 280px; 
  text-align: center; 
  background: rgba(0,0,0,0.85); 
  color: #fff; 
  padding: 8px 15px; 
  border-radius: 20px; 
  font-size: 14px; 
  font-weight: bold; 
  white-space: nowrap; 
  z-index: 90010 !important; 
  border: 1px solid #777; 
  box-shadow: 0 4px 6px rgba(0,0,0,0.5); 
}

.player-toggles { position: absolute; bottom: 120px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 90010 !important; background: rgba(0,0,0,0.7); padding: 12px; border-radius: 8px; border: 1px solid #777; box-shadow: 0 4px 6px rgba(0,0,0,0.5); }
.toggle-label { color: #fff; font-size: 14px; font-weight: bold; display: flex; align-items: center; gap: 8px; cursor: pointer; } .toggle-label input { width: 18px; height: 18px; cursor: pointer; }

/* ▼ 河（捨て牌エリア）の幅をさらに広げ、余裕をもって8枚収まるように「260px」に修正 ▼ */
.river-zone { position: absolute; width: 260px; height: 135px; background: rgba(0,0,0,0.2); border-radius: 6px; padding: 5px; box-sizing: border-box; z-index: 5; }
.river-container { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-start; width: 100%; height: 100%; }
.rz-0 { bottom: 130px; left: 50%; transform: translateX(-50%); } 
.rz-2 { top: 80px; left: 50%; transform: translateX(-50%) rotate(180deg); }
.rz-3 { left: 120px; top: 45%; transform: translateY(-50%) rotate(90deg); } 
.rz-1 { right: 120px; top: 45%; transform: translateY(-50%) rotate(-90deg); }

.player-zone { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pz-0 { bottom: 15px; left: 50%; transform: translateX(-50%); width: 100%; z-index: 90000 !important; }
.pz-0 .hand-wrapper { display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 5px; width: 100%; padding-right: 15px; box-sizing: border-box; }
#player-hand { align-self: center; }
#player-melds { transform: scale(0.9); transform-origin: right bottom; }

.pz-2, .pz-3, .pz-1 { align-items: center; justify-content: center; }
.pz-2 .hand-wrapper, .pz-3 .hand-wrapper, .pz-1 .hand-wrapper { display: flex; align-items: center; gap: 15px; }
.pz-2 { top: 15px; left: 50%; transform: translateX(-50%) rotate(180deg); width: 100%; }
.pz-3 { left: -340px; top: 50%; transform: translateY(-50%) rotate(90deg); width: 800px; } .pz-1 { right: -340px; top: 50%; transform: translateY(-50%) rotate(-90deg); width: 800px; }

#action-bar { position: absolute; bottom: 145px; left: 50%; transform: translateX(-50%); display: flex; justify-content: center; gap: 10px; z-index: 90005 !important; }
.action-btn { padding: 10px 24px; font-size: 16px; font-weight: bold; cursor: pointer; border: none; border-radius: 5px; box-shadow: 0 4px 6px rgba(0,0,0,0.5); transition: 0.2s; touch-action: manipulation;}
.action-btn:hover { transform: scale(1.05); }
.btn-agari { background-color: #d32f2f; color: white; animation: pulse 1s infinite; } .btn-call { background-color: #1976d2; color: white; } .btn-pass { background-color: #757575; color: white; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(211,47,47,0.7); } 70% { box-shadow: 0 0 0 10px rgba(211,47,47,0); } 100% { box-shadow: 0 0 0 0 rgba(211,47,47,0); } }

.hand { display: flex; justify-content: center; align-items: center; min-height: 60px; }
.melds { display: flex; gap: 8px; justify-content: center; align-items: center; }

/* ▼ 鳴き牌・カン表示用の最適化クラス ▼ */
.meld-group { display: flex; align-items: flex-end; position: relative; margin-right: 5px; }
.kan-stack-container { position: relative; display: flex; align-items: center; justify-content: center; }
.stacked-tile { position: absolute !important; top: -18px !important; left: 50% !important; transform: translateX(-50%) rotate(-90deg) !important; z-index: 10; box-shadow: 2px -2px 6px rgba(0,0,0,0.5) !important; }
.stacked-tile-ankan { position: absolute !important; top: -16px !important; left: 50% !important; transform: translateX(-50%) !important; z-index: 10; box-shadow: 2px -2px 6px rgba(0,0,0,0.5) !important; }

.tile { width: 38px; height: 54px; background: #ecf0f1 !important; border: 1px solid #bdc3c7 !important; border-right: 2px solid #7f8c8d !important; border-bottom: 3px solid #7f8c8d !important; border-radius: 4px !important; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 1px; box-shadow: 2px 2px 4px rgba(0,0,0,0.4); font-weight: bold; font-family: sans-serif; transition: transform 0.1s ease-out, filter 0.1s, box-shadow 0.1s; cursor: default; position: relative; touch-action: manipulation; }

#player-hand .tile { width: 44px; height: 64px; border-radius: 5px !important; }
#player-hand .tile.tile-drawn { margin-left: 4px !important; top: 12px; }

#player-hand.can-discard .tile:not(.darkened) { cursor: pointer; }
#player-hand.can-discard .tile.selected { transform: translateY(-25px) !important; box-shadow: 0 15px 25px rgba(0,0,0,0.6) !important; border-color: #ffeb3b !important; filter: brightness(1.2); z-index: 100; }
#player-hand.can-discard .tile.tile-drawn.selected { transform: translateY(-13px) !important; }

.tile-drawn { animation: dropIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes dropIn { 0% { transform: translateY(-30px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }

.highlighted { box-shadow: 0 0 15px #00ffff !important; background: #e0f7fa !important; border-color: #00bcd4 !important; filter: brightness(1.1); }
.tsumogiri { filter: brightness(0.7) contrast(1.1); }
.rotated-tile { transform: rotate(-90deg); margin: 0 8px; }
.red-mark { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 60%; height: 3px; background-color: #ff1744; border-radius: 2px; box-shadow: 0 0 4px rgba(255,23,68,0.8); pointer-events: none; }
.dash-red-mark { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 60%; height: 2px; background-color: #ff1744; border-radius: 1px; pointer-events: none; }
.river-tile { width: 26px; height: 38px; margin: 0 1px 1px 0; border-right: 1px solid #7f8c8d !important; border-bottom: 2px solid #7f8c8d !important; border-radius: 3px; }

.uni-tile-large { font-size: 44px; line-height: 1; margin-top: -4px; font-family: sans-serif; text-shadow: none; pointer-events: none; font-weight: normal !important; }
.river-tile .uni-tile-large { font-size: 30px; line-height: 1; margin-top: -2px; font-weight: normal !important; }
.uni-tile-small { font-size: 16px; line-height: 1; margin-top: 0px; font-family: sans-serif; text-shadow: none; font-weight: normal !important; }
#player-hand .uni-tile-large { font-size: 50px; margin-top: -4px; pointer-events: none; font-weight: normal !important; }

/* ▼ シンプルで美しい本来のリーチ牌 ▼ */
.riichi-tile { 
    transform: rotate(-90deg); 
    margin: 0 6px; 
    position: relative;
    z-index: 2;
    box-shadow: -2px 2px 3px rgba(0,0,0,0.4);
}

.darkened { filter: brightness(0.25); pointer-events: none; }
.riichi-selectable { box-shadow: 0 0 15px #ffeb3b; border-color: #ffeb3b; animation: pulse-yellow 1s infinite; position: relative; z-index: 10; }
.riichi-selectable::after { content: "リーチ"; position: absolute; top: -22px; left: 50%; transform: translateX(-50%); background: #d32f2f; color: white; font-size: 11px; padding: 2px 5px; border-radius: 3px; box-shadow: 0 2px 4px rgba(0,0,0,0.5); pointer-events: none; white-space: nowrap; }
.cpu-hand-container { display: flex; justify-content: center; height: 38px; }
.tile-facedown { width: 26px; height: 38px; background: linear-gradient(to bottom, #f39c12 0%, #d68910 100%); border: 1px solid #b9770e; border-right: 2px solid #9c640c; border-bottom: 2px solid #7e5109; border-radius: 3px; margin: 0 1px; box-shadow: 1px 1px 2px rgba(0,0,0,0.3); }

.action-popup { position: absolute; font-size: 42px; font-weight: bold; color: #ffeb3b; text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 0 20px #d32f2f; opacity: 0; pointer-events: none; z-index: 90020 !important; }
.pop-bottom { bottom: 200px; left: 50%; transform: translate(-50%, 0) scale(0.5); } .pop-top { top: 200px; left: 50%; transform: translate(-50%, 0) scale(0.5); }
.pop-left { left: 280px; top: 50%; transform: translateY(-50%) scale(0.5); } .pop-right { right: 280px; top: 50%; transform: translateY(-50%) scale(0.5); }
.popup-active { animation: pop-anim 1.5s forwards; }
@keyframes pop-anim { 0% { opacity: 0; transform: translate(-50%, 0) scale(0.5); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.2); } 80% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, 0) scale(1); } }
.pop-left.popup-active, .pop-right.popup-active { animation: pop-anim-side 1.5s forwards; }
@keyframes pop-anim-side { 0% { opacity: 0; transform: translateY(-50%) scale(0.5); } 20% { opacity: 1; transform: translateY(-50%) scale(1.2); } 80% { opacity: 1; transform: translateY(-50%) scale(1); } 100% { opacity: 0; transform: translateY(-50%) scale(1); } }

#effect-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90050 !important; display: none; justify-content: center; align-items: center; background: rgba(255,255,255,0); }
.effect-text { font-size: 120px; font-weight: bold; color: #ffeb3b; text-shadow: 0 0 30px #d32f2f, 0 0 60px #d32f2f, 4px 4px 10px #000; font-family: serif; font-style: italic; opacity: 0; animation: popInText 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes popInText { 0% { transform: scale(0.2) rotate(-15deg); opacity: 0; filter: blur(10px); } 15% { transform: scale(1.1) rotate(5deg); opacity: 1; filter: blur(0); } 30% { transform: scale(1) rotate(0); opacity: 1; } 80% { transform: scale(1) rotate(0); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.lightning-effect { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; background: linear-gradient(to bottom, rgba(255,255,255,0) 30%, rgba(200,230,255,0.8) 50%, rgba(255,255,255,0) 70%); animation: flashStrike 0.3s ease-out; z-index: 90050 !important; opacity: 0; }
@keyframes flashStrike { 0% { opacity: 1; transform: scaleY(0) skewX(-20deg); } 50% { opacity: 1; transform: scaleY(30) skewX(-20deg); background: rgba(255,255,255,0.9); } 100% { opacity: 0; transform: scaleY(0) skewX(-20deg); } }
.flash-bg { animation: flashBgAnim 0.5s ease-out forwards; }
@keyframes flashBgAnim { 0% { background: rgba(255,255,255,0.8); } 100% { background: rgba(255,255,255,0); } }

#title-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(27, 94, 32, 0.95); z-index: 95000 !important; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 12px; }
#maker-logo { max-width: 280px; height: auto; margin-bottom: 5px; filter: drop-shadow(2px 2px 5px rgba(0,0,0,0.8)); }
#title-screen h1 { font-size: 54px; color: #ffeb3b; text-shadow: 3px 3px 6px #000; margin-bottom: 10px; margin-top: 0; }

#result-modal, #final-result-modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.95); border: 2px solid #d32f2f; border-radius: 10px; width: 90% !important; max-width: 500px; z-index: 2147483647 !important; box-shadow: 0 0 30px rgba(0,0,0,0.9); text-align: center; box-sizing: border-box; }
#final-result-modal { border-color: #ffeb3b; }
.modal-base { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.95); border: 2px solid #1976d2; border-radius: 10px; padding: 20px; width: 90%; z-index: 2147483647 !important; box-shadow: 0 0 20px rgba(0,0,0,0.8); color: white; box-sizing: border-box; text-align: center; max-height: 85vh; overflow-y: auto;}

#stats-content-wrapper { max-height: 50vh; overflow-y: auto; margin-bottom: 15px; border-bottom: 1px solid #555; }
#settings-modal select { padding: 8px; font-size: 16px; margin-left: 10px; border-radius: 5px; background: #333; color: white; border: 1px solid #777; }
.setting-toggle { margin-bottom: 15px; font-size: 18px; display: flex; justify-content: center; align-items: center; gap: 10px; cursor: pointer; }
.setting-toggle input { width: 20px; height: 20px; cursor: pointer; touch-action: manipulation;}
#result-title, #final-title { font-size: 32px; color: #ffeb3b; margin-bottom: 10px; text-shadow: 2px 2px 4px #000; }
#result-hand { display: flex; justify-content: center; margin-bottom: 10px; transform: scale(0.9); }
#result-yaku { font-size: 18px; color: #fff; margin-bottom: 5px; text-align: left; display: inline-block; line-height: 1.6; }
#result-score { font-size: 38px; color: #fff; font-weight: bold; margin-bottom: 10px; line-height: 1.2; }
.score-diff { font-size: 18px; color: #aaa; margin-bottom: 15px; }
#final-rankings { margin-bottom: 30px; }
.st-tb { width: 100%; border-collapse: collapse; margin-top: 0; font-size: 14px; }
.st-tb th, .st-tb td { border: 1px solid #777; padding: 4px; text-align: center; }
.st-tb th { background: #333; color: #ffeb3b; position: sticky; top: -1px; }

.fr-note { font-size: 14px; color: #aaa; margin-bottom: 15px; text-align: center; }
.fr-row { margin: 8px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #333; padding-bottom: 5px; }
.fr-row span:nth-child(1) { font-size: 20px; width: 45px; text-align: left; }
.fr-row span:nth-child(2) { flex-grow: 1; text-align: left; font-size: 18px; }
.fr-row span:nth-child(3) { width: 100px; text-align: right; font-size: 18px; }
.fr-row span:nth-child(4) { font-size: 24px; font-weight: bold; width: 110px; text-align: right; }
.fr-y { color: #ff9800; font-size: 16px; font-weight: bold; margin-right: 5px; }
.frc { text-align: center; margin-top: 20px; font-size: 20px; color: #ffeb3b; background: rgba(0,0,0,0.5); padding: 10px; border-radius: 8px; border: 1px solid #ffeb3b; }
.rm-row { display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.rm-name { color: #ffeb3b; width: 80px; font-size: 16px; text-align: right; margin-right: 15px; font-weight: bold; }
.rm-tiles { display: flex; align-items: center; }
.rm-meld { display: flex; margin-left: 10px; align-items: center; }

/* PC時はコントローラーを非表示 */
#mobile-controller { display: none; }

/* ========================================================
   💡 スマホ用UI：仮想パッドのボタンサイズ調整 ＆ タッチ無効化
   ======================================================== */
@media screen and (max-aspect-ratio: 4/5), screen and (max-width: 768px) {
  .board { width: 600px !important; height: 900px !important; touch-action: none; }

  #mobile-controller { 
      bottom: 10px !important; 
      display: flex !important; 
      position: absolute; 
      left: 0; 
      width: 100%; 
      padding: 0 10px; 
      box-sizing: border-box; 
      justify-content: space-between; 
      gap: 15px; /* ボタン間の隙間を少し広げる */
      z-index: 90010 !important; 
      touch-action: none; 
      user-select: none;
      -webkit-user-select: none;
  }

  /* ▼ 修正: 左右ボタンを大きく、決定ボタンを小さく ▼ */
  .mc-btn { 
      flex: 1.5; /* 左右ボタンの割合を大きく */
      padding: 15px 0; 
      font-size: 28px; 
      border-radius: 10px; 
      background: rgba(0, 0, 0, 0.85); 
      color: #fff; 
      border: 2px solid #777; 
      font-weight: bold; 
      box-shadow: 0 4px 6px rgba(0,0,0,0.5); 
      cursor: pointer; 
      touch-action: none; 
  }
  
  .mc-enter { 
      flex: 1; /* 決定ボタンの割合を小さく */
      font-size: 18px; 
      background: #1976d2; 
      border-color: #115293; 
      border-radius: 50%; /* 丸くして誤爆を防ぐ */
  }

  .pz-0 { bottom: 85px !important; z-index: 90000 !important; }
  #player-hand .tile { width: 38px; height: 56px; }
  #player-hand .tile.tile-drawn { margin-left: 3px !important; top: 10px; }

  #action-bar { bottom: 75px !important; width: 100%; padding: 0 10px; box-sizing: border-box; gap: 8px; flex-wrap: wrap; justify-content: center; z-index: 90020 !important; touch-action: none;}
  .action-btn { flex: 1 1 30%; padding: 12px 0; font-size: 18px; margin: 0; border-radius: 8px; border: 2px solid #777; box-shadow: 0 4px 6px rgba(0,0,0,0.5); font-weight: bold; touch-action: none; }

  #message { 
    top: 466px !important; 
    bottom: auto !important; 
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 16px !important; 
    padding: 10px 20px !important; 
    border-radius: 20px !important; 
    background: rgba(0,0,0,0.85) !important; 
    border: 1px solid #777 !important; 
    color: #fff !important; 
    z-index: 90030 !important; 
    white-space: nowrap !important; 
  }

  .player-toggles { bottom: 220px !important; right: 10px !important; transform: scale(0.85) !important; transform-origin: bottom right !important; background: rgba(0,0,0,0.85) !important; padding: 12px; border-radius: 8px; z-index: 90025 !important; }
  .toggle-label { font-size: 18px; }
  .toggle-label input { width: 20px; height: 20px; touch-action: manipulation; }

  .rz-0 { bottom: 280px !important; z-index: 5 !important; }

  .center-dashboard { top: 350px !important; transform: translate(-50%, -50%) scale(0.7) !important; }

  .pz-2 { top: 10px !important; }
  .pz-2 .hand-wrapper { transform: scale(0.75) !important; transform-origin: top center !important; }
  .rz-2 { top: 90px !important; }

  .pz-3 { left: -370px !important; top: 350px !important; transform: translateY(-50%) rotate(90deg) scale(0.8) !important; }
  .rz-3 { left: 10px !important; top: 350px !important; transform: translateY(-50%) rotate(90deg) !important; }

  .pz-1 { right: -370px !important; top: 350px !important; transform: translateY(-50%) rotate(-90deg) scale(0.8) !important; }
  .rz-1 { right: 10px !important; top: 350px !important; transform: translateY(-50%) rotate(-90deg) !important; }

  .pop-left { left: 160px !important; top: 350px !important; }
  .pop-right { right: 160px !important; top: 350px !important; }
  .pop-top { top: 220px !important; }
  .pop-bottom { bottom: 330px !important; }
  #wait-display { bottom: 330px !important; transform: translateX(-50%) scale(0.9) !important; }

  #volume-control { top: 10px; right: 10px; padding: 10px 15px; border-radius: 12px; gap: 12px; background: rgba(0,0,0,0.95); box-shadow: 0 4px 10px rgba(0,0,0,0.7); border: 2px solid #555; }
  #volume-control .volume-btn { font-size: 14px !important; padding: 8px 12px !important; border-radius: 8px; font-weight: bold; background: #555 !important; touch-action: manipulation; }
  #mute-btn { font-size: 28px !important; touch-action: manipulation; }
  #volume-slider { width: 100px; height: 16px; touch-action: manipulation; }

  .stacked-tile { top: -14px !important; }
  .stacked-tile-ankan { top: -12px !important; }

  .modal-base { width: 98% !important; padding: 15px; max-height: 90vh; }
  #result-modal, #final-result-modal { width: 95% !important; }
  #restart-btn, #final-result-modal .game-btn { font-size: 20px !important; padding: 15px 0 !important; width: 95% !important; border-radius: 12px !important; border: 2px solid #fff; margin: 15px auto !important; display: block; background: #1976d2; touch-action: manipulation; }
  #stats-modal .game-btn, #settings-modal .game-btn, #adjust-modal .game-btn { font-size: 16px !important; padding: 12px 18px !important; border-radius: 8px; margin: 5px; touch-action: manipulation; }

  #maker-logo { max-width: 180px; }
  #title-screen h1 { font-size: 38px; }
  #title-screen > div { transform: scale(0.95); }
  #result-score { font-size: 28px; }
  #result-hand { transform: scale(0.7) !important; margin-bottom: 5px; }
  .rm-row { flex-direction: column; align-items: flex-start; margin-bottom: 15px; background: rgba(255,255,255,0.05); padding: 8px; border-radius: 8px; }
  .rm-name { text-align: left; margin-bottom: 5px; font-size: 16px; width: 100%; }
}

.menu-section {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #777;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  width: 100%;
  max-width: 450px;
  box-sizing: border-box;
}
.menu-section-title {
  font-size: 16px;
  color: #fff;
  margin-bottom: 10px;
  text-align: left;
  border-bottom: 1px dashed #555;
  padding-bottom: 5px;
}
.menu-radio-group {
  margin-bottom: 15px;
  font-size: 16px;
  color: #ddd;
}
.menu-btn-row {
  display: flex;
  gap: 15px;
  justify-content: center;
}
.menu-btn-row .game-btn {
  flex: 1;
  padding: 12px 0;
}
.menu-wide-btn {
  width: 100%;
  max-width: 450px;
  margin-bottom: 10px;
  display: block;
  box-sizing: border-box;
}
.auto-watch-input-box {
  background: #004d40;
  border: 1px solid #00796b;
  color: #fff;
  padding: 8px 15px;
  border-radius: 5px;
  margin-bottom: 15px;
  display: inline-block;
}

#player-melds .rotated-tile {
    transform: rotate(-90deg);
    margin-left: 12px !important;  
    margin-right: 12px !important; 
    position: relative;
    top: 8px !important; 
}

.melds .rotated-tile {
    transform: rotate(-90deg);
    margin-left: 4px;
    margin-right: 4px;
    position: relative;
    top: 3px;
}