/* All rules scoped to Kierki; existing games and media code keep their styles. */
body.kh-in-game #app{max-width:1150px;margin-inline:auto;padding:12px}
body.kh-in-game>.footer{display:none}
body.kh-in-game .call-tile.kh-empty-call{display:none}
.kh-game{--kh-card-w:clamp(46px,5vw,66px);color:#f9f4e6}
.kh-heading{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px}
.kh-heading h1{font-size:clamp(20px,3vw,30px);margin:3px 0}.kh-tools{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}
.kh-status{margin:8px 0;padding:10px 14px;border:1px solid #6b7853;border-radius:12px;background:#12281f;min-height:40px}
.kh-table{position:relative;width:min(100%,660px);aspect-ratio:1;margin:auto;background:radial-gradient(ellipse at center,#2b614b,#194432);border:8px solid #2a4233;border-radius:32px;box-shadow:inset 0 0 0 2px #547256}
.kh-seat{position:absolute;display:flex;flex-direction:column;gap:3px;align-items:center;justify-content:center;text-align:center;width:clamp(100px,25%,175px);min-height:74px;padding:8px;border:1px solid transparent;border-radius:16px;z-index:2;overflow-wrap:anywhere}
.kh-seat strong{font-size:clamp(14px,2.2vw,21px);line-height:1.15}.kh-seat small{font-size:clamp(10px,1.4vw,12px);line-height:1.3;color:#dbdfcb}
.kh-seat.kh-north{top:3%;left:50%;transform:translateX(-50%)}.kh-seat.kh-south{bottom:3%;left:50%;transform:translateX(-50%)}
.kh-seat.kh-west{left:2%;top:50%;transform:translateY(-50%)}.kh-seat.kh-east{right:2%;top:50%;transform:translateY(-50%)}
.kh-turn{background:#7e1d37;border-color:#efd68b;box-shadow:0 0 0 3px #e1bf7450}
.kh-packet{display:block;width:23px;height:31px;border-radius:4px;border:2px solid #c3b783;background:repeating-linear-gradient(45deg,#152d23 0 3px,#31583d 3px 5px);box-shadow:2px 2px 0 #a3a079;margin-top:3px}
.kh-center{position:absolute;inset:22%;pointer-events:none}.kh-watermark{position:absolute;top:44%;width:100%;text-align:center;color:#d9d0a126;font-size:30px}
.kh-played{position:absolute;z-index:1;--kh-card-w:clamp(44px,7vw,76px)}
.kh-played.kh-north{left:50%;top:0;transform:translateX(-50%)}.kh-played.kh-south{left:50%;bottom:0;transform:translateX(-50%)}
.kh-played.kh-west{left:0;top:50%;transform:translateY(-50%)}.kh-played.kh-east{right:0;top:50%;transform:translateY(-50%)}
.kh-card{display:inline-flex;position:relative;flex-shrink:0;width:var(--kh-card-w);height:calc(var(--kh-card-w)*1.43);padding:5px;flex-direction:column;justify-content:space-between;align-items:stretch;border-radius:7px;border:1px solid #d1cfb9;background:#fffcec;color:#101b17;box-shadow:1px 2px 4px #0005;font-family:Georgia,serif;line-height:1;vertical-align:top;font-size:clamp(15px,2.1vw,20px)}
.kh-card b{display:flex;flex-direction:column;align-items:flex-start;gap:1px}.kh-card b:last-child{transform:rotate(180deg)}.kh-card small{font-size:.7em}.kh-card em{position:absolute;inset:0;display:grid;place-items:center;font-size:1.6em;font-style:normal}.kh-red{color:#c51e43}
.kh-hand{padding:12px;border:1px solid #395042;border-radius:16px;margin-top:12px;background:#10271e}
.kh-hand h2{font-size:15px;margin:0 0 12px}.kh-hand>div{display:flex;justify-content:center;flex-wrap:wrap;gap:6px}
.kh-hand .kh-card:disabled{filter:brightness(.78);cursor:default;opacity:.85}.kh-hand .kh-card:not(:disabled){cursor:pointer;outline:2px solid #e5c481;outline-offset:1px}.kh-hand .kh-card:not(:disabled):hover{transform:translateY(-4px)}
.kh-choice,.kh-summary{padding:16px;border:1px solid #9a986b;border-radius:16px;margin-top:12px;background:#183429}.kh-choice h2,.kh-summary h2{font-size:19px}.kh-choice>div{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.kh-error{color:#ff9a9a}.kh-dialog{max-width:min(900px,95vw);max-height:90dvh;background:#142b22;color:#fff7df;border:1px solid #6d7b52;border-radius:18px;padding:22px}.kh-dialog::backdrop{background:#000a}.kh-dialog h2{margin-top:0}.kh-dialog p{max-width:75ch;line-height:1.55}.kh-scroll{max-width:100%;overflow:auto;margin-bottom:16px}.kh-scroll table{border-collapse:collapse;min-width:100%}.kh-scroll th,.kh-scroll td{padding:10px;text-align:left;border-bottom:1px solid #4a5b49}.kh-scroll small{display:block;white-space:nowrap;color:#cdcdb7}.kh-management{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:12px}.kh-management select{padding:10px;background:#14291f;color:#fff4df;border:1px solid #6d7b52;border-radius:6px}
.kh-collected .kh-packet{animation:kh-collect .65s ease-out}@keyframes kh-collect{from{opacity:0;translate:0 -35px}to{opacity:1;translate:0 0}}
@media(min-width:900px){.kh-table{width:min(100%,660px,calc(100dvh - 380px))}}
@media(min-width:801px){body.kh-in-game.kh-call-present #app{margin-left:210px;margin-right:0;width:calc(100% - 210px);max-width:calc(100% - 210px)}}
@media(max-width:800px){body.kh-in-game.kh-call-present #app{padding-top:calc(6px + var(--kh-call-offset,0px))}}
@media(min-width:900px) and (max-height:850px){.kh-table{width:min(100%,490px,calc(100dvh - 330px))}.kh-hand{margin-top:8px}.kh-game{--kh-card-w:48px}.kh-heading h1{font-size:22px}.kh-seat{min-height:65px}.kh-played{--kh-card-w:57px}}
@media(max-width:600px){body.kh-in-game #app{padding:6px}.kh-heading{align-items:flex-start}.kh-tools .button{font-size:11px;padding:7px}.kh-table{border-width:5px;border-radius:20px}.kh-seat{width:25%;padding:4px;min-height:55px}.kh-seat.kh-west{left:0}.kh-seat.kh-east{right:0}.kh-center{inset:22% 25%}.kh-card{padding:3px}.kh-hand>div{gap:5px}.kh-hand .kh-card{--kh-card-w:43px}.kh-game .eyebrow{font-size:9px}.kh-status{font-size:13px}.kh-heading small{font-size:11px}}
@media(prefers-reduced-motion:reduce){.kh-collected .kh-packet{animation:none}.kh-card:hover{transform:none}}
