/* =========================================================
   btn3d.css — ปุ่มสไตล์ 3D (อิง Codrops demo 2)
   โหลดหลัง #gameStyle เพื่อทับสไตล์ปุ่มเดิม (ยกเว้นปุ่มไอคอน)
   สีอิงของเดิม · ตอนกด = สีเดิมเข้มขึ้น + ยุบลง
   ========================================================= */

/* ---------- 1) สีแต่ละปุ่ม (hi/lo = gradient, hl = ไฮไลต์บน, edge = ขอบล่าง 3D) ---------- */
.game-card .play-btn{ --b-hi:#f0903a; --b-lo:#d9601a; --b-hl:#ffc48a; --b-edge:#9a3f0c; --b-d:5px; }
.app-topbar #backBtn{ --b-hi:#343434; --b-lo:#1f1f1f; --b-hl:#4a4a4a; --b-edge:#0a0a0a; --b-d:3px; }
.modal-close,
.pause-btn.pause-exit{ --b-hi:#9c4533; --b-lo:#7a3022; --b-hl:#c06a55; --b-edge:#4a1a10; --b-d:4px; }
.pause-btn{ --b-hi:#363636; --b-lo:#232323; --b-hl:#4d4d4d; --b-edge:#0d0d0d; --b-d:4px; }

/* Undo (ม่วง) */
.makruk-shell .scorebar button.undo,
.othello-shell .scorebar button.undo,
.go-shell .scorebar button.undo,
.makhos-shell button.undo{ --b-hi:#9a7ab0; --b-lo:#7a5a90; --b-hl:#c3a6d8; --b-edge:#4e3762; --b-d:3px; }

/* Restart / ผลแพ้ชนะ (ชมพู: หมากรุก, หมากฮอส) */
.makruk-shell button.restart,
.makhos-shell button.restart,
.makruk-shell #resultRestartBtn,
.makhos-shell #resultRestartBtn{ --b-hi:#c06070; --b-lo:#a04858; --b-hl:#e095a2; --b-edge:#6e2c38; --b-d:4px; }

/* Restart (แดงอิฐ: โอเทลโล) */
.othello-shell button.restart{ --b-hi:#9c4533; --b-lo:#7a3022; --b-hl:#c06a55; --b-edge:#4a1a10; --b-d:4px; }

/* ผลแพ้ชนะ (แดงเข้ม: โอเทลโล, โกะ) */
.othello-shell #resultRestartBtn,
.go-shell #resultRestartBtn{ --b-hi:#7a2a1a; --b-lo:#5c1e10; --b-hl:#a8503c; --b-edge:#320e06; --b-d:4px; }

/* Pass (เทาฟ้า: โกะ) */
.go-shell #passBtn{ --b-hi:#3e4e59; --b-lo:#2b373f; --b-hl:#5b6e7b; --b-edge:#151c21; --b-d:4px; }

/* ---------- 2) กลไก 3D ร่วม (selector เท่ากับ/สูงกว่าของเดิม) ---------- */
.game-card .play-btn,
.app-topbar #backBtn,
.modal-close,
.pause-btn,
.makruk-shell .scorebar button.undo,
.othello-shell .scorebar button.undo,
.go-shell .scorebar button.undo,
.makhos-shell button.undo,
.makruk-shell button.restart,
.makhos-shell button.restart,
.othello-shell button.restart,
.makruk-shell #resultRestartBtn,
.makhos-shell #resultRestartBtn,
.othello-shell #resultRestartBtn,
.go-shell #resultRestartBtn,
.go-shell #passBtn{
  position:relative; top:0;
  border:none;
  color:#fff;
  background:linear-gradient(to top, var(--b-lo) 0%, var(--b-hi) 100%);  /* แก้จาก linear-gradient(bottom,...) ที่เบราว์เซอร์ไม่รับ */
  box-shadow:inset 0 1px 0 var(--b-hl), 0 var(--b-d) 0 var(--b-edge);
  text-shadow:0 1px 1px rgba(0,0,0,0.25);
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
  transition:top .08s ease, box-shadow .08s ease, filter .08s ease;
}
.pause-btn{ margin-bottom:calc(8px + var(--b-d)); }  /* กันเงาล่างชนปุ่มถัดไป */
.app-topbar #backBtn{ color:#eee; }

/* ---------- 3) ตอนกด: ยุบลงเท่าความหนา + เข้มขึ้น ---------- */
.game-card .play-btn:active,
.app-topbar #backBtn:active,
.modal-close:active,
.pause-btn:active,
.makruk-shell .scorebar button.undo:active,
.othello-shell .scorebar button.undo:active,
.go-shell .scorebar button.undo:active,
.makhos-shell button.undo:active,
.makruk-shell button.restart:active,
.makhos-shell button.restart:active,
.othello-shell button.restart:active,
.makruk-shell #resultRestartBtn:active,
.makhos-shell #resultRestartBtn:active,
.othello-shell #resultRestartBtn:active,
.go-shell #resultRestartBtn:active,
.go-shell #passBtn:active{
  top:var(--b-d);
  transform:none;                                     /* ยกเลิก scale() เดิม */
  box-shadow:inset 0 1px 0 var(--b-hl), inset 0 -1px 0 var(--b-edge);
  filter:brightness(0.82);                            /* สีเดิมแต่เข้มขึ้น */
}

/* ---------- 4) Undo ตอน disabled: ใช้สีเดิมของแต่ละเกม แค่ตัดความนูน ---------- */
.makruk-shell .scorebar button.undo:disabled,
.othello-shell .scorebar button.undo:disabled,
.go-shell .scorebar button.undo:disabled,
.makhos-shell button.undo:disabled{
  top:0; box-shadow:none; filter:none; text-shadow:none; cursor:not-allowed;
}
