:root {
  --paper: #ECE7DD; --paper2: #E3DDD1; --ink: #141212; --mute: #6c655c; --red: #C8102E; --gold: #F2C230; --green: #2F8F4E;
  --cream: #F4EFE6; --line: rgba(20,18,18,.12);
  --hw: 80px; --fw: 74px; --sw: 36px; --ow: 38px; --side: 220px;
  --kk-back: none;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--paper); }
body { font-family: "Montserrat", "Zen Kaku Gothic New", system-ui, sans-serif; color: var(--ink); -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
:lang(ja) body, body:lang(ja) { font-family: "Zen Kaku Gothic New", "Montserrat", system-ui, sans-serif; }
button { font: inherit; color: inherit; }

.kk { position: relative; height: 100vh; display: flex; flex-direction: column; gap: 8px; padding: 0 14px 10px; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 45%, rgba(255,255,255,.55), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.07 0 0 0 0 0.07 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--paper); }
@supports (height: 100dvh) { .kk { height: 100dvh; } }

/* top bar */
.kk-top { display: flex; align-items: center; gap: 10px; height: 46px; flex: none; border-bottom: 1px solid var(--line); }
.kk-brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; }
.kk-brand b { font: 900 13px/1 "Montserrat", sans-serif; letter-spacing: .22em; }
.kk-brand span { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.kk-round { margin-left: auto; font: 700 13px/1 "Montserrat", "Zen Kaku Gothic New", sans-serif; color: var(--mute); letter-spacing: .04em; white-space: nowrap; }
.kk-score { display: flex; gap: 6px; }
.kk-score span { display: flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 99px; background: rgba(20,18,18,.06); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.kk-score span:last-child { background: var(--ink); color: #fff; }
.kk-score i { font-style: normal; opacity: .75; }
.kk-score b { font: 800 16px/1 "Montserrat", sans-serif; min-width: 1.2em; text-align: right; }
.kk-btn { cursor: pointer; border: 1.5px solid var(--ink); background: transparent; border-radius: 99px; padding: 10px 18px; font-weight: 700; font-size: 14px; line-height: 1.2; transition: background .15s, color .15s, transform .12s; }
.kk-btn:hover { background: rgba(20,18,18,.07); }
.kk-btn:active { transform: scale(.97); }
.kk-btn:focus-visible, .ch:focus-visible, .kk-x:focus-visible, .lk:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.kk-btn.kk-pri { background: var(--ink); color: #fff; }
.kk-btn.kk-pri:hover { background: #2b2725; }
.kk-btn.on { background: var(--red); border-color: var(--red); color: #fff; }
.kk-ico { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; font: 800 16px/1 "Montserrat", sans-serif; flex: none; }
.kk-mus { position: relative; }
.kk-mus.off { opacity: .45; }
.kk-mus.off::after { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: currentColor; transform: rotate(-45deg); }
.cr { margin: 16px 0 0; font-size: 11px; line-height: 1.5; opacity: .6; }
.cr a { color: inherit; }

/* rows */
.kk-opp, .kk-me { flex: none; display: flex; align-items: flex-start; gap: 14px; }
.kk-mid { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; gap: calc(var(--fw) * .35); }
/* landscape: deck on the left, table in the middle, captured cards on the right (like the Yakuza koi-koi table); the hint sits between the table and the hand */
.kk.land { display: grid; grid-template-columns: calc(var(--fw) * 1.25) minmax(0, 1fr) var(--side);
  grid-template-rows: 40px auto minmax(0, 1fr) 32px auto; row-gap: 6px; column-gap: calc(var(--fw) * .2); padding-bottom: 8px;
  grid-template-areas: "top top top" "deck opp cap1" "deck field cap1" "deck hint cap0" "deck me cap0"; }
.land .kk-top { grid-area: top; height: 40px; }
.land .kk-opp, .land .kk-mid, .land .kk-me { display: contents; }
.land .kk-hand-opp { grid-area: opp; justify-self: center; padding-top: 2px; }
.land .kk-field { grid-area: field; align-self: center; justify-self: center; row-gap: calc(var(--fw) * .06); }
.land .kk-deckbox { grid-area: deck; align-self: center; justify-self: center; }
.land .kk-opp .kk-capwrap { grid-area: cap1; align-self: start; padding-top: 6px; }
.land .kk-me .kk-capwrap { grid-area: cap0; align-self: end; }
.land .kk-hand { grid-area: me; justify-self: center; gap: calc(var(--hw) * .04); }
.land .kk-hint { grid-area: hint; }
.land .kk-cap { flex-wrap: wrap; row-gap: calc(var(--sw) * .3); width: 100%; }
.land .kk-side { grid-area: cap1; align-self: end; justify-self: start; margin-bottom: 4px; }
.kk-combos { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 13px; background: var(--ink); color: #fff; }
.kk-combos:hover { background: #2b2725; }

/* cards: one element per card; the picture is an <img> that is decoded once */
.cd { --w: var(--fw); position: relative; display: block; width: var(--w); height: calc(var(--w) * 1.6); flex: none; border-radius: calc(var(--w) * .08); background: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.25), 0 calc(var(--w) * .05) calc(var(--w) * .12) rgba(20,18,18,.22); }
.cd-a { position: absolute; left: 24%; top: 3.2%; width: 71%; height: 93.6%; display: block; border-radius: calc(var(--w) * .04); background: var(--cream); object-fit: cover; object-position: center; pointer-events: none; -webkit-user-drag: none; }
.cd-s { position: absolute; left: 0; top: 0; bottom: 0; width: 24%; display: flex; flex-direction: column; align-items: center; padding: calc(var(--w) * .05) 0 calc(var(--w) * .06); }
.cd-n { font: 900 calc(var(--w) * .17)/1 "Montserrat", sans-serif; color: var(--gold); letter-spacing: -.04em; }
.cd-l { flex: 1; min-height: 0; margin-top: calc(var(--w) * .05); writing-mode: vertical-rl; font-weight: 700; font-size: calc(var(--w) * .105); line-height: 1; color: #fff; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
:lang(ja) .cd-l { text-transform: none; letter-spacing: .1em; }
.cd-i { display: block; width: calc(var(--w) * .15); height: calc(var(--w) * .15); margin-top: calc(var(--w) * .04); }
.cd-i svg { display: block; width: 100%; height: 100%; }
/* face down (the opponent's hand): the same element shows the back */
.cd-back { background: var(--kk-back) center / 200% auto, var(--red); outline: calc(var(--w) * .05) solid var(--ink); outline-offset: calc(var(--w) * -.05); }
.cd-back > * { visibility: hidden; }
/* rings (match, selected, just taken) live on a pseudo-element, so pulsing them only changes opacity */
.cd::before { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; opacity: 0; }

/* opponent hand */
.kk-hand-opp { display: flex; padding-left: 4px; min-height: calc(var(--ow) * 1.6); }
.kk-hand-opp .cd { --w: var(--ow); margin-left: calc(var(--ow) * -.45); }
.kk-hand-opp .cd:first-child { margin-left: 0; }

/* captured piles */
.kk-capwrap { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.land .kk-capwrap { align-items: stretch; }
.kk-zh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; min-height: 16px; }
.kk-zh > b { font: 800 11px/1.3 "Montserrat", "Zen Kaku Gothic New", sans-serif; letter-spacing: .07em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.kk-cap { display: flex; gap: calc(var(--sw) * .35); min-height: calc(var(--sw) * 1.6 + 15px); flex-wrap: nowrap; }
.kk-cap:empty::before { content: attr(data-empty); align-self: center; font-size: 12px; font-weight: 600; color: rgba(20,18,18,.36); }
.pile { position: relative; display: flex; flex-direction: column; gap: 3px; }
.pile .pl { font: 800 10px/1.2 "Montserrat", "Zen Kaku Gothic New", sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.pile-h .pl { color: #b07d00; } .pile-a .pl { color: var(--green); } .pile-r .pl { color: var(--red); }
.pc { position: relative; display: flex; }
.pile .cd { --w: var(--sw); margin-left: calc(var(--sw) * -.5); }
.land .pile .cd { margin-left: calc(var(--sw) * -.62); }
/* captured cards: art only (no black side strip), so a stack shows the pictures fanned out */
.pile .cd .cd-s { display: none; }
.pile .cd .cd-a { left: 4%; top: 2.5%; width: 92%; height: 95%; border-radius: calc(var(--w) * .06); }
.pile .cd + .cd { box-shadow: -2px 0 3px rgba(20,18,18,.35); }
.pile .cd:first-child { margin-left: 0; }
.pile em { position: absolute; right: calc(var(--sw) * -.18); top: calc(var(--sw) * -.18); z-index: 21; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: #fff; font: 800 10px/18px "Montserrat", sans-serif; font-style: normal; text-align: center; }
.cd.sm .cd-l { display: none; }
.cd.sm .cd-s { padding-top: calc(var(--w) * .08); justify-content: space-between; }
.cd.sm .cd-n { font-size: calc(var(--w) * .2); }
.cd.sm .cd-i { width: calc(var(--w) * .2); height: calc(var(--w) * .2); }
.cd.pop::before { box-shadow: 0 0 0 calc(var(--w) * .07) var(--gold), 0 0 calc(var(--w) * .5) rgba(242,194,48,.9); animation: pop .8s ease-out both; }
@keyframes pop { 0%, 35% { opacity: 1; } 100% { opacity: 0; } }
.kk-yk { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 12px; font-weight: 700; color: var(--ink); }
.kk-yk b { font-family: "Montserrat", sans-serif; color: var(--red); }
.kk-yk .koi { color: #fff; background: var(--red); padding: 1px 8px; border-radius: 99px; }

/* field */
.kk-field { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, calc(var(--fw) * 1.6)); grid-auto-columns: var(--fw); gap: calc(var(--fw) * .1) calc(var(--fw) * .08); }
.slot { position: relative; width: var(--fw); height: calc(var(--fw) * 1.6); border-radius: calc(var(--fw) * .08); }
.slot:empty { outline: 1.5px dashed rgba(20,18,18,.09); outline-offset: -2px; }
.slot .cd { cursor: default; transition: transform .18s; }
.cd.glow, .cd.hov { transform: translateY(calc(var(--w) * -.06)); }
.cd.glow { cursor: pointer; }
.cd.glow::before, .cd.hov::before { opacity: 1; box-shadow: 0 0 0 calc(var(--w) * .04) var(--gold), 0 0 calc(var(--w) * .3) rgba(242,194,48,.8); }
.cd.glow::before { animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { to { opacity: .5; } }
.cd.on-top { position: absolute; left: 22%; top: 16%; z-index: 4; box-shadow: 0 10px 22px rgba(20,18,18,.35); }

/* deck */
.kk-deckbox { display: flex; flex-direction: column; align-items: center; gap: calc(var(--fw) * .12); }
.kk-deck { position: relative; width: var(--fw); height: calc(var(--fw) * 1.6); --w: var(--fw); border-radius: calc(var(--fw) * .08);
  background: radial-gradient(circle at 50% 50%, var(--cream) 0 18%, transparent 19%), var(--kk-back) center / 200% auto, var(--red);
  outline: calc(var(--fw) * .05) solid var(--ink); outline-offset: calc(var(--fw) * -.05);
  box-shadow: 2px 2px 0 var(--ink), 4px 4px 0 #3a3532, 6px 6px 0 var(--ink), 0 10px 20px rgba(20,18,18,.25); }
.kk-deck span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 900 calc(var(--fw) * .17)/1 "Montserrat", sans-serif; color: var(--ink); }
.kk-deck.empty { opacity: .15; box-shadow: none; }
.kk-drawn { width: var(--fw); height: calc(var(--fw) * 1.6); }
.kk-drawn .cd { box-shadow: 0 0 0 3px var(--ink), 0 12px 24px rgba(20,18,18,.35); }
.port .kk-deckbox { order: -1; }

/* my hand */
.kk-hand { display: flex; gap: calc(var(--hw) * .1); padding-top: calc(var(--hw) * .14); min-height: calc(var(--hw) * 1.74); }
.kk-hand .cd { --w: var(--hw); transition: transform .18s cubic-bezier(.2,.75,.25,1); }
.kk-hand .cd.can { cursor: pointer; }
@media (hover: hover) { .kk-hand .cd.can:not(.sel):hover { transform: translateY(calc(var(--hw) * -.08)); } }
/* gold frame: this card has a pair on the table */
.kk-hand .cd.has::before { opacity: 1; box-shadow: 0 0 0 calc(var(--w) * .035) var(--gold); }
.kk-hand .cd.sel { transform: translateY(calc(var(--hw) * -.16)); z-index: 5; }
.kk-hand .cd.sel::before { opacity: 1; box-shadow: 0 0 0 calc(var(--w) * .045) var(--red), 0 14px 26px rgba(20,18,18,.35); }

/* the hint: one clear line about what to do now */
.kk-hint { justify-self: center; align-self: center; max-width: 100%; padding: 6px 16px; border-radius: 99px; font-size: 14px; line-height: 1.3; font-weight: 700; text-align: center; opacity: 0; transition: opacity .15s; }
.kk-hint.on { opacity: 1; background: var(--ink); color: #fff; }
.kk-hint.on.cpu { background: rgba(20,18,18,.08); color: var(--mute); }

/* banner */
.kk-banner { position: absolute; left: 50%; top: 46%; z-index: 30; transform: translate(-50%, -50%) scale(.85); padding: 14px 30px; border-radius: 99px; background: var(--ink); color: #fff;
  font: 900 clamp(18px, 3.4vw, 34px)/1.15 "Zen Kaku Gothic New", "Montserrat", sans-serif; letter-spacing: .04em; width: max-content; max-width: calc(100% - 32px); text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s cubic-bezier(.2,.75,.25,1); }
.kk-banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.kk-banner.b-cpu { background: var(--red); }

/* first-run hint (not a modal: the table stays usable) */
.kk-tip { position: absolute; z-index: 25; left: 50%; top: 52px; transform: translateX(-50%); width: min(430px, calc(100% - 20px)); padding: 14px 16px; border-radius: 16px; background: var(--ink); color: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.kk-tip[hidden] { display: none; }
/* wide screens: in the free part of the right column, so the table and the opponent stay visible */
.land .kk-tip { left: auto; right: 12px; top: 132px; transform: none; width: clamp(260px, var(--side), 360px); }
.tip-h { display: block; font-size: 15px; font-weight: 900; margin-bottom: 6px; }
.kk-tip ol { margin-left: 18px; display: grid; gap: 4px; font-size: 13.5px; line-height: 1.45; font-weight: 500; }
.kk-tip p { display: flex; gap: 8px; margin-top: 10px; }
.kk-tip .kk-btn { padding: 9px 16px; font-size: 13px; border-color: #fff; }
.kk-tip .kk-btn:hover { background: rgba(255,255,255,.14); }
.kk-tip .kk-btn.kk-pri { background: #fff; color: var(--ink); }

/* modal */
.kk-modal { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(20,18,18,.6); }
.kk-modal[hidden] { display: none; }
.kk-modal.peek { background: transparent; cursor: pointer; }
.kk-modal.peek .kk-box { visibility: hidden; }
.kk-modal.peek::after { content: attr(data-back); position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); padding: 10px 18px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; }
.kk-box { width: min(560px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: var(--cream); border-radius: 18px; padding: clamp(16px, 3vw, 28px); box-shadow: 0 30px 70px rgba(0,0,0,.35); user-select: text; -webkit-user-select: text; }
.kk-box.st-box { width: min(720px, 100%); }
.kk-box.cb-box { width: min(820px, 100%); }
.kk-x { position: sticky; top: 0; float: right; z-index: 5; width: 38px; height: 38px; margin: -4px -4px 0 10px; border: 0; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 0 5px var(--cream); }
.kk-box h2 { font-size: clamp(22px, 3.4vw, 28px); font-weight: 900; line-height: 1.2; margin-bottom: 10px; }
.kk-box h2.w { color: var(--red); }
.kk-box h3 { font-size: 16px; font-weight: 900; margin: 22px 0 8px; }
.kk-box h3.h-st { margin-top: 14px; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); }
.kk-box .lead { font-size: 15px; line-height: 1.6; color: #3b3633; }
.kk-box .tx { font-size: 14px; line-height: 1.6; color: #3b3633; margin: 8px 0; }
.kk-box .len { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; font-weight: 700; color: var(--mute); }
.kk-box .len span { margin-right: 4px; }
.kk-box .len .kk-btn { min-width: 52px; padding: 9px 14px; font-size: 14px; color: var(--ink); }
.kk-box .len .kk-btn.on { color: #fff; }
.kk-box .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.kk-box .acts .kk-btn { flex: 1 1 auto; padding: 14px 20px; font-size: 16px; }
.kk-box details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.kk-box summary { cursor: pointer; font-weight: 800; font-size: 14px; padding: 4px 0; }

/* small card pictures in the rules and popups */
.tn { --w: 38px; display: inline-block; vertical-align: middle; box-shadow: 0 1px 3px rgba(20,18,18,.3); }
.sg { align-self: center; font: 800 17px/1 "Montserrat", sans-serif; font-style: normal; color: var(--mute); }
.lb { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
.lb small { font: 800 9.5px/1 "Montserrat", "Zen Kaku Gothic New", sans-serif; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.pr { display: inline-flex; }
.pr .tn + .tn { margin-left: calc(var(--w) * -.45); }
.tb { display: inline-flex; padding: 3px; border: 1.5px dashed rgba(20,18,18,.32); border-radius: 7px; }
/* the turn in 3 steps */
.steps { list-style: none; display: grid; gap: 7px; }
.steps li { display: grid; grid-template-columns: 26px 206px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 12px; border-radius: 12px; background: #fff; }
.st-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--gold); font: 900 13px/1 "Montserrat", sans-serif; }
.st-p { display: flex; align-items: flex-start; gap: 6px; }
.st-p .tn { --w: 34px; }
.st-p .sg { margin-top: 19px; align-self: flex-start; }
.steps p { font-size: 13.5px; line-height: 1.5; color: #2c2826; font-weight: 500; }
/* pairs */
.mts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.mt { padding: 10px 8px; border-radius: 12px; background: #fff; text-align: center; }
.mt-c { display: flex; justify-content: center; align-items: center; gap: 7px; }
.mt-c .tn { --w: 48px; }
.mt p { margin-top: 7px; font-size: 12px; line-height: 1.35; font-weight: 600; color: #3b3633; }
.mt p b { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.mt.ok .sg, .mt.ok p b { color: var(--green); }
.mt.no .sg, .mt.no p b { color: var(--red); }
.mt.no .tn { opacity: .75; }
.fr { display: flex; align-items: center; gap: 6px; margin: 8px 0 4px; }
/* kinds */
.kds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.kd { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 6px; border-radius: 12px; background: #fff; text-align: center; }
.kd .tn { --w: 48px; }
.kd p b { display: block; font-size: 13px; font-weight: 800; }
.kd p small { display: block; font-size: 11.5px; color: var(--mute); font-weight: 600; }
/* combinations with their cards */
.yks { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin: 10px 0; }
.yk { padding: 10px 12px; border-radius: 12px; background: #fff; }
.yk-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 800; font-size: 14px; line-height: 1.3; }
.yk-h b { font-family: "Montserrat", sans-serif; color: var(--red); white-space: nowrap; }
.yk-c { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.yk-d { margin-top: 7px; font-size: 12px; line-height: 1.45; color: var(--mute); font-weight: 500; }
/* koi-koi or stop */
.kq { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.kq-o { padding: 10px 12px; border-radius: 12px; background: #fff; }
.kq-o b { font-size: 15px; font-weight: 900; }
.kq-k b { color: var(--red); }
.kq-o p { margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: #3b3633; }
/* the question itself */
.ch2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.ch { cursor: pointer; display: flex; flex-direction: column; gap: 5px; padding: 13px 15px; border: 1.5px solid var(--ink); border-radius: 14px; background: transparent; text-align: left; transition: background .15s, transform .12s; }
.ch:hover { background: rgba(20,18,18,.06); }
.ch:active { transform: scale(.98); }
.ch b { font-size: 18px; font-weight: 900; line-height: 1.2; }
.ch span { font-size: 12.5px; line-height: 1.45; font-weight: 500; }
.ch.kk-pri { background: var(--ink); color: #fff; }
.ch.kk-pri:hover { background: #2b2725; }
.lk { border: 0; background: none; padding: 12px 0 12px 12px; min-height: 44px; cursor: pointer; font-weight: 700; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.yl { list-style: none; display: grid; gap: 6px; margin: 6px 0 10px; }
.yl li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 9px 12px; border-radius: 10px; background: #fff; font-weight: 700; font-size: 14px; }
.yl b { font-family: "Montserrat", sans-serif; color: var(--red); white-space: nowrap; }
.yl-c { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 3px; }
.yl-c .tn { --w: 30px; }
.tot { font-weight: 700; font-size: 15px; text-align: right; }
.tot b { font: 900 22px/1 "Montserrat", sans-serif; margin-left: 6px; }
.tot small { margin-left: 8px; font-size: 12px; color: var(--red); font-weight: 700; }
.x2 { font-size: 13px; font-weight: 700; color: var(--red); text-align: right; }
.note { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 14px; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--mute); line-height: 1.5; }
.sc { display: flex; justify-content: center; gap: 22px; margin-top: 14px; font-weight: 700; color: var(--mute); }
.sc b { font: 900 22px/1 "Montserrat", sans-serif; color: var(--ink); margin-left: 6px; }
.sc.big b { font-size: 38px; }
/* the Start button doubles as the loading bar: it fills while the cards load, then switches on */
.kk-go { position: relative; overflow: hidden; }
.kk-go span { position: relative; }
.go-bar { position: absolute; inset: 0; background: var(--red); transform-origin: 0 50%; transform: scaleX(0); transition: transform .2s linear, opacity .3s; }
.kk-go.rdy .go-bar, .kk-go:not([disabled]) .go-bar { opacity: 0; }
.kk-go[disabled] { cursor: progress; background: #4a4441; border-color: #4a4441; }
.kk-go[disabled]:hover { background: #4a4441; }
.kk-go[disabled]:active { transform: none; }

/* an unmatched card: the empty spots on the table you can put it on */
.slot.drop { cursor: pointer; outline: 2px dashed var(--gold); outline-offset: -3px; }
.slot.drop::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(242,194,48,.3); animation: dropPulse 1s ease-in-out infinite alternate; }
@keyframes dropPulse { to { opacity: .35; } }

/* combinations popup + cards by month */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tabs .kk-btn { padding: 9px 16px; font-size: 13px; }
.tabs .kk-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cb:not([hidden]) { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.cb-r { padding: 10px 12px; border-radius: 12px; background: #fff; }
.cb-h { display: flex; flex-wrap: wrap; gap: 2px 12px; font-weight: 800; font-size: 13.5px; }
.cb-h b { font-family: "Montserrat", sans-serif; color: var(--red); }
.cb-d { margin-top: 3px; font-size: 12px; line-height: 1.45; color: var(--mute); }
.cb-c { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.cb-c:empty { display: none; }
.cb-c .tn { --w: 44px; opacity: .45; }
.cb-c .tn.got0, .cb-c .tn.got1 { opacity: 1; }
.cb-c .tn.got0 { box-shadow: 0 0 0 2px var(--gold), 0 2px 6px rgba(0,0,0,.25); }
.cb-c .tn.got1 { box-shadow: 0 0 0 2px var(--red), 0 2px 6px rgba(0,0,0,.25); }
.cb-n { margin-top: 6px; font-size: 12px; font-weight: 700; color: #3b3633; }
.mo:not([hidden]) { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.mo-r { padding: 10px 12px; border-radius: 12px; background: #fff; }
.mo-h { font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.mo-h b { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-right: 8px; border-radius: 6px; background: var(--ink); color: var(--gold); font: 900 13px/1 "Montserrat", sans-serif; }
.mo-h small { font-weight: 500; color: var(--mute); }
.mo-c { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mo-c figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mo-c .tn { --w: 56px; }
.mo-c figcaption { font-size: 10.5px; line-height: 1.25; text-align: center; font-weight: 700; color: #3b3633; }
.mo-k { display: block; font-style: normal; font-weight: 800; font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
.mo-k.k-h { color: #b07d00; } .mo-k.k-a { color: var(--green); } .mo-k.k-r { color: var(--red); }

/* phone (portrait): like card-game apps – opponent on top, captured cards in two panels, the hint above the own captured cards, own hand fanned at the bottom */
.kk.port { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 48px auto auto minmax(0, 1fr) 36px auto auto;
  grid-template-areas: "top top" "opp opp" "cap1 cap1" "mid mid" "hint side" "cap0 cap0" "me me"; row-gap: 6px; column-gap: 8px; padding: 0 10px 6px; }
.port .kk-top { grid-area: top; height: 48px; gap: 8px; }
.port .kk-brand { display: none; }
.port .kk-round { margin-left: 0; margin-right: auto; }
.port .kk-ico { width: 40px; height: 40px; }
.port .kk-opp, .port .kk-me { display: contents; }
.port .kk-hand-opp { grid-area: opp; justify-self: center; min-height: 0; height: calc(var(--ow) * 1.2); overflow: hidden; padding-left: 0; }
.port .kk-opp .kk-capwrap { grid-area: cap1; }
.port .kk-me .kk-capwrap { grid-area: cap0; }
.port .kk-capwrap { background: rgba(20,18,18,.045); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; min-height: calc(var(--sw) * 1.6 + 50px); gap: 4px; }
.port .kk-zh { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
.port .kk-yk { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.port .pile .cd { margin-left: calc(var(--sw) * (var(--ov, .4) - 1)); }
.port .pile .cd:first-child { margin-left: 0; }
.port .pile em { right: -3px; top: -4px; }
.port .kk-mid { grid-area: mid; }
.port .kk-hand { grid-area: me; justify-content: center; min-height: 0; padding-top: calc(var(--hw) * .26); padding-bottom: calc(var(--hw) * .12); gap: 0; }
.port .kk-hand .cd { margin-left: calc(var(--hw) * -.4); transform: translateY(var(--fy, 0px)) rotate(var(--fr, 0deg)); transform-origin: 50% 100%; box-shadow: -3px 2px 6px rgba(20,18,18,.3); }
.port .kk-hand .cd:first-child { margin-left: 0; }
.port .kk-hand .cd.sel { transform: translateY(calc(var(--fy, 0px) - var(--hw) * .25)) rotate(var(--fr, 0deg)); }
.port .kk-hand .cd.has::before { box-shadow: 0 0 0 3px var(--gold); }
.port .kk-hint { grid-area: hint; justify-self: start; align-self: center; max-width: 100%; padding: 5px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.25; text-align: left; }
.port .kk-side { grid-area: side; justify-self: end; align-self: center; }
.port .kk-combos { padding: 11px 12px; font-size: 12px; gap: 6px; }
.port .kk-tip { top: 54px; padding: 10px 12px; }
.port .tip-h { font-size: 13.5px; margin-bottom: 3px; }
.port .kk-tip ol { font-size: 12.5px; line-height: 1.35; gap: 2px; }
.port .kk-tip p { margin-top: 7px; }
.port .kk-tip .kk-btn { padding: 11px 16px; }

@media (max-width: 600px) {
  .kk-round { font-size: 12px; }
  .kk-score span { padding: 6px 9px; }
  .kk-modal { padding: 10px; }
  .steps li { grid-template-columns: 26px minmax(0, 1fr); gap: 6px 10px; padding: 9px 10px; }
  .steps p { grid-column: 2; }
  .mts { gap: 6px; }
  .mt { padding: 8px 4px; }
  .mt-c { gap: 4px; }
  .mt-c .tn { --w: 34px; }
  .kds { grid-template-columns: repeat(2, 1fr); }
  .kq, .ch2 { grid-template-columns: 1fr; }
  .yk-c .tn { --w: 34px; }
  .cb-c .tn { --w: 38px; }
  .mo-c .tn { --w: 50px; }
}
@media (max-width: 380px) {
  .port .kk-top { gap: 5px; }
  .port .kk-ico { width: 38px; height: 38px; }
  .kk-round { font-size: 11px; letter-spacing: 0; }
  .kk-score { gap: 4px; }
  .kk-score span { padding: 6px 7px; gap: 5px; font-size: 12px; }
  .kk-score b { font-size: 15px; min-width: 1em; }
}
@media (prefers-reduced-motion: reduce) { .cd.glow::before, .slot.drop::before, .cd.pop::before { animation: none; } .cd.pop::before { opacity: 0; } }
