/* ===== KABOOM — CI เติมเกมออนไลน์.com (กรมท่า/ดำ + ฟ้านีออน) × แดงระเบิด ===== */
#kb { background: radial-gradient(ellipse at 50% 45%, rgba(239, 68, 68, 0.16), transparent 55%), radial-gradient(ellipse at 50% 0%, rgba(43, 127, 255, 0.25), transparent 60%), #0b1020; overflow: hidden; }
#kb::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.07; background: repeating-linear-gradient(115deg, #60a5fa 0 2px, transparent 2px 70px); }
#kb .topbar { z-index: 6; }
#kb .topbar .title { background: linear-gradient(180deg, #fff, #fca5a5 55%, #ef4444); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kb-lobby { flex: 1; overflow: auto; display: flex; flex-direction: column; align-items: center; padding: 12px 16px 24px; gap: 14px; position: relative; z-index: 2; }
.kb-game { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; z-index: 2; }
.em.art { image-rendering: auto; }

/* ----- การ์ด ----- */
.kc { --kc: #ef4444; position: relative; width: 92px; aspect-ratio: 0.7; flex: none; border-radius: 12px; padding: 3px; cursor: pointer; container-type: inline-size;
  background: linear-gradient(160deg, color-mix(in srgb, var(--kc) 85%, #fff), var(--kc) 45%, color-mix(in srgb, var(--kc) 55%, #000)); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.3); transition: transform 0.18s cubic-bezier(0.2, 1.4, 0.4, 1), box-shadow 0.2s; }
.kc-in { position: relative; height: 100%; border-radius: 9px; overflow: hidden; display: flex; flex-direction: column; align-items: center; padding: 5px 4px 4px;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--kc) 40%, #13254a), #0b1020 75%); }
.kc-in::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(115deg, rgba(96, 165, 250, 0.06) 0 2px, transparent 2px 12px); }
.kc-n { font-family: 'Kanit'; font-weight: 800; font-size: clamp(9px, 15cqw, 15px); letter-spacing: 0.5px; color: #fff; text-shadow: 0 0 8px var(--kc), 0 1px 0 #000; }
.kc-art { flex: 1; min-height: 0; display: grid; place-items: center; }
.kc-art .em { width: clamp(30px, 74cqw, 92px); height: auto; aspect-ratio: 1; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.6)); }
.kc-d { font-size: clamp(6px, 9.5cqw, 10px); line-height: 1.15; text-align: center; color: #cbd5e1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kc.k-bomb { animation: bomb-pulse 1.2s ease-in-out infinite; }
.kc.k-bomb .kc-in { background: radial-gradient(circle at 50% 42%, #7f1d1d, #0b1020 75%); }
@keyframes bomb-pulse { 50% { box-shadow: 0 0 22px 4px rgba(239, 68, 68, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.3); } }
.kc.back { --kc: #2b7fff; }
.kc.back .kc-in { justify-content: center; gap: 4px; background: radial-gradient(circle at 50% 40%, #1a4f9c, #0b1020 75%); }
.kc.ghost { background: transparent; border: 2px dashed rgba(148, 163, 184, 0.25); box-shadow: none; }
.kc.mini { width: 58px; }
.kc.mini .kc-d { display: none; }
.kc.big { width: min(190px, 52vw); margin: 0 auto; cursor: default; animation: card-hover 3s ease-in-out infinite; }
.kc.cine { width: clamp(150px, 40vw, 200px); }
.kc.fan { width: 74px; }
@keyframes card-hover { 50% { transform: translateY(-6px) rotate(1deg); } }

/* ----- ผู้เล่นอื่น ----- */
.kb-opps { display: flex; gap: 8px; padding: 10px 12px 4px; overflow-x: auto; scrollbar-width: none; flex: none; justify-content: center; }
#kb .opp { min-width: 74px; }
#kb .opp.turn { transform: translateY(2px) scale(1.05); border-color: #ef4444; box-shadow: 0 0 0 2px #ef4444, 0 0 22px -2px #ef4444; --cur: #ef4444; }
#kb .opp.dead { opacity: 0.45; filter: grayscale(1); }
#kb .opp .x2 { position: absolute; top: -8px; right: -6px; padding: 1px 6px; border-radius: 8px; font-size: 11px; font-weight: 800; background: linear-gradient(135deg, #dc2626, #f97316); animation: pulse 0.8s infinite; }

/* ----- โต๊ะ ----- */
.kb-table { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(22px, 8vw, 60px); padding: 8px; }
.kb-table::before { content: ""; position: absolute; width: min(86vw, 520px); aspect-ratio: 1.6; border-radius: 50%; background: radial-gradient(ellipse, rgba(43, 127, 255, 0.18), rgba(11, 16, 32, 0) 70%); border: 1px solid rgba(96, 165, 250, 0.15); pointer-events: none; }
.kb-deck { --danger: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; color: inherit; font: inherit; }
.kb-deck .stack { position: relative; width: clamp(84px, 22vw, 112px); aspect-ratio: 0.7; }
.kb-deck .stack .kc { position: absolute; inset: 0; width: 100%; }
.kb-deck .stack .kc:nth-child(1) { transform: translate(6px, 6px) rotate(4deg); filter: brightness(0.6); }
.kb-deck .stack .kc:nth-child(2) { transform: translate(3px, 3px) rotate(2deg); filter: brightness(0.8); }
.kb-deck .stack::after { content: ""; position: absolute; inset: -14px; border-radius: 22px; pointer-events: none; box-shadow: 0 0 calc(10px + var(--danger) * 40px) calc(var(--danger) * 10px) rgba(239, 68, 68, calc(0.25 + var(--danger) * 0.6)); animation: danger 1.4s ease-in-out infinite; }
.kb-deck.hot .stack::after { animation-duration: 0.6s; }
@keyframes danger { 50% { opacity: 0.45; } }
.kb-deck .cnt { position: absolute; top: -10px; right: -12px; z-index: 3; min-width: 30px; padding: 2px 8px; border-radius: 99px; font-family: 'Kanit'; font-size: 15px; background: #0b1020; border: 2px solid #60a5fa; }
.kb-deck .odds { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: rgba(0, 0, 0, 0.45); white-space: nowrap; }
.kb-deck .odds b { color: #fca5a5; }
.kb-deck.can .stack { cursor: pointer; animation: deck-can 1.4s ease-in-out infinite; }
@keyframes deck-can { 50% { transform: translateY(-5px); } }
.kb-deck.shuffling .stack .kc { animation: shuffle-k 0.7s ease-in-out; }
.kb-deck.shuffling .stack .kc:nth-child(2) { animation-delay: 0.08s; } .kb-deck.shuffling .stack .kc:nth-child(3) { animation-delay: 0.16s; }
@keyframes shuffle-k { 30% { translate: -40px 0; rotate: -14deg; } 60% { translate: 40px 0; rotate: 14deg; } }
.kb-discard { position: relative; width: clamp(84px, 22vw, 112px); aspect-ratio: 0.7; }
.kb-discard .kc { position: absolute; inset: 0; width: 100%; }
.kb-discard .kc.under:nth-last-child(2) { transform: rotate(-10deg); filter: brightness(0.6); }
.kb-discard .kc.under:nth-last-child(3) { transform: rotate(8deg); filter: brightness(0.45); }
.kb-discard .kc.under:nth-last-child(4) { transform: rotate(-4deg); filter: brightness(0.35); }
.kb-discard .kc.top { animation: drop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }

/* ----- การ์ดรอผล + ไม่! ----- */
.kb-pending { position: relative; z-index: 4; margin: 0 12px 6px; padding: 8px 10px; border-radius: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(13, 26, 54, 0.95); border: 1px solid #60a5fa; box-shadow: 0 0 22px -6px #2b7fff; animation: banner-in 0.3s; }
.kb-pending.cancelled { border-color: #ef4444; box-shadow: 0 0 22px -6px #ef4444; }
.kb-pending .pd-txt { flex: 1; font-size: 13px; }
.kb-pending .pd-txt b { color: #93c5fd; }
.nope-chip { margin-left: 6px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.pd-bar { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.pd-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ef4444, #fbbf24); transform-origin: left; }
.nope-btn { padding: 10px 18px; font-size: 18px; font-weight: 800; animation: pulse 0.6s infinite; box-shadow: 0 0 24px rgba(239, 68, 68, 0.8); }
.kb-nope-stamp { position: fixed; left: 50%; top: 42%; z-index: 80; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; animation: stamp-in 1.1s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
.kb-nope-stamp .em { width: 120px; height: 120px; }
.kb-nope-stamp b { font-family: 'Kanit'; font-size: 64px; line-height: 1; color: #fff; -webkit-text-stroke: 3px #7f1d1d; text-shadow: 0 0 30px #ef4444; }
.kb-nope-stamp small { font-weight: 700; color: #fecaca; }
@keyframes stamp-in { 0% { transform: translate(-50%, -50%) scale(3) rotate(-20deg); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1) rotate(-8deg); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.05) rotate(-8deg); opacity: 0; } }
.kb-wait { margin: 0 12px 6px; padding: 8px 12px; border-radius: 12px; text-align: center; font-size: 13px; background: rgba(34, 197, 94, 0.12); border: 1px dashed rgba(74, 222, 128, 0.5); animation: pulse 1.6s infinite; }

/* ----- แถบตา / มือ / ปุ่ม ----- */
.kb-turn { display: flex; align-items: center; gap: 8px; margin: 0 12px 6px; padding: 7px 12px; border-radius: 14px; font-size: 13px; background: rgba(13, 26, 54, 0.92); border: 1px solid rgba(96, 165, 250, 0.3); }
.kb-turn .tt { flex: 1; }
.kb-turn .tt b { color: #fca5a5; }
.kb-turn.mine { background: linear-gradient(90deg, rgba(239, 68, 68, 0.3), rgba(43, 127, 255, 0.3)); border-color: #ef4444; animation: banner-in 0.4s; }
.kb-turn .x2 { margin-left: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 800; background: #dc2626; }
.kb-clock { min-width: 32px; padding: 2px 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.45); font-family: 'Kanit'; text-align: center; }
.kb-clock.warn { background: #dc2626; animation: pulse 0.6s infinite; }
.kb-hand { display: flex; gap: 6px; padding: 14px 12px 6px; overflow-x: auto; overflow-y: visible; scrollbar-width: none; flex: none; min-height: 150px; }
.kb-hand .kc { width: clamp(78px, 20vw, 100px); }
.kb-hand .kc:hover { transform: translateY(-6px); }
.kb-hand .kc.sel { transform: translateY(-14px); box-shadow: 0 0 0 3px #fde047, 0 0 26px rgba(253, 224, 71, 0.8); }
.kb-hand .kc.fresh { animation: flip-in 0.55s cubic-bezier(0.2, 1.2, 0.4, 1) backwards; }
.kb-hand .spectate { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; }
.kb-hand .spectate .em { width: 34px; height: 34px; }
.kb-bar { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 4px 12px calc(10px + env(safe-area-inset-bottom)); min-height: 52px; }
.kb-bar .btn { padding: 11px 18px; font-size: 15px; }
.kb-bar .draw-btn { font-size: 16px; font-weight: 800; }
.kb-bar .why { font-size: 12px; color: var(--muted); text-align: center; width: 100%; }
.kb-bar .why b { color: #fca5a5; }

/* ----- โมดัล ----- */
.kb-sheet h2 { margin: 6px 0 10px; }
.kb-big { margin: 4px 0 10px; }
.kb-targets { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 10px 0; }
.tgt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(96, 165, 250, 0.25); color: inherit; font: inherit; }
.tgt:hover { border-color: #ef4444; background: rgba(239, 68, 68, 0.12); }
.tgt small { color: var(--muted); }
.kb-names { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; max-height: 50vh; overflow: auto; }
.kb-names button { background: none; border: 0; padding: 0; }
.kb-names button:hover .kc { transform: translateY(-4px); }
.kb-future { display: flex; gap: 10px; justify-content: center; margin: 12px 0; }
.kb-future .fut { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: flip-in 0.6s cubic-bezier(0.2, 1.2, 0.4, 1) backwards; }
.kb-future .kc { width: clamp(80px, 24vw, 104px); }
.kb-range { width: 100%; accent-color: #ef4444; margin: 10px 0 4px; }
.kb-pos { text-align: center; font-weight: 700; color: #fca5a5; min-height: 22px; }
.kc.ticking { animation: tick-shake 0.5s ease-in-out infinite; }
@keyframes tick-shake { 25% { rotate: -3deg; } 75% { rotate: 3deg; } }
.kb-help { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.kb-help > div { display: flex; align-items: center; gap: 10px; }
.kb-help .kc { width: 46px; }
.kb-help span { font-size: 13px; }
.kb-howto .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }

/* ----- ล็อบบี้ ----- */
.kb-hero { text-align: center; }
.kb-bomb { position: relative; width: 96px; margin: 0 auto -4px; animation: bomb-bob 2.4s ease-in-out infinite; }
.kb-bomb .em { width: 100%; height: auto; filter: drop-shadow(0 0 22px rgba(239, 68, 68, 0.6)); }
@keyframes bomb-bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.kb-logo { font-family: 'Kanit'; font-weight: 800; font-size: clamp(50px, 15vw, 80px); line-height: 1; background: linear-gradient(180deg, #fff, #fca5a5 50%, #ef4444); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #7f1d1d) drop-shadow(0 0 26px rgba(239, 68, 68, 0.6)); }
.kb-hero p { color: #cbd5e1; margin: 8px auto; max-width: 420px; font-size: 14px; }
.kb-hero p b { color: #fca5a5; }
.kb-fan { display: flex; justify-content: center; margin-top: 6px; }
.kb-fan .kc { margin: 0 -8px; animation: deal 0.5s cubic-bezier(0.2, 1.2, 0.4, 1) backwards; }
.kb-fan .f0 { rotate: -16deg; translate: 0 14px; } .kb-fan .f1 { rotate: -8deg; translate: 0 4px; animation-delay: 0.06s; } .kb-fan .f2 { z-index: 2; scale: 1.12; animation-delay: 0.12s; }
.kb-fan .f3 { rotate: 8deg; translate: 0 4px; animation-delay: 0.18s; } .kb-fan .f4 { rotate: 16deg; translate: 0 14px; animation-delay: 0.24s; }
.kb-seats { grid-template-columns: repeat(5, minmax(0, 1fr)); width: min(480px, 100%); }

/* ----- เอฟเฟกต์ระเบิด ----- */
.kb-blast { position: fixed; inset: 0; z-index: 74; pointer-events: none; background: radial-gradient(circle at 50% 45%, #fff 0%, #fde047 12%, #f97316 30%, rgba(239, 68, 68, 0.7) 50%, transparent 75%); animation: blast 1.1s ease-out forwards; }
@keyframes blast { 0% { opacity: 0; transform: scale(0.2); } 10% { opacity: 1; } 100% { opacity: 0; transform: scale(2.2); } }
.kb-fly { position: fixed; z-index: 66; pointer-events: none; will-change: transform; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.6)); }
.kb-fly .kc { width: 100%; }
.game-card.kb { background: radial-gradient(circle at 80% 10%, rgba(239, 68, 68, 0.5), transparent 50%), linear-gradient(160deg, #13254a, #0b1020); }
.game-card .gi img.art { width: 72px; height: 72px; }

@media (min-width: 900px) {
  .kb-hand { justify-content: center; }
  .kb-hand .kc { width: 108px; }
}
.game-card .gi-uno .card { --cw: 52px; transform: rotate(10deg); }
/* การ์ดในฉากพิเศษ: กำหนดขนาดตายตัว (ชั้น cine-card หดตามเนื้อหา → container query คำนวณผิด) */
.cine-card .kc { width: 180px; height: 257px; aspect-ratio: auto; container-type: normal; }
.cine-card .kc .kc-n { font-size: 20px; }
.cine-card .kc .kc-art .em { width: 140px; }
.cine-card .kc .kc-d { font-size: 12px; }
/* หน้าเลือกเกม: 4 เกม → 2 คอลัมน์ เริ่มจากบนสุด (ไม่ตัดโลโก้) */
#picker .body { justify-content: flex-start; }
.game-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(640px, 100%); }
.game-card { min-height: 150px; padding: 16px 14px; }
.game-card h2 { font-size: clamp(18px, 5vw, 26px); }
.game-card p { font-size: 12px; }
.game-card .gi { top: 8px; right: 10px; font-size: 48px; }
.game-card .gi img.art { width: 58px; height: 58px; }
.game-card .gi-uno .card { --cw: 42px; }
@media (min-width: 900px) { .game-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(1000px, 100%); } }
