/* War Card Game. Card faces, backs and the felt come from the shared card kit; everything here is the table. */
.wc { max-width: 1000px; margin: 0 auto; }
.wc-stage { position: relative; display: flex; flex-direction: column; height: min(84vh, 760px); min-height: 480px; border-radius: 14px; overflow: hidden; outline: none; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; --p0: #55d6ff; --p1: #ff6b81; --p2: #ffd166; --p3: #b79bff; }
.wc-stage:focus-visible::after { content: ''; position: absolute; inset: 0; z-index: 70; border-radius: inherit; box-shadow: inset 0 0 0 2px #55d6ff; pointer-events: none; }
@media (max-width: 600px) { .wc-stage { height: auto; aspect-ratio: 3 / 5; max-height: 88vh; min-height: 470px; } }
@media (max-height: 540px) and (orientation: landscape) { .wc-stage { height: 94vh; min-height: 300px; aspect-ratio: auto; max-height: none; } }
.stage.is-immersive .stage-body > .wc { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; max-width: none; width: 100%; }
.stage.is-immersive .wc-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; border-radius: 0; }
.stage.is-immersive .wc-help { display: none; }
.wc-help .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .wc-help .hint-kb { display: none; } .wc-help .hint-touch { display: inline; } }
.wc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wc [hidden] { display: none !important; }
.wc button { font-family: inherit; }
.wc svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wc .ck-card svg { fill: currentColor; stroke: none; }

