:root {
  --paper: #ECE7DD; --paper2: #E3DDD1; --ink: #141212; --mute: #6c655c; --red: #C8102E; --gold: #F2C230;
  --cream: #F4EFE6; --line: rgba(20,18,18,.12);
  --hw: 80px; --fw: 74px; --sw: 36px; --ow: 38px;
  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; }
: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: 100dvh; height: 100vh; display: flex; flex-direction: column; gap: 8px; padding: 0 14px 10px;
  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: 14px; 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 12px/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: 5px 10px; border-radius: 99px; background: rgba(20,18,18,.06); font-size: 12px; 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 15px/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 { 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: 32px; height: 32px; padding: 0; display: grid; place-items: center; font: 800 15px/1 "Montserrat", sans-serif; flex: none; }
.kk-mus { position: relative; font-size: 17px; }
.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: 14px 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) */
.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) auto auto; row-gap: 6px; column-gap: calc(var(--fw) * .2); padding-bottom: 6px;
  grid-template-areas: "top top top" "deck opp cap1" "deck field cap1" "deck me cap0" "deck hint cap0"; }
.land .kk-top { grid-area: top; }
.land .kk-opp, .land .kk-mid, .land .kk-me { display: contents; }
.land .kk-hand-opp { grid-area: opp; justify-self: center; padding-top: 6px; }
.land .kk-field { grid-area: field; align-self: center; justify-self: center; }
.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; flex-direction: column-reverse; }
.land .kk-hand { grid-area: me; justify-self: center; }
.land .kk-hint { grid-area: hint; }
.land .kk-cap { flex-wrap: wrap; row-gap: calc(var(--sw) * .3); }
.land .kk-top { height: 40px; }
.land .kk-side { grid-area: cap1; align-self: end; justify-self: start; margin-bottom: 10px; }
.port .kk-side { align-self: center; }
.kk-combos { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; font-size: 13px; background: var(--ink); color: #fff; }
.kk-combos:hover { background: #2b2725; }
/* combinations popup */
.kk-box:has(.cb) { width: min(760px, 100%); }
.cb { 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 .cd { --w: 44px; opacity: .38; filter: grayscale(.6); }
.cb-c .cd.got0, .cb-c .cd.got1 { opacity: 1; filter: none; }
.cb-c .cd.got0 { box-shadow: 0 0 0 2px var(--gold), 0 2px 6px rgba(0,0,0,.25); }
.cb-c .cd.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; }
.land .kk-hand-opp { padding-top: 2px; }
.land .kk-field { row-gap: calc(var(--fw) * .06); }
.land .kk-hand { gap: calc(var(--hw) * .04); }
.land .kk-hint { min-height: 18px; font-size: 12px; line-height: 18px; }
.port .kk-deckbox { order: -1; }

/* cards */
.cd { --w: var(--fw); position: relative; 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); overflow: hidden; }
.cd-a { position: absolute; left: 24%; right: 5%; top: 3.2%; bottom: 3.2%; border-radius: calc(var(--w) * .04); background: var(--cream) center / cover no-repeat; overflow: hidden; }
.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%; }
.cd-back { background:
    radial-gradient(circle at 50% 50%, var(--cream) 0 18%, transparent 19%),
    repeating-linear-gradient(45deg, rgba(244,239,230,.9) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, rgba(244,239,230,.9) 0 2px, transparent 2px 9px),
    var(--red);
  background-size: auto, calc(var(--w) * .3) calc(var(--w) * .3), calc(var(--w) * .3) calc(var(--w) * .3), auto;
  outline: calc(var(--w) * .05) solid var(--ink); outline-offset: calc(var(--w) * -.05); }

