/* Ranked starts on the current page. Rules and community views are optional. */
#rankedDialog{box-sizing:border-box;width:min(760px,100vw - 40px);height:min(850px,100dvh - 40px);max-width:none;max-height:none;margin:auto;padding:0;color:#f4f0e4;background:#0d2425;border:1px solid #a58a55;border-radius:24px;overflow:hidden;box-shadow:0 30px 100px #000b;font:16px/1.4 system-ui,sans-serif}
#rankedDialog[open]{display:flex;flex-direction:column}
#rankedDialog [hidden]{display:none!important}
#rankedDialog::backdrop{background:#050d14e8}
#rankedDialog *{box-sizing:border-box}
#rankedDialog button{font:inherit;min-height:44px;min-width:44px;padding:10px 14px;border:1px solid #68817c;border-radius:12px;background:#1b3938;color:#f6efdf;cursor:pointer;touch-action:manipulation;white-space:normal;line-height:1.25}
#rankedDialog button:disabled{cursor:default;opacity:.5}
#rankedDialog button:focus-visible{outline:3px solid #ffdf95;outline-offset:2px}
#rankedDialog .primary{background:linear-gradient(120deg,#ffe3a0,#d9ab5d);border-color:#ffe6b0;color:#182a29;font-weight:800;box-shadow:0 6px 22px #e8bb5b25;min-height:54px;font-size:20px}
#rankedDialog h2,#rankedDialog h3{font-family:Georgia,serif;line-height:1.15;color:#fff2d2;margin:0}
#rankedDialog h2{font-size:clamp(24px,4vw,32px)}
#rankedDialog p{margin:0}
#rankedDialog .eyebrow{font:700 12px/1.4 system-ui,sans-serif;letter-spacing:.12em;color:#f0d195;margin:0}
.ranked-heading{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 20px;border-bottom:1px solid #71897b40}
.ranked-heading>strong{font:700 23px/1.2 Georgia,serif;color:#ffe3a1}
#rankedDialog .ranked-heading button{background:transparent;border-color:transparent;font-size:14px;padding:8px}
.ranked-content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:18px 22px;container-type:size}
.ranked-panel{display:flex;flex-direction:column;gap:12px;min-width:0;min-height:100%}
.ranked-ready{display:grid;gap:7px;flex:none;text-align:center}
.ranked-ready h2{text-wrap:balance}
#rankedDialog[data-screen=ready] .ranked-board{width:min(100%,360px,calc((100cqh - 175px) * var(--ranked-ratio,1)));min-width:min(100%,180px)}
.ranked-extras{display:flex;justify-content:center;gap:12px;flex:none;padding:0 16px max(10px,env(safe-area-inset-bottom))}
#rankedDialog .ranked-extras button{border:0;background:transparent;color:#e0c78d;font-size:14px;padding:8px 12px}
#rankedDialog .ranked-pagination button{font-size:28px;padding:4px}
.ranked-rules{color:#ffe4af;font-weight:700;font-variant-numeric:tabular-nums}
.ranked-lives{font-size:14px;font-weight:650;color:#f8dca9;font-variant-numeric:tabular-nums}
#rankedDialog .ranked-note{font-size:14px;line-height:1.4;color:#c5d5ce}
.ranked-personal{padding:12px 14px;background:linear-gradient(120deg,#604f2c66,#244239);border:1px solid #ab92575c;border-radius:12px}
.ranked-personal strong{color:#ffe1a0;font-size:17px}
#rankedDialog .ranked-personal p{font-size:13px;margin-top:4px;color:#c8d8ce}
.ranked-segments{display:flex;gap:6px}
#rankedDialog .ranked-segments button{flex:1;font-size:14px;padding:9px 5px}
#rankedDialog .ranked-segments button[aria-pressed=true]{background:#d4b779;color:#172b29;border-color:#f4dc9c;font-weight:700}
.ranked-empty{margin:auto 0!important;padding:28px 12px;text-align:center;color:#d4dccf}
#rankedDialog table{border-collapse:collapse;table-layout:fixed;width:100%;font-variant-numeric:tabular-nums;font-size:16px}
#rankedDialog th{font-size:12px;color:#b7cbc1;font-weight:600;text-align:start;padding:4px 8px}
#rankedDialog td{padding:10px 8px;border-bottom:1px solid #9cad8a30;vertical-align:middle;overflow-wrap:anywhere}
#rankedDialog th:first-child,#rankedDialog td:first-child{width:48px;text-align:center}
#rankedDialog td:first-child{font-size:20px;color:#e1d7b7;font-weight:750}
#rankedDialog th:last-child,#rankedDialog td:last-child{width:88px;text-align:end}
#rankedDialog td:last-child{color:#ffe0a0;font-weight:750}
#rankedDialog .ranked-podium td:first-child{color:#fff0b1;text-shadow:0 0 12px #f4ca7970}
#rankedDialog .ranked-you{background:#ddc17b18}
.ranked-row-details{display:block;font-size:12px;color:#b5c8bc;margin-top:4px}
#rankedDialog .ranked-report-name{font-size:11px;min-height:28px;padding:3px 6px;min-width:44px;margin-inline-start:5px;background:transparent;border:0;color:#b7c8be;text-decoration:underline}
.ranked-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:auto;font-size:14px}
.ranked-card-panel{text-align:center;gap:12px}
.ranked-player-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:150px;flex:1;max-height:250px;border:1px solid #b99b61;border-radius:18px;background:radial-gradient(ellipse at top,#d2a95925,transparent 70%),linear-gradient(140deg,#27473c,#132c31)}
.ranked-player-card>img{filter:drop-shadow(0 0 16px #e7bc6270)}
#rankedPlayerName{font-size:clamp(22px,4vw,32px);max-width:100%;overflow-wrap:anywhere}
.ranked-style-preview{display:grid;gap:10px;padding:12px;border:1px solid #788c7355;border-radius:14px;background:#132f2e}
#rankedStyleName{font-size:22px;min-height:34px}
.ranked-info{justify-content:center}
.ranked-info>div>p{font-size:15px;margin-top:14px!important;color:#d5dfd5}
.ranked-info ol{padding-inline-start:24px;margin:0;font-size:17px;color:#ffe5ae}
.ranked-info li{margin:12px 0}
.ranked-game{justify-content:center}
.ranked-stats{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:20px;font-variant-numeric:tabular-nums;flex:none}
.ranked-stats strong{font-size:30px;color:#ffe3a1}
#rankedDialog .ranked-urgent{color:#ffb495}
.ranked-board{--ranked-columns:5;display:grid;grid-template-columns:repeat(var(--ranked-columns),minmax(0,1fr));gap:3px;width:min(100%,520px,calc((100cqh - 70px) * var(--ranked-ratio,1)));margin:auto;border:1px solid #af8f5c;padding:5px;border-radius:12px;background:#091916;touch-action:manipulation;flex:none}
#rankedDialog .ranked-board .ranked-tile{padding:0;min-height:0;min-width:0;aspect-ratio:1;border-radius:5px;border:1px solid #4d6558;background:#1d342d;opacity:1}
.ranked-tile svg{display:block;width:100%;height:100%}
#rankedDialog .ranked-board .ranked-lit{background:#534831;border-color:#b3985e}
#rankedDialog .ranked-picture .ranked-tile{aspect-ratio:1.5;background-repeat:no-repeat}
#rankedDialog .ranked-picture .ranked-blank{background:#091916}
.ranked-result{text-align:center;justify-content:center;align-items:center}
.ranked-result>img{filter:drop-shadow(0 0 18px #e3b65370)}
.ranked-result>strong{display:block;font:700 clamp(30px,6vw,48px)/1.2 Georgia,serif;color:#ffe2a7}
.ranked-result>p{max-width:440px;color:#c7d7ca;line-height:1.5}
.ranked-result>button{width:100%}
#rankedDialog .ranked-status{flex:none;font-size:13px;line-height:1.35;color:#e7d5af;padding:0 20px 8px;max-height:5em;overflow:auto}
#rankedDialog .ranked-status:empty{display:none}
.ranked-actions{display:grid;gap:8px;flex:none;padding:0 20px 12px}
.ranked-actions:has(>button:not([hidden])){display:grid}
.ranked-actions:not(:has(>button:not([hidden]))){display:none}
.ranked-leave{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;justify-content:safe center;gap:16px;padding:30px;overflow-y:auto;overscroll-behavior:contain;background:#10292bf5;backdrop-filter:blur(12px)}
.ranked-leave>*{flex-shrink:0;min-width:0}
#rankedDialog .ranked-leave p{font-size:20px;color:#fff0d2;text-align:center;margin-bottom:16px}
@media(max-width:600px){#rankedDialog{width:100vw;height:100dvh;border:0;border-radius:0}.ranked-heading{padding:max(8px,env(safe-area-inset-top)) 12px 8px}.ranked-content{padding:14px 16px}.ranked-actions{padding-inline:16px}}
@media(max-height:700px){.ranked-content{padding-block:10px}.ranked-panel{gap:8px}.ranked-player-card{min-height:105px}.ranked-player-card>img{width:34px;height:42px}.ranked-style-preview{gap:6px;padding:8px}#rankedDialog td{padding-block:6px}.ranked-row-details{display:none}.ranked-personal{padding:8px 10px}#rankedDialog .ranked-personal p{font-size:12px}.ranked-info>div>p{margin-top:8px!important}.ranked-info li{margin:8px 0}}
@media(max-height:580px){.ranked-heading{padding-block:4px}.ranked-content{padding-block:8px}.ranked-panel{gap:7px}#rankedDialog h2{font-size:24px}.ranked-ready{gap:5px}.ranked-actions{padding-bottom:7px}#rankedDialog .primary{min-height:48px}.ranked-card-panel{gap:7px}.ranked-style-preview{gap:5px}.ranked-player-card{gap:5px;min-height:100px}.ranked-player-card>img{display:none}}
/* Large text and landscape remain usable with scrolling confined to the active
   panel; we never clip essential actions or disable zoom to force a fit. */
@media(prefers-reduced-motion:reduce){#rankedDialog *{scroll-behavior:auto}}
.emberforge{--accent:#e8b578;--gold:#efc583}.emberforge .world{background:#25191b}.emberforge .tile{border-color:#7a573e;background-color:#2e2826}.emberforge .tile.active{background-color:#50402c}.emberforge .board{border-color:#9d734e}.forge-gear{filter:drop-shadow(0 0 2px #ffb45144)}
.pass-benefit{padding:16px;margin:12px 0;border:1px solid #b99755;border-radius:12px;background:#17251f}.pass-benefit h3{font:600 20px/1.3 Georgia,serif;color:#f1dbab;margin:0 0 8px}.pass-benefit p{font-size:14px;line-height:1.5}.battle-rewards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding-left:24px;font-size:13px}.battle-rewards li{padding:7px 5px}.battle-rewards .earned{color:#b8e8b3}

#rankedPlayerName .player-name,#rankedStyleName .player-name{font-size:inherit}.ranked-player-card .player-name-badge{width:32px;height:40px}

.shop-details{margin:10px 0;color:#cbd8ce}.shop-details>summary{cursor:pointer;min-height:44px;display:list-item;padding:12px 4px;font:600 14px/1.4 system-ui}.shop-details>p{font-size:14px;line-height:1.5}

.ranked-player-details summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:4px}.ranked-player-details summary::after{content:'⌄';color:#b9c9be;font-size:12px;flex:none}.ranked-player-details[open] .ranked-row-details{display:block}#rankedDialog .ranked-player-details .ranked-report-name{min-height:44px}.ranked-player-details .player-name{font-size:15px}#rankedDialog td{padding-block:2px}.ranked-player-details[open]{padding-bottom:8px}.ranked-player-details[open] summary::after{content:'⌃'}
body.large-text #rankedDialog{font-size:19px}body.large-text #rankedDialog p,body.large-text #rankedDialog .ranked-note{font-size:18px!important;line-height:1.5}body.large-text #rankedDialog .ranked-segments button{font-size:16px}body.high-contrast #rankedDialog{background:#061c22}body.high-contrast #rankedDialog button{border-color:#e6d4a0}body.high-contrast #rankedDialog .ranked-note{color:#eef4e5}
@media(max-height:450px){#rankedDialog{overflow:auto}.ranked-content{flex:1 0 200px;min-height:200px}.ranked-heading{position:sticky;z-index:2;background:#102c2c;top:0}}

/* Larger text may scroll within the current page while Play stays available. */
body.large-text #rankedDialog[data-screen=ready] .ranked-board{width:min(100%,290px);min-width:150px}

/* Explicit locked state remains readable; entry buttons still open the preview. */
.ranked-lock-badge{display:inline-flex!important;align-items:center;gap:5px;padding:3px 7px;border:1px solid #c7a665;border-radius:6px;background:#332d1d;color:#ffe0a0;font:700 12px/1.2 system-ui,sans-serif;vertical-align:middle;white-space:nowrap}
.ranked-lock-badge[hidden]{display:none!important}
.ranked-lock-badge::before,#rankedDialog .ranked-start-locked::before,#hardMode[aria-disabled="true"]::before{content:"";display:inline-block;flex:none;width:16px;height:18px;vertical-align:-2px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='10' width='16' height='12' rx='3' fill='%23ffe0a0'/%3E%3Cpath d='M7 10V7a5 5 0 0110 0v3' fill='none' stroke='%23ffe0a0' stroke-width='3'/%3E%3Cpath d='M12 14v4' stroke='%23332d1d' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat}
#rankedDialog .ranked-start-locked:disabled,#hardMode[aria-disabled="true"]{opacity:1;background:#332d1d;color:#ffe0a0;border-color:#c7a665;box-shadow:none}
#rankedDialog .ranked-start-locked::before,#hardMode[aria-disabled="true"]::before{margin-inline-end:8px}
.ranked-entry-locked{border-color:#b39860!important}

/* Merchant policy links stay compact and preserve the current page in a new tab. */
.merchant-policies{margin:12px 0;font-size:14px;line-height:1.5}.merchant-policies>summary{cursor:pointer;min-height:44px;padding:12px 4px;box-sizing:border-box}.merchant-policies nav{display:flex;flex-wrap:wrap;gap:4px 16px;padding:4px 0 12px}.merchant-policies nav a{display:inline-flex;align-items:center;min-height:44px;max-width:100%;padding:4px;box-sizing:border-box;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}.merchant-policies a:focus-visible,.merchant-policies summary:focus-visible{outline:2px solid currentColor;outline-offset:3px}
