@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}