/* typographic placeholders (until the illustrations arrive) */
.ph { display: grid; place-items: center; }
.ph-mo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 900 calc(var(--w) * .42)/1 "Zen Kaku Gothic New", sans-serif; color: rgba(20,18,18,.13); writing-mode: vertical-rl; letter-spacing: -.05em; white-space: nowrap; }
.ph-key { position: relative; z-index: 2; display: grid; place-items: center; min-width: calc(var(--w) * .34); height: calc(var(--w) * .34); padding: 0 calc(var(--w) * .04); border-radius: calc(var(--w) * .04); background: var(--red); color: var(--cream); font: 900 calc(var(--w) * .2)/1 "Zen Kaku Gothic New", sans-serif; white-space: nowrap; }
.ph-key.ph-a { background: var(--ink); }
.ph-sun { position: absolute; left: 50%; top: 30%; width: calc(var(--w) * .5); height: calc(var(--w) * .5); margin-left: calc(var(--w) * -.25); border-radius: 50%; background: #E4322B; opacity: .9; }
.k-h .ph-key { margin-top: calc(var(--w) * .25); background: var(--ink); }
.ph-rib { position: relative; z-index: 2; width: calc(var(--w) * .2); height: 70%; transform: rotate(-8deg); border-radius: 2px; box-shadow: 0 2px 0 rgba(0,0,0,.1); }
.ph-aka { background: #E4322B; } .ph-red { background: #F08A24; } .ph-ao { background: #2B4C9B; }
.ph-aka::after { content: ""; position: absolute; left: 30%; right: 30%; top: 14%; bottom: 30%; background: repeating-linear-gradient(180deg, rgba(20,18,18,.85) 0 3px, transparent 3px 8px); }
.ph-n3 .ph-mo, .ph-n4 .ph-mo { color: rgba(20,18,18,.2); }
.ph-n4 { background: linear-gradient(180deg, var(--cream) 72%, #E4322B 72%); }
.ph-m12.ph-n4 { background: linear-gradient(180deg, var(--cream) 72%, #F2C230 72%); }

/* opponent hand */
.kk-hand-opp { display: flex; padding-left: 4px; }
.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: 4px; min-width: 0; }
.land .kk-capwrap { min-width: 0; align-items: stretch; }
.land .kk-cap { width: 100%; }
.land .pile .cd { margin-left: calc(var(--sw) * -.62); }
.land .pile .cd:first-child { margin-left: 0; }
.kk-cap { display: flex; gap: calc(var(--sw) * .35); min-height: calc(var(--sw) * 1.6); flex-wrap: nowrap; }
.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: #2F8F4E; } .pile-r .pl { color: var(--red); }
.pc { position: relative; display: flex; }
.pile .cd { --w: var(--sw); margin-left: calc(var(--sw) * -.5); }
/* 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%; right: 4%; top: 2.5%; bottom: 2.5%; 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-k .cd { margin-left: calc(var(--sw) * -.62); }
.pile em { position: absolute; right: calc(var(--sw) * -.18); top: calc(var(--sw) * -.18); z-index: 3; 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); }
.kk-yk { display: flex; flex-wrap: wrap; gap: 4px 10px; min-height: 16px; font-size: 12px; font-weight: 700; color: var(--mute); }
.kk-yk b { color: var(--ink); font-family: "Montserrat", sans-serif; }
.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, box-shadow .18s; }
.cd.glow { cursor: pointer; transform: translateY(calc(var(--w) * -.06)); box-shadow: 0 0 0 calc(var(--w) * .035) var(--gold), 0 0 calc(var(--w) * .3) rgba(242,194,48,.75), 0 6px 14px rgba(20,18,18,.25); animation: glow 1.1s ease-in-out infinite alternate; }
.cd.hov { transform: translateY(calc(var(--w) * -.06)); box-shadow: 0 0 0 calc(var(--w) * .035) var(--gold), 0 0 calc(var(--w) * .3) rgba(242,194,48,.75), 0 6px 14px rgba(20,18,18,.25); }
@keyframes glow { to { box-shadow: 0 0 0 calc(var(--w) * .035) var(--gold), 0 0 calc(var(--w) * .12) rgba(242,194,48,.35), 0 6px 14px rgba(20,18,18,.25); } }
.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%), repeating-linear-gradient(45deg, rgba(244,239,230,.9) 0 2px, transparent 2px 9px), repeating-linear-gradient(-45deg, rgba(244,239,230,.9) 0 2px, transparent 2px 9px), var(--red);
  background-size: auto, calc(var(--fw) * .3) calc(var(--fw) * .3), calc(var(--fw) * .3) calc(var(--fw) * .3), auto;
  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); }
/* card back art (--kk-back is set in index.html with the version); the deck keeps a cream disc under the counter */
.cd-back { background: var(--kk-back) center / 200% auto, var(--red); }
.kk-deck { background: radial-gradient(circle at 50% 50%, var(--cream) 0 18%, transparent 19%), var(--kk-back) center / 200% auto, var(--red); }
.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 { flex-direction: column; }

/* my hand */
.kk-hand { display: flex; gap: calc(var(--hw) * .1); padding-top: calc(var(--hw) * .14); }
.kk-hand .cd { --w: var(--hw); transition: transform .18s cubic-bezier(.2,.75,.25,1), box-shadow .18s; }
.kk-hand .cd.can { cursor: pointer; }
@media (hover: hover) { .kk-hand .cd.can:not(.sel):hover { transform: translateY(calc(var(--hw) * -.08)); } }
.kk-hand .cd.has::after { content: ""; position: absolute; right: calc(var(--w) * .06); top: calc(var(--w) * .06); width: calc(var(--w) * .1); height: calc(var(--w) * .1); border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--ink); }
.kk-hand .cd.sel { transform: translateY(calc(var(--hw) * -.16)); box-shadow: 0 0 0 calc(var(--w) * .035) var(--red), 0 14px 26px rgba(20,18,18,.35); }
.kk-hint { min-height: 22px; font-size: 13px; font-weight: 700; color: var(--mute); text-align: center; }
.port .kk-hint { align-self: center; }
.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); }

/* 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.1 "Zen Kaku Gothic New", "Montserrat", sans-serif; letter-spacing: .04em; 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); }

/* modal */
.kk-modal { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(20,18,18,.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.kk-modal[hidden] { display: none; }
.kk-box { width: min(560px, 100%); max-height: calc(100% - 8px); overflow: auto; background: var(--cream); border-radius: 18px; padding: clamp(18px, 3.4vw, 32px); box-shadow: 0 30px 70px rgba(0,0,0,.35); user-select: text; -webkit-user-select: text; }
.kk-box h2 { font-size: clamp(22px, 3.6vw, 30px); font-weight: 900; line-height: 1.2; margin-bottom: 12px; }
.kk-box h2.w { color: var(--red); }
.kk-box h3 { font-size: 15px; font-weight: 800; margin: 16px 0 8px; }
.kk-box .lead { font-size: 15px; line-height: 1.65; color: #3b3633; }
.kk-box .len { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; font-size: 13px; font-weight: 700; color: var(--mute); }
.kk-box .len span { margin-right: 4px; }
.kk-box .len .kk-btn { padding: 8px 14px; font-size: 13px; }
.kk-box .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.kk-box .acts .kk-btn { flex: 1 1 auto; padding: 13px 20px; font-size: 15px; }
.kk-box details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.kk-box summary { cursor: pointer; font-weight: 800; font-size: 14px; }
.kk-box .how { margin: 10px 0 0 18px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.55; color: #3b3633; }
.yt { width: 100%; border-collapse: collapse; font-size: 13px; }
.yt th, .yt td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.4; }
.yt th { font-weight: 800; white-space: nowrap; }
.yt th small { display: block; font-weight: 500; color: var(--mute); }
.yt td { color: #3b3633; }
.yt .p { text-align: right; font: 800 14px/1.4 "Montserrat", sans-serif; color: var(--red); }
.yl { list-style: none; display: grid; gap: 6px; margin: 6px 0 10px; }
.yl li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 10px; background: #fff; font-weight: 700; }
.yl b { font-family: "Montserrat", sans-serif; color: var(--red); }
.tot { font-weight: 700; font-size: 15px; text-align: right; }
.tot b { font: 900 22px/1 "Montserrat", sans-serif; margin-left: 6px; }
.x2 { font-size: 13px; font-weight: 700; color: var(--red); text-align: right; }
.note { margin-top: 8px; font-size: 12.5px; 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; }
.acts.two .kk-btn { flex: 1 1 200px; }

@media (max-width: 560px) {
  .kk { padding: 0 10px 8px; gap: 6px; }
  .kk-brand b { display: none; }
  .kk-round { font-size: 11px; }
  .kk-score span { padding: 4px 8px; }
}
@media (prefers-reduced-motion: reduce) { .cd.glow { animation: 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; background: rgba(242,194,48,.12); animation: dropPulse 1s ease-in-out infinite alternate; }
.slot.drop:hover { background: rgba(242,194,48,.3); }
@keyframes dropPulse { to { background: rgba(242,194,48,.24); } }
@media (prefers-reduced-motion: reduce) { .slot.drop { animation: none; } }
/* popup tabs + cards by month */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tabs .kk-btn { padding: 8px 16px; font-size: 13px; }
.tabs .kk-btn.on { background: var(--ink); color: #fff; }
.kk-box:has(.mo) { width: min(820px, 100%); }
.mo:not([hidden]) { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 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 .cd { --w: 58px; }
.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: #2F8F4E; } .mo-k.k-r { color: var(--red); }

/* phone (portrait): like card-game apps – opponent on top, captured cards in two panels, own hand fanned at the bottom */
.kk.port { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px auto auto minmax(0, 1fr) auto auto 22px;
  grid-template-areas: "top" "opp" "cap1" "mid" "cap0" "me" "hint"; row-gap: 6px; padding-bottom: 4px; }
.port .kk-top { grid-area: top; height: 44px; }
.port .kk-opp, .port .kk-me { display: contents; }
.port .kk-hand-opp { grid-area: opp; justify-self: center; 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: 5px 8px; min-height: calc(var(--sw) * 1.6 + 30px); }
.port .kk-cap { flex-wrap: wrap; row-gap: 4px; }
.port .pile .cd { margin-left: calc(var(--sw) * -.6); }
.port .pile .cd:first-child { margin-left: 0; }
.port .kk-mid { grid-area: mid; }
.port .kk-hand { grid-area: me; display: flex; justify-content: center; padding-top: calc(var(--hw) * .22); padding-bottom: calc(var(--hw) * .2); 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)); z-index: 5; }
.port .kk-hint { grid-area: hint; justify-self: start; align-self: center; min-height: 0; font-size: 11px; text-align: left; padding-right: 110px; }
.port .kk-side { grid-area: hint; justify-self: end; align-self: center; }
.port .kk-combos { padding: 5px 10px; font-size: 11px; gap: 6px; }
.port .kk-hand .cd.has { box-shadow: 0 0 0 3px var(--gold), -3px 2px 6px rgba(20,18,18,.3); }
.port .kk-hand .cd.has::after { display: none; }
