@font-face{font-family:'Goudy Bookletter 1911';src:url('fonts/GoudyBookletter1911.ttf') format('truetype');font-style:normal;font-weight:400;font-display:optional}
:root{--navy:#002868;--red:#bf0a30;--ink:#17273b;color-scheme:light}*{box-sizing:border-box}body{margin:0;background:var(--red);color:var(--ink);font-family:Georgia,serif;line-height:1.4}header{background:var(--navy);color:white;text-align:center;padding:8px 12px 7px;background-image:url('img/White_star.svg');background-repeat:repeat-x;background-size:100px 100px}header img{display:block;margin:auto;height:84px;width:70px}header p{display:inline-block;margin:4px 0 0;padding:2px 10px;background:var(--navy);font:11px system-ui,sans-serif;letter-spacing:.09em}header span{white-space:nowrap}main{max-width:780px;margin:auto;background:#fffdf8;padding:0 24px 12px}nav{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:40px;font-size:13px;border-bottom:1px solid #d7dbe2}button{min-height:44px;border:2px solid transparent;border-radius:24px;padding:9px 22px;background:var(--red);color:#fff;font:600 15px system-ui,sans-serif;cursor:pointer}button:disabled{background:#e1e4e9;color:#4c5867;cursor:default}button:hover:enabled{filter:brightness(.9)}:focus-visible{outline:3px solid #a76b00;outline-offset:3px}.text-button{background:none;color:var(--navy);border-radius:0;padding:8px 0;min-height:40px;font:inherit;text-decoration:underline}.sr-only{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden;white-space:nowrap}.scoreboard{text-align:center;padding:7px 0}.scoreboard p{margin:0}#progress{font-weight:bold;color:var(--navy);font-size:16px}#accounting{font-size:12px;color:#46546a;margin-top:2px}.arena{display:grid;grid-template-columns:minmax(0,1fr) 50px minmax(0,1fr);max-width:480px;margin:0 auto;text-align:center;gap:12px}.arena h2{font-size:15px;letter-spacing:.08em;margin:0;color:var(--navy)}.count{margin:2px 0 6px;font-size:13px}.versus{align-self:center;color:var(--red);font-size:18px;white-space:nowrap}.reveal-card{height:145px;border:1px solid #b7becc;background:white;border-radius:3px;display:flex;flex-direction:column;justify-content:center;align-items:center;color:var(--navy);font-size:38px;overflow:hidden}.reveal-card img{height:70px;width:95%;object-fit:contain}.reveal-card strong{font-size:34px;line-height:1.1}.reveal-card small{font-size:14px;line-height:1.2;padding:3px 4px}.reveal-card:not(:has(img)){background-image:linear-gradient(#ffffffbf,#ffffffbf),url('img/american-flag.svg');background-size:cover;background-position:center}#hand-section{margin:12px auto 0}#hand-section h2{font-size:14px;text-align:center;margin:0 0 7px}#hand-section h2 span{font-weight:normal}#hand{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;max-width:680px;margin:auto}.card{border:1px solid #aab6c8;background:white;color:var(--navy);padding:5px 3px;border-radius:3px;font-family:Georgia,serif;display:flex;flex-direction:column;align-items:center;min-height:91px}.card img{height:30px;width:56px;max-width:100%;object-fit:contain}.card strong{font-size:23px;line-height:1.05;margin-top:2px}.card small{font-size:12px;line-height:1.12;margin-top:3px;overflow-wrap:normal}.card[aria-pressed=true]{border:3px solid var(--red);padding:3px 1px;background:#fff1f3}.actions{text-align:center;margin:10px 0 0}.actions button{min-width:190px}#status{font-size:14px;text-align:center;max-width:590px;margin:8px auto;color:var(--navy)}.piles{display:grid;grid-template-columns:1fr 1fr;gap:18px;text-align:center;max-width:600px;margin:auto;color:#49566b;font-size:12px}.piles p{margin:5px 0}.collection{border-top:1px solid #c4cbd6;margin-top:10px;padding:10px 0 0;font-size:14px}.collection summary{cursor:pointer;min-height:28px;color:var(--navy)}#wins{float:right;font-size:13px}#badges{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding-top:12px}#badges img{width:65px;height:48px;object-fit:contain}.stars{color:var(--navy);letter-spacing:2px;overflow-wrap:anywhere}.small{font-size:13px;color:#4c5867}#storage-note{font-size:13px;text-align:center;margin:4px 0}#storage-note:empty{display:none}footer{font-size:12px;text-align:center;background:var(--navy);color:white;padding:10px}footer a{color:white}#setup{text-align:center;padding:20px 12px}#setup h1{font-size:27px;color:var(--navy);margin:0}#setup p{margin:12px 0}.intro-rules{max-width:510px;margin:20px auto;text-align:left;border-left:3px solid var(--red);padding-left:14px;font-size:15px}dialog{border:1px solid #bac3d2;border-radius:8px;max-width:560px;width:calc(100% - 28px);max-height:calc(100dvh - 32px);padding:22px;color:var(--ink);line-height:1.5}dialog::backdrop{background:#001331aa}dialog h2{margin-top:0}dialog ol{padding-left:22px}dialog li{margin:10px 0}[hidden]{display:none!important}@media(max-width:600px){main{padding:0 12px 10px}header{padding-top:5px;padding-bottom:4px;background-size:80px 80px}header img{height:65px;width:56px}header p{font-size:10px;margin-top:2px}.arena{gap:8px;grid-template-columns:minmax(0,1fr) 36px minmax(0,1fr);max-width:380px}.reveal-card{height:120px}.reveal-card img{height:55px}.reveal-card strong{font-size:28px}.reveal-card small{font-size:13px}.versus{font-size:15px}.count{font-size:12px}#hand{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;max-width:400px}.card{min-height:82px}.card small{font-size:12px}.card img{height:26px;width:50px}.card strong{font-size:21px}#hand-section{margin-top:9px}.scoreboard{padding:5px 0}#progress{font-size:15px}#accounting{font-size:11px}.actions{margin-top:8px}#status{font-size:13px}.piles{gap:10px;font-size:12px}}@media(max-width:350px){main{padding-left:10px;padding-right:10px}header img{height:57px;width:49px}.reveal-card{height:106px}.reveal-card img{height:45px}.card{min-height:80px}nav{font-size:12px}.count{font-size:11px}#accounting{font-size:10px}}@media(max-height:500px) and (min-width:600px){header img{height:48px;width:40px}.reveal-card{height:100px}.reveal-card img{height:45px}}
/* Compact hand labels remain readable at narrow widths. */
.card small{overflow-wrap:anywhere;max-width:100%}
@media(max-width:600px) and (max-height:700px){.card{min-height:64px;justify-content:center}.reveal-card{height:98px}.reveal-card img{height:40px}}
.card small{font-weight:400}
/* Match console and compact portrait playing cards. */
.arena{grid-template-columns:minmax(0,128px) minmax(100px,140px) minmax(0,128px);justify-content:center;max-width:428px;gap:10px;position:relative}
.match-console{align-self:center;text-align:center;color:var(--navy);position:relative;min-width:0;font-size:13px;line-height:1.3;padding:5px 0}
#match-outcome{font-size:15px;display:block;color:var(--red)}
.match-console p{margin:9px 0 0}.match-console p:empty{display:none}
#capture-detail strong{display:block;font:700 10px system-ui,sans-serif;letter-spacing:.04em;margin-top:4px;color:var(--navy)}
#discard-detail{font-size:12px;color:#596273}
.reveal-card{width:100%;height:auto;aspect-ratio:5/7;padding:6px 3px;gap:2px;border-radius:7px;box-shadow:0 2px 3px #00286812;overflow:visible}
.reveal-card img{width:100%;height:70px;object-fit:contain;flex-shrink:1;min-height:0}
.reveal-card small{font-size:13px;padding:1px 0;line-height:1.2;overflow-wrap:anywhere}
.reveal-card:not(:has(img)){background-size:contain;background-repeat:no-repeat}
.card-fate{font:700 9px system-ui,sans-serif;letter-spacing:.03em;margin-top:3px;color:var(--red)}
.arena[data-winner="0"] #your-card,.arena[data-winner="1"] #their-card{outline:3px solid #b97812;outline-offset:2px}
.arena[data-winner="0"] #your-card .card-fate,.arena[data-winner="1"] #their-card .card-fate{color:#805000}
#hand{max-width:608px;justify-content:center;grid-template-columns:repeat(7,minmax(0,80px))}
.card{aspect-ratio:5/7;min-height:0;justify-content:center;gap:2px;border-radius:6px;padding:5px 3px}
.card img{width:100%;height:34px;object-fit:contain}.card small{margin-top:0}.card strong{margin-top:0}
.card[aria-pressed=true]{padding:3px 1px}
.ledger{text-align:center;margin:9px 0 0!important;font-size:11px!important}
#star-flight{position:absolute;left:50%;top:40%;width:1px;height:1px;pointer-events:none;z-index:3}
#star-flight span{position:absolute;left:-9px;top:-9px;font-size:21px;color:#a56700;text-shadow:0 1px #fff;opacity:0}
#star-flight.flying span{animation:star-to-winner 620ms ease-out both}
#star-flight.flying span:nth-child(2){animation-delay:60ms;top:3px;font-size:16px}
#star-flight.flying span:nth-child(3){animation-delay:120ms;top:-21px;font-size:14px}
@keyframes star-to-winner{0%{opacity:0;transform:translate(0,0) scale(.6)}20%{opacity:1}80%{opacity:1}100%{opacity:0;transform:translate(var(--flight-x),-12px) scale(1.1)}}
@media(max-width:600px){.arena{grid-template-columns:minmax(0,1fr) 94px minmax(0,1fr);gap:6px;max-width:354px}.match-console{font-size:12px}#match-outcome{font-size:12px}#discard-detail{font-size:11px}.reveal-card img{height:46px}.reveal-card strong{font-size:27px}.reveal-card small{font-size:12px}.card-fate{font-size:8px}#hand{grid-template-columns:repeat(4,minmax(0,78px));max-width:330px;gap:6px}.card img{height:28px}.card{aspect-ratio:5/7;min-height:0}}
@media(max-width:600px) and (max-height:700px){.card{aspect-ratio:auto;min-height:64px}.reveal-card{height:auto}.reveal-card img{height:38px}.arena{max-width:330px}.card-fate{font-size:8px}}
@media(prefers-reduced-motion:reduce){#star-flight.flying span{animation:none!important;opacity:0!important}}
#round-summary{text-align:center;color:var(--navy);font-size:14px;margin:10px auto;max-width:480px}
.arena article{min-width:0}
@media(max-width:600px){.arena h2{font-size:12px;letter-spacing:.04em}}
/* Official shield branding and centered rows at every hand size. */
header{padding:6px 12px}
header img{height:120px;width:auto;max-width:100%;object-fit:contain}
#hand{display:flex;flex-wrap:wrap;justify-content:center;align-items:stretch;gap:8px;max-width:608px}
.card{flex:0 0 80px;width:80px}
.arena{padding-top:5px;padding-bottom:6px}
.reveal-card:not(:has(img)){background-position:center top;background-size:100% auto}
.captured-ranks{display:inline-block;text-align:center;margin-top:3px}
#capture-detail,#discard-detail{font-size:13px;line-height:1.35;margin:8px 0;color:var(--navy)}
#capture-detail{font-weight:bold}#discard-detail{color:#596273}
#star-flight span{font-size:29px;left:-13px;top:-13px;color:#b4780a;text-shadow:0 1px 1px #fff}
#star-flight.flying span:nth-child(2){font-size:23px;top:5px}
#star-flight.flying span:nth-child(3){font-size:20px;top:-28px}
@media(max-width:600px){header img{height:88px}#hand{gap:6px;max-width:330px}.card{flex-basis:calc((100% - 18px)/4);width:calc((100% - 18px)/4);max-width:78px}#capture-detail,#discard-detail{font-size:12px}}
@media(max-width:600px) and (max-height:700px){header{padding:3px 12px}header img{height:78px}.arena{padding-top:3px;padding-bottom:4px}.reveal-card{aspect-ratio:5/6.6}#hand-section{margin-top:6px}.card{min-height:62px}}
@media(max-width:350px) and (max-height:700px){header img{height:72px}.scoreboard{padding:3px 0}nav,.text-button{min-height:36px}}
.retained-ranks,.next-hand-label,.next-hand-ranks{display:block;text-align:center}
.retained-ranks{margin-top:7px}.next-hand-label{margin-top:5px;font-weight:bold}.next-hand-ranks{color:var(--navy)}
/* Completed games have a distinct result, separate from the card-match console. */
.game-result{max-width:500px;margin:8px auto 18px;padding:15px 18px;text-align:center;background:#edf1f8;border:1px solid #b6c2d4;border-radius:9px}
.game-result[data-winner="0"]{background:#fff7e3;border:2px solid #bb831c}
.finish-kicker{font:700 10px system-ui,sans-serif;letter-spacing:.13em;margin:0;color:var(--navy)}
.game-result h2{font-size:32px;line-height:1.1;margin:5px 0 8px;color:var(--navy)}
.game-result p{margin:5px 0}.game-result #finish-reward{font-weight:bold;font-size:16px}
.finish-icon{float:left;font-size:40px;line-height:1;color:#a66e05;min-width:48px;margin:4px 8px 4px 0}
.finish-icon img{width:75px;height:52px;object-fit:contain}
.game-result[data-winner="0"] .finish-icon{animation:finish-glow 700ms ease-out 1}
.game-result[data-winner="1"] .finish-icon{color:var(--navy);font-size:27px}
#finish-total,#finish-progress-label{font-size:12px}#finish-progress{display:block;width:180px;height:7px;margin:8px auto;accent-color:#b57910}
#replay{display:block;min-width:190px;margin:12px auto 0}
#match-outcome{font-size:12px;line-height:1.25;margin-bottom:6px}
#round-summary{padding:10px;background:#edf1f8;border-radius:6px}
@keyframes finish-glow{0%{transform:scale(.85);opacity:.4}60%{transform:scale(1.1);opacity:1}100%{transform:scale(1);opacity:1}}
@media(max-width:600px){.game-result{padding:12px;margin:6px auto 12px}.game-result h2{font-size:28px}.game-result #finish-reward{font-size:14px}.finish-icon{font-size:30px;min-width:32px}.finish-icon img{width:55px;height:40px}#match-outcome{font-size:11px}}
@media(prefers-reduced-motion:reduce){.game-result .finish-icon{animation:none!important}}
.back-home{display:block;width:fit-content;min-height:44px;padding:10px 14px;margin:4px auto 0;color:var(--navy);font-size:14px;text-decoration:underline}
.back-home[aria-disabled="true"]{opacity:.6;cursor:default}

/* Original reading face; action controls keep their existing system-font sizing. */
body,.card{font-family:'Goudy Bookletter 1911',Georgia,serif}

/* Original 140px star band and 200px transparent shield, layered independently. */
header{--band-height:140px;--logo-width:200px;--logo-overhang:60px;height:var(--band-height);padding:0;position:relative;z-index:1;background:var(--navy) url('img/White_star.svg') repeat-x center top / 140px 140px}
header img{position:absolute;top:0;left:50%;transform:translateX(-50%);width:var(--logo-width);max-width:200px;height:auto;margin:0;opacity:.93;object-fit:contain}
main>nav{padding-top:30px}
/* Match original .toptext sizing; arena remains only the layout container. */
.arena h2{font-size:1.6rem;font-weight:400;line-height:1.2;letter-spacing:normal;margin:0}
.reveal-card,.card{padding:0;justify-content:flex-start;gap:0;overflow:hidden}
.reveal-card img,.card img{display:block;width:100%;max-width:100%;height:auto;object-fit:contain;object-position:center top;flex-shrink:0;margin:0}
.reveal-card strong{margin-top:6px}.reveal-card small{padding:1px 3px}
.card strong{margin-top:4px}.card small{padding:3px 3px 4px}
.card[aria-pressed=true]{border:1px solid var(--red);padding:0;outline:2px solid var(--red);outline-offset:0}
@media(max-width:600px){header{--band-height:80px;--logo-width:112px;background-size:80px 80px}main>nav{padding-top:32px}.arena h2{font-size:1.5rem}.reveal-card strong{margin-top:3px}}
@media(max-width:600px) and (max-height:700px){header{--band-height:64px;--logo-width:90px;background-size:64px 64px}main>nav{padding-top:26px}.card{justify-content:center}.card strong{margin-top:0}}
@media(max-width:350px) and (max-height:700px){header{--band-height:58px;--logo-width:84px;background-size:58px 58px}.arena h2{font-size:1.4rem}}
@media(max-width:350px){.arena{grid-template-columns:minmax(0,1fr) 64px minmax(0,1fr);gap:4px}.arena h2{letter-spacing:-.025em}.match-console{overflow-wrap:anywhere}}
@media(max-width:600px){.arena article:last-child h2{width:calc(100% + 24px);margin-left:-24px}}
/* Taller flag proportions may increase a card instead of cropping its art or label. */
.reveal-card{min-height:min-content}.card:has(img){min-height:min-content}
@media(max-width:600px) and (max-height:700px){.card:has(img){min-height:62px}}
.reveal-card:has(img){aspect-ratio:auto;min-height:180px}
.card:has(img){aspect-ratio:auto;min-height:112px}
@media(max-width:600px){.reveal-card:has(img){min-height:145px}.card:has(img){min-height:109px}}
@media(max-width:600px) and (max-height:700px){.reveal-card:has(img){min-height:128px}.card:has(img){min-height:62px}}

/* Equal flag slots align ranks and names while containing every flag uncropped. */
.reveal-card img{height:84px;object-fit:contain;object-position:center top}
.card img{height:44px;object-fit:contain;object-position:center top}
@media(max-width:600px){.reveal-card img{height:70px}.card img{height:42px}}
@media(max-width:600px) and (max-height:700px){.reveal-card img{height:64px}.card,.card[aria-pressed=true]{justify-content:flex-start;padding-top:8px}}

/* Decorative reward layer never participates in heading or text alignment. */
.game-result{position:relative;isolation:isolate}
.game-result .finish-icon{position:absolute;inset:0;z-index:-1;float:none;display:flex;align-items:center;justify-content:center;margin:0;min-width:0;font-size:170px;line-height:1;opacity:.12;pointer-events:none}
.game-result .finish-icon img{width:160px;height:120px;object-fit:contain}
#storage-note{font:inherit;color:inherit;text-align:inherit;margin:0}

/* Phone cards always show artwork. Cover crops without stretching, anchored at canton. */
.card,.card[aria-pressed=true]{padding:0;justify-content:flex-start}
.card img{display:block;height:44px;object-fit:cover;object-position:left center}
.card:has(img){min-height:112px}
.reveal-card.is-unrevealed{background-image:none;aspect-ratio:auto;min-height:180px}
.reveal-card img.card-back{display:block;height:90px;object-fit:cover;object-position:left top}
.reveal-card .unknown-rank{display:block;margin-top:6px}
@media(max-width:600px){.card img{height:42px}.card:has(img){min-height:109px}.reveal-card.is-unrevealed{min-height:145px}.reveal-card img.card-back{height:90px}}
@media(max-width:600px) and (max-height:700px){.card img{height:32px}.card:has(img){min-height:88px}.reveal-card.is-unrevealed{min-height:128px}.reveal-card img.card-back{height:90px}}

/* Preserve complete emblems on these taller flags without changing the slot. */
.card img[src$="/rhode-island-flag.svg"],
.card img[src$="/wyoming-flag.svg"],
.card img[src$="/nebraska-flag.svg"]{object-fit:contain}
/* Additional breathing room above Confirm only while choosing a hand card. */
#hand-section:not([hidden]) + .actions{padding-top:10px}

/* Wider match arena: headings/counts share rows, details center on the cards. */
button{font-family:'Goudy Bookletter 1911',Georgia,serif;font-size:19px;font-weight:700}
button.text-button{font-family:'Goudy Bookletter 1911',Georgia,serif;font-size:16px;font-weight:700}
button.card{font-size:16px}
.arena{max-width:535px;grid-template-columns:minmax(0,166px) minmax(116px,175px) minmax(0,166px);column-gap:12px;row-gap:2px;align-items:start}
.arena article{display:contents}
.arena article:first-child>*{grid-column:1}.arena article:last-child>*{grid-column:3}
.arena h2{grid-row:1}.arena .count{grid-row:2}
.reveal-card{grid-row:3;align-self:stretch;width:calc(100% - 6px);margin-left:3px;margin-right:3px}
.reveal-card:has(img),.reveal-card.is-unrevealed{min-height:210px;aspect-ratio:auto}
.reveal-card img,.reveal-card img.card-back{height:90px;object-fit:cover;object-position:left center}
.reveal-card img.card-back{object-position:left top}
.reveal-card .unknown-rank{margin-top:0;font-size:13px;font-weight:700}
.match-console{grid-column:2;grid-row:3;align-self:center;justify-self:stretch;padding:0;text-align:center}
#match-outcome,#capture-detail,#discard-detail{font-size:14px;line-height:1.3;margin:6px 0;font-weight:400;color:var(--navy);overflow-wrap:anywhere}
.match-console span{display:block}.match-console strong{display:block;font:700 15px/1.3 'Goudy Bookletter 1911',Georgia,serif;letter-spacing:normal;margin-top:2px}
.card img[src$="/rhode-island-flag.svg"],.card img[src$="/wyoming-flag.svg"],.card img[src$="/nebraska-flag.svg"],.reveal-card img[src$="/rhode-island-flag.svg"],.reveal-card img[src$="/wyoming-flag.svg"],.reveal-card img[src$="/nebraska-flag.svg"]{object-fit:cover;object-position:center center}
#badges{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.trophy{display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center;font-size:14px}
.trophy-icon{display:flex;align-items:center;justify-content:center;height:42px;font-size:30px;color:#986600}
#badges .trophy-icon img{width:48px;height:32px;object-fit:contain}
#finish-total{line-height:1.5}
@media(max-width:600px){.arena{max-width:443px;grid-template-columns:minmax(0,1fr) 104px minmax(0,1fr);column-gap:6px}.reveal-card:has(img),.reveal-card.is-unrevealed{min-height:170px}.reveal-card .unknown-rank{font-size:12px}#match-outcome,#capture-detail,#discard-detail{font-size:12px}.match-console strong{font-size:13px}.arena article:last-child h2{width:calc(100% + 24px);margin-left:-24px}}
@media(max-width:350px){.arena{grid-template-columns:minmax(0,1fr) 86px minmax(0,1fr);column-gap:4px}.reveal-card:has(img),.reveal-card.is-unrevealed{min-height:165px}.arena h2{font-size:20px}.match-console strong{font-size:12px}#badges{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Override the earlier compact capture label so all three values share one face/weight. */
#match-outcome strong,#capture-detail strong,#discard-detail strong{font:700 15px/1.3 'Goudy Bookletter 1911',Georgia,serif;letter-spacing:normal;margin-top:2px}
@media(max-width:600px){#match-outcome strong,#capture-detail strong,#discard-detail strong{font-size:13px}}
@media(max-width:350px){#match-outcome strong,#capture-detail strong,#discard-detail strong{font-size:12px}}

/* Navy labels, brand-red values; cabinet contains only held denominations. */
#match-outcome strong,#capture-detail strong,#discard-detail strong{color:var(--red)}
#badges{display:flex;flex-wrap:wrap;justify-content:center;gap:16px}
.trophy{min-width:72px}.trophy-empty{width:100%;text-align:center;margin:0}

/* Rival headings wrap within their own column, including on narrow phones. */
.arena article:last-child h2{width:auto;margin-left:0;font-size:21px;overflow-wrap:anywhere}
#opponent-heading small{display:block;font:12px/1.3 'Goudy Bookletter 1911',Georgia,serif;margin-top:3px;letter-spacing:normal}
#match-outcome strong{overflow-wrap:anywhere}
@media(max-width:600px){.arena article:last-child h2{font-size:18px}}
@media(max-width:350px){.arena article:last-child h2{font-size:16px}#opponent-heading small{font-size:11px}}

#difficulty{display:block;margin:8px auto;max-width:100%;min-height:44px;padding:8px;font:inherit;color:var(--navy)}
#badges{display:block}.trophy-row{border-top:1px solid #d7dbe2;padding:10px 0}.trophy-row h3{font-size:15px;margin:0 0 8px}.held-trophies{display:flex;flex-wrap:wrap;gap:16px}.trophy svg{width:28px;height:28px}.trophy{min-width:60px}.finish-icon svg{width:48px;height:48px}.relaxed{color:#805126}.probability{color:#58606b}.strategic{color:#806000}
/* Closed native select: brand color and reserved arrow space. */
#difficulty{appearance:none;-webkit-appearance:none;background-color:var(--navy);color:#fff;padding:10px 40px 10px 12px;padding-inline-end:40px;border:1px solid var(--navy);border-radius:6px;min-height:44px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center}
/* Center state artwork; retain the left-aligned American card back. */
.card img:not(.card-back),.reveal-card img:not(.card-back){object-fit:cover;object-position:center center}
.reveal-card img.card-back{object-position:left top}
.reveal-card .unknown-rank{font-size:28px;line-height:1.2;font-weight:700;margin-top:0;transform:translateY(-9px)}
@media(max-width:600px){.reveal-card .unknown-rank{font-size:24px;transform:translateY(-7.2px)}}

.leaderboard-announcement{margin:16px 0 8px;padding:10px 12px;border:1px solid #ccd4e2;border-radius:6px;background:#eef2f8;color:var(--navy);text-align:center;font-size:14px;line-height:1.4;overflow-wrap:break-word}

/* Phase 1.1: one shelf per available difficulty, individual earned awards. */
.view-trophies{display:block;width:fit-content;margin:8px auto 12px;padding:8px;min-height:44px;color:var(--navy);font-weight:bold}
.local-section>summary{scroll-margin-top:16px}.local-section>summary:focus:not(:focus-visible){outline:none}.local-section>summary:focus-visible{outline:3px solid #a76b00;outline-offset:3px}
.trophy-row{padding:14px 12px 18px;margin:12px 0 18px;border:1px solid #d5d9de;border-bottom:7px solid #acb3bc;border-radius:6px;box-shadow:0 5px 5px -4px #26324426;background:#f3f4f6}
.trophy-row.relaxed{border-bottom-color:#805126}.trophy-row.probability{border-bottom-color:#58606b}.trophy-row.strategic{border-bottom-color:#806000}
.trophy-row h3{margin-bottom:14px;font-size:16px}.held-trophies{gap:16px 22px;align-items:end}.trophy{max-width:100%;min-width:0;align-items:flex-start;gap:7px;font-size:13px}.trophy-icons{display:flex;flex-wrap:wrap;gap:5px;max-width:100%}.trophy-icons svg{width:24px;height:28px;flex:none;filter:drop-shadow(0 1px 0 #fff9)}
.local-section{border-top:1px solid #c4cbd6;margin-top:10px;padding:0;font-size:14px}.local-section>summary{cursor:pointer;min-height:48px;padding:12px 0;color:var(--navy);font-size:18px;font-weight:bold;line-height:24px}.section-content{padding:0 0 8px}.local-section #wins{float:none;font-size:13px;margin:0 0 8px;color:var(--navy)}.rival-record label{margin-right:10px}.rival-record select{font:inherit;padding:8px;max-width:100%;min-height:44px;color:var(--navy);background:#fffdf8;border:1px solid #aab6c8;border-radius:5px}.rival-record table{border-collapse:collapse;width:100%;table-layout:fixed;font-size:14px}.rival-record th,.rival-record td{padding:9px 4px;border-bottom:1px solid #dce0e6;text-align:right;overflow-wrap:anywhere}.rival-record th:first-child{width:43%;text-align:left}.rival-record thead{color:var(--navy)}.rival-record tbody th{font-weight:400}#record-summary{font-size:14px;color:var(--navy)}#record-coverage{line-height:1.5;margin-bottom:18px}
@media(max-width:350px){.rival-record table{font-size:13px}.trophy-row{padding-left:10px;padding-right:10px}}

/* Phase 1.2 local pacing preview: animation does not affect the committed card. */
.reveal-card .opponent-readiness{font-size:12px;line-height:1.3;display:flex;justify-content:center;align-items:center;gap:2px;width:100%;padding:3px 2px;transform:translateY(-9px)}
.reveal-card .opponent-readiness.is-ready{font-size:28px;line-height:1.2}
.choosing-dots{animation:choosing-pulse 1.2s ease-in-out infinite}
@keyframes choosing-pulse{50%{opacity:.3}}
@media(max-width:600px){.reveal-card .opponent-readiness{font-size:11px;transform:translateY(-7.2px)}.reveal-card .opponent-readiness.is-ready{font-size:24px}}
@media(prefers-reduced-motion:reduce){.choosing-dots{animation:none}}

/* Phase 1.3: one small captured-card copy; results remain in place. */
.capture-flight{position:fixed;z-index:20;pointer-events:none;width:56px;height:76px;border:1px solid #aab6c8;border-radius:4px;background:#fffdf8;color:var(--navy);box-shadow:0 2px 6px #17273b33;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;overflow:hidden}
.capture-flight img{width:100%;height:28px;object-fit:cover}.capture-flight strong{font-size:18px;line-height:1.1}.capture-flight small{font-size:9px;line-height:1.1;padding:2px}
.captured-ranks{display:flex;flex-wrap:wrap;flex-direction:row;direction:ltr;justify-content:center;align-items:end;gap:4px;margin-top:6px}
.capture-card{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;width:30px;min-height:42px;padding:2px;background:#fff;border:1px solid #c6cbd2;border-radius:3px;color:var(--navy);vertical-align:bottom}
.capture-card img{width:24px;height:17px;object-fit:contain}.capture-card strong{font-size:16px;line-height:1.2;font-weight:700}
.capture-card.is-latest{width:40px;min-height:54px;box-shadow:0 2px 4px #17273b24}.capture-card.is-latest img{width:32px;height:23px}.capture-card.is-latest strong{font-size:20px}

@media(prefers-reduced-motion:reduce){.capture-flight{display:none}}

/* Local phase 1.4 presentation and permanent milestones. */
.sound-controls{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;padding:4px 0}.sound-controls .small{font-size:12px}.sound-controls button{font-size:13px}
.readiness-label{text-align:center;margin:4px 0;min-height:18px}
.flipping-out{animation:flip-out 180ms ease-in both}.flipping-in{animation:flip-in 180ms ease-out both}
@keyframes flip-out{from{transform:perspective(600px) rotateY(0)}to{transform:perspective(600px) rotateY(90deg)}}
@keyframes flip-in{from{transform:perspective(600px) rotateY(-90deg)}to{transform:perspective(600px) rotateY(0)}}
#achievements{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;border-top:1px solid #d7dbe2;margin-top:16px}.achievement-row h3{font-size:14px}.milestone-badge{display:inline-block;border:1px solid currentColor;border-radius:9px;padding:6px 10px;margin:4px 8px 4px 0;font-weight:bold}.milestone-badge small{font-size:10px;font-weight:normal}
@media(max-width:450px){#achievements{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.flipping-out,.flipping-in{animation:none}}

/* Align the home heading's first line with the game's status line. */
:root{--opening-offset:7px}
#setup,.scoreboard{padding-top:var(--opening-offset)}
@media(max-width:600px){:root{--opening-offset:5px}}
@media(max-width:350px) and (max-height:700px){:root{--opening-offset:3px}}

/* Emphasize the completed match notification, without changing its detail lines. */
.arena[data-winner="0"] #match-outcome,
.arena[data-winner="1"] #match-outcome{font-weight:700;margin-bottom:12px}

/* The bundled face is static Regular; retain browser bold rather than inventing a 900 face. */
.arena:is([data-winner="0"],[data-winner="1"]) #match-outcome{font-size:15px}
.arena:is([data-winner="0"],[data-winner="1"]) #match-outcome strong{font-size:16px}
@media(max-width:600px){
 .arena:is([data-winner="0"],[data-winner="1"]) #match-outcome{font-size:13px}
 .arena:is([data-winner="0"],[data-winner="1"]) #match-outcome strong{font-size:14px}
}
@media(max-width:350px){.arena:is([data-winner="0"],[data-winner="1"]) #match-outcome strong{font-size:13px}}

.score-toggle{display:flex;align-items:center;justify-content:center;gap:10px;min-height:44px}.score-toggle input{width:22px;height:22px;accent-color:var(--navy)}#deal-scores{margin:4px 0 0;overflow-wrap:anywhere}

.underdog-counts{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.underdog-badge{display:inline-block;border:1px solid currentColor;border-radius:12px;padding:3px 9px;font-size:14px;font-weight:700}.underdog-earned{animation:underdog-emphasis 1.2s ease-out}@keyframes underdog-emphasis{0%,100%{filter:none}35%{filter:brightness(.65)}}@media(prefers-reduced-motion:reduce){.underdog-earned{animation:none}}

.underdog-badge{display:inline-flex;flex-direction:column;align-items:center;border:0;padding:2px;width:82px;max-width:100%;font-size:12px;font-weight:normal;line-height:1.2;text-align:center}.underdog-badge img{display:block;width:76px;height:72px;max-width:100%;object-fit:contain}.underdog-counts{align-items:start;gap:6px}#underdog-opportunity{font-size:12px;color:var(--navy);margin:3px 0 0}

.lower-start-progress{border-top:1px solid #d5d9de;margin-top:12px;padding-top:10px}.lower-start-progress>strong{font-size:16px;display:block}.lower-start-progress p{margin:4px 0 0}.progress-coverage{line-height:1.35}
/* One consistent cabinet per playing style. Details are available by keyboard/touch. */
.cabinet-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(76px,1fr));gap:8px;align-items:stretch}
.cabinet-badge{min-width:0;min-height:106px;border:1px solid #cbd0d7;border-radius:7px;background:#fffdf8;color:inherit;padding:6px 3px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font:12px Georgia,serif;line-height:1.2}
.cabinet-badge:hover:enabled{background:#fff;filter:none;border-color:currentColor}
.cabinet-badge.is-unearned{background:transparent;border-style:dashed}
.cabinet-badge.is-unearned .cabinet-art{filter:grayscale(1);opacity:.4}
.cabinet-art{position:relative;display:flex;justify-content:center;align-items:center;width:48px;height:48px;flex:none}
#badges .cabinet-art svg,#badges .cabinet-art img{width:44px;height:44px;object-fit:contain}
.cabinet-number{position:absolute;bottom:-2px;right:-3px;padding:1px 3px;min-width:17px;background:#fffdf8;border:1px solid currentColor;border-radius:4px;color:inherit;font:700 12px system-ui;max-width:76px;overflow-wrap:anywhere}
.cabinet-label{font-weight:700}.cabinet-state{font-size:10px;color:#4c5867;overflow-wrap:anywhere;max-width:100%}
.cabinet-hint{margin:6px 0}.cabinet-guide{margin:12px 0}.cabinet-guide>summary{font-size:13px}
.trophy-row{margin:10px 0;padding:10px 10px 12px}.trophy-row h3{margin-bottom:9px}
#cabinet-detail p{font-size:15px}#cabinet-detail button{min-width:90px}
@media(max-width:380px){.cabinet-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}}
.cabinet-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:600px){.cabinet-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Twelve slots per style; preserve readable mobile targets. */
.cabinet-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.cabinet-label{overflow-wrap:anywhere}.cabinet-number{max-width:100%;font-size:11px}.cabinet-art{max-width:100%}@media(max-width:700px){.cabinet-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

@media(max-width:380px){.cabinet-label{font-size:11px;letter-spacing:-.015em}}
@media(max-width:380px){[data-badge="domination"] .cabinet-label{font-size:10px;white-space:nowrap;letter-spacing:-.02em}}

/* Rank is personal progress; four metrics wrap without squeezing their labels. */
.rank-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) minmax(130px,1.4fr);gap:14px;align-items:center;margin:14px 0;padding:14px 0;border-block:1px solid #d5d9de;text-align:center}
.rank-metrics dt{font:600 12px system-ui;line-height:1.4}.rank-metrics dd{margin:6px 0 0;font:700 25px Georgia,serif;overflow-wrap:anywhere}
#rank-info{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;min-height:44px;border:1px solid transparent;border-radius:8px;padding:5px;background:transparent;color:inherit;white-space:normal}
#rank-info:hover{border-color:currentColor;background:#ffffff80}#rank-info strong{font:700 14px Georgia,serif;line-height:1.3}#rank-info small{font:11px system-ui;color:inherit}#rank-art{display:block;width:52px;height:59px;color:#637080}#rank-art svg{width:100%;height:100%}
#rank-info[data-color=relaxed] #rank-art{color:#865323}#rank-info[data-color=probability] #rank-art{color:#596475}#rank-info[data-color=strategic] #rank-art{color:#866500}
#rank-dialog{max-width:min(560px,calc(100vw - 32px));max-height:85vh;overflow:auto}#rank-dialog p,#rank-dialog li{font:14px/1.55 system-ui}#rank-dialog details{margin:12px 0}#rank-ladder{padding-left:24px}#rank-ladder li{margin:5px 0}#rank-dialog button{min-height:44px}
.rank-notice-actions{display:flex;flex-direction:column;align-items:center;flex:none}.rank-notice .text-button{white-space:nowrap}#rank-header-note:empty{display:none}
@media(max-width:600px){.rank-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 12px}.rank-metrics dd{font-size:24px}}

#rank-rules,#rank-game-rules{white-space:pre-line}

/* Exit confirmation only; no Home/Arena layout changes. */
#quit-dialog .quit-actions{display:flex;flex-wrap:wrap;gap:12px;}
#quit-dialog .quit-actions>button{margin:0;min-height:44px;}
@media(max-width:480px){#quit-dialog .quit-actions>button{flex:1 1 100%;}}

/* A quiet special finish; existing win audio/motion preferences remain authoritative. */
#game-result.close-call-earned #finish-reward{border-inline-start:3px solid currentColor;padding-inline-start:12px;}
.trophy-row>h3{overflow-wrap:anywhere;}
