:root{--gold:#eacb7a;--cream:#f9eac8;--ink:#14251f;--green:#174637}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at top,#3a654a,#10231e 70%);color:var(--cream);font:16px/1.45 Georgia,serif}header{text-align:center;padding:23px 10px 16px;background:#10251fc9;border-bottom:3px solid #b99750}header h1{font-size:clamp(30px,6vw,55px);margin:0;color:var(--gold);letter-spacing:2px;text-shadow:2px 3px #080f0b}header p{margin:0;color:#d7c8a3}.eyebrow{font:11px Arial;letter-spacing:3px;color:#e8ce8d;margin-bottom:6px}main{max-width:1200px;margin:auto;padding:15px}.top,.yourhead,.centerhead{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}.status{font-weight:bold;color:var(--gold)}button{border:1px solid #f2d68e;border-radius:7px;background:linear-gradient(#ebcf86,#bc913d);color:#1c271e;padding:12px 16px;font-weight:bold;cursor:pointer;font-size:14px}button:hover{filter:brightness(1.1)}button:disabled{opacity:.4;cursor:not-allowed}.secondary{background:#2a493d;color:var(--cream)}.table{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:15px 0}.opponent,.battle,.yourarea,.logbox{border:2px solid #b99b5b;border-radius:12px;background:#0d211cc9;box-shadow:0 4px 12px #08171080}.opponent{padding:12px;min-height:190px}.opponent h3{margin:0 0 5px;color:var(--gold)}.mini{font:13px Arial;color:#d7d3bf}.opcards{display:flex;gap:7px;align-items:center;margin-top:8px}.opcards img{width:70px;height:98px;object-fit:cover;border-radius:5px}.opcards .hidden{width:70px;height:98px;background:repeating-linear-gradient(45deg,#713b4e,#713b4e 8px,#a36e76 8px,#a36e76 16px);border:3px solid #c5a260;border-radius:5px}.battle,.yourarea,.logbox{padding:17px;margin-bottom:15px}.centerhead h2,.yourarea h2{margin:0;color:var(--gold)}#crowns{display:flex;gap:6px;flex-wrap:wrap}#crowns img{height:82px;border-radius:4px}.battlecols{display:grid;grid-template-columns:1fr 2fr;gap:20px}.battle h3,.logbox h3{color:var(--gold);margin:10px 0}.dice{font-size:54px;color:#fff;text-shadow:0 3px #222}#result{min-height:65px;white-space:pre-line}.yourhead p{margin:5px 0}.actions{display:flex;gap:8px;flex-wrap:wrap}#hint{color:#e7d6aa;margin:8px 0 14px}.hand{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}.card{border:3px solid transparent;border-radius:8px;background:transparent;padding:2px;color:var(--cream);cursor:pointer;position:relative;transition:transform .1s}.card img{width:clamp(70px,14vw,130px);aspect-ratio:2.5/3.5;object-fit:fill;border-radius:6px;box-shadow:0 3px 8px #000a}.card.selected{border-color:#f3df81;transform:translateY(-12px)}.card:disabled{opacity:.65;cursor:default}.card span{display:block;font:12px Arial}.logbox #log{font:13px/1.6 Arial;max-height:190px;overflow:auto}.logentry{border-bottom:1px solid #ffffff22;padding:4px}footer{text-align:center;font:12px Arial;color:#c2b99f;padding:8px 0 20px}.overlay{position:fixed;inset:0;background:#000b;display:grid;place-items:center;padding:20px;z-index:10}.overlay[hidden],button[hidden]{display:none}.modal{background:#183d30;border:2px solid var(--gold);border-radius:12px;max-width:450px;width:100%;padding:22px;text-align:center}.modal h2{color:var(--gold)}#modalChoices{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}@media(max-width:700px){.table{grid-template-columns:1fr}.opponent{min-height:unset}.opcards img,.opcards .hidden{width:45px;height:65px}.battlecols{grid-template-columns:1fr}.card img{width:clamp(70px,17vw,100px)}.dice{font-size:40px}}

.deckcount{font:14px Arial;color:#f3d68c;margin:12px 0 4px}#notices.show{background:#6a4b16;border:1px solid #eacb7a;border-radius:8px;padding:11px;margin-top:10px;font-weight:bold}.trophies{display:flex;gap:5px;align-items:center;flex-wrap:wrap;min-height:32px;margin:4px 0 8px}.trophies img{width:31px;height:44px;object-fit:fill;border:1px solid #f2d68e;border-radius:3px;box-shadow:0 1px 5px #0008}.outcome{margin-top:8px;font-weight:bold;color:#f2d68e}.powerbox{display:flex;align-items:center;gap:22px;background:#294638;border:2px solid #eacb7a;border-radius:10px;padding:12px 16px;margin:12px 0}.powerbox>div:first-child{min-width:155px;text-align:center}.powerlabel{display:block;font:11px Arial;letter-spacing:1px;color:#eacb7a}.powerbox strong{font:bold 42px Georgia;color:#fff}.powerbox #powerDetails{font-weight:bold}#powerStatus{margin-top:5px}.summarygrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.summaryplayer{padding:10px;border:1px solid #b99b5b;border-radius:7px;background:#213d30}.summaryplayer b{color:#eacb7a}.summarycards{display:flex;gap:5px;margin:8px 0}.summarycards img{width:54px;height:76px;object-fit:fill;border-radius:4px}.summaryplayer p{font:12px Arial;margin:5px 0}#roundSummary h3{color:#eacb7a}@media(max-width:700px){.summarygrid{grid-template-columns:repeat(2,minmax(0,1fr))}.powerbox{flex-direction:column;align-items:stretch;gap:6px}.powerbox>div:first-child{text-align:left}.powerbox strong{font-size:32px}}

.tiebreaks{background:#423018;border:2px solid #d6ac56;border-radius:12px;padding:12px 16px;margin:12px 0;color:#fff2ca;font-weight:bold}.tiebreaks p{margin:5px 0}

/* V1.3 compact tabletop */
header{padding:7px 12px 6px}header h1{font-size:27px;line-height:1.05}header p{font-size:12px}.eyebrow{font-size:9px;margin-bottom:2px}
main{max-width:1320px;padding:7px 12px}.top{min-height:32px}.top button{padding:5px 10px}.table{margin:7px 0;gap:8px}
.opponent{padding:8px 10px;min-height:0}.opponent h3{font-size:16px;margin:0}.opcards{margin-top:4px}.opcards img,.opcards .hidden{width:48px;height:67px}.opponent .mini{font-size:11px}.outcome{margin-top:2px}
.battle,.yourarea{padding:9px 12px;margin-bottom:8px}.battle h2,.yourarea h2{font-size:19px}.battle h3{margin:4px 0;font-size:13px}
#crowns img{height:43px}.battlecols{grid-template-columns:160px 1fr;gap:12px}.dice{font-size:28px;line-height:1.1}#roundinfo{font-size:11px;line-height:1.3}#result{min-height:0;font-size:13px}
.yourhead p{margin:0}.actions button{padding:8px 12px}.powerbox{margin:5px 0;padding:6px 10px;gap:12px}.powerbox strong{font-size:27px}.powerbox>div:first-child{min-width:120px}.powerlabel{font-size:9px}#powerDetails{font-size:12px}#powerStatus{font-size:11px}#hint{margin:3px 0 7px;font-size:12px}
.hand{gap:7px}.card img{width:clamp(64px,8vw,93px)}.card span{font-size:10px}.card.selected{transform:translateY(-5px)}
.badge-row{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin:4px 0}.badge-side{display:flex;align-items:center;gap:5px}.badge-label{font:9px Arial;letter-spacing:.5px;color:#d9bd76}.badge-slots{display:flex;gap:3px}.badge-slots img,.empty-slot{width:25px;height:35px;border-radius:3px;object-fit:fill}.badge-slots img{border:1px solid #e4c274}.empty-slot{display:grid;place-items:center;border:1px dashed #b4a27a88;color:#a8a18b70;background:#ffffff0b;font-size:15px}
.yourarea .badge-row{justify-content:flex-start;gap:20px}.yourarea .badge-slots img,.yourarea .empty-slot{width:30px;height:42px}
#roundSummary h3{font-size:13px;margin:7px 0 4px}.summarygrid{gap:5px}.summaryplayer{padding:5px}.summarycards{margin:3px 0}.summarycards img{width:36px;height:51px}.summaryplayer p{margin:2px 0}.tiebreaks{margin:6px 0;padding:5px 9px;font-size:12px}
.battle-history{margin-top:6px;border-top:1px solid #b99b5b70;padding-top:3px}.battle-history h3{margin:2px 0 4px}.battle-history #battleEvents{max-height:92px;overflow:auto;display:flex;flex-direction:column;gap:2px;font:12px/1.25 Arial}.event-line{padding:2px 6px;border-left:2px solid #ae9059;background:#ffffff09}.event-line.latest{border-left-color:#f3d68c;background:#d5a74920}
.deckcount{margin:3px 0;font-size:11px}#notices.show{margin-top:4px;padding:5px;font-size:12px}footer{padding:0;font-size:10px}
@media(min-width:950px) and (min-height:850px){.battle-history #battleEvents{max-height:110px}}
@media(max-width:700px){header h1{font-size:24px}.table{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.opponent{padding:5px}.opponent h3{font-size:12px}.opcards img,.opcards .hidden{width:32px;height:45px}.opcards{gap:3px}.badge-row{flex-direction:column;gap:3px}.badge-label{font-size:8px}.badge-slots img,.empty-slot{width:19px;height:27px}.battlecols{grid-template-columns:1fr 2fr;gap:7px}.summarygrid{grid-template-columns:repeat(2,minmax(0,1fr))}.powerbox{flex-direction:row;gap:7px}.powerbox strong{font-size:24px}.card img{width:clamp(54px,16vw,80px)}.yourarea .badge-row{flex-direction:row}.yourarea .badge-slots img,.yourarea .empty-slot{width:24px;height:34px}}

/* V1.4: artwork framing and compact three-column opponent displays */
body{background:radial-gradient(ellipse at 50% 5%,#416c51,#142a24 63%,#0b1715);position:relative}
body:before,body:after{content:"";position:fixed;top:85px;bottom:0;width:max(0px,calc((100vw - 1360px)/2));opacity:.23;pointer-events:none;z-index:-1;background-repeat:repeat-y;background-size:100% auto}
body:before{left:0;background-image:linear-gradient(90deg,#06171277,transparent),url('cards/Clubs_K.webp')}
body:after{right:0;background-image:linear-gradient(270deg,#06171277,transparent),url('cards/Spades_J.webp')}
main{max-width:1320px;position:relative}
main:before,main:after{position:absolute;pointer-events:none;color:#d7bd7b38;font-size:42px;line-height:1;z-index:-1}
main:before{content:"♜  ⚔  ♞";top:10px;left:-5px}main:after{content:"♞  ⚔  ♜";top:10px;right:0}
.opponent{background:linear-gradient(140deg,#173d32f0,#0a1e19f0);border-color:#c3a466}
.opponent-row{display:grid;grid-template-columns:58px minmax(95px,1fr) 112px;align-items:center;gap:4px;margin-top:3px}
.opponent-center{text-align:center;min-width:0}.opponent-center .opcards{justify-content:center;margin:0;min-height:70px}
.opponent-center .mini{font-size:10px}.joker-rail,.crown-rail{align-self:stretch;display:flex;flex-direction:column;justify-content:center;gap:4px}.crown-rail{align-items:flex-end}
.joker-rail .badge-slots{display:grid;grid-template-columns:repeat(2,25px);gap:3px}.crown-rail .badge-slots{display:grid;grid-template-columns:repeat(4,25px);gap:3px}
.joker-rail .badge-label,.crown-rail .badge-label{font-size:9px}.opponent h3{text-align:center;font-size:17px}
.battle{border:3px solid #d1b373;background:linear-gradient(130deg,#183b30f5,#112920f5);box-shadow:0 0 0 3px #533e1e55,0 5px 22px #0008}
.battle h2{font-size:24px}.battle-history{margin-top:7px;border-top:2px solid #a88a51}
.battle-history h3{font-size:17px;color:#ffe5a2}.battle-history #battleEvents{max-height:160px;min-height:44px;font:15px/1.4 Georgia,serif;gap:4px}
.event-line{padding:5px 9px;border-left-width:4px;background:#f4d7930c}.event-line.latest{font-weight:bold;background:#b88c302c}
#result{font-size:17px;font-weight:bold;color:#fff1c6}.battlecols{grid-template-columns:125px 1fr}.dice{font-size:33px}
.score-heading{font-size:17px!important;margin:8px 0 5px!important}.scoreboard{display:flex;flex-direction:column;gap:4px}
.score-row{display:grid;grid-template-columns:minmax(90px,1fr) 100px 68px 90px 138px;gap:10px;align-items:center;padding:5px 12px;background:#244438;border:1px solid #8f855b;border-radius:7px;min-height:59px}
.score-row.qualified{background:#1b4d35;border-left:5px solid #68df8b}.score-row.failed{background:#4d2b2a;border-left:5px solid #f17873}.score-row.satout{opacity:.7}
.score-name{font-size:17px;font-weight:bold;color:#ffe6a4}.score-cards{display:flex;gap:4px;align-items:center}.score-cards img{height:49px;width:35px;object-fit:fill;border-radius:3px}
.score-caption{display:block;font:10px Arial,sans-serif;color:#e2d1a7;letter-spacing:1px}.score-dice strong,.score-strength strong{font:bold 28px Georgia,serif;color:#fff}.score-status{font:bold 15px Arial,sans-serif;text-align:right}.qualified .score-status{color:#a9ffbd}.failed .score-status{color:#ffada8}
#roundSummary{margin-top:6px}.tiebreaks{font-size:14px}.yourarea{background:linear-gradient(120deg,#17392cf0,#0b231df0)}
@media(max-width:1050px){.opponent-row{grid-template-columns:48px minmax(70px,1fr) 86px}.joker-rail .badge-slots{grid-template-columns:repeat(2,20px)}.crown-rail .badge-slots{grid-template-columns:repeat(4,20px)}.opponent .badge-slots img,.opponent .empty-slot{width:20px;height:29px}.opcards img{width:40px;height:56px}}
@media(max-width:700px){.table{grid-template-columns:1fr;gap:5px}.opponent-row{grid-template-columns:60px 1fr 112px}.joker-rail .badge-slots{grid-template-columns:repeat(2,25px)}.crown-rail .badge-slots{grid-template-columns:repeat(4,25px)}.opponent .badge-slots img,.opponent .empty-slot{width:25px;height:35px}.opcards img{width:43px;height:60px}.opponent{padding:5px 8px}.opponent h3{font-size:14px}.score-row{grid-template-columns:1fr 68px 48px 55px 90px;gap:4px;padding:4px}.score-name{font-size:12px}.score-cards img{height:39px;width:28px}.score-dice strong,.score-strength strong{font-size:21px}.score-status{font-size:10px}.battle-history #battleEvents{font-size:13px}.battlecols{grid-template-columns:90px 1fr}#result{font-size:14px}}

/* V1.5: larger cards, crowns, visible round winner, side-by-side strength */
@media(min-width:950px){main{max-width:1480px}.table{gap:10px}.opcards img{width:clamp(56px,5.5vw,86px);height:auto;aspect-ratio:5/7}.opponent-center .opcards{min-height:118px}.opponent-row{grid-template-columns:58px minmax(110px,1fr) 132px}.opponent .badge-slots img,.opponent .empty-slot{width:29px;height:41px}.joker-rail .badge-slots{grid-template-columns:repeat(2,29px)}.crown-rail .badge-slots{grid-template-columns:repeat(4,29px)}}
#crowns{min-height:142px;align-items:center;gap:14px}#crowns img{height:clamp(95px,10vw,160px);width:auto;aspect-ratio:5/7;object-fit:fill;border:2px solid #d7b15c;border-radius:7px;box-shadow:0 0 12px #eacb7a50;transition:transform .15s}#crowns img:hover{transform:scale(1.07)}.centerhead{align-items:flex-start}.centerhead h2{padding-top:14px}.centerhead #crowns{flex:1;justify-content:center}
.hand-power-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,300px);grid-template-areas:'hand power';gap:15px;align-items:center}.hand-power-layout .hand{grid-area:hand;justify-content:flex-start;flex-wrap:nowrap}.hand-power-layout .powerbox{grid-area:power;flex-direction:column;align-items:stretch;margin:0;padding:14px;gap:12px}.hand-power-layout .powerbox>div:first-child{text-align:center}.hand-power-layout .powerbox strong{font-size:44px}.hand-power-layout .card img{width:clamp(80px,8.3vw,127px)}
.score-row.round-winner{border:3px solid #ffda62!important;box-shadow:0 0 15px #e9c4559c;background:#4c4b23!important}.winner-tag{display:block;color:#ffed9b;font:bold 12px Arial;margin-top:3px;white-space:nowrap}.score-row.round-winner .score-name{font-weight:bold;color:#fff0b8}
@media(max-width:950px){.hand-power-layout{grid-template-columns:1fr;grid-template-areas:'power' 'hand'}.hand-power-layout .hand{flex-wrap:wrap;justify-content:center}.hand-power-layout .powerbox{flex-direction:row;justify-content:space-between}.centerhead #crowns{min-height:95px}#crowns img{height:95px}}
@media(max-width:600px){#crowns{gap:5px;min-height:75px}#crowns img{height:70px}.hand-power-layout .card img{width:clamp(53px,16vw,90px)}.winner-tag{font-size:9px}.score-row{grid-template-columns:minmax(66px,1fr) 62px 40px 50px 75px}}

/* V1.6 clarity fixes */
.score-name{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.winner-tag{display:inline-flex;align-items:center;margin:0;padding:5px 10px;font:bold clamp(14px,1.5vw,21px)/1.15 Arial,sans-serif;color:#231b08;background:#ffda62;border-radius:6px;box-shadow:0 0 12px #ffd84d9e;white-space:nowrap}
.available-crowns{display:flex;align-items:center;justify-content:flex-end;gap:14px;flex:1;min-width:0}
.available-label{font:bold clamp(13px,1.2vw,18px)/1.2 Arial,sans-serif;color:#ffe7a0;white-space:nowrap;text-shadow:0 1px 5px #000}
.centerhead #crowns{flex:0 1 auto;justify-content:flex-end}
@media(max-width:850px){.available-crowns{flex-wrap:wrap;justify-content:center}.available-label{width:100%;text-align:center}.score-name{gap:5px}.winner-tag{font-size:12px;padding:3px 5px}}

/* V1.7 compact desktop layout: avoid extra vertical stacking and wasted gaps */
@media(min-width:951px){
 header{padding:5px 14px 4px}header h1{font-size:27px;margin:0}header p{margin:0;font-size:11px}.eyebrow{font-size:9px}
 main{padding-top:3px}.top{margin:2px 0;padding:3px 9px}.deckcount{margin:2px 0}
 .table{gap:7px;margin-bottom:5px}.opponent{padding:5px 8px}.opponent h3{font-size:15px;margin:0 0 2px}.opponent-row{margin-top:0;grid-template-columns:55px minmax(100px,1fr) 122px}
 .opponent-center .opcards{min-height:90px}.opcards img{width:clamp(49px,4.4vw,68px)}
 .opponent .badge-slots img,.opponent .empty-slot{width:26px;height:36px}.joker-rail .badge-slots{grid-template-columns:repeat(2,26px)}.crown-rail .badge-slots{grid-template-columns:repeat(4,26px)}
 .battle{padding:7px 12px}.battle h2{font-size:20px}.centerhead h2{padding-top:4px}#crowns{min-height:91px;gap:9px}#crowns img{height:clamp(76px,7.5vw,115px)}
 .battlecols{margin:2px 0;gap:8px}.battlecols h3{margin:2px 0;font-size:12px}.dice{font-size:26px}#result{font-size:15px}
 .score-heading{font-size:14px!important;margin:3px 0!important}.scoreboard{gap:2px}.score-row{min-height:42px;padding:2px 8px;grid-template-columns:minmax(100px,1fr) 85px 54px 80px 115px;gap:6px}.score-name{font-size:14px}.score-cards img{height:38px;width:27px}.score-dice strong,.score-strength strong{font-size:23px}.score-status{font-size:12px}.winner-tag{font-size:13px;padding:3px 6px}
 .battle-history{margin-top:4px}.battle-history h3{font-size:14px;margin:1px}.battle-history #battleEvents{max-height:82px;min-height:25px;font-size:13px;gap:2px}.event-line{padding:2px 6px}
 .yourarea{padding:6px 12px}.yourhead h2{font-size:18px;margin:0}.yourhead p{margin:2px 0}.hand-power-layout{grid-template-columns:minmax(0,1fr) minmax(195px,240px);gap:8px}.hand-power-layout .card img{width:clamp(65px,6.5vw,100px)}.hand-power-layout .powerbox{padding:7px;gap:5px}.hand-power-layout .powerbox strong{font-size:35px}#hint{margin:2px 0;font-size:11px}footer{display:none}
}
@media(max-width:950px){.battle-history #battleEvents{max-height:115px}.hand-power-layout .card img{width:clamp(58px,13vw,100px)}}

/* V1.8: player hand and trophies in one horizontal band, larger battlefield Crowns */
.yourarea .hand-power-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(140px,200px) minmax(175px,225px);grid-template-areas:"hand trophies power";gap:10px;align-items:center}
.yourarea .hand{grid-area:hand;flex-wrap:nowrap;justify-content:flex-start;gap:5px;min-width:0}
.yourarea .your-trophies{grid-area:trophies;min-width:0}
.yourarea .powerbox{grid-area:power}
.yourarea .your-trophies .badge-row{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:10px;margin:0}
.yourarea .your-trophies .badge-side{display:flex;flex-direction:column;align-items:flex-start;gap:3px}
.yourarea .your-trophies .badge-label{font-size:11px;letter-spacing:1px;font-weight:bold}
.yourarea .your-trophies .badge-slots{display:flex;gap:5px}
.yourarea .your-trophies .badge-slots img,.yourarea .your-trophies .empty-slot{width:31px;height:44px}
.yourarea .hand .card img{width:clamp(62px,6.7vw,108px)}
.yourarea .hand .card span{font-size:10px}
.battle-history #battleEvents{max-height:65px;min-height:22px;overflow:auto}
.battle-history h3{font-size:13px}
#crowns{gap:12px;min-height:135px}
#crowns img{height:clamp(105px,9.8vw,155px)}
@media(min-width:1250px){#crowns img{height:clamp(130px,10vw,165px)}}
@media(max-width:1100px){.yourarea .hand-power-layout{grid-template-columns:minmax(0,1fr) 155px 170px;gap:6px}.yourarea .hand .card img{width:clamp(50px,6.3vw,76px)}.yourarea .your-trophies .badge-slots img,.yourarea .your-trophies .empty-slot{width:25px;height:35px}}
@media(max-width:760px){.yourarea .hand-power-layout{grid-template-columns:minmax(0,1fr) 120px;grid-template-areas:"hand trophies" "power power";gap:7px}.yourarea .hand{flex-wrap:wrap}.yourarea .hand .card img{width:clamp(55px,14vw,88px)}.yourarea .your-trophies .badge-slots img,.yourarea .your-trophies .empty-slot{width:23px;height:33px}#crowns img{height:clamp(70px,15vw,110px)}#crowns{min-height:85px;gap:5px}}

/* V1.9: four seats around a central crown display */
.table[hidden],#roundSummary[hidden]{display:none!important}
.board{padding:9px 12px;background:radial-gradient(ellipse at center,#285743 0%,#173b30 50%,#0b241d 100%);border:5px ridge #c8a461;box-shadow:inset 0 0 35px #0009,0 8px 22px #0007}
.board-heading{display:flex;align-items:center;gap:18px;margin-bottom:5px}.board-heading h2{margin:0;font-size:21px}.round-indicator{font:bold 13px Arial;color:#e7d3a0}.board-dice{margin-left:auto;font-size:24px}
.board-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(245px,.86fr) minmax(0,1fr);grid-template-rows:minmax(190px,auto) minmax(190px,auto);gap:9px;align-items:stretch}
#seat1{grid-area:1/1}#seat2{grid-area:1/3}#seat0{grid-area:2/1}#seat3{grid-area:2/3}
.battle-seat{min-width:0;display:flex;flex-direction:column;gap:5px;padding:9px;border:2px solid #b69b60;border-radius:11px;background:#102920e8;transition:box-shadow .2s}
.battle-seat.qualified{border-color:#63d987;background:#174833e8}.battle-seat.failed{border-color:#ed7771;background:#4b2928e8}.battle-seat.round-winner{border:3px solid #ffdc67;background:#50451de8;box-shadow:0 0 18px #eac04a9a}
.seat-header{display:flex;align-items:center;flex-wrap:wrap;gap:9px}.seat-name{font:bold clamp(14px,1.25vw,20px) Georgia;color:#ffe5a0}.seat-winner{font:bold 13px Arial;color:#1d1b10;background:#ffdc67;padding:4px 7px;border-radius:5px}
.seat-metrics{display:flex;align-items:center;gap:13px;flex-wrap:wrap;font:12px Arial}.seat-metrics strong{font-size:clamp(19px,2vw,28px);color:white}.seat-result{margin-left:auto;font:bold 12px Arial;color:#e9d4aa}.qualified .seat-result{color:#b2ffbf}.failed .seat-result{color:#ffb7b0}
.seat-cards{display:flex;gap:9px;justify-content:center;align-items:center;flex:1;min-height:102px}.seat-cards img{height:clamp(95px,10vw,145px);width:auto;aspect-ratio:5/7;object-fit:fill;border:2px solid #cfb06a;border-radius:6px;box-shadow:0 4px 8px #0009}.seat-cards .waiting{font:12px Arial;color:#d9c5a3}
.seat-badges{display:flex;justify-content:space-between;gap:8px}.seat-badges>div{min-width:0}.seat-badges .badge-label{display:block;font-size:9px}.seat-badges .badge-slots{display:flex;gap:3px}.seat-badges .badge-slots img,.seat-badges .empty-slot{width:clamp(20px,2.4vw,31px);height:auto;aspect-ratio:5/7}
.crown-center{grid-area:1/2/3/3;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:10px 6px;border:2px solid #e3bc66;border-radius:60px;background:radial-gradient(ellipse,#375e40a8,#112c2490 75%);text-align:center;min-width:0}.crown-title{font:bold clamp(13px,1.4vw,19px) Arial;color:#ffe8a2;letter-spacing:.5px}
.crown-center #crowns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));justify-items:center;align-items:center;gap:12px;min-height:0;width:min(100%,320px)}.crown-center #crowns img{height:clamp(105px,11.5vw,165px);width:auto;max-width:100%;object-fit:contain}
.crown-center #result{font-size:clamp(12px,1vw,15px);font-weight:bold;line-height:1.35;padding:0 8px;max-height:105px;overflow:auto}
.crown-center .tiebreaks{font-size:12px;max-height:100px;overflow:auto}
.board .battle-history{margin-top:8px}.board .battle-history #battleEvents{min-height:0;max-height:56px}
.yourarea .your-trophies .badge-slots img,.yourarea .your-trophies .empty-slot{width:clamp(34px,3.7vw,55px);height:auto;aspect-ratio:5/7}
.yourarea .hand-power-layout{grid-template-columns:minmax(0,1fr) minmax(175px,250px) minmax(175px,220px)}
@media(max-width:1050px){.board-grid{grid-template-columns:minmax(0,1fr) minmax(190px,.9fr) minmax(0,1fr)}.seat-cards img{height:105px}.seat-metrics{gap:6px}.seat-metrics strong{font-size:19px}.seat-result{font-size:10px}.crown-center #crowns img{height:115px}}
@media(max-width:700px){.board-grid{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto}.crown-center{grid-area:2/1/3/3;border-radius:25px;min-height:180px}.crown-center #crowns{display:flex;justify-content:center;flex-wrap:wrap;width:100%}.crown-center #crowns img{height:95px}#seat1{grid-area:1/1}#seat2{grid-area:1/2}#seat0{grid-area:3/1}#seat3{grid-area:3/2}.seat-cards img{height:90px}.seat-badges .badge-slots img,.seat-badges .empty-slot{width:19px}.seat-metrics strong{font-size:17px}.seat-header{gap:4px}.seat-winner{font-size:10px}.yourarea .hand-power-layout{grid-template-columns:minmax(0,1fr) 125px;grid-template-areas:'hand trophies' 'power power'}}

/* V2.0: roll beside the Crowns; make collected Crown/Joker slots more legible */
.crown-center .battle-roll-area{display:flex;flex-direction:column;align-items:center;gap:7px;width:100%;padding:4px 8px 2px}
.crown-center #roll{font-size:clamp(14px,1.3vw,18px);padding:12px 20px;min-width:min(100%,225px);box-shadow:0 0 14px #f1c85e6b}
.crown-center .qualify-hint{font:700 clamp(11px,1vw,14px)/1.25 Arial,sans-serif;color:#ffe6a1;text-align:center}
.yourarea .your-trophies .badge-slots img,.yourarea .your-trophies .empty-slot{width:clamp(43px,4.8vw,69px);height:auto;aspect-ratio:5/7}
.yourarea .your-trophies .badge-slots{gap:6px}
.yourarea .hand-power-layout{grid-template-columns:minmax(0,1fr) minmax(220px,320px) minmax(160px,210px)}
@media(max-width:1100px){.yourarea .hand-power-layout{grid-template-columns:minmax(0,1fr) minmax(170px,240px) minmax(145px,180px)}.yourarea .your-trophies .badge-slots img,.yourarea .your-trophies .empty-slot{width:clamp(35px,4vw,53px)}}
@media(max-width:760px){.yourarea .hand-power-layout{grid-template-columns:minmax(0,1fr) 150px;grid-template-areas:'hand trophies' 'power power'}.yourarea .your-trophies .badge-slots img,.yourarea .your-trophies .empty-slot{width:clamp(29px,6vw,45px)}.crown-center #roll{padding:10px 12px}}

/* V2.2: the same central action area switches from Roll to Next Round. */
.crown-center #next{font-size:clamp(14px,1.3vw,18px);padding:12px 20px;min-width:min(100%,225px);background:linear-gradient(180deg,#f7d878,#b78022);color:#251705;font-weight:900;box-shadow:0 0 14px #f1c85e6b}
.crown-center #next[hidden],.crown-center #roll[hidden]{display:none!important}
.crown-center .battle-roll-area:has(#next:not([hidden])) .qualify-hint{display:none}

/* V2.3: Explain the locked battle strength beside each player's total. */
.seat-strength{display:inline-flex;align-items:center;gap:5px;flex-wrap:wrap}
.strength-breakdown{font-size:clamp(10px,.83vw,13px);font-weight:650;line-height:1.15;color:#f4e4b5;white-space:normal;max-width:100%;opacity:.97}
.battle-seat .seat-metrics{flex-wrap:wrap;row-gap:4px}

/* V2.4: physical-style dice at the bottom of the battlefield */
.your-dice-panel{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;margin:9px auto 4px;padding:9px 12px;border:1px solid #ae884a80;border-radius:13px;background:linear-gradient(90deg,#1d3027,#304734,#1d3027);width:min(100%,690px)}
.dice-label{font:900 14px Arial,sans-serif;letter-spacing:1px;color:#f3d891}.custom-dice{display:flex;gap:12px}.custom-die{height:70px;width:70px;flex-shrink:0;border-radius:11px;background:#f9f5e9;color:#171717;border:3px solid #ded8cb;box-shadow:inset 0 -5px 0 #c9c5bb,0 5px 8px #0007;display:grid;place-items:center;font:bold 28px Arial}.red-die{border-color:#e5c8c8}.pip-grid{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);width:48px;height:48px;gap:3px}.pip-grid i{width:11px;height:11px;border-radius:50%;align-self:center;justify-self:center}.pip-grid i.on{background:#191919}.red-die .pip-grid i.on{background:#191919}.die-jester{display:flex;flex-direction:column;align-items:center;font-size:35px;line-height:.9}.die-jester.black{color:#171717}.die-jester.red{color:#bd222d}.die-jester small{font:900 9px Arial;letter-spacing:1px}.dice-total{font:bold 15px Arial;color:#fff0c8;text-align:center}
@media(max-width:760px){.your-dice-panel{gap:8px;padding:6px}.custom-die{height:54px;width:54px}.pip-grid{width:38px;height:38px}.pip-grid i{width:9px;height:9px}.dice-label,.dice-total{font-size:11px}.die-jester{font-size:27px}}

/* V2.5: prominent, readable, end-of-round event recap without adding page height */
.board .battle-history{margin-top:7px;padding:6px 10px;border:1px solid #b99b5b70;border-radius:8px;background:#0c241ed9}
.board .battle-history h3{font-size:16px;margin:0 0 4px;color:#ffe6a3}
.board .battle-history #battleEvents{max-height:125px;min-height:24px;overflow-y:auto;font:15px/1.35 Georgia,serif}
.board .battle-history .event-line{padding:4px 8px;margin-bottom:2px}
@media(max-width:700px){.board .battle-history #battleEvents{max-height:110px;font-size:13px}}

/* V2.6: Round events are part of the center table, not a separate battlefield window. */
.board .crown-center{gap:7px}
.board .crown-center .battle-history{width:94%;max-width:340px;margin:0;padding:2px 5px;border:0;border-radius:0;background:transparent;text-align:left}
.board .crown-center .battle-history h3{font:700 12px/1.15 Arial,sans-serif;margin:0 0 3px;color:#ffe6a3}
.board .crown-center .battle-history #battleEvents{max-height:100px;min-height:0;overflow-y:auto;font:12px/1.25 Georgia,serif}
.board .crown-center .battle-history .event-line{padding:2px 5px;margin:1px 0}
.board .crown-center .battle-history:has(#battleEvents .mini){display:none}
@media(max-width:700px){.board .crown-center .battle-history{width:96%;max-width:480px}.board .crown-center .battle-history #battleEvents{max-height:105px}}

/* V2.7: bring the collection trays leftward and enlarge both trophies and battle strength. */
@media (min-width:1101px){
 .yourarea .hand-power-layout{grid-template-columns:minmax(385px,1.3fr) minmax(250px,.85fr) minmax(285px,1fr);gap:12px;align-items:stretch}
 .yourarea .hand{align-self:center;gap:3px}
 .yourarea .hand .card img{width:clamp(62px,6vw,100px)}
 .yourarea .your-trophies{align-self:center}
 .yourarea .your-trophies .badge-row{gap:12px}
 .yourarea .your-trophies .badge-slots img,.yourarea .your-trophies .empty-slot{width:clamp(44px,4.3vw,63px);height:auto;aspect-ratio:5/7}
 .yourarea .your-trophies .badge-slots{gap:5px}
 .yourarea .powerbox{min-width:0;justify-content:center;padding:14px 18px;gap:10px}
 .yourarea .powerbox strong{font-size:clamp(46px,4vw,62px)}
 .yourarea .powerbox .powerlabel{font-size:12px}
 .yourarea #powerDetails{font-size:15px;line-height:1.45}
 .yourarea #powerStatus{font-size:13px}
}
@media (min-width:761px) and (max-width:1100px){
 .yourarea .hand-power-layout{grid-template-columns:minmax(0,1fr) minmax(180px,240px) minmax(230px,290px);gap:8px}
 .yourarea .hand .card img{width:clamp(48px,5.5vw,74px)}
 .yourarea .your-trophies .badge-slots img,.yourarea .your-trophies .empty-slot{width:clamp(32px,3.8vw,48px);height:auto;aspect-ratio:5/7}
 .yourarea .powerbox{padding:12px}
 .yourarea .powerbox strong{font-size:44px}
 .yourarea #powerDetails{font-size:13px}
}
@media (max-width:760px){
 .yourarea .hand-power-layout{grid-template-columns:minmax(0,1fr) minmax(145px,42%);grid-template-areas:'hand trophies' 'power power'}
 .yourarea .your-trophies .badge-slots img,.yourarea .your-trophies .empty-slot{width:clamp(30px,7vw,48px);height:auto;aspect-ratio:5/7}
 .yourarea .powerbox{padding:12px;gap:8px}
 .yourarea .powerbox strong{font-size:40px}
 .yourarea #powerDetails{font-size:14px}
}

/* V2.8: crown suit selection within the existing decision overlay */
#modalChoices .crown-choice{display:inline-flex;flex-direction:column;align-items:center;gap:6px;padding:9px;margin:6px;min-width:95px;cursor:pointer}
#modalChoices .crown-choice img{width:76px;height:105px;object-fit:contain;border-radius:5px}
#modalChoices .crown-choice span{font-weight:700;font-size:14px}

/* V3.1: give the five playable cards priority; tuck trophies against strength. */
@media (min-width:1101px){
  .yourarea .hand-power-layout{grid-template-columns:minmax(0,1fr) minmax(220px,255px) minmax(245px,285px);gap:6px;align-items:center}
  .yourarea .hand{gap:4px;justify-content:flex-start}
  .yourarea .hand .card img{width:clamp(84px,7.5vw,122px);max-width:100%}
  .yourarea .your-trophies{justify-self:end;width:100%}
  .yourarea .your-trophies .badge-slots{gap:3px}
  .yourarea .your-trophies .badge-slots img,.yourarea .your-trophies .empty-slot{width:clamp(39px,3.6vw,53px)}
  .yourarea .powerbox{padding:12px 12px}
}
@media (min-width:761px) and (max-width:1100px){
  .yourarea .hand-power-layout{grid-template-columns:minmax(0,1fr) minmax(150px,185px) minmax(185px,215px);gap:5px}
  .yourarea .hand{gap:2px}
  .yourarea .hand .card img{width:clamp(62px,7.1vw,88px)}
  .yourarea .your-trophies .badge-slots{gap:2px}
  .yourarea .your-trophies .badge-slots img,.yourarea .your-trophies .empty-slot{width:clamp(29px,3.1vw,41px)}
}

/* V3.2: enlarge collectible cards without changing hand/strength column widths. */
@media (min-width:1101px){
 .yourarea .your-trophies .badge-slots{gap:4px;flex-wrap:nowrap}
 .yourarea .your-trophies .badge-slots img,
 .yourarea .your-trophies .empty-slot{width:clamp(46px,4.4vw,60px);height:auto;aspect-ratio:5/7;flex-shrink:1}
 .yourarea .your-trophies .badge-row{gap:9px}
 .yourarea .your-trophies .badge-side{width:100%}
 .yourarea .your-trophies .badge-label{font-size:13px}
}
@media (min-width:761px) and (max-width:1100px){
 .yourarea .your-trophies .badge-slots{gap:2px;flex-wrap:nowrap}
 .yourarea .your-trophies .badge-slots img,
 .yourarea .your-trophies .empty-slot{width:clamp(32px,3.65vw,44px);height:auto;aspect-ratio:5/7;flex-shrink:1}
}

/* V3.4: Full battlefield end-of-game announcement, without altering gameplay layout. */
.board-grid{position:relative}
.game-over-screen{position:absolute;inset:0;z-index:8;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(5,18,13,.84);border-radius:16px;backdrop-filter:blur(3px)}
.game-over-screen[hidden]{display:none!important}
.game-over-card{width:min(100%,570px);padding:clamp(22px,4vw,44px) 18px;border:3px solid #f3d78c;border-radius:24px;background:radial-gradient(circle at top,#345d45,#10261e 80%);box-shadow:0 0 45px #e7c36b55,0 12px 40px #000a;text-align:center}
.game-over-crown{font-size:clamp(54px,7vw,92px);line-height:1.1}
.game-over-eyebrow{color:#e9d39b;font:bold 12px/1.5 Arial,sans-serif;letter-spacing:2px;margin:12px 0}
.game-over-card h2{color:#ffe7a2;font:bold clamp(32px,5vw,56px)/1.1 Georgia,serif;margin:10px 0;text-shadow:0 3px 6px #000}
#gameOverWinner{font:bold clamp(23px,3.5vw,39px)/1.2 Georgia,serif;color:#fff4c6;margin:16px 0}
.game-over-subtitle{color:#e4d9b9;font-size:16px;margin:0 0 24px}
#playAgain{font-size:18px;padding:15px 28px}

.audio-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.audio-controls button{white-space:nowrap;padding:9px 12px;font-size:.88rem}.top{flex-wrap:wrap;gap:10px}

/* V3.8 rules guide */
.how-to-play-btn{margin-left:auto;white-space:nowrap}
.rules-overlay[hidden]{display:none!important}
.rules-overlay{position:fixed;inset:0;z-index:10000;background:rgba(5,9,20,.83);display:flex;justify-content:center;align-items:center;padding:16px;box-sizing:border-box}
.rules-dialog{width:min(820px,100%);max-height:min(90vh,920px);display:flex;flex-direction:column;background:linear-gradient(150deg,#17233b,#0e1424);border:2px solid #d5ae5d;border-radius:18px;color:#f6ecd8;box-shadow:0 20px 70px #000c;outline:none}
.rules-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 24px;border-bottom:1px solid #bd985a55}
.rules-kicker{font-size:11px;letter-spacing:.15em;color:#e6c883}.rules-header h2{font-size:clamp(19px,3vw,29px);margin:5px 0 0;color:#ffe6a4}.rules-close{flex-shrink:0}
.rules-body{padding:18px 28px;overflow:auto;line-height:1.6;font-size:15px;overscroll-behavior:contain}.rules-body h3{font-size:18px;color:#f9d488;margin:21px 0 5px}.rules-body p{margin:7px 0 10px}.rules-body ul{padding-left:23px;margin:8px 0 14px}.rules-body li{margin:6px 0}.rules-body strong{color:#fff1c8}.rules-callout{background:#9b782c26;border:1px solid #e1b35b77;border-radius:10px;padding:13px 16px;margin:5px 0 17px}
.rules-footer{padding:13px 22px;border-top:1px solid #bd985a55;display:flex;justify-content:flex-end}.rules-open{overflow:hidden}
@media(max-width:600px){.rules-header{padding:12px}.rules-body{padding:12px 16px;font-size:14px}.rules-header h2{font-size:18px}.rules-close{font-size:12px}.how-to-play-btn{margin-left:0}}

/* V4.0: use spare desktop room for larger playable cards without shrinking trophies. */
@media (min-width:1101px){
  .board-grid .seat-cards{min-height:clamp(135px,13vw,205px);gap:12px}
  .board-grid .seat-cards img{height:clamp(126px,12.2vw,190px);max-width:45%;width:auto}
  .yourarea .hand-power-layout{grid-template-columns:minmax(0,1fr) minmax(220px,255px) minmax(245px,285px);gap:8px}
  .yourarea .hand{gap:clamp(3px,.55vw,9px)}
  .yourarea .hand .card img{width:clamp(100px,8.2vw,145px);max-width:100%}
}
@media (min-width:761px) and (max-width:1100px){
  .board-grid .seat-cards img{height:clamp(106px,10.5vw,135px)}
  .yourarea .hand .card img{width:clamp(72px,7.4vw,100px)}
}

/* V4.1: Battlefield legibility and larger center Crowns. Preserve the four-seat layout. */
@media (min-width:1051px){
 .board .crown-center{gap:10px;padding:14px 10px}
 .board .crown-title{font-size:clamp(19px,1.8vw,25px);line-height:1.2}
 .board .crown-center #crowns{width:min(100%,380px);gap:15px}
 .board .crown-center #crowns img{height:clamp(133px,12.5vw,188px);max-width:100%}
 .board .crown-center #result{font-size:clamp(16px,1.45vw,20px);line-height:1.4;max-height:145px}
 .board .crown-center .tiebreaks{font-size:16px;max-height:120px}
 .board .crown-center .battle-history{max-width:385px}
 .board .crown-center .battle-history h3{font-size:16px}
 .board .crown-center .battle-history #battleEvents{font-size:15px;line-height:1.4;max-height:145px}
 .board .crown-center .qualify-hint{font-size:16px}
 .board .crown-center #roll,.board .crown-center #next{font-size:19px}
 .board-heading h2{font-size:26px}
 .board-heading .round-indicator{font-size:16px}
}
@media (min-width:701px) and (max-width:1050px){
 .board .crown-title{font-size:19px}
 .board .crown-center #result{font-size:16px}
 .board .crown-center .battle-history #battleEvents{font-size:14px}
 .board .crown-center #crowns img{height:clamp(112px,12vw,145px)}
 .board .crown-center .qualify-hint{font-size:14px}
}
@media (max-width:700px){
 .board .crown-title{font-size:18px}
 .board .crown-center #result{font-size:15px}
 .board .crown-center .battle-history #battleEvents{font-size:14px}
 .board .crown-center #crowns img{height:clamp(85px,20vw,118px)}
}

/* V4.2: Make voiced collection cards visibly interactive. */
img[data-voice-kind]{cursor:pointer;}
img[data-voice-kind]:hover{filter:brightness(1.17);transform:translateY(-2px);}

/* V4.3 Joker's Bargain */
.bargain-button{background:linear-gradient(125deg,#63349a,#a259d1);color:white;border:1px solid #c59deb;font-weight:800}#modalChoices .bargain-grid{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin:12px 0}#modalChoices .bargain-card{width:104px;display:flex;flex-direction:column;align-items:center;gap:5px;padding:5px;background:#302c42;color:white;border:2px solid transparent;border-radius:8px}#modalChoices .bargain-card img{width:100%;height:auto;border-radius:5px}#modalChoices .bargain-card span{font-size:11px}#modalChoices .bargain-card.chosen{border-color:#f7c957;box-shadow:0 0 0 2px #f7c957}#modalChoices .bargain-actions{display:flex;justify-content:center;gap:12px;margin-top:12px}

/* V4.4: Win record uses only free horizontal space beside the existing dice panel.
   Existing battlefield, dice, hand and player box dimensions are unchanged. */
.dice-record-row{display:flex;align-items:center;justify-content:center;gap:12px;margin:9px auto 4px;max-width:100%}
.dice-record-row .your-dice-panel{margin:0;flex:0 1 690px;min-width:0}
.battle-record{flex:0 0 205px;box-sizing:border-box;padding:8px 11px;border:1px solid #ae884a80;border-radius:13px;background:linear-gradient(120deg,#263a2d,#172d26);color:#f3e4bd;font:12px Arial,sans-serif}
.record-title{font-size:13px;font-weight:800;text-align:center;margin-bottom:5px;color:#f5d990}
.record-grid{display:grid;gap:3px}.record-line{display:flex;justify-content:space-between;gap:10px}.record-line strong{font-size:13px}.record-line.is-you{color:#ffe2a0;font-weight:700}.record-footer{border-top:1px solid #ae884a60;padding-top:5px;margin-top:3px;font-size:11px;text-align:center}
.record-reset{display:block;margin:5px auto 0;padding:3px 9px;font-size:10px;min-height:0;border-radius:7px;opacity:.86}
@media(max-width:960px){.dice-record-row{flex-wrap:wrap}.battle-record{flex:0 1 220px}.dice-record-row .your-dice-panel{flex:0 1 690px}}
