/* Canasta: a deep emerald card table under the night sky. The HUD, the helper strip, the move bar, the panels and
   the result card follow the site's glass style; the cards, seats and melds are laid out by game.js inside the felt. */
.cn { display: flex; flex-direction: column; color: #e6f1ff; --cn-line: #1d3346; --cn-glass: rgba(6, 18, 26, 0.86); --cn-gold: #ffd166; --cn-cyan: #55d6ff;
  --cn-us: #55d6ff; --cn-them: #ff8a8a; --cn-red: #e8364f; --cn-mix: #c7d0e4; }
.cn [hidden] { display: none !important; }
.cn-stage { position: relative; width: 100%; height: min(88vh, 820px); min-height: 560px; display: flex; flex-direction: column; overflow: hidden; outline: none;
  background: radial-gradient(120% 80% at 50% 0%, #0d2b35 0%, #061019 55%, #03070d 100%);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
@media (max-width: 600px) { .cn-stage { height: min(88vh, 780px); min-height: 540px; } }

/* HUD */
.cn-hud { flex: none; height: 54px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 10px; z-index: 3; }
.cn-pz { flex: 0 1 auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; min-width: 92px; max-width: 40vw; height: 44px; padding: 2px 26px 2px 10px;
  border-radius: 12px; border: 1px solid var(--cn-line); background: var(--cn-glass); color: #fff; cursor: pointer; font: inherit; line-height: 1.05; touch-action: manipulation; text-align: left; transition: border-color .15s; }
.cn-pz-k { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #8fb6c9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cn-pz-n { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cn-pz-dd { position: absolute; right: 6px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: none; stroke: #8fb6c9; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cn-score { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--cn-line); background: var(--cn-glass); color: #fff; font: inherit; cursor: pointer; touch-action: manipulation; transition: border-color .15s; min-width: 0; }
.cn-sc { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.cn-sc i { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.cn-sc.us i { color: var(--cn-us); } .cn-sc.them i { color: var(--cn-them); }
.cn-sc b { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.cn-score small { font-size: 11px; color: #7f9db3; font-weight: 700; white-space: nowrap; align-self: flex-end; margin-bottom: 5px; }
@media (hover: hover) { .cn-pz:hover, .cn-score:hover { border-color: var(--cn-cyan); } }
.cn-pz:focus-visible, .cn-score:focus-visible, .cn-tool:focus-visible { outline: 2px solid var(--cn-cyan); outline-offset: 2px; }
.cn-sp { flex: 1 1 auto; }
.cn-tool { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--cn-line); background: var(--cn-glass);
  color: #c6dcea; cursor: pointer; touch-action: manipulation; padding: 0; transition: border-color .15s, color .15s; }
.cn-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cn-tool .spk, .cn-tool .fill { fill: currentColor; stroke: none; }
@media (hover: hover) { .cn-tool:hover { border-color: var(--cn-cyan); color: #fff; } }
#cn-sound .off { display: none; } #cn-sound[aria-pressed="true"] { color: #5d7488; } #cn-sound[aria-pressed="true"] .on { display: none; } #cn-sound[aria-pressed="true"] .off { display: inline; }
.cn-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #ff6b8b; box-shadow: 0 0 8px #ff6b8b; }

/* the felt */
.cn-felt { position: relative; z-index: 1; isolation: isolate; flex: 1 1 auto; min-height: 0; margin: 0 6px; border-radius: 18px; overflow: hidden; touch-action: manipulation;
  background: radial-gradient(rgba(255,255,255,0.025) 0.8px, transparent 1px) 0 0 / 5px 5px, radial-gradient(ellipse 90% 70% at 50% 45%, #145249 0%, #0b3434 45%, #072128 80%, #05161d 100%);
  box-shadow: inset 0 0 0 1px rgba(124, 214, 192, 0.12), inset 0 18px 60px rgba(0,0,0,0.35), 0 8px 30px rgba(0,0,0,0.35); }
.cn-felt::after { content: ''; position: absolute; inset: 7px; border-radius: 13px; border: 1px solid rgba(255, 209, 102, 0.08); pointer-events: none; }
.cn-layer { position: absolute; inset: 0; }
.cn-deco { position: absolute; inset: 0; pointer-events: none; }
.cn-deco > * { position: absolute; }
.cn-deco button { pointer-events: auto; }

/* cards */
.cn-c { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * 0.09); background: linear-gradient(170deg, #ffffff 0%, #fbfaf6 55%, #f0eee6 100%);
  box-shadow: 0 0 0 0.6px rgba(0,0,0,0.4), 0 2px 5px rgba(0,0,0,0.32); transform-origin: 0 0; overflow: hidden; pointer-events: none;
  transition: transform .34s cubic-bezier(.2,.8,.25,1), opacity .3s, box-shadow .18s; }
.cn-c svg { display: block; width: 100%; height: 100%; }
.cn-c.wild { box-shadow: 0 0 0 0.6px rgba(0,0,0,0.4), inset 0 0 0 calc(var(--cw) * 0.03) rgba(214, 160, 40, 0.45), 0 2px 5px rgba(0,0,0,0.32); }
.cn-c.mine { pointer-events: auto; cursor: pointer; box-shadow: 0 0 0 0.6px rgba(0,0,0,0.45), -2px 3px 7px rgba(0,0,0,0.35); }
.cn-c.mine.wild { box-shadow: 0 0 0 0.6px rgba(0,0,0,0.45), inset 0 0 0 calc(var(--cw) * 0.03) rgba(214, 160, 40, 0.45), -2px 3px 7px rgba(0,0,0,0.35); }
.cn-c.mine.sel { box-shadow: 0 0 0 2.5px var(--cn-gold), 0 0 16px rgba(255, 209, 102, 0.55), 0 8px 18px rgba(0,0,0,0.45); }
.cn-c.mine.focus { box-shadow: 0 0 0 2.5px var(--cn-cyan), 0 8px 18px rgba(0,0,0,0.45); }
.cn-c.mine.sel.focus { box-shadow: 0 0 0 2.5px var(--cn-gold), 0 0 0 5px var(--cn-cyan), 0 8px 18px rgba(0,0,0,0.45); }
.cn-c.mine.wait { filter: brightness(0.93); }
/* the cards that just came into your hand (drawn, or from the pile), until you discard */
.cn-c.mine.new::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--ch) * 0.04); background: linear-gradient(90deg, #55d6ff, #7dffcf); box-shadow: 0 0 8px rgba(85, 214, 255, 0.8); pointer-events: none; }
@media (hover: hover) { .cn-c.mine:not(.sel):hover { box-shadow: 0 0 0 1.5px rgba(85,214,255,0.8), -2px 3px 7px rgba(0,0,0,0.35); } }
.cn-c.staged { box-shadow: 0 0 0 0.6px rgba(0,0,0,0.4), 0 2px 5px rgba(0,0,0,0.32); }
.cn-c.pilet { box-shadow: 0 0 0 0.6px rgba(0,0,0,0.4), 0 4px 10px rgba(0,0,0,0.45); }
.cn-c.down { background: #0d3b44; }
.cn-ghost { z-index: 400; transition: transform .42s cubic-bezier(.3,.7,.3,1), opacity .42s; }
.cn-c.flash { animation: cn-flash .9s ease-out; }
@keyframes cn-flash { 0% { filter: brightness(1); } 25% { filter: brightness(1.25) drop-shadow(0 0 10px rgba(255,209,102,.9)); } 100% { filter: brightness(1); } }

/* seats */
.cn-seat { z-index: 70; display: flex; align-items: center; gap: 7px; padding: 0 8px 0 4px; border-radius: 12px; background: rgba(4, 14, 20, 0.62); border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25); transition: box-shadow .25s, border-color .25s; min-width: 0; box-sizing: border-box; }
.cn-av { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 13px; color: #fff;
  background: linear-gradient(160deg, #d0566a, #7d2235); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18); }
.cn-seat.partner .cn-av { background: linear-gradient(160deg, #2bb3d9, #155c86); }
.cn-dealer { position: absolute; right: -5px; bottom: -4px; width: 15px; height: 15px; border-radius: 50%; background: var(--cn-gold); color: #1a1200; font-size: 9.5px; font-weight: 900; font-style: normal; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.cn-si { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; flex: 1 1 auto; }
.cn-si b { font-size: 13px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-si small { font-size: 10.5px; color: #8fa9bd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.cn-seat.partner .cn-si small { color: #7fd8f5; } .cn-seat.opp .cn-si small { color: #f0a0a8; }
.cn-si .r3 { font-style: normal; color: #ff8e9e; }
.cn-backs { position: relative; flex: none; width: 34px; height: 26px; }
.cn-backs i { position: absolute; left: 50%; bottom: 0; width: 14px; height: 20px; margin-left: -7px; border-radius: 2.5px; background: linear-gradient(135deg, #1b6670, #0d3b44); box-shadow: 0 0 0 0.6px rgba(0,0,0,0.5), inset 0 0 0 1.2px #e9c36a;
  transform-origin: 50% 130%; transform: rotate(calc(var(--i) * 10deg)); }
.cn-backs em { display: none; position: absolute; right: -6px; top: -5px; min-width: 18px; height: 17px; padding: 0 4px; border-radius: 999px; background: #08151d; border: 1px solid #2a4a60; color: #fff; font-size: 10.5px; font-weight: 800; font-style: normal; display: grid; place-items: center; z-index: 2; font-variant-numeric: tabular-nums; }
.cn-seat.cur { border-color: var(--cn-gold); box-shadow: 0 0 0 1px var(--cn-gold), 0 0 20px rgba(255,209,102,0.32); }
.cn-seat.cur .cn-av { animation: cn-glow 1.6s ease-in-out infinite; }
@keyframes cn-glow { 50% { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18), 0 0 0 3px rgba(255,209,102,.55); } }
.cn-think { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); display: inline-flex; gap: 3px; padding: 3px 6px; border-radius: 999px; background: #08151d; border: 1px solid #2a4a60; }
.cn-think i { width: 4px; height: 4px; border-radius: 50%; background: var(--cn-gold); animation: cn-dotb 1s ease-in-out infinite; }
.cn-think i:nth-child(2) { animation-delay: .15s; } .cn-think i:nth-child(3) { animation-delay: .3s; }
@keyframes cn-dotb { 50% { transform: translateY(-3px); opacity: .5; } }
.cn-bub { z-index: 300; transform: translate(-50%, 0); padding: 5px 11px; border-radius: 12px; background: #fff7de; color: #2a1d00; font-size: 12.5px; font-weight: 800; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  animation: cn-bub .25s cubic-bezier(.2,1.4,.4,1); pointer-events: none; }
.cn-bub::before { content: ''; position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; margin-left: -5px; background: #fff7de; transform: rotate(45deg); border-radius: 2px; }
.cn-bub.me { transform: translate(-50%, -100%); }
.cn-bub.me::before { top: auto; bottom: -5px; }
@keyframes cn-bub { from { opacity: 0; transform: translate(-50%, 6px) scale(.9); } }
.cn-bub.me { animation-name: cn-bubme; }
@keyframes cn-bubme { from { opacity: 0; transform: translate(-50%, -90%) scale(.9); } }

/* the sides' melds */
.cn-sidehead { z-index: 6; height: 15px; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.cn-sidehead b { font-size: 10.5px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }
.cn-sidehead.us b { color: var(--cn-us); } .cn-sidehead.them b { color: var(--cn-them); }
.cn-chip { font-size: 10.5px; font-weight: 700; color: #a8c3d4; padding: 0 6px; height: 15px; line-height: 15px; border-radius: 999px; background: rgba(255,255,255,0.06); font-variant-numeric: tabular-nums; }
.cn-chip.need { color: #ffe3a3; background: rgba(255,209,102,0.12); }
.cn-chip.can { color: #ffd0d6; background: rgba(232,54,79,0.22); }
.cn-chip.dim { color: #7f9db3; background: transparent; }
.cn-chip.stg { color: #1a1200; background: var(--cn-gold); }
.cn-empty { z-index: 2; display: grid; place-items: center; border-radius: 12px; border: 1.5px dashed rgba(255,255,255,0.09); color: rgba(220, 238, 248, 0.38); font-size: 12px; font-weight: 700; text-align: center; padding: 0 10px; box-sizing: border-box; }
.cn-canasta { z-index: 50; border-radius: 6px; pointer-events: none; }
.cn-canasta.nat { box-shadow: 0 0 0 2px var(--cn-red), 0 0 14px rgba(232,54,79,0.55); }
.cn-canasta.mix { box-shadow: 0 0 0 2px #10141c, 0 0 0 3.5px var(--cn-mix), 0 0 12px rgba(199,208,228,0.3); }
.cn-cb { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); padding: 0 6px; height: 15px; line-height: 15px; border-radius: 999px; font-size: 10px; font-weight: 900; letter-spacing: 0.03em; white-space: nowrap; }
.cn-canasta.nat .cn-cb { background: var(--cn-red); color: #fff; } .cn-canasta.mix .cn-cb { background: #10141c; color: #e6ecf8; box-shadow: 0 0 0 1px var(--cn-mix); }
.cn-cn { position: absolute; right: -6px; top: -6px; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 999px; background: #08151d; border: 1px solid #2a4a60; color: #fff; font-size: 10px; font-weight: 900; display: grid; place-items: center; box-sizing: border-box; }
.cn-mcount { z-index: 50; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 999px; background: #08151d; border: 1px solid #2a4a60; color: #dfeaf5; font-size: 9.5px; font-weight: 900; display: grid; place-items: center; box-sizing: border-box; }
.cn-stagebox { z-index: 45; border-radius: 8px; border: 2px dashed var(--cn-gold); background: rgba(255,209,102,0.06); animation: cn-dash 1.4s ease-in-out infinite; box-sizing: border-box; }
@keyframes cn-dash { 50% { border-color: rgba(255,209,102,0.45); } }
.cn-r3tag { z-index: 50; text-align: center; font-size: 9.5px; font-weight: 900; color: #ffb3bf; text-shadow: 0 1px 2px #000; }
.cn-hit { z-index: 15; border: 0; padding: 0; margin: 0; background: transparent; border-radius: 8px; cursor: pointer; touch-action: manipulation; }
.cn-hit:focus-visible { outline: 2px solid var(--cn-cyan); outline-offset: 2px; }
.cn-hit.pick { box-shadow: 0 0 0 2px var(--cn-gold), 0 0 16px rgba(255,209,102,0.5); animation: cn-dash 1.2s ease-in-out infinite; }
@media (hover: hover) { .cn-hit:hover { box-shadow: 0 0 0 1.5px rgba(85,214,255,0.6); } }

/* stock and pile */
.cn-stock { z-index: 8; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; touch-action: manipulation;
  box-shadow: calc(var(--d) * 0.7px) calc(var(--d) * 0.7px) 0 -1px #0b2a30, calc(var(--d) * 1px) calc(var(--d) * 1.1px) 0 -0.5px #e9e6dc, 0 6px 14px rgba(0,0,0,0.4); overflow: visible; }
.cn-stock svg { display: block; width: 100%; height: 100%; border-radius: 6px; background: #f7f4ea; }
.cn-stock em { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); min-width: 22px; height: 18px; padding: 0 5px; border-radius: 999px; background: #08151d; border: 1px solid #2a4a60; color: #fff; font-size: 11px; font-weight: 800; font-style: normal; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.cn-stock.empty { border: 1.5px dashed rgba(255,255,255,0.18); box-shadow: none; }
.cn-stock.live { animation: cn-live 1.8s ease-in-out infinite; }
.cn-stock:focus-visible, .cn-slot:focus-visible { outline: 2px solid var(--cn-cyan); outline-offset: 3px; }
@keyframes cn-live { 50% { filter: drop-shadow(0 0 10px rgba(255,209,102,0.55)); } }
.cn-slot { z-index: 8; padding: 0; border-radius: 6px; border: 1.5px dashed rgba(255,255,255,0.16); background: rgba(0,0,0,0.12); cursor: pointer; touch-action: manipulation; }
.cn-slot.live { border-color: rgba(255,209,102,0.45); }
.cn-glow { }
.cn-stock.glow, .cn-slot.glow { box-shadow: 0 0 0 3px var(--cn-gold), 0 0 22px rgba(255,209,102,0.7); }
.cn-pdepth { z-index: 7; border-radius: 6px; background: #e8e5db; box-shadow: 0 0 0 0.6px rgba(0,0,0,0.4), 2px 2px 0 #d8d4c8, 0 5px 12px rgba(0,0,0,0.4); }
.cn-pinfo { z-index: 6; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; min-width: 0; }
.cn-pinfo > * { flex-shrink: 0; }
.cn-pinfo b { font-size: 13px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.cn-pinfo small { font-size: 11px; color: #9dbccd; line-height: 1.3; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cn-pst { display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.cn-pst.open { background: rgba(125, 255, 207, 0.14); color: #8ff5d0; }
.cn-pst.frozen { background: rgba(130, 200, 255, 0.2); color: #cfeaff; box-shadow: 0 0 12px rgba(130,200,255,0.35); }
.cn-pst.frozen::before { content: '❄'; font-size: 12px; letter-spacing: 0; }
.cn-pst.mine { background: rgba(255, 209, 102, 0.14); color: #ffe3a3; }
.cn-pst.block { background: rgba(255, 120, 120, 0.18); color: #ffc2c2; }

/* the helper strip and the move bar */
.cn-tips { flex: none; height: 50px; margin: 4px 8px 0; display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; align-content: center; overflow: hidden; font-size: 13px; line-height: 1.3; color: #cfe3ef; padding: 0 4px; }
.cn-tmsg { flex: 1 1 200px; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cn-tips.ok .cn-tmsg { color: #a8f5d4; } .cn-tips.warn .cn-tmsg { color: #ffd48a; } .cn-tips.hint .cn-tmsg { color: #ffe9b0; } .cn-tips.wait .cn-tmsg { color: #9dbccd; }
.cn-tips.ask { background: rgba(85, 214, 255, 0.08); border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(85,214,255,0.35); padding: 0 8px; }
.cn-tmsg b { color: #fff; }
.cn-tmsg small { color: #9dbccd; font-size: 12px; }
.cn-tips.acts .cn-tmsg { -webkit-line-clamp: 1; }
.cn-tips.shake { animation: cn-shake .32s ease; }
@keyframes cn-shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.cn-tacts { flex: 0 1 auto; display: flex; gap: 6px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.cn-tacts::-webkit-scrollbar { display: none; }
.cn-tb { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid #2a4a60; background: #0a1b25; color: #dfeefa; font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; touch-action: manipulation; white-space: nowrap; transition: border-color .15s, background .15s; }
.cn-tb svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cn-tb.sug { border-color: rgba(85,214,255,0.4); color: #bfeeff; }
.cn-tb.take { border-color: rgba(255,209,102,0.55); color: #ffe3a3; }
.cn-tb.out, .cn-tb.yes { background: var(--cn-gold); color: #1a1200; border-color: var(--cn-gold); }
.cn-tb.ask { border-color: rgba(85,214,255,0.6); color: #bfeeff; }
@media (hover: hover) { .cn-tb:hover { border-color: var(--cn-cyan); } .cn-tb.out:hover, .cn-tb.yes:hover { background: #ffe08a; } }
.cn-tb:focus-visible { outline: 2px solid var(--cn-cyan); outline-offset: 2px; }
.cn-bar { flex: none; height: 60px; display: flex; gap: 6px; padding: 6px 8px 8px; width: min(100%, 620px); margin: 0 auto; box-sizing: border-box; }
.cn-btn { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 14px; border: 1px solid var(--cn-line);
  background: rgba(8, 20, 30, 0.9); color: #d4e6f2; font: inherit; font-size: 11.5px; font-weight: 800; letter-spacing: 0.02em; cursor: pointer; touch-action: manipulation; padding: 0 2px;
  transition: border-color .15s, color .15s, opacity .15s, background .15s, transform .08s; }
.cn-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cn-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (hover: hover) { .cn-btn:hover:not(:disabled) { border-color: var(--cn-cyan); color: #fff; } }
.cn-btn:active:not(:disabled) { transform: translateY(1px); }
.cn-btn:focus-visible { outline: 2px solid var(--cn-cyan); outline-offset: 2px; }
.cn-btn:disabled { opacity: 0.36; cursor: default; }
.cn-hintb { color: #ffe3a3; }
.cn-main.ready { border-color: rgba(255,209,102,0.7); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,209,102,0.25), 0 0 16px rgba(255,209,102,0.15); }
.cn-out.ready { background: linear-gradient(135deg, #ffd166, #ffb35c); color: #1a1200; border-color: transparent; box-shadow: 0 6px 22px rgba(255,190,90,0.35); animation: cn-pulse 1.8s ease-in-out infinite; }
@keyframes cn-pulse { 50% { box-shadow: 0 6px 30px rgba(255,190,90,0.6); } }

/* result card */
.cn-card { position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 8; width: min(calc(100% - 16px), 460px); padding: 16px 14px 12px; border-radius: 18px;
  background: rgba(6, 18, 26, 0.95); border: 1px solid rgba(255,209,102,0.35); box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 40px rgba(85,214,255,.1); animation: cn-up .35s cubic-bezier(.2,.9,.25,1.1);
  max-height: calc(100% - 140px); overflow: auto; overscroll-behavior: contain; box-sizing: border-box; }
@keyframes cn-up { from { opacity: 0; transform: translate(-50%, 24px); } }
.cn-rc-top { display: flex; align-items: center; gap: 12px; }
.cn-rc-top > div:first-child { flex: 1 1 auto; min-width: 0; }
.cn-card h2 { margin: 0; font-size: 23px; font-weight: 900; color: #fff; line-height: 1.1; text-shadow: 0 0 22px rgba(255,209,102,.4); text-transform: none; letter-spacing: 0.005em; }
.cn-card p { margin: 3px 0 0; font-size: 13px; color: #9dbccd; line-height: 1.4; }
.cn-rc-score { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; font-variant-numeric: tabular-nums; }
.cn-rc-score b { font-size: 26px; font-weight: 900; color: var(--cn-us); }
.cn-rc-score span { font-size: 15px; font-weight: 800; color: var(--cn-them); }
.cn-rc-score.won b { color: var(--cn-gold); text-shadow: 0 0 16px rgba(255,209,102,0.5); }

/* panels */
.cn-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 9; overflow: auto;
  background: radial-gradient(ellipse at center, rgba(3, 10, 16, 0.55), rgba(2, 6, 10, 0.88)); animation: cn-fade .18s ease-out; }
.cn-panel { position: relative; width: min(100%, 430px); margin: auto; padding: 20px 18px 18px; border: 1px solid var(--cn-line); border-radius: 18px; text-align: left; outline: none; box-sizing: border-box;
  background: rgba(6, 18, 26, 0.96); box-shadow: 0 20px 60px rgba(0,0,0,0.55); animation: cn-in .26s cubic-bezier(.2,.9,.25,1.1); color: #dfeefa; }
.cn-panel.wide { width: min(100%, 560px); }
@keyframes cn-in { from { opacity: 0; transform: scale(.95) translateY(8px); } }
@keyframes cn-fade { from { opacity: 0; } }
.cn-panel h2 { margin: 0 38px 12px 0; font-size: 20px; font-weight: 900; color: #fff; line-height: 1.25; text-transform: none; letter-spacing: 0.005em; }
.cn-panel h3 { margin: 16px 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #8fb6c9; }
.cn-panel p, .cn-panel li { font-size: 13.5px; line-height: 1.55; color: #bcd2e0; }
.cn-panel p { margin: 0 0 10px; }
.cn-panel ol, .cn-panel ul { margin: 0 0 10px; padding-left: 20px; }
.cn-panel b { color: #fff; }
.cn-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(255,255,255,.07); color: #d4e6f2; cursor: pointer; padding: 0; z-index: 2; }
.cn-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (hover: hover) { .cn-x:hover { background: rgba(255,255,255,.14); color: #fff; } }
.cn-x:focus-visible { outline: 2px solid var(--cn-cyan); outline-offset: 2px; }
.cn-fine { font-size: 12px !important; color: #7393a8 !important; margin: 10px 0 0 !important; }
.cn-sub { font-size: 12.5px !important; color: #9dbccd !important; margin: 8px 0 0 !important; }
.cn-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.cn-row { display: flex; gap: 8px; } .cn-row > * { flex: 1 1 0; }
.cn-sticky { position: sticky; bottom: -18px; margin: 14px -18px -18px; padding: 12px 18px 16px; background: linear-gradient(rgba(6,18,26,0), rgba(6,18,26,0.96) 30%); border-radius: 0 0 18px 18px; z-index: 2; }
@media (max-width: 460px) { .cn-sticky { margin: 14px -14px -14px; padding: 12px 14px 14px; bottom: -14px; } }
.cn-b { font: inherit; font-weight: 800; font-size: 14.5px; padding: 10px 14px; min-height: 46px; border-radius: 12px; cursor: pointer; touch-action: manipulation; text-decoration: none; border: 1px solid var(--cn-line);
  background: #0a1b25; color: #e6f1ff; transition: background .15s, border-color .15s, transform .1s, filter .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
@media (hover: hover) { .cn-b:hover:not(:disabled) { border-color: var(--cn-cyan); } }
.cn-b:active { transform: translateY(1px); }
.cn-b:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cn-b svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cn-b span { white-space: nowrap; }
.cn-b-primary { background: var(--cn-gold); color: #1a1200; border-color: var(--cn-gold); font-size: 15.5px; }
@media (hover: hover) { .cn-b-primary:hover:not(:disabled) { background: #ffe08a; border-color: #ffe08a; } }
.cn-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 4px; }
.cn-stats.three { grid-template-columns: repeat(3, 1fr); }
.cn-stats div { padding: 8px 4px; border-radius: 10px; background: #05121a; border: 1px solid #13283a; text-align: center; min-width: 0; }
.cn-stats span { display: block; font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #6f8ea3; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-stats b { display: block; margin-top: 2px; font-size: 17px; color: #e6f1ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cn-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cn-table th, .cn-table td { padding: 6px 4px; text-align: right; border-bottom: 1px solid #13283a; font-variant-numeric: tabular-nums; }
.cn-table th:first-child { text-align: left; }
.cn-table thead th { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #6f8ea3; }
.cn-table thead th:nth-child(2) { color: var(--cn-us); } .cn-table thead th:nth-child(3) { color: var(--cn-them); }
.cn-table.plain thead th { color: #6f8ea3; }
.cn-table tbody th { color: #cfe3ef; font-weight: 700; }
.cn-table td { color: #e6f1ff; font-weight: 700; }
.cn-table td small, .cn-table th small { display: block; font-size: 10.5px; color: #6f8ea3; font-weight: 700; }
.cn-table tr.z td { color: #5a768a; }
.cn-table tr.tot th, .cn-table tr.tot td { color: #fff; font-weight: 900; border-bottom-color: #2a4a60; }
.cn-table tr.grand td { color: var(--cn-gold); font-size: 16px; }
.cn-table.vals th { font-weight: 700; color: #bcd2e0; } .cn-table.vals td { color: var(--cn-gold); }
.cn-table.vals th:nth-child(3) { text-align: left; padding-left: 14px; }
.cn-table.hist td small { display: inline; margin-left: 6px; }
.cn-left { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #13283a; }
.cn-left b { flex: none; width: 52px; font-size: 13px; }
.cn-left em { flex: none; font-style: normal; font-weight: 800; color: #ffb38a; font-variant-numeric: tabular-nums; }
.cn-minis { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 3px; }
.cn-minis i { font-style: normal; font-size: 11.5px; font-weight: 800; padding: 1px 4px; border-radius: 4px; background: #f6f3ea; color: #161a24; }
.cn-minis i.r { color: #d11f3a; }
.cn-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: #05121a; border: 1px solid var(--cn-line); margin: 0 0 6px; }
.cn-tab { font: inherit; font-size: 13.5px; font-weight: 800; color: #8fb6c9; background: transparent; border: 0; border-radius: 9px; min-height: 38px; cursor: pointer; }
.cn-tab[aria-selected="true"] { background: #10293a; color: #fff; box-shadow: inset 0 0 0 1px rgba(85,214,255,0.45); }
.cn-tab:focus-visible { outline: 2px solid var(--cn-cyan); outline-offset: 1px; }
.cn-seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #05121a; border: 1px solid var(--cn-line); }
.cn-seg button { flex: 1 1 0; min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: #8fb6c9; font: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px; line-height: 1.2; }
.cn-seg button small { font-size: 10.5px; font-weight: 700; color: #6f8ea3; }
.cn-seg button[aria-pressed="true"] { background: #10293a; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,209,102,.6); }
.cn-seg button[aria-pressed="true"] small { color: #ffe3a3; }
.cn-seg button:focus-visible { outline: 2px solid var(--cn-cyan); outline-offset: 1px; }
.cn-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #13283a; cursor: pointer; position: relative; }
.cn-set.static { cursor: default; border-bottom: 0; padding-bottom: 6px; }
.cn-set span { display: flex; flex-direction: column; gap: 2px; } .cn-set b { font-size: 14px; color: #fff; } .cn-set small { font-size: 12px; color: #8fb6c9; }
.cn-set input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cn-sw { position: relative; width: 46px; height: 27px; flex: none; border-radius: 14px; border: 1px solid #2a4a60; background: #0a1b25; transition: background .15s, border-color .15s; }
.cn-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #5d7488; transition: transform .15s, background .15s; }
.cn-set input:checked + .cn-sw { background: #3a2f10; border-color: var(--cn-gold); }
.cn-set input:checked + .cn-sw::after { transform: translateX(19px); background: var(--cn-gold); box-shadow: 0 0 10px rgba(255,209,102,.6); }
.cn-set input:focus-visible + .cn-sw { outline: 2px solid var(--cn-cyan); outline-offset: 2px; }
.cn-rules h3:first-of-type { margin-top: 12px; }
.cn-fanview { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 12px; }
.cn-mini-card { width: 46px; height: 64px; border-radius: 5px; background: linear-gradient(170deg, #fff, #f2f0e8); box-shadow: 0 0 0 .6px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.35); overflow: hidden; }
.cn-mini-card svg { display: block; width: 100%; height: 100%; }
.cn-cal-head { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; }
.cn-cal-head b { flex: 1 1 auto; text-align: center; color: #fff; font-size: 15px; }
.cn-step { width: 40px; height: 40px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 10px; border: 1px solid #2a4a60; background: #0a1b25; color: #e6f1ff; cursor: pointer; }
.cn-step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cn-step:disabled { opacity: .35; cursor: default; }
.cn-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cn-cal-w { text-align: center; font-size: 10.5px; font-weight: 800; color: #6f8ea3; padding: 2px 0; }
.cn-cal-d { aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; border: 1px solid #13283a; background: #05121a; color: #d4e6f2; font: 700 13px system-ui, sans-serif; cursor: pointer; padding: 0; }
.cn-cal-d.off { opacity: .28; cursor: default; }
.cn-cal-d.ok { background: rgba(125,255,207,0.12); border-color: rgba(125,255,207,0.55); color: #8ff5d0; }
.cn-cal-d.today { box-shadow: 0 0 0 2px var(--cn-gold), 0 0 12px rgba(255,209,102,.4); }
.cn-cal-pad { aspect-ratio: 1; }
@media (hover: hover) { .cn-cal-d:not(.off):hover { border-color: var(--cn-cyan); } }
.cn-cal-d:focus-visible { outline: 2px solid var(--cn-cyan); outline-offset: 1px; }

.cn-toast { position: absolute; left: 50%; top: 60px; transform: translateX(-50%); z-index: 10; padding: 8px 14px; border-radius: 16px; width: max-content; max-width: min(calc(100% - 24px), 380px) !important; background: #e6f1ff; color: #06121a; font-size: 13px; font-weight: 800;
  animation: cn-drop .2s ease-out; pointer-events: none; max-width: calc(100% - 24px); text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.cn-toast.warn { background: var(--cn-gold); color: #1a1200; }
@keyframes cn-drop { from { opacity: 0; transform: translate(-50%, -6px); } }
.cn-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cn-help { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; }
.cn-help .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .cn-help .hint-kb { display: none; } .cn-help .hint-touch { display: inline; } }
.stage .cn-help { padding: 10px 14px 12px; }

/* narrow phones */
@media (max-width: 460px) {
  .cn-hud { gap: 6px; padding: 0 6px 0 8px; }
  .cn-pz { padding-right: 22px; padding-left: 8px; min-width: 84px; }
  .cn-pz-n { font-size: 16px; }
  .cn-score { gap: 8px; padding: 0 8px; }
  .cn-sc b { font-size: 17px; }
  .cn-tool { width: 36px; height: 36px; border-radius: 11px; }
  .cn-btn { font-size: 10.5px; border-radius: 12px; }
  .cn-panel { padding: 18px 14px 14px; }
  .cn-stats b { font-size: 15px; }
  .cn-panel .cn-stats:not(.three):not(.four) { grid-template-columns: repeat(3, 1fr); }
  .cn-tips { font-size: 12.5px; }
  .cn-felt { margin: 0 4px; border-radius: 14px; }
}
@media (max-width: 390px) { .cn-score small { display: none; } }
@media (max-width: 420px) { .cn-sc b { font-size: 16px; } .cn-score { gap: 8px; } }
@media (max-width: 400px) {
  .cn-sc b { font-size: 15px; } .cn-score { gap: 6px; padding: 0 6px; }
  .cn-stats.four span { letter-spacing: 0.04em; }
  .cn-hud { gap: 4px; padding: 0 5px 0 6px; }
  .cn-tool { width: 32px; height: 34px; }
  .cn-tool::after { content: ''; position: absolute; inset: -3px -2px; }   /* a bigger tap area than the button looks */
  .cn-pz { padding-right: 18px; } .cn-pz-dd { right: 3px; }
  .cn-pz-k, .cn-sc i { letter-spacing: 0.1em; }
}
@media (max-width: 350px) { #cn-sound { display: none; } }

/* a short stage (a phone on its side, full screen) */
.cn-short .cn-hud { height: 42px; }
.cn-short .cn-pz, .cn-short .cn-score { height: 36px; }
.cn-short .cn-pz-n { font-size: 15px; } .cn-short .cn-sc b { font-size: 15px; }
.cn-short .cn-tool { width: 34px; height: 34px; }
.cn-short .cn-tips { height: 34px; margin-top: 2px; }
.cn-short .cn-tips .cn-tmsg { -webkit-line-clamp: 1; }
.cn-short .cn-bar { height: 46px; padding: 4px 8px 6px; }
.cn-short .cn-btn { flex-direction: row; gap: 6px; font-size: 11.5px; }
.cn-short .cn-btn svg { width: 18px; height: 18px; }
.cn-short .cn-seat { gap: 5px; } .cn-short .cn-av { width: 22px; height: 22px; font-size: 11px; }
.cn-short .cn-si { flex-direction: row; align-items: baseline; gap: 6px; } .cn-short .cn-si b { flex: none; }
.cn-short .cn-card { bottom: 54px; }
.cn-pinfo.short { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 8px; }

/* full screen: the table takes every pixel */
.stage.is-immersive .stage-body > .cn { min-height: 0; flex: 1 1 auto; }
.stage.is-immersive .cn-stage { flex: 1 1 auto; height: auto; max-height: none; min-height: 0; }
.stage.is-immersive .cn-help { display: none; }
@media (prefers-reduced-motion: reduce) { .cn-c, .cn-ghost { transition: none !important; } .cn-panel, .cn-toast, .cn-overlay, .cn-card, .cn-bub { animation: none; } .cn-seat.cur .cn-av, .cn-stock.live, .cn-out.ready, .cn-stagebox, .cn-think i { animation: none; } }
.cn-calm .cn-c, .cn-calm .cn-ghost { transition: none !important; }
.cn-calm .cn-panel, .cn-calm .cn-toast, .cn-calm .cn-overlay, .cn-calm .cn-card, .cn-calm .cn-bub { animation: none; }
.cn-calm .cn-seat.cur .cn-av, .cn-calm .cn-stock.live, .cn-calm .cn-out.ready, .cn-calm .cn-stagebox, .cn-calm .cn-c.flash { animation: none; }
