/* minigame.vn — khung Arcade dùng chung cho 4 game demo */
.arcade {
	--a-bg: #4B1FA8; --a-bg2: #6A3BD6; --a-fg: #fff; --a-accent: #FFC22E; --a-accent-ink: #1C1433;
	--a-c1: #FF3D7F; --a-c2: #4B1FA8; --a-c3: #FFC22E; --a-c4: #16B989;
	--a-c1-ink: #fff; --a-c2-ink: #fff; --a-c3-ink: #1C1433; --a-c4-ink: #fff;
	--a-radius: 28px;
	position: relative; isolation: isolate;
	border-radius: var(--a-radius); background: var(--a-bg); color: var(--a-fg);
	box-shadow: 0 30px 60px -30px rgba(28,20,51,.55), 0 0 0 2px var(--ink, #1C1433);
	overflow: hidden;
}
.arcade-bar { position: relative; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; background: rgba(0,0,0,.18); border-bottom: 1px solid rgba(255,255,255,.12); }
.arcade[data-theme="hong"] .arcade-bar { background: rgba(255,255,255,.55); border-bottom-color: rgba(59,21,48,.12); }
.arcade-themes { display: flex; gap: 6px; }
.arcade-sw { width: 30px; height: 30px; padding: 0; border: 3px solid var(--ring); border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 2px rgba(255,255,255,.55); transition: transform .12s, box-shadow .12s; }
.arcade-sw:hover { transform: scale(1.1); }
.arcade-sw.on { box-shadow: 0 0 0 3px var(--a-accent), 0 0 0 5px rgba(0,0,0,.35); transform: scale(1.08); }
.arcade-theme-name { font-weight: 700; font-size: .9rem; opacity: .9; }
.arcade-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.arcade-tool { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1.5px solid rgba(255,255,255,.35); border-radius: 999px; background: rgba(255,255,255,.1); color: inherit; font: 700 .86rem var(--body, system-ui); cursor: pointer; }
.arcade-tool:hover { background: rgba(255,255,255,.22); }
.arcade[data-theme="hong"] .arcade-tool { border-color: rgba(59,21,48,.25); background: rgba(255,255,255,.6); }
.arcade-tool span[aria-hidden] { font-size: 1rem; line-height: 1; }
@media (max-width: 640px) {
	.arcade-tool-text { display: none; }
	.arcade-tool { width: 38px; padding: 0; justify-content: center; }
	.arcade-theme-name { display: none; }
	.arcade-sw { width: 26px; height: 26px; }
}
.arcade-custom { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; padding: 7px 12px; background: var(--a-accent); color: var(--a-accent-ink); font-weight: 700; font-size: .86rem; }
.arcade-custom button { padding: 3px 10px; border: 1.5px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: 700 .8rem var(--body, system-ui); cursor: pointer; }

.arcade-stage {
	position: relative; z-index: 1; min-height: 560px; padding: 28px 20px 32px;
	background: radial-gradient(circle at 50% 30%, var(--a-bg2), var(--a-bg) 66%);
	display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.arcade-stage::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .18; pointer-events: none;
	background-image: radial-gradient(circle at 12% 18%, var(--a-c1) 0 6px, transparent 7px), radial-gradient(circle at 88% 24%, var(--a-c3) 0 5px, transparent 6px), radial-gradient(circle at 80% 86%, var(--a-c4) 0 7px, transparent 8px), radial-gradient(circle at 16% 80%, var(--a-accent) 0 5px, transparent 6px); }
@media (max-width: 640px) { .arcade-stage { min-height: 520px; padding: 20px 12px 24px; } }

/* Hộp phần thưởng */
.arcade-reward { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 18px; background: rgba(12,6,30,.55); backdrop-filter: blur(3px); }
.arcade-reward-card { width: min(100%, 420px); padding: 28px 24px 22px; border-radius: 24px; background: #fff; color: #1C1433; text-align: center; box-shadow: 8px 8px 0 var(--a-accent); animation: ar-pop .38s cubic-bezier(.2,1.4,.4,1); }
@keyframes ar-pop { from { transform: scale(.82); opacity: 0; } to { transform: none; opacity: 1; } }
.ar-kicker { margin: 0; color: #6E6688; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.ar-title { margin: 6px 0 6px; font-family: var(--display, system-ui); font-weight: 800; font-size: clamp(1.9rem, 6vw, 2.5rem); line-height: 1.05; color: #E0225F; overflow-wrap: anywhere; }
.is-lose .ar-title { color: #463D5E; }
.ar-sub { margin: 0 0 12px; color: #463D5E; }
.ar-code { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; padding: 10px 12px; border: 2px dashed #DDD4F3; border-radius: 12px; text-align: left; }
.ar-code span { font-size: .8rem; color: #6E6688; }
.ar-code b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; letter-spacing: .06em; }
.ar-code button { margin-left: auto; padding: 6px 12px; border: 0; border-radius: 999px; background: #F1ECFF; color: #4B1FA8; font: 700 .82rem var(--body, system-ui); cursor: pointer; }
.ar-note { margin: 0 0 12px; font-size: .86rem; color: #6E6688; }
.ar-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.ar-btn1 { background: var(--a-accent); border-color: #1C1433; color: var(--a-accent-ink); box-shadow: 0 4px 0 #1C1433; }
.ar-btn1:hover { color: var(--a-accent-ink); }
.ar-btn2 { border-color: #DDD4F3; }

/* Tuỳ chỉnh */
.arcade-editor { position: absolute; top: 0; right: 0; bottom: 0; z-index: 7; width: min(100%, 460px); overflow: auto; padding: 18px 18px 24px; background: #fff; color: #1C1433; box-shadow: -18px 0 40px -20px rgba(0,0,0,.5); animation: ae-in .22s ease-out; }
@keyframes ae-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.ae-head { display: flex; align-items: center; justify-content: space-between; }
.ae-title { margin: 0; font-family: var(--display, system-ui); font-weight: 800; font-size: 1.5rem; }
.ae-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #F1ECFF; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.ae-hint { margin: 4px 0 14px; color: #6E6688; font-size: .88rem; }
.ae-form { display: grid; gap: 14px; }
.ae-field { display: grid; gap: 4px; }
.ae-label { margin: 0; font-weight: 700; font-size: .92rem; }
.ae-form input:not([type=checkbox]), .ae-form select { width: 100%; min-width: 0; padding: 9px 10px; border: 2px solid #DDD4F3; border-radius: 10px; font: inherit; font-size: .93rem; color: #1C1433; background: #fff; }
.ae-form input:focus, .ae-form select:focus { outline: none; border-color: #4B1FA8; }
.ae-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ae-row { position: relative; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 40px 10px 10px; border: 2px solid #EEE9FA; border-radius: 12px; }
.ae-cell { display: grid; gap: 2px; flex: 1 1 90px; min-width: 0; }
.ae-cell.ae-wide { flex-basis: 100%; }
.ae-cell.ae-number { flex: 0 1 76px; }
.ae-cell.ae-checkbox { flex: 0 0 auto; align-content: end; justify-items: center; }
.ae-cell.ae-checkbox input { width: 20px; height: 20px; margin: 8px 0; accent-color: #4B1FA8; }
.ae-cap { font-size: .72rem; font-weight: 600; color: #6E6688; }
.ae-del { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: #FFE3EC; color: #A3123F; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.ae-add { justify-self: start; margin-top: 8px; padding: 7px 14px; border: 2px dashed #4B1FA8; border-radius: 999px; background: #fff; color: #4B1FA8; font: 700 .86rem var(--body, system-ui); cursor: pointer; }
.ae-err { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #FFE3EC; color: #A3123F; font-weight: 600; font-size: .9rem; }
.ae-actions { position: sticky; bottom: -24px; display: flex; gap: 8px; margin: 16px -18px -24px; padding: 14px 18px; background: #fff; border-top: 1px solid #EEE9FA; }
.ae-actions .btn { flex: 1; min-height: 46px; }

/* Toàn màn hình */
.arcade.is-full { position: fixed; inset: 0; z-index: 200; border-radius: 0; display: flex; flex-direction: column; }
.arcade.is-full .arcade-stage { flex: 1; }
body.arcade-lock { overflow: hidden; }
.arcade-confetti { position: absolute; inset: 0; z-index: 8; width: 100%; height: 100%; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .arcade-reward-card, .arcade-editor { animation: none; } }

/* Sửa chung: nút trong khung Tuỳ chỉnh không xuống dòng trên điện thoại; bóng nút rõ hơn trên nền Đen vàng */
.ae-actions { flex-wrap: wrap; }
.ae-actions .btn { flex: 1 1 auto; padding: 0 14px; white-space: nowrap; }
.arcade[data-theme="sang"] .vq-spin, .arcade[data-theme="sang"] .ar-btn1 { box-shadow: 0 5px 0 #000, 0 0 0 2px rgba(246,235,208,.4); }

/* Ô mã ưu đãi gọn trên màn hình hẹp */
@media (max-width: 420px) { .ar-code { flex-wrap: wrap; gap: 4px 10px; } .ar-code span { flex-basis: 100%; } .ar-code button { white-space: nowrap; } }

/* Hộp chia sẻ có mã QR */
.ar-share { position: relative; width: min(100%, 400px); max-height: calc(100% - 8px); overflow: auto; padding: 22px 22px 18px; }
.ar-share-title { margin: 0 0 4px; font-family: var(--display, system-ui); font-weight: 800; font-size: 1.5rem; color: #1C1433; }
.ar-x { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #F1ECFF; color: #4B1FA8; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.ar-qr { width: min(240px, 70%); margin: 6px auto 8px; padding: 6px; border-radius: 14px; border: 2px solid #1C1433; background: #fff; }
.ar-qr svg { display: block; width: 100%; height: auto; }
.ar-link { display: flex; gap: 6px; margin: 4px 0 6px; }
.ar-link input { flex: 1; min-width: 0; padding: 9px 10px; border: 1.5px solid #DDD4F3; border-radius: 10px; font: .82rem ui-monospace, Menlo, Consolas, monospace; color: #463D5E; background: #FBFAFF; }
.ar-link button { flex: none; padding: 0 14px; border: 0; border-radius: 10px; background: #F1ECFF; color: #4B1FA8; font: 700 .85rem var(--body, system-ui); cursor: pointer; }
.arcade.is-full .ar-share { max-height: 92vh; }