/* ---- top bar */
.wc-hud { position: relative; z-index: 5; flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: rgba(4,6,15,0.58); }
.wc-modes { display: inline-flex; align-items: center; background: #0b1328; border: 1px solid #1c2b4a; border-radius: 10px; padding: 2px; flex: none; }
.wc-modes button { min-height: 40px; min-width: 40px; border: 0; background: transparent; color: #8aa3c4; font-size: 13px; font-weight: 700; padding: 0 10px; border-radius: 8px; cursor: pointer; touch-action: manipulation; white-space: nowrap; }
.wc-modes button b { font-weight: 800; }
.wc-modes button[aria-checked="true"] { background: #1c2b4a; color: #fff; }
.wc-modes button:focus-visible, .wc-rules:focus-visible, .wc-tool:focus-visible, .wc-auto:focus-visible, .wc-flip:focus-visible, .wc-speed button:focus-visible, .wc-pflip:focus-visible, .wc-pile:focus-visible, .wc-hc:focus-visible { outline: 2px solid #55d6ff; outline-offset: 2px; }
.wc-rules { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; min-width: 0; padding: 0 6px 0 11px; border-radius: 10px; border: 1px solid #1c2b4a; background: #0b1328; color: #dfe9ff; font-size: 13px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.wc-rules span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-rules svg { width: 18px; height: 18px; flex: none; color: #8aa3c4; }
.wc-rules .wc-ic-set { display: none; }
.wc-sp { flex: 1 1 0; min-width: 0; }
.wc-tool { width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid #1c2b4a; background: #0b1328; color: #dfe9ff; cursor: pointer; touch-action: manipulation; }
.wc-tool svg { width: 20px; height: 20px; }
.wc-tool:hover, .wc-rules:hover { border-color: #2f4a7c; }
#wc-sound[aria-pressed="true"] .on, #wc-sound[aria-pressed="false"] .off { display: none; }
#wc-sound[aria-pressed="true"] { color: #8aa3c4; }
@media (max-width: 600px) {
  .wc-hud { gap: 4px; padding: 5px 6px; }
  .wc-modes button { padding: 0; }
  .wc-modes button span { display: none; }
  .wc-modes::before { content: 'Players'; color: #8aa3c4; font-size: 11.5px; font-weight: 700; padding: 0 5px 0 7px; }
  .wc-rules { padding-left: 8px; font-size: 12.5px; }
}
@media (max-width: 430px) {
  .wc-modes::before { display: none; }
  .wc-hud { gap: 3px; padding: 5px 4px; }
  .wc-modes { padding: 1px; }
  .wc-rules { min-width: 40px; padding: 0; justify-content: center; flex: none; }
  .wc-rules span, .wc-rules .wc-ic-drop { display: none; }
  .wc-rules .wc-ic-set { display: block; width: 20px; height: 20px; color: #dfe9ff; }
}

/* ---- the tug of war */
.wc-tug { position: relative; z-index: 4; flex: none; padding: 7px 10px 3px; background: linear-gradient(rgba(4,6,15,0.4), rgba(4,6,15,0)); }
.wc-bar { position: relative; display: flex; height: 22px; border-radius: 999px; overflow: hidden; background: #0b1328; box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.35); }
.wc-bar i { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; padding: 0 9px; font-style: normal; font-size: 12.5px; font-weight: 800; color: #06101f; background: var(--pc); overflow: hidden; white-space: nowrap; transition: flex-grow 0.35s cubic-bezier(.3,1.3,.5,1); box-shadow: inset 0 -7px 9px rgba(0,0,0,0.16), inset 0 2px 0 rgba(255,255,255,0.3); }
.wc-bar i + i { box-shadow: inset 2px 0 0 rgba(4,6,15,0.75), inset 0 -7px 9px rgba(0,0,0,0.16), inset 0 2px 0 rgba(255,255,255,0.3); }
.wc-bar i:last-child { justify-content: flex-end; }
.wc-bar i.wc-zero { padding: 0; }
.wc-bar.wc-two::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(4,6,15,0.55); }
.wc-line { display: flex; justify-content: space-between; gap: 8px; padding: 4px 3px 0; font-size: 12.5px; font-weight: 650; color: #b9cbe6; text-shadow: 0 1px 2px rgba(0,0,0,0.6); font-variant-numeric: tabular-nums; }
.wc-line span { white-space: nowrap; }
.wc-line b { color: #fff; }
.wc-line .wc-mid { color: #ffd166; font-weight: 800; }
.wc-line .wc-hot { color: #ffd166; }

/* ---- the table */
.wc-table { position: relative; flex: 1 1 auto; min-height: 0; }
.wc-table::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s; background: radial-gradient(ellipse at 50% 50%, rgba(255,107,129,0.3), rgba(255,107,129,0) 68%); }
.wc-table.wc-war::before { opacity: 1; }
.wc-seats, .wc-cards { position: absolute; inset: 0; }
.wc-cards { pointer-events: none; z-index: 6; }
.wc-name { position: absolute; z-index: 2; transform: translate(-50%, 0); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; background: rgba(4,6,15,0.62); color: #dfe9ff; font-size: 13px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.wc-name i { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); flex: none; }
.wc-name b { color: #fff; font-variant-numeric: tabular-nums; min-width: 1.2em; text-align: right; }
.wc-name.wc-tight { font-size: 12px; gap: 4px; padding: 3px 7px 3px 6px; }
.wc-name.wc-tight b { min-width: 1em; }
.wc-name.wc-out { opacity: 0.5; }
.wc-name.wc-out span { text-decoration: line-through; }
.wc-name.wc-bump b { animation: wc-bump 0.3s ease; }
.wc-rot { rotate: 180deg; }
.wc-name.wc-rot { transform: translate(50%, 0); }
.wc-slot { position: absolute; border-radius: calc(var(--cw) * 0.1); border: 2px dashed rgba(255,255,255,0.16); box-sizing: border-box; pointer-events: none; }
.wc-pile { position: absolute; z-index: 1; padding: 0; border: 0; background: transparent; border-radius: calc(var(--cw) * 0.1); cursor: default; touch-action: manipulation; }
.wc-pile.wc-mine { cursor: pointer; }
.wc-pile.wc-mine:hover .ck-card:last-of-type { filter: brightness(1.12); }
.wc-pile.wc-empty { border: 2px dashed rgba(255,255,255,0.16); box-sizing: border-box; }
.wc-pile .ck-card { pointer-events: none; }
.wc-mini { position: absolute; display: flex; gap: 3px; pointer-events: none; }
.wc-mini .ck-card { position: relative; }
.wc-card { will-change: transform; transition-property: transform, opacity, box-shadow, filter; transition-timing-function: cubic-bezier(.25,.8,.3,1); backface-visibility: hidden; }
.wc-card.wc-win { box-shadow: 0 0 0 3px #ffd166, 0 0 26px 4px rgba(255,209,102,0.75); z-index: 50 !important; }
.wc-card.wc-lose { filter: brightness(0.7) saturate(0.8); }
.wc-card.wc-tie { box-shadow: 0 0 0 3px #ff6b81, 0 0 24px 3px rgba(255,107,129,0.7); }
.wc-joker .wc-jk { position: absolute; left: 0; right: 0; bottom: 7%; text-align: center; font-size: calc(var(--cw) * 0.15); font-weight: 900; letter-spacing: 0.08em; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wc-joker .ck-big { top: 48%; width: calc(var(--cw) * 0.62); height: calc(var(--cw) * 0.62); }

.wc-banner { position: absolute; left: 50%; top: 50%; z-index: 55; transform: translate(-50%, -50%) scale(0.4); opacity: 0; pointer-events: none; font-size: clamp(34px, 9vw, 76px); font-weight: 900; letter-spacing: 0.04em; color: #fff; white-space: nowrap; text-shadow: 0 0 18px #ff6b81, 0 0 44px #ff3d5e, 0 3px 0 rgba(0,0,0,0.45); }
.wc-banner.show { animation: wc-banner var(--bd, 0.9s) cubic-bezier(.2,1.3,.4,1) forwards; }
.wc-banner.wc-gold { text-shadow: 0 0 18px #ffd166, 0 0 44px #ff9f1c, 0 3px 0 rgba(0,0,0,0.45); font-size: clamp(22px, 5.4vw, 44px); }
.wc-prompt { position: absolute; left: var(--pl, 8px); right: 8px; bottom: 6px; z-index: 54; width: fit-content; margin: 0 auto; padding: 5px 13px; border-radius: 15px; background: rgba(4,6,15,0.72); color: #fff; font-size: 13.5px; font-weight: 700; text-align: center; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.wc-prompt.show { opacity: 1; }
.wc-shake { animation: wc-shake 0.42s linear; }
.wc-pflip { position: absolute; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 92%, #fff), var(--pc)); color: #06101f; font-size: 22px; font-weight: 900; letter-spacing: 0.03em; cursor: pointer; touch-action: manipulation; box-shadow: 0 5px 0 color-mix(in srgb, var(--pc) 55%, #000), 0 8px 18px rgba(0,0,0,0.4); transition: transform 0.08s, box-shadow 0.08s, filter 0.15s; }
.wc-pflip small { font-size: 11.5px; font-weight: 800; opacity: 0.75; letter-spacing: 0; }
.wc-pflip:active, .wc-pflip.wc-ready { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--pc) 55%, #000), 0 3px 8px rgba(0,0,0,0.4); }
.wc-pflip.wc-ready { filter: saturate(0.6) brightness(0.8); }

/* ---- the dock */
.wc-dock { position: relative; z-index: 5; flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: rgba(4,6,15,0.58); }
.wc-flip { min-width: 168px; height: 56px; padding: 0 26px; border: 0; border-radius: 16px; background: linear-gradient(180deg, #ffe08f, #ffd166 55%, #f5bd3b); color: #1a1200; font-size: 21px; font-weight: 900; letter-spacing: 0.02em; cursor: pointer; touch-action: manipulation; box-shadow: 0 5px 0 #a8770f, 0 8px 22px rgba(255,209,102,0.28); transition: transform 0.08s, box-shadow 0.08s, opacity 0.15s; }
.wc-flip:active:not(:disabled), .wc-flip.wc-down { transform: translateY(4px); box-shadow: 0 1px 0 #a8770f, 0 3px 10px rgba(255,209,102,0.25); }
.wc-flip.wc-pulse { animation: wc-pulse 1.5s ease-in-out infinite; }
.wc-flip:disabled { opacity: 0.55; cursor: default; }
.wc-auto { display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 14px 0 10px; border-radius: 13px; border: 1px solid #1c2b4a; background: #0b1328; color: #dfe9ff; font-size: 14px; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.wc-auto svg { width: 20px; height: 20px; }
.wc-auto .wc-ic-play { fill: currentColor; stroke: none; }
.wc-auto .wc-ic-pause { display: none; stroke-width: 3; }
.wc-auto[aria-pressed="true"] { background: #55d6ff; border-color: #55d6ff; color: #04101c; }
.wc-auto[aria-pressed="true"] .wc-ic-play { display: none; }
.wc-auto[aria-pressed="true"] .wc-ic-pause { display: block; }
.wc-speed { display: inline-flex; align-items: center; height: 48px; border-radius: 13px; border: 1px solid #1c2b4a; background: #0b1328; }
.wc-speed button { width: 42px; height: 46px; border: 0; background: transparent; color: #dfe9ff; border-radius: 12px; cursor: pointer; touch-action: manipulation; display: inline-grid; place-items: center; }
.wc-speed button svg { width: 18px; height: 18px; }
.wc-speed button:disabled { opacity: 0.3; cursor: default; }
.wc-speed span { min-width: 54px; text-align: center; font-size: 13px; font-weight: 800; color: #dfe9ff; }
.wc-hand { display: flex; align-items: flex-end; justify-content: center; gap: 8px; --cw: 62px; --ch: 87px; --fs: 17px; }
.wc-hc { position: relative; width: var(--cw); height: var(--ch); padding: 0; border: 0; background: transparent; border-radius: calc(var(--cw) * 0.1); cursor: pointer; touch-action: manipulation; transition: transform 0.12s; }
.wc-hc:hover:not(:disabled), .wc-hc.wc-sel { transform: translateY(-7px); }
.wc-hc.wc-sel .ck-card { box-shadow: 0 0 0 3px #55d6ff, 0 6px 14px rgba(0,0,0,0.45); }
.wc-hc:disabled { cursor: default; }
.wc-hc.wc-gone { visibility: hidden; }
.wc-hc em { position: absolute; left: 50%; top: -9px; z-index: 2; transform: translateX(-50%); padding: 1px 7px; border-radius: 999px; font-style: normal; font-size: 10.5px; font-weight: 800; white-space: nowrap; background: #7be0a3; color: #062414; box-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.wc-hc em.wc-t { background: #ff6b81; color: #2a0510; }
.wc-hc kbd { position: absolute; right: 3px; bottom: 3px; z-index: 2; min-width: 15px; padding: 0 3px; border-radius: 4px; background: rgba(11,19,40,0.82); color: #dfe9ff; font: 700 10.5px/15px system-ui, sans-serif; text-align: center; }
@media (hover: none) { .wc-hc kbd, .wc-pflip small { display: none; } }
@media (max-width: 600px) {
  .wc-dock { gap: 6px; padding: 7px 6px calc(7px + env(safe-area-inset-bottom, 0px)); }
  .wc-flip { min-width: 0; flex: 1 1 0; max-width: 190px; padding: 0 10px; }
  .wc-auto { padding: 0 10px 0 7px; font-size: 13px; }
  .wc-speed button { width: 40px; }
  .wc-speed span { min-width: 46px; font-size: 12px; }
  .wc-line { font-size: 11.5px; }
  .wc-hand { --cw: 58px; --ch: 81px; --fs: 16px; gap: 6px; }
}
/* the narrowest phones: everything in the top bar and the dock still fits on one row */
@media (max-width: 380px) {
  .wc-hud { gap: 2px; }
  .wc-modes button { min-width: 35px; }
  .wc-rules { min-width: 38px; }
  .wc-tool { width: 38px; }
  .wc-speed button { width: 34px; }
  .wc-speed span { min-width: 42px; font-size: 11.5px; }
}
@media (max-width: 340px) {
  .wc-hud { padding-left: 3px; padding-right: 3px; }
  .wc-modes button { min-width: 30px; }
  .wc-rules { min-width: 34px; }
  .wc-tool { width: 34px; }
  .wc-dock { gap: 4px; padding-left: 4px; padding-right: 4px; }
  .wc-speed button { width: 30px; }
  .wc-hand { --cw: 50px; --ch: 70px; --fs: 14px; gap: 4px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .wc-flip { height: 46px; } .wc-auto, .wc-speed { height: 44px; } .wc-speed button { height: 42px; }
  .wc-dock { padding-top: 5px; padding-bottom: 5px; } .wc-hud { padding-top: 3px; padding-bottom: 3px; }
}

/* ---- panels */
.wc-overlay { position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 10px; background: rgba(2,4,10,0.7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: ck-fade 0.2s ease; }
.wc-sheet { max-width: 460px; max-height: 100%; padding: 20px 18px 16px; }
.wc-sheet h3 { font-size: 21px; }
.wc-sheet .ck-seg { flex-wrap: wrap; }
.wc-sheet .ck-seg button { min-height: 40px; }
.wc-sheet .ck-row { flex-wrap: wrap; gap: 6px 12px; }
.wc-sheet .ck-row > span { flex: 1 1 130px; }
.wc-result { margin: 0 40px 2px 0; font-size: 27px; font-weight: 900; color: #fff; letter-spacing: -0.01em; }
.wc-result.wc-w { color: #ffd166; }
.wc-ach { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.wc-ach span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; border: 1px solid #1c2b4a; background: #0b1328; color: #5f7696; font-size: 12px; font-weight: 700; }
.wc-ach span.wc-got { color: #ffd166; border-color: rgba(255,209,102,0.5); }
.wc-ach span.wc-new { background: #ffd166; color: #1a1200; border-color: #ffd166; }
.wc-ach svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.wc-eg { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; --cw: 40px; --ch: 56px; --fs: 13px; }
.wc-eg .ck-card { position: relative; flex: none; }
.wc-eg p { margin: 0 !important; flex: 1 1 0; }
.wc-eg u { text-decoration: none; font-weight: 900; color: #ffd166; font-size: 17px; }
.wc-steps { margin: 0 0 6px; padding-left: 20px; color: #b9cbe6; font-size: 14px; line-height: 1.5; }
.wc-steps li { margin-bottom: 5px; }
.wc-steps b { color: #fff; }

@keyframes wc-banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.14); } 30% { transform: translate(-50%, -50%) scale(1); } 78% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); } }
@keyframes wc-shake { 0%, 100% { transform: translate(0, 0); } 15% { transform: translate(-5px, 2px); } 30% { transform: translate(5px, -3px); } 45% { transform: translate(-4px, -2px); } 60% { transform: translate(4px, 2px); } 80% { transform: translate(-2px, 1px); } }
@keyframes wc-pulse { 0%, 100% { box-shadow: 0 5px 0 #a8770f, 0 8px 22px rgba(255,209,102,0.28); } 50% { box-shadow: 0 5px 0 #a8770f, 0 8px 34px 6px rgba(255,209,102,0.6); } }
@keyframes wc-bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: #ffd166; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .wc-banner.show { animation: wc-fadeonly var(--bd, 0.9s) linear forwards; transform: translate(-50%, -50%) scale(1); }
  .wc-shake, .wc-flip.wc-pulse, .wc-name.wc-bump b { animation: none; }
  .wc-bar i { transition: none; }
}
@keyframes wc-fadeonly { 0% { opacity: 0; } 15%, 80% { opacity: 1; } 100% { opacity: 0; } }
.wc-rec { margin: 8px 0 4px !important; font-size: 13.5px !important; color: #b9cbe6; }
.wc-rec b { color: #fff; }
