:root {
  --red: #ec3b4c;
  --yellow: #ffbe2e;
  --green: #35b64a;
  --blue: #2b7cff;
  --ink: #241238;
  --cream: #fff7ec;
  --font: 'Itim', 'Noto Sans Thai', system-ui, sans-serif;
  --font-head: 'Mali', 'Itim', system-ui, sans-serif;
  --font-num: 'Fredoka', 'Itim', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--cream);
  background:
    radial-gradient(1200px 600px at 20% -5%, #5b3aa6 0%, transparent 55%),
    radial-gradient(1000px 700px at 100% 10%, #b8306a 0%, transparent 50%),
    linear-gradient(160deg, #2a1150 0%, #160a2e 60%, #0d0620 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  font-size: 17px;
  line-height: 1.35;
}

.hidden { display: none !important; }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(16px + var(--safe-t)) 18px calc(16px + var(--safe-b));
}

/* ============ ปุ่มใหญ่แบบกดสนุก ============ */
.big-btn {
  width: 100%;
  border: none;
  border-radius: 26px;
  padding: 18px 22px;
  font-family: var(--font-head);
  font-size: 22px;
  color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 8px 0 rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.35);
  transition: transform .07s ease, box-shadow .07s ease, filter .2s;
}
.big-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.35); }
.big-btn:disabled { filter: grayscale(.6) brightness(.7); cursor: not-allowed; }
.big-btn .bb-emoji { font-size: 26px; }
.big-btn.create { background: linear-gradient(135deg, #ff6a5a, #ff9f45); }
.big-btn.join { background: linear-gradient(135deg, #33c2d6, #4f7bff); border-radius: 22px; padding: 16px 18px; font-size: 19px; }

/* ปุ่มทั่วไป (lobby/win) */
.btn {
  border: none; border-radius: 999px; padding: 16px 30px;
  font-family: var(--font-head); font-size: 20px; color: #fff; cursor: pointer;
  box-shadow: 0 7px 0 rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.3);
  transition: transform .07s, box-shadow .07s, filter .2s;
}
.btn:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.3); }
.btn-primary { background: linear-gradient(135deg, #ff6a5a, #ffb648); }
.btn-ghost { background: rgba(255,255,255,.16); box-shadow: 0 5px 0 rgba(0,0,0,.22); }
.btn-danger { background: linear-gradient(135deg, #ff5a5a, #c0231f); }
.btn.full { width: 100%; margin-top: 12px; }
.btn:disabled { filter: grayscale(.6) brightness(.7); cursor: not-allowed; }
.link-btn { background: none; border: none; color: #ffd0e6; cursor: pointer; font-family: var(--font); font-size: 16px; text-decoration: underline; margin-top: 6px; }
.link-btn:active { transform: scale(.96); }

/* ============ หน้าแรก = จอไตเติลเกม ============ */
#screen-home { justify-content: center; gap: 4px; position: relative; overflow: hidden; }
.home-deco {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    radial-gradient(circle at 12% 22%, #ffffff22 0 3px, transparent 4px),
    radial-gradient(circle at 82% 14%, #ffffff18 0 5px, transparent 6px),
    radial-gradient(circle at 70% 82%, #ffffff14 0 4px, transparent 5px),
    radial-gradient(circle at 24% 78%, #ffffff1a 0 3px, transparent 4px);
}
.home-wrap { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 16px; z-index: 1; }

.logo-stack { display: flex; gap: 8px; margin-bottom: 2px; }
.logo-card {
  width: 62px; height: 84px; border-radius: 14px;
  font-family: var(--font-num); font-weight: 700; font-size: 44px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 4px solid #fff;
  box-shadow: 0 10px 22px rgba(0,0,0,.45), inset 0 3px 0 rgba(255,255,255,.35);
  text-shadow: 0 3px 0 rgba(0,0,0,.28);
  animation: floaty 3s ease-in-out infinite;
}
.logo-card.lc-red { background: var(--red); transform: rotate(-8deg); animation-delay: 0s; }
.logo-card.lc-yellow { background: var(--yellow); transform: rotate(4deg) translateY(-6px); animation-delay: .25s; }
.logo-card.lc-green { background: var(--green); transform: rotate(-3deg) translateY(-2px); animation-delay: .5s; }
.logo-card.lc-blue { background: var(--blue); transform: rotate(9deg); animation-delay: .75s; }
@keyframes floaty { 50% { translate: 0 -8px; } }

.tag { font-size: 19px; opacity: .92; text-align: center; margin-bottom: 6px; }

.name-line {
  width: 100%; display: flex; align-items: center; gap: 10px;
  border-bottom: 3px dashed rgba(255,255,255,.35); padding: 6px 4px;
}
.name-line .name-emoji { font-size: 24px; }
.name-line input {
  flex: 1; background: transparent; border: none; outline: none; color: #fff;
  font-family: var(--font); font-size: 22px; padding: 6px 0;
}
.name-line input::placeholder { color: rgba(255,255,255,.45); }

.or-line { width: 100%; text-align: center; position: relative; opacity: .7; margin: 2px 0; }
.or-line::before, .or-line::after {
  content: ''; position: absolute; top: 50%; width: 26%; height: 2px; background: rgba(255,255,255,.25);
}
.or-line::before { left: 0; } .or-line::after { right: 0; }
.or-line span { font-size: 16px; }

.join-line { width: 100%; display: flex; gap: 10px; }
.code-in {
  width: 118px; text-align: center; text-transform: uppercase; letter-spacing: 5px;
  font-family: var(--font-num); font-size: 24px; color: var(--ink);
  background: var(--cream); border: none; border-radius: 20px; outline: none;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.15);
}
.code-in::placeholder { color: #b9a; letter-spacing: 2px; }
.join-line .big-btn.join { flex: 1; }

.error { color: #ffd0d0; min-height: 22px; font-size: 17px; text-align: center; }

.support-link {
  margin-top: 4px; background: none; border: none; color: #ffd0e6; cursor: pointer;
  font-family: var(--font); font-size: 17px; text-decoration: underline; opacity: .9;
}
.support-link:active { transform: scale(.96); }
.support-inner .support-sub { opacity: .85; font-size: 16px; margin: 6px 0 16px; }
.qr-frame {
  background: #fff; padding: 14px; border-radius: 20px; display: inline-block;
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
}
.qr-frame img { display: block; width: 240px; height: 240px; image-rendering: pixelated; }
.pp-name { font-family: var(--font-head); font-size: 22px; margin-top: 14px; }
.pp-tag { opacity: .7; font-size: 15px; margin-bottom: 18px; }
.support-inner .btn-ghost { width: 100%; }

/* ============ ล็อบบี้ ============ */
#screen-lobby { justify-content: center; gap: 4px; }
.lobby-card { width: 100%; max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.lobby-card h2 { font-family: var(--font-head); font-size: 28px; }
.room-code {
  font-family: var(--font-num); background: var(--yellow); color: var(--ink);
  padding: 4px 18px; border-radius: 14px; letter-spacing: 6px;
  box-shadow: 0 5px 0 #b8801a; display: inline-block;
}
.hint { opacity: .8; font-size: 16px; }
.player-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 6px 0; }
.player-list li {
  background: rgba(255,255,255,.1); border-radius: 20px; padding: 15px 20px;
  display: flex; align-items: center; gap: 12px; font-size: 20px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.1);
}
.dot { width: 12px; height: 12px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 10px #4ade80; }
.dot.off { background: #777; box-shadow: none; }
.lobby-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 6px; }

/* ============ โต๊ะเกม ============ */
#screen-game { padding: calc(8px + var(--safe-t)) 8px calc(8px + var(--safe-b)); justify-content: space-between; gap: 6px; }

/* แถบบนสุดของหน้าเกม: เมนู+ทิศทางซ้าย / เลขห้องขวา */
.game-hud { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px; }
.hud-left { display: flex; align-items: center; gap: 8px; }
.hud-btn {
  border: none; background: rgba(0,0,0,.32); color: #fff; font-size: 20px;
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer; line-height: 1;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.08);
}
.hud-btn:active { transform: scale(.94); }
.dir-badge { font-size: 24px; opacity: .85; }
.room-badge {
  background: rgba(0,0,0,.32); padding: 5px 14px; border-radius: 999px; font-size: 15px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.08);
}
.room-badge b { font-family: var(--font-num); color: var(--yellow); letter-spacing: 3px; font-weight: 700; }

.opponents { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; }
.opp {
  background: rgba(255,255,255,.09); border: 3px solid transparent; border-radius: 18px;
  padding: 8px 12px; min-width: 92px; text-align: center; position: relative; transition: .25s;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.08);
}
.opp.current { border-color: var(--yellow); box-shadow: 0 0 22px rgba(255,190,46,.6); transform: translateY(-3px) scale(1.05); }
.opp .opp-name { font-size: 17px; }
.opp .opp-count { font-size: 16px; margin-top: 4px; opacity: .95; }
.opp .opp-count b { font-family: var(--font-num); font-size: 20px; color: var(--yellow); }
.opp.offline { opacity: .5; }
.opp .off-tag { font-size: 11px; background: #777; color: #fff; padding: 1px 7px; border-radius: 8px; margin-left: 5px; }
.my-count { font-family: var(--font-num); color: var(--yellow); font-size: 16px; }
.opp .uno-tag {
  position: absolute; top: -12px; right: -8px; background: var(--red); color: #fff;
  font-family: var(--font-num); font-size: 12px; padding: 3px 9px; border-radius: 12px;
  transform: rotate(8deg); box-shadow: 0 3px 8px rgba(0,0,0,.4); animation: wobble .5s ease infinite;
}
@keyframes wobble { 50% { transform: rotate(-6deg) scale(1.08); } }
.opp .catch-btn {
  margin-top: 5px; font-family: var(--font); font-size: 13px; padding: 5px 11px; border-radius: 12px;
  border: none; background: var(--yellow); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 #b8801a;
}

.table { position: relative; width: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 220px; }
.pile-area { display: flex; align-items: flex-start; gap: 30px; }
.pile-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pile-label { font-size: 14px; opacity: .8; background: rgba(0,0,0,.28); padding: 3px 12px; border-radius: 999px; }
.turn-banner {
  font-family: var(--font-head); font-size: 19px; background: rgba(0,0,0,.32);
  padding: 7px 22px; border-radius: 999px; box-shadow: inset 0 2px 0 rgba(255,255,255,.08);
}
.turn-banner.you { background: linear-gradient(135deg,#ff8a2b,#ffd200); color: var(--ink); }
.dir-indicator { position: absolute; top: 2px; right: 8px; font-size: 26px; opacity: .8; }

/* แถบบอกวิธีทำ (ติดกับมือไพ่) */
.action-hint {
  margin: 0 6px 6px; text-align: center; font-family: var(--font-head); font-size: 18px;
  padding: 11px 16px; border-radius: 16px; box-shadow: 0 4px 0 rgba(0,0,0,.22);
}
.action-hint.go { background: linear-gradient(135deg,#2a9d3f,#57c96a); color: #fff; animation: hintPulse 1.3s infinite; }
.action-hint.draw { background: linear-gradient(135deg,#2b7cff,#5b9dff); color: #fff; }
@keyframes hintPulse { 50% { transform: scale(1.02); filter: brightness(1.12); } }

/* ---- ไพ่ ---- */
.card {
  width: 78px; height: 112px; border-radius: 14px; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-num); font-weight: 700; color: #fff;
  box-shadow: 0 7px 16px rgba(0,0,0,.45), inset 0 3px 0 rgba(255,255,255,.28);
  border: 4px solid #fff; flex-shrink: 0; background: #333;
}
.card .corner { position: absolute; font-size: 16px; text-shadow: 0 1px 1px rgba(0,0,0,.3); }
.card .corner.tl { top: 5px; left: 7px; }
.card .corner.br { bottom: 5px; right: 7px; transform: rotate(180deg); }
.card .center {
  background: var(--cream); width: 66%; height: 74%;
  border-radius: 50% / 42%; display: flex; align-items: center; justify-content: center;
  font-size: 40px; transform: rotate(-20deg); box-shadow: inset 0 -3px 8px rgba(0,0,0,.12);
}
.card .center .glyph { transform: rotate(20deg); }
.card.red { background: var(--red); color: var(--red); }
.card.yellow { background: var(--yellow); color: #d98a00; }
.card.green { background: var(--green); color: var(--green); }
.card.blue { background: var(--blue); color: var(--blue); }
.card.wild { background: conic-gradient(from 45deg, var(--red) 0 25%, var(--yellow) 0 50%, var(--green) 0 75%, var(--blue) 0); color: var(--ink); }
.card.wild .center { background: var(--cream); }

.card-back {
  width: 78px; height: 112px; border-radius: 14px; border: 4px solid #fff;
  background: repeating-linear-gradient(45deg,#2a1a5e,#2a1a5e 9px,#3d2680 9px,#3d2680 18px);
  display: flex; align-items: center; justify-content: center; position: relative;
  box-shadow: 0 7px 16px rgba(0,0,0,.45);
}
.card-back::after {
  content: "UNO"; position: absolute; color: var(--yellow); font-family: var(--font-num); font-weight: 700;
  font-size: 20px; transform: rotate(-20deg); text-shadow: 0 2px 4px rgba(0,0,0,.6);
}
.draw-pile { cursor: pointer; transition: transform .12s; }
.draw-pile.active { box-shadow: 0 0 22px 5px rgba(255,190,46,.7); animation: bob 1s infinite; }
@keyframes bob { 50% { transform: translateY(-7px); } }
.pile-count {
  position: absolute; bottom: -11px; left: 50%; transform: translateX(-50%);
  background: #000; padding: 2px 9px; border-radius: 10px; font-family: var(--font-num); font-size: 13px; z-index: 2;
}
.discard-pile .card { animation: slap .28s ease; }
@keyframes slap { 0% { transform: scale(1.6) rotate(14deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---- มือเรา ---- */
.my-area { width: 100%; }
.my-controls { display: flex; align-items: center; gap: 12px; padding: 0 8px 6px; }
.my-name { margin-left: auto; font-size: 19px; opacity: .92; }
.btn-uno {
  border: none; border-radius: 999px; padding: 13px 26px; font-family: var(--font-num); font-weight: 700;
  font-size: 21px; letter-spacing: 1px; color: #7a1f00; cursor: pointer;
  background: linear-gradient(135deg,#ffd200,#ff9f2b);
  box-shadow: 0 6px 0 #b87400, inset 0 2px 0 rgba(255,255,255,.4);
  animation: unoPulse 1.2s infinite;
}
.btn-uno:active { transform: translateY(4px); box-shadow: 0 2px 0 #b87400; }
.btn-uno:disabled { filter: grayscale(.65) brightness(.72); animation: none; cursor: not-allowed; }
@keyframes unoPulse {
  0%,100% { box-shadow: 0 6px 0 #b87400, 0 0 0 0 rgba(255,210,0,.55); }
  50% { box-shadow: 0 6px 0 #b87400, 0 0 0 15px rgba(255,210,0,0); }
}
.my-hand {
  display: flex; gap: 8px; overflow-x: auto; padding: 16px 10px calc(14px + var(--safe-b));
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.my-hand::-webkit-scrollbar { height: 0; }
.my-hand .card { scroll-snap-align: center; cursor: pointer; transition: transform .12s, box-shadow .2s; }
.my-hand .card.playable {
  box-shadow: 0 0 0 4px #fff, 0 0 22px 5px #8dff5a, 0 7px 16px rgba(0,0,0,.4);
  transform: translateY(-12px);
  animation: glow 1.3s infinite;
}
@keyframes glow {
  0%,100% { box-shadow: 0 0 0 4px #fff, 0 0 18px 4px #8dff5a, 0 7px 16px rgba(0,0,0,.4); }
  50% { box-shadow: 0 0 0 4px #fff, 0 0 30px 9px #8dff5a, 0 7px 16px rgba(0,0,0,.4); }
}
.my-hand .card.playable:active { transform: translateY(-22px) scale(1.06); }
.my-hand .card.disabled { filter: brightness(.6) saturate(.7); }

/* ---- ปุ่มแซว ---- */
.btn-taunt {
  border: none; border-radius: 999px; padding: 12px 20px; font-family: var(--font-head);
  font-size: 18px; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #b14bff, #ff4ba0);
  box-shadow: 0 5px 0 rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.3);
  transition: transform .07s, box-shadow .07s;
}
.btn-taunt:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.28); }

.taunt-tray {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(150px + var(--safe-b)); z-index: 60;
  background: linear-gradient(160deg,#3a2270,#1a0d3c); border: 3px solid rgba(255,255,255,.18);
  border-radius: 24px; padding: 14px; box-shadow: 0 18px 44px rgba(0,0,0,.55);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  width: min(92vw, 380px); max-height: 46vh; overflow-y: auto;
}
.taunt-item {
  border: none; border-radius: 16px; padding: 12px 6px; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff; font-family: var(--font);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.08); transition: transform .07s, background .15s;
}
.taunt-item:active { transform: scale(.94); background: rgba(255,255,255,.2); }
.taunt-item .ti-emoji { font-size: 30px; }
.taunt-item .ti-text { font-size: 14px; }

/* ---- ป้ายคำแซวลอย ---- */
#reactions { position: fixed; inset: 0; pointer-events: none; z-index: 95; }
.taunt-bubble { position: fixed; transform: translateX(-50%); }
.taunt-bubble.above { transform: translate(-50%, -100%); }
.tb-inner {
  position: relative;
  background: #fff; color: var(--ink); border-radius: 18px; padding: 8px 14px;
  font-family: var(--font-head); font-size: 18px; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,.45); border: 3px solid var(--yellow);
  animation: tauntPop 2.2s ease forwards;
}
.tb-inner::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent;
}
.taunt-bubble.above .tb-inner::after { bottom: -14px; border-top-color: #fff; }
.taunt-bubble.below .tb-inner::after { top: -14px; border-bottom-color: #fff; }
.tb-inner .tb-emoji { font-size: 24px; }
@keyframes tauntPop {
  0% { opacity: 0; transform: translateY(6px) scale(.4); }
  15% { opacity: 1; transform: translateY(-2px) scale(1.15); }
  28% { transform: translateY(0) scale(1); }
  80% { opacity: 1; transform: translateY(-6px) scale(1); }
  100% { opacity: 0; transform: translateY(-18px) scale(.95); }
}
.shake { animation: shake .5s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px) rotate(-3deg); }
  40% { transform: translateX(6px) rotate(3deg); }
  60% { transform: translateX(-5px) rotate(-2deg); }
  80% { transform: translateX(5px) rotate(2deg); }
}

/* ---- log ---- */
.log-box {
  width: 100%; max-width: 640px; height: 52px; overflow-y: auto; font-size: 15px;
  background: rgba(0,0,0,.26); border-radius: 14px; padding: 6px 14px; opacity: .95;
}
.log-box::-webkit-scrollbar { width: 0; }
.log-box div { padding: 1px 0; }

/* ---- modal ---- */
.modal {
  position: fixed; inset: 0; background: rgba(10,4,26,.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 22px;
}
.modal-inner {
  background: linear-gradient(160deg,#3a2270,#1a0d3c); border: 3px solid rgba(255,255,255,.18);
  border-radius: 30px; padding: 30px 26px; text-align: center; max-width: 420px; width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.modal-inner h3 { font-family: var(--font-head); font-size: 24px; }
.color-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.color-choice {
  border: 4px solid #fff; border-radius: 20px; padding: 28px; font-family: var(--font-head); font-size: 21px;
  color: #fff; cursor: pointer; box-shadow: 0 7px 0 rgba(0,0,0,.3); text-shadow: 0 2px 0 rgba(0,0,0,.25);
}
.color-choice:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.c-red-bg { background: var(--red); } .c-yellow-bg { background: var(--yellow); color: var(--ink); text-shadow: none; }
.c-green-bg { background: var(--green); } .c-blue-bg { background: var(--blue); }
.win-inner .trophy { font-size: 78px; animation: bob 1.2s infinite; }
.win-inner h2 { font-family: var(--font-head); font-size: 34px; margin: 8px 0; color: var(--yellow); }

/* ---- ป้ายเด้งไพ่พิเศษ ---- */
.effect-banner {
  position: fixed; top: 34%; left: 50%; transform: translate(-50%, -50%);
  z-index: 98; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 34px; border-radius: 26px; border: 5px solid #fff;
  font-family: var(--font-head); color: #fff; text-align: center; white-space: nowrap;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  animation: fxPop 1.8s ease forwards;
}
.effect-banner .fx-icon { font-size: 52px; line-height: 1; }
.effect-banner .fx-text { font-size: 30px; text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.effect-banner.skip { background: linear-gradient(160deg,#8a4bff,#5a1fd0); }
.effect-banner.reverse { background: linear-gradient(160deg,#2a9d3f,#1c7a2f); }
.effect-banner.draw2 { background: linear-gradient(160deg,#2b7cff,#1550c0); }
.effect-banner.wild4 { background: conic-gradient(from 45deg, var(--red) 0 25%, var(--yellow) 0 50%, var(--green) 0 75%, var(--blue) 0); color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
@keyframes fxPop {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.3) rotate(-12deg); }
  14% { opacity: 1; transform: translate(-50%,-50%) scale(1.15) rotate(4deg); }
  26% { transform: translate(-50%,-50%) scale(1) rotate(0); }
  80% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(1.05); }
}

/* ---- UNO เด้ง ---- */
.uno-burst { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 100; pointer-events: none; }
.uno-burst span {
  font-family: var(--font-num); font-weight: 700; font-size: 34vw; color: var(--yellow);
  text-shadow: 0 0 32px #ff2d55, 6px 6px 0 var(--red), -5px -5px 0 var(--blue);
  animation: unoPop 1.3s ease;
}
@keyframes unoPop {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  40% { transform: scale(1.25) rotate(8deg); opacity: 1; }
  70% { transform: scale(1) rotate(-4deg); }
  100% { transform: scale(1.12); opacity: 0; }
}

/* ---- confetti ---- */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetto { position: absolute; width: 11px; height: 15px; top: -20px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(108vh) rotate(720deg); } }

@media (min-width: 620px) {
  .card, .card-back { width: 84px; height: 120px; }
  .card .center { font-size: 44px; }
}
