/* Shared bounds: content wraps inside its own column rather than widening it. */
:where(.home-heading,.home-layout,.setup-grid,.game-grid,.daily-intro-grid,.profile-sections,.profile-metrics,.home-destinations,.atlas-toolbar,.answer-options,.duel-scores,.finish-actions,.profile-history-item summary,.result-row)>*{min-width:0}
:where(.app-shell,.topbar,.top-actions,.stage,.plate-zone,.preview-wrap,.setup-panel,.answer-card,.map-card,.country-statistics,.table-scroll){min-width:0;max-width:100%}
:where(h1,h2,h3,.context,.source-line,.history-route,.history-performance,.history-score,.duel-history-row,.duel-round-results,.personal-stats,.rules-card,.breadcrumbs li,.legal-shell a){overflow-wrap:anywhere}
:where(input,select,textarea,button){max-width:100%}
.primary,.secondary,.text-button{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.primary>span:not([aria-hidden]){min-width:0}
.primary>span[aria-hidden]{flex-shrink:0}
.topbar,.top-actions{flex-wrap:wrap}
.top-actions{justify-content:flex-end}
.brand-mark{flex-shrink:0}
.account-button,.profile-button,.duel-top .text-button,.duel-history-row b{white-space:normal}
.route-copy,.profile-metric span,.duel-score strong,.finish-score,dialog p{min-width:0;overflow-wrap:anywhere}
.map-heading>div,.scoreboard{flex-wrap:wrap;min-width:0;max-width:100%}
.map-heading>div>*{min-width:0;overflow-wrap:anywhere}
.dialog-head>*{min-width:0}
.dialog-head .close{flex-shrink:0}
.stage-foot,.map-intro,.duel-top,.duel-round-bar{flex-wrap:wrap}
.stage-foot>span,.map-intro>*,.duel-top>*,.duel-round-bar>*{min-width:0;max-width:100%;overflow-wrap:anywhere}
.plate-loading{max-width:calc(100% - 24px);white-space:normal;text-align:center}
.mode-card{grid-template-columns:32px minmax(0,1fr)}
.answer-options,.duel-scores{grid-template-columns:repeat(2,minmax(0,1fr))}
.result-row{grid-template-columns:28px minmax(0,1fr) minmax(0,1fr) 80px}
.result-row>*,.profile-country-table th,.profile-country-table td{overflow-wrap:anywhere}
.table-scroll{width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
.profile-country-table{min-width:360px}
.profile-filter select{max-width:100%}
.continent-links strong{overflow-wrap:anywhere}

/* One complete plate per frame, regardless of portrait/landscape proportions. */
.catalog-grid{align-items:stretch;row-gap:32px}
.catalog-plate{display:flex;flex-direction:column;min-width:0;--atlas-media-height:190px;--atlas-media-padding:18px}
.catalog-plate>.atlas-image,
.atlas-detail .catalog-plate>.atlas-image{
 display:flex;align-items:center;justify-content:center;
 flex:0 0 auto;width:100%;max-width:100%;min-width:0;
 height:var(--atlas-media-height);min-height:0;aspect-ratio:auto;
 padding:var(--atlas-media-padding);margin:0;
 overflow:hidden;box-sizing:border-box;background:#efeddc;
 border:1px solid var(--line);border-radius:3px;
}
.catalog-plate>.atlas-image>img{
 display:block;flex:0 1 auto;width:100%;height:100%;
 min-width:0;min-height:0;max-width:100%;max-height:100%;
 object-fit:contain;object-position:center;
}
/* Preserve any source crop's aspect ratio before fitting it inside the frame. */
.catalog-plate>.atlas-image>.source-crop{
 flex:none;
 width:min(100%,calc((var(--atlas-media-height) - var(--atlas-media-padding) * 2 - 2px) * var(--source-aspect)));
 max-width:100%;max-height:none;aspect-ratio:var(--source-aspect);
}
.catalog-plate>.atlas-image .source-canvas img{display:block;width:100%;height:auto;max-width:none;max-height:none}
.atlas-image-error{max-width:100%;margin:0;padding:0;overflow-wrap:anywhere;text-align:center}
.atlas-card-copy{display:flex;flex-direction:column;flex:1;min-width:0;padding:18px 0 12px;overflow-wrap:anywhere}
.atlas-card-copy h2{margin:0 0 10px;line-height:1.15}
.atlas-card-copy small{margin-bottom:0}
.atlas-card-copy>.atlas-card-link{align-self:flex-start;margin-top:auto;padding-top:18px;max-width:100%}
.atlas-detail .catalog-plate{--atlas-media-height:280px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}
.atlas-detail .atlas-card-copy{padding-top:0}
.atlas-detail .atlas-card-copy>.primary{margin-top:24px}

@media(max-width:1000px){
 .catalog-plate{--atlas-media-height:180px;--atlas-media-padding:16px}
 .atlas-detail .catalog-plate{--atlas-media-height:240px}
}
@media(max-width:700px){
 .mode-card{grid-template-columns:26px minmax(0,1fr)}
 .home-heading{max-width:100%}
 .top-actions{max-width:100%;gap:8px}
 .profile-head-actions>*{min-width:0}
 .result-row{grid-template-columns:22px minmax(0,1fr) 62px}
 .atlas-detail .catalog-plate{grid-template-columns:minmax(0,1fr);gap:20px}
 .atlas-detail .atlas-card-copy{padding-top:0}
 .map-intro>.secondary{flex-shrink:1}
}
@media(max-width:600px){
 .catalog-grid{grid-template-columns:minmax(0,1fr);row-gap:24px}
 .catalog-plate{--atlas-media-height:210px;--atlas-media-padding:16px}
 .atlas-detail .catalog-plate{--atlas-media-height:240px}
 .atlas-card-copy h2{font-size:28px}
 .atlas-card-copy{padding-bottom:8px}
 .top-actions{width:100%;justify-content:space-between}
}
@media(max-width:380px){
 .catalog-plate{--atlas-media-height:185px;--atlas-media-padding:12px}
 .atlas-detail .catalog-plate{--atlas-media-height:215px}
 .hero-play{padding-inline:16px;gap:10px}
 .continent-links{grid-template-columns:minmax(0,1fr)}
 .profile-history-item summary{grid-template-columns:minmax(0,1fr) 58px 62px;gap:8px}
}
