/* Cờ úp – phần riêng (tiền tố coup-); bàn, quân, bố cục dùng chung cotuong.css. Nạp sau cotuong.css. */
body[data-scene="coup"] {
  background-color: #c8a465;
  background-image:
    radial-gradient(ellipse 70% 50% at 25% 15%, rgba(255, 244, 210, .28), transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(90, 60, 10, .22), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 118px, rgba(92, 62, 20, .35) 118px 121px),
    repeating-linear-gradient(0deg, rgba(120, 82, 28, .22) 0 1.5px, rgba(255, 240, 200, .12) 1.5px 3px, transparent 3px 7px, rgba(120, 82, 28, .12) 7px 8px);
}
body[data-scene="coup"] .cotuong-backlink { color: #4a2a0c; }
/* Mặt lưng quân úp: gỗ sẫm, vòng chỉ vàng; viền mỏng màu bên (đỏ / đen) để dễ nhìn */
.coup-back { background: radial-gradient(circle at 38% 30%, #b07a46 0, #8a5a2b 45%, #6a4019 80%, #4e2c10 100%) !important;
  box-shadow: inset 0 -2px 0 rgba(30, 15, 0, .45), 0 2px 0 #3a200a, 0 3px 5px rgba(40, 20, 0, .45) !important; }
.coup-back::before { border-style: dashed !important; border-color: #e9c48a !important; opacity: .7 !important; inset: 16% !important; border-width: max(1px, calc(2.5 * var(--cqd))) !important; }
.coup-back::after { content: ""; position: absolute; inset: 3%; border-radius: 50%; border: max(1.5px, calc(4 * var(--cqd))) solid transparent; }
.coup-b0::after { border-color: rgba(200, 40, 30, .75); }
.coup-b1::after { border-color: rgba(20, 20, 24, .7); }
.coup-back b { color: #f4dca6; font: 700 calc(46 * var(--cqd))/1 var(--f-body); }
.cotuong-caps .coup-back b { font-size: 12px; }
.cotuong-sample .coup-back { width: 46px; }
/* Hồi hộp trước khi lật: quân nhấc lên, rung nhẹ; rồi lật mặt (thu ngang lại rồi mở ra) */
@media (prefers-reduced-motion: no-preference) {
  .cotuong-pc.coup-wobble { z-index: 6; }
  .cotuong-pc.coup-wobble .cotuong-disc { animation: coup-wob .32s ease-in-out infinite; scale: 1.12; box-shadow: 0 0 0 max(2px, calc(.6 * var(--cq))) #ffd23f, 0 10px 16px rgba(40, 20, 0, .4) !important; }
  .cotuong-pc.coup-flipping { z-index: 6; }
  .cotuong-pc.coup-flipping .cotuong-disc { animation: coup-flip .36s ease-in-out; }
  .cotuong-pc.coup-endrev .cotuong-disc { animation: coup-flip .36s ease-in-out; }
}
@keyframes coup-wob { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }
@keyframes coup-flip { 0% { transform: scaleX(1); } 47% { transform: scaleX(.04); } 53% { transform: scaleX(.04); } 100% { transform: scaleX(1); } }
.cotuong-pc.coup-endrev .cotuong-disc:not(.coup-back) { outline: max(1.5px, calc(.4 * var(--cq))) dashed rgba(90, 46, 18, .55); outline-offset: 1px; }
/* Chữ bay lên khi lật: "Xe!", "Ăn được Pháo" */
.coup-tag { position: absolute; z-index: 7; pointer-events: none; translate: -50% -70%; white-space: nowrap; font: 700 clamp(.9rem, calc(4.6 * var(--cq)), 1.6rem)/1 "Mali", var(--f-hand); color: #fff8e6; background: rgba(90, 46, 18, .9); padding: .18em .5em; border-radius: 10px; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); }
.coup-tag.coup-tagbig { background: rgba(168, 35, 27, .95); }
@media (prefers-reduced-motion: no-preference) { .coup-tag { animation: coup-tag 1.4s ease-out forwards; } }
@keyframes coup-tag { 0% { opacity: 0; translate: -50% -30%; scale: .7; } 15% { opacity: 1; translate: -50% -80%; scale: 1.08; } 75% { opacity: 1; translate: -50% -110%; scale: 1; } 100% { opacity: 0; translate: -50% -140%; } }
.coup-pool { margin: -4px 0 0; color: #6b2a12; }
.coup-pool:empty { display: none; }
.art-coup { background: #f6e7c3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.38' cy='.3' r='.75'%3E%3Cstop offset='0' stop-color='%23fff6dc'/%3E%3Cstop offset='.55' stop-color='%23f4dca6'/%3E%3Cstop offset='1' stop-color='%23d4a560'/%3E%3C/radialGradient%3E%3CradialGradient id='k' cx='.4' cy='.3' r='.8'%3E%3Cstop offset='0' stop-color='%23a06a3a'/%3E%3Cstop offset='.6' stop-color='%237a4a22'/%3E%3Cstop offset='1' stop-color='%234e2c10'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='96' height='96' fill='%23f6e7c3'/%3E%3Cpath d='M6 0V96M0 6H96M34 0V96M0 34H96M62 0V96M0 62H96M90 0V96M0 90H96M34 6L90 62M90 6L34 62' fill='none' stroke='%235a2e12' stroke-width='1.6'/%3E%3Crect x='2' y='2' width='92' height='92' fill='none' stroke='%235a2e12' stroke-width='3'/%3E%3Ccircle cx='66' cy='36.6' r='16' fill='%233a200a'/%3E%3Ccircle cx='66' cy='35' r='16' fill='url(%23k)'/%3E%3Ccircle cx='66' cy='35' r='11' fill='none' stroke='%23e9c48a' stroke-width='1.3' stroke-dasharray='2.2 2' opacity='.8'/%3E%3Ccircle cx='66' cy='35' r='4' fill='%23e9c48a' opacity='.55'/%3E%3Ccircle cx='20' cy='22.6' r='12' fill='%233a200a'/%3E%3Ccircle cx='20' cy='21' r='12' fill='url(%23k)'/%3E%3Ccircle cx='20' cy='21' r='8' fill='none' stroke='%23e9c48a' stroke-width='1.1' stroke-dasharray='2 1.8' opacity='.8'/%3E%3Cg transform='rotate(-12 36 64)'%3E%3Ccircle cx='36' cy='65.6' r='21' fill='%238a5a2b'/%3E%3Ccircle cx='36' cy='64' r='21' fill='url(%23g)'/%3E%3Ccircle cx='36' cy='64' r='16.8' fill='none' stroke='%23b8231b' stroke-width='1.4'/%3E%3Ctext x='36' y='71.6' text-anchor='middle' font-size='22' font-weight='700' font-family='Noto Serif TC,STKaiti,KaiTi,PMingLiU,WenQuanYi Zen Hei,serif' fill='%23b8231b'%3E%E4%BF%A5%3C/text%3E%3C/g%3E%3Cpath d='M58 76c10 0 18-6 20-15' fill='none' stroke='%23b8231b' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath d='M74 58l4 3 3-5' fill='none' stroke='%23b8231b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/cover no-repeat; }
/* Quân đã ăn (khay nhỏ cạnh tên): chữ nhỏ vừa quân */
.coup-play .cotuong-caps .cotuong-disc { width: 22px; }
.coup-play .cotuong-caps .cotuong-vi b { font-size: 6px; letter-spacing: -.04em; }
.coup-play .cotuong-caps .cotuong-han b { font-size: 12px; }
/* Cờ úp ăn nhiều quân: khay xuống dòng thay vì bị che mất */
.coup-play .cotuong-caps { flex-wrap: wrap; row-gap: 2px; padding-right: 6px; }
.coup-play .cotuong-caps .cotuong-disc { margin-right: -6px; }
