/* Cộng trừ: hai nhóm hình (hoặc một nhóm có hình bị gạch), phép tính to, ba ô đáp án. Tiền tố gct- (gm- đã dùng ở game-memory/game-music) */
body[data-scene="cong-tru"] { --sky1: #8F7BFF; --sky2: #E4DCFF; }

/* --av: chiều cao còn lại cho khu chơi (đã trừ thanh trên, câu hỏi của Gấu Con, hàng chấm tiến độ) */
.gct { --av: calc(var(--vh) - var(--over) - 40px); --gp: clamp(8px, 2.2vh, 20px);
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "g" "e" "o"; justify-items: center; align-content: center; gap: var(--gp); width: 100%; }
.gct-groups { grid-area: g; display: flex; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 18px); width: 100%; height: clamp(110px, calc(var(--av) * .42), 300px); }
.gct-eq { grid-area: e; }
.gct-opts { grid-area: o; }

/* nhóm hình: thẻ trắng viền màu, bấm để đếm to */
.gct-grp { --c: var(--blue); flex: 1 1 0; min-width: 0; max-width: 300px; height: 100%; padding: 0; display: block; background: #fff; border: 5px solid var(--c); border-radius: 22px;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 60%, #000), 0 10px 14px rgba(30, 42, 94, .22); transition: transform .1s; }
.gct-grp:active { transform: translateY(3px); }
.gct-sub .gct-grp { max-width: 520px; }
.gct-in { display: block; width: 100%; height: 100%; container-type: size; }
.gct-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), auto); justify-content: center; align-content: center; gap: .06em; width: 100%; height: 100%;
  font-size: clamp(20px, 9vw, 50px); /* máy cũ chưa có đơn vị cqw */
  font-size: min(calc(84cqw / var(--cols, 3)), calc(80cqh / var(--rows, 2)), 110px); }
.gct-it { position: relative; display: grid; place-items: center; line-height: 1; }
.gct-it .emo { display: block; }
.gct-it > b { display: none; position: absolute; right: -.04em; bottom: -.04em; place-items: center; min-width: 1.5em; height: 1.5em; border-radius: 50%; padding: 0 .1em; box-sizing: border-box;
  background: var(--navy, #1E2A5E); color: #fff; border: .1em solid #fff; font: 700 .34em/1 var(--font-letter); }
.gct-it.gct-on { animation: gct-count .5s; }
.gct-it.gct-on > b { display: grid; }
@keyframes gct-count { 0% { transform: scale(1); } 40% { transform: scale(1.35) rotate(-6deg); } 100% { transform: scale(1); } }

/* dấu + giữa hai nhóm */
.gct-sign { flex: none; font: 700 clamp(30px, min(9vw, calc(var(--av) * .12)), 72px)/1 var(--font-letter); color: var(--navy, #1E2A5E); text-shadow: 0 .04em 0 #fff; }

/* hình bị gạch: mờ đi, có vạch đỏ chéo; trả lời đúng thì bay đi */
.gct-gone .emo { opacity: .4; filter: grayscale(.9); }
.gct-gone::after { content: ''; position: absolute; left: 2%; right: 2%; top: 50%; height: .11em; margin-top: -.055em; border-radius: 99px; background: var(--red, #FF5A5F); transform: rotate(-38deg); box-shadow: 0 0 0 .02em #fff; }
.gct-solved .gct-gone { animation: gct-fly .9s ease-in forwards; }
@keyframes gct-fly { 0% { transform: none; opacity: 1; } 100% { transform: translate(.3em, -1.8em) rotate(28deg) scale(.4); opacity: 0; } }

/* phép tính */
.gct-eq { --es: clamp(32px, min(11vw, calc(var(--av) * .13)), 84px); display: flex; align-items: center; justify-content: center; gap: .28em; max-width: 100%; box-sizing: border-box;
  padding: .08em .5em .12em; border-radius: 999px; background: rgba(255, 255, 255, .88); box-shadow: 0 4px 0 rgba(30, 42, 94, .16);
  font: 700 var(--es)/1.1 var(--font-letter); color: var(--navy, #1E2A5E); }
.gct-op { color: var(--purple, #8F7BFF); }
.gct-ans { display: inline-grid; place-items: center; min-width: 1.05em; border-bottom: .08em dashed var(--pink, #FF86B9); color: var(--pink, #FF86B9); }
.gct-solved .gct-ans { border-bottom-style: solid; border-color: var(--green, #35C48B); color: color-mix(in srgb, var(--green, #35C48B) 70%, var(--navy, #1E2A5E)); }
.gct-ans.gct-pop { animation: gct-pop .5s; }
@keyframes gct-pop { 0% { transform: scale(.3); } 60% { transform: scale(1.35); } 100% { transform: none; } }

/* ba đáp án: ô số lớn (--t: cạnh một ô) */
.gct-opts { --g: clamp(10px, 3.4vw, 24px); --t: min(calc((100vw - 32px - 2 * var(--g)) / 3), calc(var(--av) * .24), 150px);
  display: grid; grid-template-columns: repeat(3, var(--t)); gap: var(--g); justify-content: center; }
.gct-opts .block { width: var(--t); font-size: calc(var(--t) * .6); }
.gct-opts .no { animation: wobble .45s; }
.gct-opts .gct-yes { background: #E7FBEA; animation: bump .4s; }

/* điện thoại nằm ngang: nhóm hình bên trái, phép tính và đáp án bên phải */
@media (max-height: 560px) and (min-aspect-ratio: 5/4) {
  .gct { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "g e" "g o"; column-gap: 18px; align-content: center; justify-items: center; }
  .gct-groups { height: clamp(100px, calc(var(--av) * .94), 300px); }
  .gct-opts { --t: min(calc((45vw - 2 * var(--g)) / 3), calc(var(--av) * .5), 110px); }
  .gct-eq { --es: clamp(30px, calc(var(--av) * .24), 60px); }
}

/* thẻ trang chủ */
.card .art > .gct-mini { font: 700 1.1em/1 var(--font-letter); color: #fff; text-shadow: 0 .06em 0 rgba(30, 42, 94, .45); }

@media (prefers-reduced-motion: reduce) { .gct-it.gct-on, .gct-solved .gct-gone, .gct-ans.gct-pop, .gct-opts .gct-yes { animation: none; } .gct-solved .gct-gone { opacity: 0; } }
