/* Cờ tư lệnh – CSS riêng (tiền tố cotl-). Dùng chung khung màn chọn, màn chơi của Cờ tướng (lớp cotuong-*, cotuong.css).
   Khung cảnh: tấm bản đồ tác chiến trải trên bàn gỗ xanh rêu; quân tròn đỏ / xanh, biểu tượng trắng tự vẽ. */
body[data-scene="cotulenh"] {
  background-color: #6f7b4a;
  background-image:
    radial-gradient(ellipse 60% 40% at 20% 10%, rgba(255, 250, 210, .22), transparent 70%),
    radial-gradient(ellipse 50% 45% at 85% 85%, rgba(30, 40, 10, .3), transparent 70%),
    radial-gradient(circle at 30% 60%, rgba(60, 70, 30, .35) 0 60px, transparent 61px),
    radial-gradient(circle at 75% 30%, rgba(140, 130, 80, .25) 0 80px, transparent 81px),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, .04) 0 2px, transparent 2px 9px);
}
body[data-scene="cotulenh"] .cotuong-backlink, body[data-scene="cotulenh"] .cotuong-back, body[data-scene="cotulenh"] .cotuong-sub { color: #fffbe6; }
body[data-scene="cotulenh"] .cotuong-head p { color: #fffbe6; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.cotl-h1, .cotl-bt { color: #fff3c4 !important; text-shadow: 2px 2px 0 #3b4420 !important; }
body[data-scene="cotulenh"] .cotuong-pl { background: rgba(255, 251, 230, .82); }
body[data-scene="cotulenh"] .cotuong-pl.on { border-color: #f2b705; background: #fffbe6; }

/* ---- Thẻ trang chủ, ảnh đầu màn ---- */
.art-cotl { background: #e9dfb9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Crect width='96' height='96' fill='%23e9dfb9'/%3E%3Crect width='22' height='96' fill='%2362b1db'/%3E%3Crect y='42' width='96' height='14' fill='%2362b1db'/%3E%3Crect x='52' y='42' width='9' height='14' fill='%23c9b27a'/%3E%3Cpath d='M11 0V96M33 0V96M55 0V96M77 0V96M0 14H96M0 32H96M0 64H96M0 82H96' stroke='%235b4a24' stroke-width='1.3' opacity='.6'/%3E%3Ccircle cx='66' cy='24' r='15' fill='%231f5fbf' stroke='%23fff' stroke-width='2'/%3E%3Cpath d='M64.6 13h2.8l1.4 7.6 7.8 4.5v2.4L68.4 25.4l-.6 4.6 2.6 2v1.7L66 32.4l-4.4 1.3V32l2.6-2-.6-4.6-8.2 2.1V25.1l7.8-4.5z' fill='%23fff'/%3E%3Ccircle cx='38' cy='72' r='18' fill='%23c62828' stroke='%23fff' stroke-width='2'/%3E%3Cpath d='M38 58.5l3.4 7.5 8.2.8-6.2 5.4 1.8 8L38 76l-7.2 4.2 1.8-8-6.2-5.4 8.2-.8z' fill='%23ffd54a'/%3E%3C/svg%3E") center/cover no-repeat; }
.cotl-setup .cotuong-headart { border-color: #3b4420; }

/* ---- Quân ---- */
.cotl-disc { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 50%;
  box-shadow: inset 0 0 0 max(1.5px, 6%) rgba(255, 255, 255, .9), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 2px 0 rgba(0, 0, 0, .35), 0 3px 5px rgba(0, 0, 0, .3); }
.cotl-disc svg { width: 62%; height: 62%; fill: #fff; color: inherit; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.cotl-c0 { background: radial-gradient(circle at 36% 30%, #ef5350 0, #c62828 55%, #8e1b1b 100%); color: #c62828; }
.cotl-c1 { background: radial-gradient(circle at 36% 30%, #5b9cf0 0, #1f5fbf 55%, #143d80 100%); color: #1f5fbf; }
.cotl-hero { box-shadow: 0 0 0 max(2px, 8%) #f2b705, inset 0 0 0 max(1.5px, 6%) rgba(255, 255, 255, .9), 0 2px 0 rgba(0, 0, 0, .35); }
.cotl-hero::after { content: "★"; position: absolute; top: -14%; right: -14%; width: 44%; aspect-ratio: 1; border-radius: 50%; background: #f2b705; color: #5a3d00; display: grid; place-items: center; font-size: clamp(7px, 1.6cqw, 13px); line-height: 1; }

.cotl-pcs { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.cotl-pc { position: absolute; left: 0; top: 0; width: calc(100% / 11); height: calc(100% / 12); display: grid; place-items: center; transition: transform .28s cubic-bezier(.3, .7, .3, 1); will-change: transform; }
.cotl-pc > .cotl-disc { width: 86%; transition: scale .15s, translate .15s; }
.cotl-pass { position: absolute; width: 50%; bottom: -4%; z-index: 1; }
.cotl-pass1 { right: -6%; }
.cotl-pass2 { left: -6%; }
.cotl-pass .cotl-disc { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .95), 0 1px 2px rgba(0, 0, 0, .5); }
.cotl-pass .cotl-hero { box-shadow: 0 0 0 2px #f2b705, inset 0 0 0 1.5px #fff; }
.cotl-pass .cotl-hero::after { display: none; }
.cotl-pc.cotl-moving { z-index: 6; }
.cotl-pc.cotl-moving > .cotl-disc { scale: 1.12; }
.cotl-pc.cotl-sel { z-index: 5; }
.cotl-pc.cotl-sel > .cotl-disc { translate: 0 -6%; scale: 1.08; outline: 3px solid #2f8a3e; outline-offset: 1px; }
.cotl-pc.cotl-last > .cotl-disc { outline: 2.5px solid #f2b705; outline-offset: 1px; }
.cotl-pc.cotl-chk > .cotl-disc { animation: cotl-chk .8s ease-in-out infinite alternate; }
@keyframes cotl-chk { from { outline: 3px solid rgba(230, 40, 20, .2); outline-offset: 1px; } to { outline: 4px solid #e62814; outline-offset: 3px; } }

/* ---- Bàn ---- */
.cotl-left { max-width: min(100%, calc((100svh - 190px) * 11 / 12)); }
@media (min-width: 900px) {
  .cotl-layout { grid-template-columns: minmax(0, auto) 300px; }
  .cotl-left { width: min(580px, calc((100svh - 180px) * 11 / 12)); }
}
.cotl-frame { padding: 5px; border-radius: 6px; background: #4a5228; box-shadow: inset 0 0 0 2px #2f3518, 0 6px 14px rgba(20, 25, 5, .45); }
.cotl-board { position: relative; width: 100%; aspect-ratio: 11 / 12; touch-action: manipulation; container-type: inline-size; border-radius: 3px; overflow: hidden; }
.cotl-svgwrap, .cotl-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cotl-river-t { font: 700 34px/1 "Barlow Semi Condensed", sans-serif; fill: #fff; opacity: .7; letter-spacing: 6px; text-anchor: middle; dominant-baseline: central; }
.cotl-pts { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(11, 1fr); grid-template-rows: repeat(12, 1fr); z-index: 4; }
.cotl-pt { position: relative; border: 0; padding: 0; margin: 0; background: none; cursor: pointer; border-radius: 50%; min-width: 0; min-height: 0; }
.cotl-pt:focus-visible { outline: 3px solid #f2b705; outline-offset: -2px; }
.cotl-pt.cotl-dot::after { content: ""; position: absolute; left: 35%; top: 35%; width: 30%; height: 30%; border-radius: 50%; background: rgba(30, 120, 50, .85); box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); }
.cotl-pt.cotl-join::after { content: ""; position: absolute; inset: 6%; border-radius: 50%; border: 3px dashed #2f8a3e; background: rgba(47, 138, 62, .15); }
.cotl-pt.cotl-capt::after { content: ""; position: absolute; inset: 2%; border-radius: 50%; border: max(3px, 1cqw) solid rgba(40, 160, 60, .95); box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.cotl-pt.cotl-kami::after { border-color: #f57c00; }
.cotl-pt.cotl-from::before { content: ""; position: absolute; inset: 24%; border-radius: 50%; border: 2px dashed rgba(90, 60, 10, .8); }
.cotl-pt.cotl-hint::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(255, 210, 30, .45); box-shadow: 0 0 0 3px #e0a400; }
.cotl-ad { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.cotl-adz { position: absolute; width: calc(100% / 11); height: calc(100% / 12); }
.cotl-adz0 { background: radial-gradient(circle, rgba(220, 40, 30, .35) 0 45%, transparent 70%); }
.cotl-adz1 { background: radial-gradient(circle, rgba(30, 90, 220, .35) 0 45%, transparent 70%); }
.cotl-adz0 + .cotl-adz1, .cotl-adz1 + .cotl-adz0 { mix-blend-mode: multiply; }
.cotl-boom { position: absolute; z-index: 7; width: 9%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff6b0 0, #ffb300 35%, rgba(240, 80, 20, .85) 60%, transparent 72%); animation: cotl-boom .6s ease-out forwards; }
.cotl-boom.big { width: 14%; }
@keyframes cotl-boom { from { scale: .2; opacity: 1; } 70% { opacity: .9; } to { scale: 1.8; opacity: 0; } }
.cotl-shot { position: absolute; z-index: 7; width: 2.4%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: #ffe066; box-shadow: 0 0 8px 3px rgba(255, 170, 0, .8); transition: transform .3s ease-in; pointer-events: none; }
.cotl-chkbanner { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 8; pointer-events: none; font: 700 clamp(1.3rem, 7cqw, 2.4rem)/1 "Mali", var(--f-hand); color: #fff; background: rgba(200, 30, 20, .88); padding: .3em .7em; border-radius: 12px; animation: cotl-pop 1.1s ease-out forwards; white-space: nowrap; }
@keyframes cotl-pop { from { scale: .5; opacity: 0; } 20% { scale: 1.08; opacity: 1; } 80% { opacity: 1; } to { opacity: 0; } }
.cotl-choice { position: absolute; z-index: 9; display: grid; gap: 6px; padding: 8px; background: #fffbe6; border: 2px solid #3b4420; border-radius: 12px; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); min-width: 38%; }

/* ---- Người chơi ---- */
.cotl-dotc { width: 16px; height: 16px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px rgba(0, 0, 0, .3); }
.cotl-dotc0 { background: #c62828; }
.cotl-dotc1 { background: #1f5fbf; }
.cotl-caps { display: flex; align-items: center; flex: 1; min-width: 0; overflow: hidden; }
.cotl-caps .cotl-disc { width: 18px; flex: none; margin-right: -3px; box-shadow: inset 0 0 0 1.5px #fff; }
.cotl-score { margin-left: auto; font: 700 .95rem/1 var(--f-body); font-variant-numeric: tabular-nums; background: #3b4420; color: #fff3c4; border-radius: 8px; padding: 5px 8px; white-space: nowrap; }

/* ---- Cột bên ---- */
.cotl-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: rgba(255, 251, 230, .92); border-radius: 12px; padding: 8px; }
.cotl-pick > span { width: 100%; color: #3b4420; }
.cotl-chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid #3b4420; background: #fff; border-radius: 999px; padding: 4px 10px 4px 4px; font: 600 .88rem/1.1 var(--f-body); color: #2c3315; cursor: pointer; min-height: 40px; }
.cotl-chip .cotl-disc { width: 28px; }
.cotl-chip[aria-pressed="true"] { background: #3b4420; color: #fff3c4; }
.cotl-info { background: rgba(255, 251, 230, .95); border: 1.5px solid #3b4420; border-radius: 12px; padding: 8px 10px; display: grid; gap: 6px 10px; grid-template-columns: 112px minmax(0, 1fr); align-items: start; }
.cotl-info-h { grid-column: 1 / -1; }
.cotl-info .cotl-demo { max-width: 112px; }
.cotl-info p:only-of-type { grid-column: 2; }
.cotl-info .cotl-info-h + p { grid-column: 1 / -1; }
.cotl-info-h { display: flex; align-items: center; gap: 8px; }
.cotl-info-h .cotl-disc { width: 30px; flex: none; }
.cotl-info-h span { margin-left: auto; color: #6b5a2a; }
.cotl-info p { margin: 0; color: #2c3315; }
.cotl-demo { width: 100%; max-width: 230px; height: auto; display: block; }
.cotl-moves { max-height: 180px; }
@media (max-width: 899px) { .cotl-moves { max-height: 120px; } }
.cotl-n0 { color: #a61d1d; font-style: normal; }
.cotl-n1 { color: #174a99; font-style: normal; }

/* ---- Luật ---- */
.cotl-demos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 10px 0; }
.cotl-demo-f { margin: 0; background: #fff; border: 1px solid #d8cfa8; border-radius: 10px; padding: 6px; display: grid; gap: 4px; }
.cotl-demo-h { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.cotl-demo-h .cotl-disc { width: 24px; flex: none; }
.cotl-rules li { margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) {
  .cotl-pc, .cotl-shot { transition: none; }
  .cotl-boom, .cotl-chkbanner, .cotl-pc.cotl-chk > .cotl-disc { animation: none; }
}
