/* Cờ vây – toàn bộ CSS của trò (tiền tố covay-, riêng .art-covay là ảnh thẻ trang chủ). Nạp sau style.css.
   Khung cảnh: bàn trà gỗ óc chó tối màu, trên đặt bàn cờ gỗ kaya sáng; quân đá đen và trắng có bóng (vẽ trong canvas). */
.art-covay { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cdefs%3E%3ClinearGradient id='k' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23efca86'/%3E%3Cstop offset='1' stop-color='%23d9a65a'/%3E%3C/linearGradient%3E%3CradialGradient id='b' cx='.36' cy='.32' r='.75'%3E%3Cstop offset='0' stop-color='%238c8c8c'/%3E%3Cstop offset='.3' stop-color='%23333'/%3E%3Cstop offset='1' stop-color='%23050505'/%3E%3C/radialGradient%3E%3CradialGradient id='w' cx='.36' cy='.32' r='.8'%3E%3Cstop offset='0' stop-color='%23fff'/%3E%3Cstop offset='.6' stop-color='%23f1eee5'/%3E%3Cstop offset='1' stop-color='%23bab3a0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='96' height='96' fill='url(%23k)'/%3E%3Cpath d='M-2 -2.0Q24 4.6 48 -2.0T98 -1.1' stroke='%23a8692a' stroke-opacity='0.25' stroke-width='1.3' fill='none'/%3E%3Cpath d='M-2 30.9Q24 36.7 48 30.9T98 33.2' stroke='%23fff2cf' stroke-opacity='0.24' stroke-width='1.5' fill='none'/%3E%3Cpath d='M-2 79.7Q24 82.9 48 79.7T98 80.8' stroke='%23fff2cf' stroke-opacity='0.25' stroke-width='0.7' fill='none'/%3E%3Cpath d='M-2 66.4Q24 70.7 48 66.4T98 69.2' stroke='%23fff2cf' stroke-opacity='0.14' stroke-width='1.3' fill='none'/%3E%3Cpath d='M-2 90.3Q24 95.8 48 90.3T98 92.2' stroke='%23fff2cf' stroke-opacity='0.28' stroke-width='1.9' fill='none'/%3E%3Cpath d='M-2 35.2Q24 38.9 48 35.2T98 37.7' stroke='%23a8692a' stroke-opacity='0.15' stroke-width='1.0' fill='none'/%3E%3Cpath d='M-2 40.8Q24 44.3 48 40.8T98 43.7' stroke='%23fff2cf' stroke-opacity='0.25' stroke-width='1.8' fill='none'/%3E%3Cpath d='M-2 3.9Q24 7.2 48 3.9T98 5.5' stroke='%23fff2cf' stroke-opacity='0.20' stroke-width='0.9' fill='none'/%3E%3Cpath d='M-2 88.9Q24 91.2 48 88.9T98 90.0' stroke='%23a8692a' stroke-opacity='0.24' stroke-width='1.9' fill='none'/%3E%3Cpath d='M-2 49.5Q24 52.3 48 49.5T98 50.7' stroke='%23a8692a' stroke-opacity='0.19' stroke-width='1.2' fill='none'/%3E%3Cpath d='M-2 31.3Q24 35.9 48 31.3T98 33.1' stroke='%23a8692a' stroke-opacity='0.28' stroke-width='1.2' fill='none'/%3E%3Cpath d='M-2 84.3Q24 89.5 48 84.3T98 86.2' stroke='%23fff2cf' stroke-opacity='0.21' stroke-width='1.6' fill='none'/%3E%3Cpath d='M-2 92.0Q24 95.9 48 92.0T98 94.1' stroke='%23a8692a' stroke-opacity='0.23' stroke-width='1.1' fill='none'/%3E%3Cpath d='M-2 31.1Q24 35.0 48 31.1T98 33.4' stroke='%23fff2cf' stroke-opacity='0.14' stroke-width='1.7' fill='none'/%3E%3Cpath d='M4 0V96M0 4H96M26 0V96M0 26H96M48 0V96M0 48H96M70 0V96M0 70H96M92 0V96M0 92H96' stroke='%233a2208' stroke-opacity='.8' stroke-width='1.2'/%3E%3Ccircle cx='70' cy='70' r='2.4' fill='%233a2208'/%3E%3Ccircle cx='27.3' cy='50' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='26' cy='48' r='10.3' fill='url(%23b)'/%3E%3Ccircle cx='49.3' cy='28' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='48' cy='26' r='10.3' fill='url(%23b)'/%3E%3Ccircle cx='27.3' cy='72' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='26' cy='70' r='10.3' fill='url(%23b)'/%3E%3Ccircle cx='71.3' cy='50' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='70' cy='48' r='10.3' fill='url(%23w)'/%3E%3Ccircle cx='49.3' cy='72' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='48' cy='70' r='10.3' fill='url(%23w)'/%3E%3Ccircle cx='71.3' cy='28' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='70' cy='26' r='10.3' fill='url(%23w)'/%3E%3Ccircle cx='49.3' cy='50' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='48' cy='48' r='10.3' fill='url(%23b)'/%3E%3Ccircle cx='48' cy='48' r='4.4' fill='none' stroke='%23fff' stroke-width='1.4'/%3E%3C/svg%3E") center/cover no-repeat; }
.gcard .art-covay, .sh-head .art-covay { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cdefs%3E%3ClinearGradient id='k' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23efca86'/%3E%3Cstop offset='1' stop-color='%23d9a65a'/%3E%3C/linearGradient%3E%3CradialGradient id='b' cx='.36' cy='.32' r='.75'%3E%3Cstop offset='0' stop-color='%238c8c8c'/%3E%3Cstop offset='.3' stop-color='%23333'/%3E%3Cstop offset='1' stop-color='%23050505'/%3E%3C/radialGradient%3E%3CradialGradient id='w' cx='.36' cy='.32' r='.8'%3E%3Cstop offset='0' stop-color='%23fff'/%3E%3Cstop offset='.6' stop-color='%23f1eee5'/%3E%3Cstop offset='1' stop-color='%23bab3a0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='96' height='96' fill='url(%23k)'/%3E%3Cpath d='M-2 -2.0Q24 4.6 48 -2.0T98 -1.1' stroke='%23a8692a' stroke-opacity='0.25' stroke-width='1.3' fill='none'/%3E%3Cpath d='M-2 30.9Q24 36.7 48 30.9T98 33.2' stroke='%23fff2cf' stroke-opacity='0.24' stroke-width='1.5' fill='none'/%3E%3Cpath d='M-2 79.7Q24 82.9 48 79.7T98 80.8' stroke='%23fff2cf' stroke-opacity='0.25' stroke-width='0.7' fill='none'/%3E%3Cpath d='M-2 66.4Q24 70.7 48 66.4T98 69.2' stroke='%23fff2cf' stroke-opacity='0.14' stroke-width='1.3' fill='none'/%3E%3Cpath d='M-2 90.3Q24 95.8 48 90.3T98 92.2' stroke='%23fff2cf' stroke-opacity='0.28' stroke-width='1.9' fill='none'/%3E%3Cpath d='M-2 35.2Q24 38.9 48 35.2T98 37.7' stroke='%23a8692a' stroke-opacity='0.15' stroke-width='1.0' fill='none'/%3E%3Cpath d='M-2 40.8Q24 44.3 48 40.8T98 43.7' stroke='%23fff2cf' stroke-opacity='0.25' stroke-width='1.8' fill='none'/%3E%3Cpath d='M-2 3.9Q24 7.2 48 3.9T98 5.5' stroke='%23fff2cf' stroke-opacity='0.20' stroke-width='0.9' fill='none'/%3E%3Cpath d='M-2 88.9Q24 91.2 48 88.9T98 90.0' stroke='%23a8692a' stroke-opacity='0.24' stroke-width='1.9' fill='none'/%3E%3Cpath d='M-2 49.5Q24 52.3 48 49.5T98 50.7' stroke='%23a8692a' stroke-opacity='0.19' stroke-width='1.2' fill='none'/%3E%3Cpath d='M-2 31.3Q24 35.9 48 31.3T98 33.1' stroke='%23a8692a' stroke-opacity='0.28' stroke-width='1.2' fill='none'/%3E%3Cpath d='M-2 84.3Q24 89.5 48 84.3T98 86.2' stroke='%23fff2cf' stroke-opacity='0.21' stroke-width='1.6' fill='none'/%3E%3Cpath d='M-2 92.0Q24 95.9 48 92.0T98 94.1' stroke='%23a8692a' stroke-opacity='0.23' stroke-width='1.1' fill='none'/%3E%3Cpath d='M-2 31.1Q24 35.0 48 31.1T98 33.4' stroke='%23fff2cf' stroke-opacity='0.14' stroke-width='1.7' fill='none'/%3E%3Cpath d='M4 0V96M0 4H96M26 0V96M0 26H96M48 0V96M0 48H96M70 0V96M0 70H96M92 0V96M0 92H96' stroke='%233a2208' stroke-opacity='.8' stroke-width='1.2'/%3E%3Ccircle cx='70' cy='70' r='2.4' fill='%233a2208'/%3E%3Ccircle cx='27.3' cy='50' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='26' cy='48' r='10.3' fill='url(%23b)'/%3E%3Ccircle cx='49.3' cy='28' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='48' cy='26' r='10.3' fill='url(%23b)'/%3E%3Ccircle cx='27.3' cy='72' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='26' cy='70' r='10.3' fill='url(%23b)'/%3E%3Ccircle cx='71.3' cy='50' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='70' cy='48' r='10.3' fill='url(%23w)'/%3E%3Ccircle cx='49.3' cy='72' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='48' cy='70' r='10.3' fill='url(%23w)'/%3E%3Ccircle cx='71.3' cy='28' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='70' cy='26' r='10.3' fill='url(%23w)'/%3E%3Ccircle cx='49.3' cy='50' r='10.6' fill='%234a2a08' fill-opacity='.38'/%3E%3Ccircle cx='48' cy='48' r='10.3' fill='url(%23b)'/%3E%3Ccircle cx='48' cy='48' r='4.4' fill='none' stroke='%23fff' stroke-width='1.4'/%3E%3C/svg%3E") center/cover no-repeat; }

body[data-scene="covay"] {
  background-color: #4a2f1c;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 220, 170, .16), transparent 70%),
    repeating-linear-gradient(176deg, rgba(0, 0, 0, .08) 0 2px, transparent 2px 7px, rgba(255, 210, 160, .04) 7px 9px, transparent 9px 17px),
    linear-gradient(180deg, #5b3a22, #3e2716);
  background-attachment: fixed;
}
body[data-scene="covay"] #app { max-width: 1000px; }

/* ================= Màn chọn ================= */
.covay-setup { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); max-width: 640px; }
.covay-backlink, body[data-scene="covay"] .covay-setup .back { color: #f6e2bd; justify-self: start; }
.covay-head { display: flex; gap: 16px; align-items: center; color: #f6e2bd; }
.covay-logo { display: block; width: 84px; height: 84px; flex: none; border-radius: 12px; box-shadow: 0 4px 0 #a7773c, 0 10px 18px rgba(0, 0, 0, .4); }
.covay-h1 { font: 700 2.7rem/1.05 "Mali", var(--f-hand); color: #fff3da; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.covay-head p { margin: 4px 0 0; color: #ecd3a8; font-size: .95rem; text-wrap: pretty; }
.covay-resume { display: grid; gap: 10px; padding: 14px 16px; background: #fff3cf; border: 3px solid #f2c14e; border-radius: 16px; box-shadow: 0 6px 0 rgba(0, 0, 0, .25), 0 0 0 4px rgba(242, 193, 78, .25); }
.covay-resume > div:first-child { display: grid; gap: 2px; }
.covay-resume b { font: 400 1.45rem/1.1 var(--f-hand); color: #2a1a0d; }
.covay-resume span { font-size: .9rem; color: #5b4a38; }
.covay-rbtns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.covay-rbtns .btn { border-color: #2a1a0d; color: #2a1a0d; }
.covay-rbtns .btn.ink { background: #2a1a0d; color: #fff3da; }
.covay-box { background: #fffaf0; border: 2px solid #2a1a0d; border-radius: 16px; padding: 16px; display: grid; gap: 14px; box-shadow: 0 6px 0 rgba(0, 0, 0, .25); }
.covay-field { display: grid; gap: 6px; min-width: 0; }
.covay-lab { font: 600 .82rem var(--f-body); color: #6b4a2a; text-transform: uppercase; letter-spacing: .04em; }
.covay-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 2px solid #2a1a0d; border-radius: 10px; overflow: hidden; }
.covay-seg button { font: 500 clamp(.78rem, 3.6vw, .92rem)/1.2 var(--f-body); padding: .6em 2px; text-wrap: balance; background: #fffaf0; color: #2a1a0d; border: 0; border-left: 1.5px solid #2a1a0d; cursor: pointer; min-width: 0; }
.covay-seg button:first-child { border-left: 0; }
.covay-seg button[aria-checked="true"] { background: #2a1a0d; color: #fff3da; }
.covay-rulepick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.covay-rulepick button { display: grid; gap: 3px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 2px solid #c9b392; background: #fffdf7; color: #2a1a0d; cursor: pointer; font: inherit; }
.covay-rulepick b { font: 600 .98rem var(--f-body); }
.covay-rulepick span { font-size: .8rem; line-height: 1.35; color: #6b5a48; }
.covay-rulepick button[aria-checked="true"] { border-color: #2a1a0d; background: #fbecd0; box-shadow: inset 0 0 0 1px #2a1a0d; }
.covay-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.covay-step { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; border: 2px solid #2a1a0d; border-radius: 10px; overflow: hidden; height: 44px; }
.covay-step button { height: 100%; border: 0; background: #f3e4c8; color: #2a1a0d; font: 600 1.3rem/1 var(--f-body); cursor: pointer; }
.covay-step output { text-align: center; font: 700 1.1rem var(--f-body); color: #2a1a0d; font-variant-numeric: tabular-nums; }
.covay-select { height: 44px; width: 100%; min-width: 0; font: 500 .95rem var(--f-body); color: #2a1a0d; background: #fffaf0; border: 2px solid #2a1a0d; border-radius: 10px; padding: 0 8px; }
.covay-hint { color: #6b5a48; min-height: 1.3em; }
.btn.covay-start { background: #2a1a0d; border-color: #2a1a0d; box-shadow: 2px 3px 0 rgba(0, 0, 0, .25); }
.covay-stat { color: #2a1a0d; }
.covay-rules { background: #fffaf0; border: 2px dashed #c9a46a; border-radius: 14px; padding: 12px 18px; }
.covay-rules summary { font-family: var(--f-hand); font-size: 1.4rem; color: #2a1a0d; cursor: pointer; }
.covay-rules p, .covay-rules li { font-size: .95rem; text-wrap: pretty; }
.covay-rules ul { padding-left: 1.2em; }

/* ================= Màn chơi ================= */
.covay-play { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.covay-bar { display: flex; align-items: center; gap: 8px; color: #fff3da; }
.covay-back { font: 1.7rem/1 var(--f-hand); color: #fff3da; background: none; border: 0; padding: 4px 8px 4px 0; cursor: pointer; }
.covay-bt { flex: 1; min-width: 0; display: grid; }
.covay-bt b { font: 700 1.45rem/1.15 "Mali", var(--f-hand); color: #fff3da; }
.covay-sub { font-size: .8rem; color: #e6cda3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.covay-icon { background: none; border: 0; font-size: 1.3rem; cursor: pointer; padding: 6px; }
.covay-layout { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "pl" "st" "sd"; align-items: start; }
.covay-layout > * { min-width: 0; }
.covay-players { grid-area: pl; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.covay-pl { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 10px; background: rgba(255, 250, 240, .93); border: 2px solid transparent; border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
.covay-pl.on { border-color: #f2c14e; box-shadow: 0 0 0 3px rgba(242, 193, 78, .35); }
.covay-pst { width: 26px; height: 26px; flex: none; }
.covay-pst svg { display: block; width: 100%; height: 100%; }
.covay-pn { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.covay-pn b { font: 600 .92rem var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #2a1a0d; }
.covay-pn em { font-style: normal; font-size: .75rem; color: #7a6650; }
.covay-cap { display: grid; justify-items: end; line-height: 1.1; }
.covay-cap small { font-size: .66rem; color: #7a6650; }
.covay-cap b { font: 700 1.05rem var(--f-body); color: #a8322a; font-variant-numeric: tabular-nums; }
.covay-stage { grid-area: st; position: relative; width: 100%; }
.covay-scroll { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 6px; background: #e2b56a;
  box-shadow: 0 5px 0 #a8763a, 0 7px 0 #7d5225, 0 16px 28px rgba(0, 0, 0, .45); touch-action: manipulation; overscroll-behavior: contain; }
.covay-scroll.covay-zoomable { touch-action: none; }
.covay-scroll.covay-zoomed { overflow: auto; scrollbar-width: thin; }
.covay-scroll:focus-visible { outline: 3px solid #f2c14e; outline-offset: 3px; }
.covay-canvas { display: block; cursor: pointer; }
.covay-zoom { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 12px; }
.covay-zoom::before { content: "Phóng to để đặt quân dễ hơn"; margin-right: auto; font-size: .78rem; color: #e6cda3; }
.covay-zoom button { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1.5px solid #2a1a0d; background: rgba(255, 250, 240, .92); color: #2a1a0d; font: 600 1.15rem/1 var(--f-body); cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.covay-zoom button[data-z="fit"] { font-size: .85rem; }
.covay-tip { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); margin: 0; padding: .35em .9em; border-radius: 999px; background: #2a1a0d; color: #fff3da; font: 500 .85rem var(--f-body); white-space: nowrap; pointer-events: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.covay-side { grid-area: sd; display: grid; gap: 10px; }
.covay-status { margin: 0; min-height: 1.5em; font: 400 1.3rem/1.25 var(--f-hand); color: #fff3da; text-wrap: balance; }
.covay-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.covay-acts .btn { padding: .65em .3em; font-size: .88rem; line-height: 1.15; border-color: #2a1a0d; color: #2a1a0d; background: #fffaf0; box-shadow: 2px 3px 0 rgba(0, 0, 0, .3); }
.covay-acts .btn.red { color: #a8322a; border-color: #a8322a; }
.covay-acts .btn.ink { background: #2a1a0d; color: #fff3da; }
.covay-acts .btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.covay-markbox { background: #fffaf0; border: 2px solid #f2c14e; border-radius: 14px; padding: 12px; display: grid; gap: 8px; }
.covay-markbox .small { color: #5b4a38; }
.covay-markbox .covay-acts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.covay-mtitle { margin: 0; font: 400 1.35rem/1.1 var(--f-hand); color: #2a1a0d; }
.covay-mscore { margin: 0; font-size: 1rem; color: #2a1a0d; }
.covay-side > .covay-acts:has(.covay-reopen) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.covay-info { color: #e6cda3; }
@media (min-width: 900px) {
  .covay-layout { grid-template-columns: minmax(0, 1fr) 290px; grid-template-areas: "st pl" "st sd"; grid-template-rows: auto 1fr; gap: 12px 20px; }
  .covay-stage { max-width: min(100%, calc(100vh - 120px), calc(100svh - 120px)); min-width: 360px; justify-self: center; }
  .covay-players { grid-template-columns: minmax(0, 1fr); }
  .covay-acts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ================= Kết quả ================= */
.covay-modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(20, 12, 5, .55); padding: 16px; z-index: 50; overflow-y: auto; }
.covay-res { width: min(100%, 420px); background: #fffaf0; border: 3px double #2a1a0d; border-radius: 18px; padding: 20px 18px; display: grid; gap: 8px; text-align: center; }
@media (prefers-reduced-motion: no-preference) { .covay-res { animation: covay-pop .25s ease-out; } }
@keyframes covay-pop { from { transform: scale(.92); opacity: .6; } to { transform: none; opacity: 1; } }
.covay-res h2 { font-size: 2rem; color: #2a1a0d; }
.covay-res p { margin: 0; }
.covay-stamp { justify-self: center; font: 1.6rem var(--f-hand); color: #a8322a; border: 3px solid #a8322a; border-radius: 50%; width: 88px; height: 88px; display: grid; place-items: center; transform: rotate(-12deg); }
.covay-stamp.lose { color: #2a1a0d; border-color: #2a1a0d; }
.covay-score { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.covay-score th, .covay-score td { padding: 5px 6px; border-bottom: 1px solid #e6d6ba; }
.covay-score th { font-weight: 600; }
.covay-score th svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.covay-score td:first-child { text-align: left; color: #5b4a38; }
.covay-score td:not(:first-child), .covay-score th:not(:first-child) { text-align: right; width: 26%; }
.covay-tot td { font-weight: 700; color: #2a1a0d !important; border-bottom: 0; }
.covay-ibtns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.covay-ibtns .btn { padding: .7em .4em; border-color: #2a1a0d; color: #2a1a0d; box-shadow: 2px 3px 0 rgba(0, 0, 0, .18); }
.covay-ibtns .btn.red { border-color: #a8322a; color: #a8322a; }
.covay-ibtns .btn.ink { background: #2a1a0d; border-color: #2a1a0d; color: #fff3da; }

@media (max-width: 480px) {
  .covay-h1 { font-size: 2.3rem; }
  .covay-logo { width: 68px; height: 68px; }
  .covay-rulepick { grid-template-columns: minmax(0, 1fr); }
  .covay-seg button { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { .covay-pl { transition: none; } }

/* ================= Điện thoại xoay ngang ================= */
/* Cột trái: tiêu đề, người chơi, trạng thái, nút (cột nút tự cuộn); cột phải: bàn cờ cao bằng màn hình. */
@media (orientation: landscape) and (max-height: 540px) {
  body[data-scene="covay"] #app { max-width: none; }
  .covay-play { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto minmax(0, 1fr); column-gap: 14px; row-gap: 8px; height: calc(100dvh - 18px); }
  .covay-layout { display: contents; }
  .covay-bar { grid-column: 1; grid-row: 1; gap: 6px; }
  .covay-back, .covay-icon { min-width: 40px; min-height: 40px; }
  .covay-bar .rot-btn { min-height: 40px; }
  .covay-bt b { font-size: 1.25rem; }
  .covay-players { grid-area: auto; grid-column: 1; grid-row: 2; gap: 6px; }
  .covay-pl { padding: 4px 8px; }
  .covay-side { grid-area: auto; grid-column: 1; grid-row: 3; align-content: start; gap: 8px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 2px 8px 0; }
  .covay-status { font-size: 1.15rem; }
  .covay-acts, .covay-side > .covay-acts:has(.covay-reopen) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .covay-acts .btn { min-height: 40px; padding-block: .4em; }
  .covay-stage { grid-area: auto; grid-column: 2; grid-row: 1 / -1; display: flex; align-items: flex-end; gap: 8px; width: auto; max-width: none; min-width: 0; justify-self: end; }
  .covay-scroll { flex: none; width: calc(100dvh - 30px); }
  .covay-zoom { flex-direction: column; margin: 0 0 8px; }
  .covay-zoom::before { content: none; }
  .covay-zoom button[data-z="fit"] { width: 48px; padding: 0 2px; font-size: .72rem; line-height: 1.1; white-space: normal; }
  .covay-zoom button { width: 48px; }
}
