/* Dò mìn – toàn bộ CSS của trò (tiền tố domin-). Nạp sau style.css.
   Khung cảnh: phòng tin học ngày xưa, tường quét sơn hai màu (trên xanh bạc hà nhạt, dưới xanh lá đậm), cửa sổ chương trình
   kiểu máy tính cũ: khung xám nổi khối, đèn số đỏ, mặt cười. Ô bàn tự đổi cỡ theo --c (px, tính bằng JS, không dùng cqw). */
body[data-scene="domin"] {
  background-color: #d7ead8;
  background-image:
    linear-gradient(180deg, transparent 0 calc(100% - 20vh), #2c5e47 calc(100% - 20vh) calc(100% - 20vh + 6px), #4f8a68 calc(100% - 20vh + 6px)),
    radial-gradient(ellipse 70% 40% at 20% 10%, rgba(255, 255, 255, .45), transparent 70%),
    repeating-linear-gradient(90deg, rgba(40, 90, 60, .035) 0 2px, transparent 2px 11px),
    radial-gradient(rgba(40, 80, 50, .09) 1px, transparent 1.5px);
  background-size: auto, auto, auto, 6px 6px;
  background-attachment: fixed, scroll, scroll, scroll;
}
body[data-scene="domin"] .domin-backlink { color: #1f4a35; background: none; border: 0; cursor: pointer; padding: 0; }
.art-domin { background: #d9ecd9 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='%23d9ecd9'/%3E%3Crect x='4' y='4' width='88' height='88' rx='3' fill='%23c3c3c3' stroke='%23222' stroke-width='1.5'/%3E%3Cpath d='M6 90V6H90' stroke='%23fff' stroke-width='2' fill='none'/%3E%3Crect x='9' y='9' width='78' height='20' fill='%23bdbdbd' stroke='%23777' stroke-width='1.2'/%3E%3Crect x='12' y='12' width='22' height='14' fill='%23111'/%3E%3Ctext x='23' y='23.5' text-anchor='middle' font-family='Courier New,monospace' font-weight='700' font-size='12' fill='%23ff2a1a'%3E010%3C/text%3E%3Crect x='62' y='12' width='22' height='14' fill='%23111'/%3E%3Ctext x='73' y='23.5' text-anchor='middle' font-family='Courier New,monospace' font-weight='700' font-size='12' fill='%23ff2a1a'%3E042%3C/text%3E%3Ccircle cx='48' cy='19' r='7.5' fill='%23ffd629' stroke='%23111' stroke-width='1'/%3E%3Ccircle cx='45.3' cy='17.2' r='1.1' fill='%23111'/%3E%3Ccircle cx='50.7' cy='17.2' r='1.1' fill='%23111'/%3E%3Cpath d='M44.5 20.6q3.5 3.4 7 0' fill='none' stroke='%23111' stroke-width='1.1'/%3E%3Crect x='9' y='32' width='78' height='63' fill='none'/%3E%3Crect x='10.0' y='33.0' width='15.2' height='15.2' fill='%23c3c3c3'/%3E%3Cpath d='M10.0 48.2V33.0H25.2' stroke='%23fff' stroke-width='2' fill='none'/%3E%3Cpath d='M25.2 33.0V48.2H10.0' stroke='%23777' stroke-width='2' fill='none'/%3E%3Crect x='25.2' y='33.0' width='15.2' height='15.2' fill='%23c3c3c3'/%3E%3Cpath d='M25.2 48.2V33.0H40.4' stroke='%23fff' stroke-width='2' fill='none'/%3E%3Cpath d='M40.4 33.0V48.2H25.2' stroke='%23777' stroke-width='2' fill='none'/%3E%3Crect x='40.4' y='33.0' width='15.2' height='15.2' fill='%23c3c3c3'/%3E%3Cpath d='M40.4 48.2V33.0H55.6' stroke='%23fff' stroke-width='2' fill='none'/%3E%3Cpath d='M55.6 33.0V48.2H40.4' stroke='%23777' stroke-width='2' fill='none'/%3E%3Crect x='55.6' y='33.0' width='15.2' height='15.2' fill='%23bdbdbd' stroke='%238f8f8f' stroke-width='.8'/%3E%3Ctext x='63.2' y='44.9' text-anchor='middle' font-family='Arial,sans-serif' font-weight='900' font-size='12.5' fill='%230000f5'%3E1%3C/text%3E%3Crect x='70.8' y='33.0' width='15.2' height='15.2' fill='%23bdbdbd' stroke='%238f8f8f' stroke-width='.8'/%3E%3Crect x='10.0' y='48.2' width='15.2' height='15.2' fill='%23c3c3c3'/%3E%3Cpath d='M10.0 63.4V48.2H25.2' stroke='%23fff' stroke-width='2' fill='none'/%3E%3Cpath d='M25.2 48.2V63.4H10.0' stroke='%23777' stroke-width='2' fill='none'/%3E%3Crect x='25.2' y='48.2' width='15.2' height='15.2' fill='%23bdbdbd' stroke='%238f8f8f' stroke-width='.8'/%3E%3Ctext x='32.8' y='60.1' text-anchor='middle' font-family='Arial,sans-serif' font-weight='900' font-size='12.5' fill='%23007b00'%3E2%3C/text%3E%3Crect x='40.4' y='48.2' width='15.2' height='15.2' fill='%23bdbdbd' stroke='%238f8f8f' stroke-width='.8'/%3E%3Ctext x='48.0' y='60.1' text-anchor='middle' font-family='Arial,sans-serif' font-weight='900' font-size='12.5' fill='%230000f5'%3E1%3C/text%3E%3Crect x='55.6' y='48.2' width='15.2' height='15.2' fill='%23bdbdbd' stroke='%238f8f8f' stroke-width='.8'/%3E%3Crect x='70.8' y='48.2' width='15.2' height='15.2' fill='%23bdbdbd' stroke='%238f8f8f' stroke-width='.8'/%3E%3Crect x='10.0' y='63.4' width='15.2' height='15.2' fill='%23c3c3c3'/%3E%3Cpath d='M10.0 78.6V63.4H25.2' stroke='%23fff' stroke-width='2' fill='none'/%3E%3Cpath d='M25.2 63.4V78.6H10.0' stroke='%23777' stroke-width='2' fill='none'/%3E%3Cpath d='M18.4 75.5V66.0' stroke='%23111' stroke-width='1.4'/%3E%3Cpath d='M18.8 65.5L12.6 68.5L18.8 71.5z' fill='%23e01b1b'/%3E%3Cpath d='M14.1 76.0h8' stroke='%23111' stroke-width='1.6'/%3E%3Crect x='25.2' y='63.4' width='15.2' height='15.2' fill='%23bdbdbd' stroke='%238f8f8f' stroke-width='.8'/%3E%3Ctext x='32.8' y='75.3' text-anchor='middle' font-family='Arial,sans-serif' font-weight='900' font-size='12.5' fill='%230000f5'%3E1%3C/text%3E%3Crect x='40.4' y='63.4' width='15.2' height='15.2' fill='%23bdbdbd' stroke='%238f8f8f' stroke-width='.8'/%3E%3Crect x='55.6' y='63.4' width='15.2' height='15.2' fill='%23bdbdbd' stroke='%238f8f8f' stroke-width='.8'/%3E%3Ctext x='63.2' y='75.3' text-anchor='middle' font-family='Arial,sans-serif' font-weight='900' font-size='12.5' fill='%230000f5'%3E1%3C/text%3E%3Crect x='70.8' y='63.4' width='15.2' height='15.2' fill='%23c3c3c3'/%3E%3Cpath d='M70.8 78.6V63.4H86.0' stroke='%23fff' stroke-width='2' fill='none'/%3E%3Cpath d='M86.0 63.4V78.6H70.8' stroke='%23777' stroke-width='2' fill='none'/%3E%3Crect x='10.0' y='78.6' width='15.2' height='15.2' fill='%23bdbdbd' stroke='%238f8f8f' stroke-width='.8'/%3E%3Ctext x='17.6' y='90.5' text-anchor='middle' font-family='Arial,sans-serif' font-weight='900' font-size='12.5' fill='%230000f5'%3E1%3C/text%3E%3Crect x='25.2' y='78.6' width='15.2' height='15.2' fill='%23bdbdbd' stroke='%238f8f8f' stroke-width='.8'/%3E%3Crect x='40.4' y='78.6' width='15.2' height='15.2' fill='%23bdbdbd' stroke='%238f8f8f' stroke-width='.8'/%3E%3Ctext x='48.0' y='90.5' text-anchor='middle' font-family='Arial,sans-serif' font-weight='900' font-size='12.5' fill='%230000f5'%3E1%3C/text%3E%3Crect x='55.6' y='78.6' width='15.2' height='15.2' fill='%23c3c3c3'/%3E%3Cpath d='M55.6 93.8V78.6H70.8' stroke='%23fff' stroke-width='2' fill='none'/%3E%3Cpath d='M70.8 78.6V93.8H55.6' stroke='%23777' stroke-width='2' fill='none'/%3E%3Crect x='70.8' y='78.6' width='15.2' height='15.2' fill='%23c3c3c3'/%3E%3Cpath d='M70.8 93.8V78.6H86.0' stroke='%23fff' stroke-width='2' fill='none'/%3E%3Cpath d='M86.0 78.6V93.8H70.8' stroke='%23777' stroke-width='2' fill='none'/%3E%3Crect x='9.3' y='32.3' width='77.4' height='61.6' fill='none' stroke='%23777' stroke-width='1.2'/%3E%3C/svg%3E") center/cover no-repeat; }
.domin-svg { display: block; width: 74%; height: 74%; margin: auto; pointer-events: none; }

/* ================= Màn chọn ================= */
.domin-setup { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); max-width: 660px; }
.domin-head { display: flex; gap: 14px; align-items: center; color: #173d2b; }
.domin-headart { display: block; width: 76px; height: 76px; flex: none; border-radius: 10px; border: 3px solid #2c5e47; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.domin-h1 { margin: 0; font: 700 2.6rem/1.25 "Mali", var(--f-hand); color: #173d2b; text-wrap: balance; padding-top: .08em; }
.domin-head p { margin: 4px 0 0; color: #24513b; font-size: .95rem; }
.domin-box { background: #fbfdf8; border: 2px solid #2c5e47; border-radius: 14px; padding: 14px 16px 16px; display: grid; gap: 14px; box-shadow: 0 5px 0 rgba(30, 70, 50, .25); min-width: 0; }
.domin-field { display: grid; gap: 6px; min-width: 0; }
.domin-field h2 { margin: 0; font: 400 1.3rem/1.3 var(--f-hand); color: #1f5a3e; }
.domin-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.domin-seg button { font: 600 .9rem/1.3 var(--f-body); min-height: 40px; padding: .4em .95em; border-radius: 999px; border: 1.5px solid #3c8d63; background: #fff; color: #1f5a3e; cursor: pointer; }
.domin-seg button[aria-checked="true"] { background: #1f5a3e; border-color: #1f5a3e; color: #fff; }
.domin-chk { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: .95rem; cursor: pointer; }
.domin-chk input { width: 22px; height: 22px; accent-color: #1f5a3e; flex: none; }
.domin-box .btn.ink { background: #1f5a3e; border-color: #173d2b; }
.domin-box .btn.red { background: #fff; }
.domin-best, .domin-stat { color: #1f5a3e; }
.domin-stat:empty { display: none; }
.domin-rules { background: #fbfdf8; border: 1.5px dashed #3c8d63; border-radius: 14px; padding: 12px 18px; }
.domin-rules summary { font-family: var(--f-hand); font-size: 1.4rem; line-height: 1.4; color: #1f5a3e; cursor: pointer; min-height: 40px; }
.domin-rules p, .domin-rules li { font-size: .95rem; }
.domin-rules ul { padding-left: 1.2em; }
.domin-note { color: var(--muted); font-size: .86rem !important; }
.domin-resume { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; padding: 12px 14px; background: #fff3c4; border: 2.5px solid #e0a400; border-radius: 14px; }
.domin-resume > div:first-child { display: grid; gap: 2px; min-width: 0; }
.domin-resume b { font: 400 1.35rem/1.3 var(--f-hand); color: #1f5a3e; }
.domin-resume span { font-size: .88rem; color: #24513b; }
.domin-resume-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.domin-resume .btn.ink { background: #1f5a3e; border-color: #173d2b; }

/* ================= Màn chơi ================= */
.domin-play { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.domin-play > * { width: 100%; }
.domin-bar { display: flex; align-items: center; gap: 8px; min-width: 0; color: #173d2b; }
.domin-back { font: 1.7rem/1 var(--f-hand); color: #173d2b; background: none; border: 0; padding: 2px 8px 2px 0; cursor: pointer; min-width: 40px; min-height: 40px; }
.domin-bt { flex: 1; min-width: 0; display: grid; }
.domin-bt b { font: 700 1.4rem/1.3 "Mali", var(--f-hand); color: #173d2b; }
.domin-sub { font-size: .8rem; line-height: 1.4; color: #24513b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.domin-icon { background: none; border: 0; font-size: 1.3rem; cursor: pointer; padding: 6px; min-width: 40px; min-height: 40px; }
.domin-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-radius: 12px; background: #fff3c4; border: 2px solid #e0a400; font-size: .95rem; }

/* Cửa sổ chương trình kiểu máy tính cũ */
.domin-win { width: auto !important; max-width: 100%; min-width: 0; justify-self: center; background: #c3c3c3; padding: 3px 6px 6px; border: 1px solid #1d1d1d;
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #7b7b7b, 0 10px 24px rgba(20, 50, 35, .3); display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
.domin-title { display: flex; align-items: center; gap: 6px; margin: 0 -3px; padding: 3px 6px; background: linear-gradient(90deg, #1f5a3e, #4f9d74); color: #fff; font: 700 .85rem/1.3 "Courier New", monospace; letter-spacing: .06em; }
.domin-ticon { width: 16px; height: 16px; display: block; background: #c3c3c3; border-radius: 2px; }
.domin-ticon .domin-svg { width: 100%; height: 100%; }
.domin-tdots { margin-left: auto; display: flex; gap: 3px; }
.domin-tdots i { width: 14px; height: 12px; background: #c3c3c3; box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #555; display: block; }
.domin-panel { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 6px; box-shadow: inset 2px 2px 0 #7b7b7b, inset -2px -2px 0 #fff; min-width: 0; }
.domin-led { background: #140b0b; padding: 1px 4px; box-shadow: inset 1px 1px 0 #555, inset -1px -1px 0 #fff; flex: none; }
.domin-ledv { display: block; font: 700 1.65rem/1.1 "Courier New", ui-monospace, monospace; color: #ff2a1a; letter-spacing: .02em; text-shadow: 0 0 6px rgba(255, 40, 20, .55); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.domin-face { width: 42px; height: 42px; flex: none; padding: 4px; background: #c3c3c3; border: 1px solid #7b7b7b; box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #7b7b7b; cursor: pointer; display: grid; }
.domin-face:active { box-shadow: inset 2px 2px 0 #7b7b7b; padding: 5px 3px 3px 5px; }
.domin-face .domin-svg { width: 100%; height: 100%; }
.domin-vface { cursor: default; }
.domin-field2 { box-shadow: inset 3px 3px 0 #7b7b7b, inset -3px -3px 0 #fff; padding: 3px; min-width: 0; }
.domin-scroll { overflow-x: auto; overflow-y: hidden; max-width: 100%; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.domin-grid { display: grid; width: max-content; margin: 0 auto; --c: 30px; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* Ô */
.domin-c { width: var(--c); height: var(--c); padding: 0; margin: 0; border: 0; border-radius: 0; background: #c3c3c3; cursor: pointer; display: grid; place-items: center;
  box-shadow: inset max(2px, calc(var(--c) * .09)) max(2px, calc(var(--c) * .09)) 0 #fff, inset calc(-1 * max(2px, calc(var(--c) * .09))) calc(-1 * max(2px, calc(var(--c) * .09))) 0 #7b7b7b;
  font: 900 calc(var(--c) * .64)/1 "Arial Black", "Be Vietnam Pro", Arial, sans-serif; color: #000; -webkit-tap-highlight-color: transparent; position: relative; }
.domin-c:focus-visible { outline: 3px solid #1f5a3e; outline-offset: -3px; z-index: 2; }
.domin-c b { font: inherit; }
.domin-o, .domin-pressed { background: #bdbdbd; box-shadow: inset 1px 1px 0 #8f8f8f; cursor: default; }
.domin-o.domin-n1, .domin-o.domin-n2, .domin-o.domin-n3, .domin-o.domin-n4, .domin-o.domin-n5, .domin-o.domin-n6, .domin-o.domin-n7, .domin-o.domin-n8 { cursor: pointer; }
.domin-n1 { color: #0000f0; } .domin-n2 { color: #007b00; } .domin-n3 { color: #e00000; } .domin-n4 { color: #00007b; }
.domin-n5 { color: #7b0000; } .domin-n6 { color: #007b7b; } .domin-n7 { color: #000; } .domin-n8 { color: #6b6b6b; }
.domin-boom { background: #ff2a1a; }
.domin-wrong { background: #bdbdbd; }
.domin-hint { box-shadow: inset 0 0 0 3px #ffc400, inset 4px 4px 0 #fff, inset -4px -4px 0 #7b7b7b; background: #fff1a8; }
@media (prefers-reduced-motion: no-preference) { .domin-hint { animation: domin-glow 1s ease-in-out infinite; } }
@keyframes domin-glow { 50% { background: #ffd84a; } }
.domin-aim { background: #ffe36e; }
.domin-o.domin-aim { background: #f2dc8a; }
.domin-last { outline: 2px dashed #1d1d1d; outline-offset: -4px; }
.domin-own0 { background: #f3cbc5; }
.domin-own1 { background: #c8d7f5; }
.domin-mine { background: #bdbdbd; }
.domin-flagmode .domin-c:not(.domin-o) { cursor: crosshair; }
@media (prefers-reduced-motion: no-preference) {
  .domin-shake { animation: domin-shake .45s ease-out; }
  .domin-blast::after { content: ""; position: absolute; inset: -60%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 230, 120, .95) 0 20%, rgba(255, 110, 30, .75) 35%, rgba(255, 60, 20, 0) 68%); animation: domin-blast .6s ease-out forwards; pointer-events: none; z-index: 3; }
  .domin-pop .domin-svg { animation: domin-pop .45s ease-out; }
}
@keyframes domin-shake { 0%, 100% { transform: none; } 20% { transform: translate(-5px, 2px); } 40% { transform: translate(5px, -2px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(2px, 0); } }
@keyframes domin-blast { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes domin-pop { 0% { transform: scale(.2); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* Đối kháng: hàng người chơi trong khung */
.domin-vs .domin-panel { gap: 6px; }
.domin-pl { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 1 1 0; padding: 3px 5px; border: 2px solid transparent; border-radius: 3px; }
.domin-pl1 { flex-direction: row-reverse; text-align: right; }
.domin-pl.on { border-color: #1d1d1d; background: #fff8c8; }
.domin-pl.win { background: #d6f2d6; }
.domin-plflag { width: 22px; height: 22px; flex: none; }
.domin-plflag .domin-svg { width: 100%; height: 100%; }
.domin-plname { font: 600 .82rem/1.25 var(--f-body); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.domin-plname em { font-style: normal; font-weight: 400; color: #444; }
.domin-led-s .domin-ledv { font-size: 1.35rem; min-width: 2ch; }

/* Dưới bàn */
.domin-status { margin: 0; min-height: 1.4em; font: 400 1.2rem/1.35 var(--f-hand); color: #173d2b; text-align: center; max-width: 640px; background: rgba(251, 253, 248, .82); border-radius: 12px; padding: 4px 12px; }
.domin-status:empty { background: none; }
.domin-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; max-width: 640px; }
.domin-tools .btn { background: #fff; }
.domin-tools .btn.ink { background: #1f5a3e; border-color: #173d2b; color: #fff; }
.domin-tools .btn:disabled { opacity: .5; cursor: default; }
.domin-mode { display: inline-flex; border: 2px solid #1f5a3e; border-radius: 999px; overflow: hidden; }
.domin-mode button { font: 600 .92rem/1.2 var(--f-body); min-height: 42px; padding: 0 14px; border: 0; background: #fff; color: #1f5a3e; cursor: pointer; }
.domin-mode button[aria-checked="true"] { background: #1f5a3e; color: #fff; }
.domin-zoom { display: inline-flex; gap: 4px; }
.domin-zoom .btn { min-width: 44px; font-size: 1.1rem; }
.domin-goal { flex: 1 0 100%; margin: 0; text-align: center; font-size: .9rem; color: #173d2b; }
.domin-goal span { background: rgba(251, 253, 248, .82); border-radius: 999px; padding: 2px 10px; }
.domin-emos { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.domin-emo { font: 500 .85rem var(--f-body); padding: .4em .8em; min-height: 36px; border-radius: 999px; border: 1.5px solid #3c8d63; background: #fff; color: #1f5a3e; cursor: pointer; }
.domin-result .res-card { border-color: #1f5a3e; }
@media (max-width: 420px) {
  .domin-h1 { font-size: 2.2rem; }
  .domin-ledv { font-size: 1.4rem; }
  .domin-led-s .domin-ledv { font-size: 1.2rem; }
  .domin-face { width: 38px; height: 38px; }
  .domin-plname { font-size: .76rem; }
  .domin-win { padding: 3px 4px 4px; }
}
