/* Targeted review corrections; retain existing artwork and theme variables. */
.round-event span span{color:var(--ink,#49382e)!important}
#modal:has(.action-preview-label){font-size:14px}
#modal:has(.action-preview-label) h2{font-size:clamp(22px,2.5vw,30px);margin:8px 0}
#modal:has(.action-preview-label) p{margin:6px 0;font-size:14px}
#modal:has(.action-preview-label) .preview-scene{height:125px;margin:0 0 4px;overflow:visible}
#modal:has(.action-preview-label) .resource{margin:8px 0;gap:10px}
#modal:has(.action-preview-label) .resource>div{padding:6px;display:flex;align-items:center;justify-content:space-between;gap:8px}
#modal:has(.action-preview-label) .resource b{font-size:24px}
#modal:has(.action-preview-label) .access-choice{margin:6px 0;padding:7px}
#modal:has(.action-preview-label) .access-choice label{padding:6px;margin:2px 0}
#modal:has(.action-preview-label) .notice{padding:7px;margin:6px 0;font-size:14px}
@media(min-width:951px){
 body.desktop-play.faithful-target.online-active #players .player{position:relative;box-sizing:border-box}
 body.desktop-play.faithful-target.online-active #players .online-player-name{position:static;display:block;line-height:16px;font-size:12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:center}
 body.desktop-play.faithful-target #desktop-event-ribbon:not([hidden]){display:flex!important;align-items:center;gap:8px}
 body.desktop-play.faithful-target #desktop-event-ribbon .event-current{flex:1;min-width:0;width:auto}
 body.desktop-play.faithful-target #desktop-event-ribbon .event-next-link{flex:none;font-size:11px;min-height:26px;padding:3px 7px;background:transparent;color:var(--ink);border:1px solid var(--edge);border-radius:6px}
 .online-final-standings{width:min(760px,calc(100vw - 64px))!important;margin:0 auto!important;box-sizing:border-box}
 #desktop-board-status:has(.online-final-standings){left:0!important;right:0!important;display:flex;justify-content:center}
}
.online-final-standings h2{text-align:center}.online-final-standings .score{gap:20px}.online-final-standings>button{display:block;margin:12px auto 0}
#phone-faithful .mobile-event-row{display:flex;align-items:center;min-width:0;gap:4px}
#phone-faithful .mobile-event-row .event{flex:1;min-width:0}
#phone-faithful .mobile-next-event{flex:none;font-size:10px;min-height:28px;padding:3px 5px;background:transparent;color:var(--ink);border:1px solid var(--edge);border-radius:5px}
@media(min-width:951px){body.desktop-play.faithful-target #desktop-shell>#end.online-final-standings{position:absolute!important;inset:16px auto 24px 50%!important;transform:translateX(-50%)!important;margin:0!important;width:min(760px,calc(100% - 48px))!important;max-width:none!important;overflow:auto!important;z-index:15}}
.current-event-label{font:inherit;font-size:10px;font-style:normal;font-weight:normal;opacity:.85}

/* Plain close glyphs; keep a touch-sized invisible hit area. */
body.faithful-target :is(dialog .close,.faithful-context-heading>button,#desktop-drawer-close,.sheet-close,#phone-faithful .close,#game-menu-close){background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;color:var(--ink)!important;padding:0!important;display:grid!important;place-items:center!important;width:36px!important;height:36px!important;font:28px/1 Arial,sans-serif!important;transform:none!important}
body.faithful-target :is(dialog .close,.faithful-context-heading>button,#desktop-drawer-close,.sheet-close,#phone-faithful .close,#game-menu-close):focus-visible{outline:2px solid var(--copper)!important;outline-offset:2px!important}
@media(min-width:951px){
 body.faithful-target #desktop-menu>summary{display:grid!important;place-items:center!important;position:relative;line-height:1!important;padding:0!important;list-style:none!important}
 body.faithful-target #desktop-menu>summary::-webkit-details-marker{display:none}
 body.faithful-target #desktop-menu>summary::after{position:absolute!important;inset:0!important;display:grid!important;place-items:center!important;margin:0!important;padding:0!important;line-height:1!important;transform:none!important}
 body.faithful-target:is([data-desktop-view=tabletop],[data-desktop-view=command]) #desktop-drawer{padding:clamp(52px,7dvh,76px) 64px clamp(62px,8dvh,90px)!important;background-color:transparent!important;border-radius:0!important;border:0!important;box-shadow:none!important}
 body.faithful-target #desktop-drawer .drawer-heading{padding-right:40px}
 body.faithful-target #desktop-drawer .drawer-heading h2{margin:0;line-height:1.2}
}
#sm,#se{display:inline-flex;align-items:center;gap:5px}

@media(min-width:951px){body.faithful-target #desktop-menu>summary::after{content:""!important;background:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23f4e7ce%22%20fill-rule%3D%22evenodd%22%20d%3D%22M19.50%2C12.00%20L21.95%2C12.98%20L21.81%2C13.95%20L21.57%2C14.90%20L21.24%2C15.83%20L18.61%2C15.54%20L18.24%2C16.17%20L17.80%2C16.76%20L17.30%2C17.30%20L18.34%2C19.73%20L17.56%2C20.31%20L16.71%2C20.82%20L15.83%2C21.24%20L14.18%2C19.18%20L13.46%2C19.36%20L12.74%2C19.46%20L12.00%2C19.50%20L11.02%2C21.95%20L10.05%2C21.81%20L9.10%2C21.57%20L8.17%2C21.24%20L8.46%2C18.61%20L7.83%2C18.24%20L7.24%2C17.80%20L6.70%2C17.30%20L4.27%2C18.34%20L3.69%2C17.56%20L3.18%2C16.71%20L2.76%2C15.83%20L4.82%2C14.18%20L4.64%2C13.46%20L4.54%2C12.74%20L4.50%2C12.00%20L2.05%2C11.02%20L2.19%2C10.05%20L2.43%2C9.10%20L2.76%2C8.17%20L5.39%2C8.46%20L5.76%2C7.83%20L6.20%2C7.24%20L6.70%2C6.70%20L5.66%2C4.27%20L6.44%2C3.69%20L7.29%2C3.18%20L8.17%2C2.76%20L9.82%2C4.82%20L10.54%2C4.64%20L11.26%2C4.54%20L12.00%2C4.50%20L12.98%2C2.05%20L13.95%2C2.19%20L14.90%2C2.43%20L15.83%2C2.76%20L15.54%2C5.39%20L16.17%2C5.76%20L16.76%2C6.20%20L17.30%2C6.70%20L19.73%2C5.66%20L20.31%2C6.44%20L20.82%2C7.29%20L21.24%2C8.17%20L19.18%2C9.82%20L19.36%2C10.54%20L19.46%2C11.26%20Z%20M16%2012%20A4%204%200%201%200%208%2012%20A4%204%200%201%200%2016%2012%20Z%22/%3E%3C/svg%3E") center/20px 20px no-repeat!important}}
/* Unified parchment windows: artwork is the sole exterior frame. */
@media(min-width:951px){
 body.faithful-target:is([data-desktop-view=tabletop],[data-desktop-view=command]) :is(dialog:not(:where(#online-entry)),#desktop-drawer,#faithful-context){background-color:transparent!important;background-image:url(visuals/faithful/frame.webp)!important;background-position:center!important;background-size:100% 100%!important;background-repeat:no-repeat!important;border:0!important;border-radius:0!important;box-shadow:none!important}
 body.faithful-target:is([data-desktop-view=tabletop],[data-desktop-view=command]) :is(dialog:not(:where(#online-entry)),#faithful-context){padding:clamp(76px,9dvh,120px) 64px clamp(92px,10dvh,130px)!important}
}

/* Shared compact infrastructure indicators: no planet overlay or extra desktop row. */
body .infrastructure-marks{display:inline-flex!important;align-items:center;gap:3px;flex:none;margin:0;vertical-align:middle;line-height:1}
body .infrastructure-role{display:inline-flex;align-items:center;gap:2px;color:var(--owner);border-left:1px solid #ad946277;padding-left:3px;flex:none}
body .infrastructure-role svg,body .infrastructure-role img{display:block;width:15px;height:15px;object-fit:contain;flex:none}
body .infrastructure-role.vacant{opacity:.55}body .role-empty{font-size:10px}
body .resource-shortfall{color:#aa2929!important;border-left-color:#aa2929!important;font-weight:600}
body[data-desktop-view="star-map"] .resource-shortfall{color:#ffb0a4!important}
#phone-faithful .world .infrastructure-marks{height:15px;gap:2px;justify-content:center}
#phone-faithful .world .infrastructure-role{gap:1px;padding-left:2px}
#phone-faithful .world .infrastructure-role svg,#phone-faithful .world .infrastructure-role img{width:11px;height:11px}
@media(min-width:951px){
 body.desktop-play.faithful-target #selected .worldportrait{height:var(--summary-image-height,80px)!important}
}
/* Close glyph stays plain, including automatic focus when a dialog opens. */
body.faithful-target :is(dialog .close,.faithful-context-heading>button,#desktop-drawer-close,.sheet-close,#phone-faithful .close,#game-menu-close):focus-visible{outline:none!important;text-decoration:none!important;color:var(--copper,#a77945)!important}
@media(min-width:951px){
 body.desktop-play.faithful-target dialog#modal .close{top:var(--dialog-close-top,clamp(76px,9dvh,120px))!important;right:64px!important}
}

/* Equal tracks for known/unknown planets and a contrasting mobile information strip. */
#phone-faithful .world{display:grid;grid-template-rows:minmax(0,1fr) 18px 20px;gap:0;align-items:stretch}
#phone-faithful .world .terrain-wrap{grid-row:1;height:100%;align-items:center}
#phone-faithful .world .world-name{grid-row:2}
#phone-faithful .mobile-world-meta{grid-row:3;display:flex;align-items:center;justify-content:center;min-height:0;height:20px}
#phone-faithful .mobile-world-meta.empty{visibility:hidden}
#phone-faithful .mobile-world-meta .infrastructure-marks{height:18px;padding:1px 4px;background:linear-gradient(#393236,#231e26);border:1px solid #b88c55;border-radius:5px;box-shadow:inset 0 0 0 1px #fff1,0 1px 2px #38231b66}
#phone-faithful .mobile-world-meta .infrastructure-role.vacant{opacity:1;color:#afa69c}
#phone-faithful .world .live-puck,#phone-faithful .world .unknown-art{max-height:54px;height:100%;padding:0}
@media(orientation:landscape) and (min-width:600px){
 #phone-faithful .world .live-puck,#phone-faithful .world .unknown-art{max-height:36px}
 #phone-faithful .world{grid-template-rows:minmax(0,1fr) 18px 18px}
 #phone-faithful .mobile-world-meta{height:18px}
}

/* The Mobile board owns the visible viewport, independent of previous page scroll. */
.phone-faithful-active #phone-shell{position:fixed;inset:0 auto auto 0;width:var(--mobile-viewport-width,100%);max-width:100%;height:var(--mobile-viewport-height,100dvh);margin:0;min-width:0;z-index:5;box-sizing:border-box}
.phone-faithful-active #phone-scroll,.phone-faithful-active #phone-play,.phone-faithful-active #phone-faithful{width:100%;min-width:0;max-width:100%}
.phone-faithful-active #phone-faithful .mini.dense{grid-template-columns:minmax(0,1fr);min-width:0;max-width:100%;-webkit-text-size-adjust:100%;text-size-adjust:100%}
#phone-faithful .mini.dense>*,#phone-faithful .middle>*{min-width:0;max-width:100%}
#phone-faithful .turn-strip .online-compact-state{min-width:0;max-width:48%;gap:3px}
#phone-faithful .turn-strip .online-compact-state .async-deadline{white-space:nowrap}
#phone-faithful .event>span:not(.event-cost){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#phone-faithful .detail-top{min-width:0}
#phone-faithful .detail-name{min-width:0;max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* One shared symbol per infrastructure role, across map, summary and controls. */
.infrastructure-symbol{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;flex:none;vertical-align:middle;color:inherit}
.infrastructure-symbol svg{display:block;width:100%;height:100%}
.infrastructure-role .infrastructure-symbol{width:15px;height:15px}
#phone-faithful .infrastructure-role .infrastructure-symbol{width:11px;height:11px}
.mobile-world-row>.infrastructure-symbol{width:28px;height:28px;color:#947044}
.role-letter>.infrastructure-symbol{width:24px;height:24px}
.role-heading{align-items:center}
button[data-project="link"]>.infrastructure-symbol{width:18px;height:18px;margin-right:4px}
dialog h2>.infrastructure-symbol{margin-right:8px}

/* Shared close geometry: align with the content heading, never the frame decoration. */
body.faithful-target :is(dialog .close,.faithful-context-heading>button,#desktop-drawer-close,.sheet-close,#phone-faithful .close,#game-menu-close){text-decoration:none!important;min-width:36px;min-height:36px;background:transparent!important;border:0!important;box-shadow:none!important}
body.faithful-target dialog#modal #modalbody>h2:first-of-type{padding-right:42px}
.production-summary>h2{padding-right:42px}
.production-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.production-summary-grid article{min-width:0;padding:14px;border:1px solid #b89662;border-radius:12px;background:#fff7e350}
.production-summary-grid h3{margin:0 0 12px;color:var(--ink,#49382e)!important;overflow-wrap:anywhere}
.production-summary-grid dl{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;margin:0}
.production-summary-grid dd{margin:0;text-align:right}
.production-summary-grid small{display:block;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
.production-amount{white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:700px){.production-summary-grid{grid-template-columns:minmax(0,1fr)}body.faithful-target dialog#modal .close{top:var(--dialog-close-top,24px)!important;right:24px!important}}
#modalbody>.production-summary{background:transparent;border:0;border-radius:0;box-shadow:none;padding:0;margin:0}
@media(min-width:951px){body.desktop-play #modal:has(.production-summary){width:min(1100px,94vw)!important}.production-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* Center the account name and turn labels within each player card. */
#players .online-player-name{text-align:center}

/* Keep the title and Room control outside the only scrolling region. */
body.faithful-target:not(.results-dismissed) #end.online-final-standings{display:flex!important}
body.faithful-target #end.online-final-standings,
body.desktop-play.faithful-target #desktop-shell>#end.online-final-standings{
 flex-direction:column;position:relative!important;inset:auto!important;transform:none!important;
 align-self:start!important;width:min(680px,calc(100% - 32px))!important;height:auto!important;min-height:0!important;
 max-height:calc(100dvh - 150px)!important;margin:16px auto!important;padding:36px 44px!important;
 overflow:hidden!important;background:url(visuals/faithful/frame.webp) center/100% 100% no-repeat!important;
 border:0!important;border-radius:0!important;box-shadow:none!important;color:#49382e!important;box-sizing:border-box;
}
.online-final-standings>.standings-content{display:grid;grid-template-rows:auto minmax(0,1fr) auto;flex:1 1 auto;min-height:0;min-width:0;padding:0}
.standings-scroll{min-height:0;overflow:auto;overscroll-behavior:contain}
.standings-heading{margin:0 0 10px;padding-top:16px;padding-bottom:10px;border-bottom:1px solid #b79766}
.online-final-standings .standings-heading h2{text-align:left;margin:4px 0 0;font-size:24px;line-height:1.2;font-weight:500;color:#49382e}
.standings-heading .eyebrow{font-size:10px}
.standings-table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;background:none;color:#49382e}
.standings-table th,.standings-table td{padding:8px 10px;border:0;border-bottom:1px solid #b7976680;background:transparent!important;text-align:left}
.standings-table thead th{font-size:12px;font-weight:500;letter-spacing:.02em;color:#786047}
.standings-table thead th:last-child,.standings-table .standings-points{text-align:right}
.standings-table .standings-rank{width:30px;font-size:18px;color:#94713f}
.standings-table .standings-player{display:block;font-size:17px;line-height:1.2;font-weight:600;margin-bottom:3px;overflow-wrap:anywhere}
.standings-table .company-name{display:inline-flex;gap:6px;align-items:center;font-size:13px;line-height:1.2;font-weight:400}
.standings-table .company-symbol{width:20px;height:20px;object-fit:contain}
.standings-table .standings-points{font-size:25px;font-weight:700;white-space:nowrap}
.standings-table .sw-symbol{width:16px;height:16px;vertical-align:middle}
.standings-footer{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin-top:12px}
body.faithful-target .standings-footer button{min-height:44px;background:transparent;border:1px solid #b79766;box-shadow:none;padding:7px 24px;color:#49382e}
@media(max-width:700px){
 body.faithful-target #end.online-final-standings{width:100%!important;margin:0!important;padding:24px 20px!important;max-height:calc(100dvh - 110px)!important}
 .online-final-standings .standings-heading h2{font-size:22px}
 .standings-table th,.standings-table td{padding:7px 4px}
}
@media(min-width:951px){
 body.desktop-play.faithful-target #desktop-shell[data-phase='finished']>#end.online-final-standings{position:absolute!important;inset:16px auto auto 50%!important;transform:translateX(-50%)!important;margin:0!important;max-height:calc(100% - 32px)!important}
}
body.phone-faithful-active #phone-shell #phone-status #end.online-final-standings{padding:24px 32px!important}
/* Online hub uses the same illustrated frame and transparent parchment content. */
body.faithful-target #online-screen:not(.welcome-screen)>.online-card{
 background:url(visuals/faithful/frame.webp) center/100% 100% no-repeat!important;
 border:0!important;border-radius:0!important;box-shadow:none!important;padding:48px!important;color:#49382e;
}
body.faithful-target #online-screen .hub-tabs{background:transparent;border-top:1px solid #b79766;border-bottom:1px solid #b79766;padding:16px 0;gap:8px}
body.faithful-target #online-screen .my-games>article{background:transparent;border:0;border-bottom:1px solid #b7976680;border-radius:0;padding:12px 0}
body.faithful-target #online-screen .my-games .game-continue{display:flex;align-items:center;justify-content:space-between;gap:24px;width:100%;padding:12px 8px;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0;text-align:left;color:#49382e}
.game-overview{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}
.game-overview>strong{font-size:21px;overflow-wrap:anywhere}
.game-results{display:flex;flex-direction:column;gap:8px;flex:0 1 240px;min-width:160px;border-left:1px solid #b7976680;padding-left:20px}
.game-result-row{display:grid;grid-template-columns:20px minmax(0,1fr) auto;gap:8px;align-items:baseline;font-variant-numeric:tabular-nums}
.game-result-rank{color:#94713f}.game-result-player{overflow-wrap:anywhere}.game-result-score{font-size:21px}
@media(max-width:600px){
 body.faithful-target #online-screen:not(.welcome-screen)>.online-card{padding:32px 24px!important}
 body.faithful-target #online-screen .my-games .game-continue{flex-direction:column;align-items:stretch;gap:16px}
 .game-results{flex:auto;border-left:0;border-top:1px solid #b7976680;padding:12px 0 0;min-width:0}
 .hub-tabs button{font-size:14px;padding:8px}.online-heading{flex-wrap:wrap}
}
body.faithful-target #online-screen #online-content nav{background:transparent!important;box-shadow:none!important;color:#49382e}
body.faithful-target #online-screen #hub-body :is(form,fieldset,.invite-setup,.invite-item,.invite-seat,.online-seat){background:transparent!important;color:#49382e;box-shadow:none!important;border-color:#b7976680}
body.faithful-target #online-screen .invite-item{border:0;border-bottom:1px solid #b7976680;border-radius:0;padding:16px 0}
body.faithful-target #online-screen .hub-tabs{flex-wrap:wrap;overflow:visible}
/* Keep frame corners proportional even on long setup forms. */
body.faithful-target #online-screen:not(.welcome-screen)>.online-card{
 background:none!important;border:30px solid transparent!important;
 border-image:url(visuals/faithful/frame.webp) 110 80 fill / 30px / 0 stretch!important;
 padding:20px!important;
}
@media(max-width:600px){body.faithful-target #online-screen:not(.welcome-screen)>.online-card{border-width:22px!important;border-image-width:22px!important;padding:12px!important}}
/* Account content belongs on the parchment, without separate white cards. */
body.faithful-target #online-screen #account-body :is(section,.notify-panel,.invite-settings,.account-danger,.stats-totals>div,.stats-badge,.stats-recent>li){
 background:transparent!important;box-shadow:none!important;border:0!important;border-radius:0!important;
}
body.faithful-target #online-screen #account-body>section{padding:20px 0!important;border-top:1px solid #b7976680!important;margin:20px 0!important}
body.faithful-target #online-screen #account-body :is(input:not([type=checkbox]),select){background:#bc914b18!important;border:1px solid #b79766;border-radius:6px;color:#49382e;padding:8px 10px}
body.faithful-target #online-screen #account-body button:not(#account-delete-final){background:#bc914b14!important;color:#49382e;border-color:#b79766;box-shadow:none}
body.faithful-target #online-screen #account-body>section:is(.notify-panel,.invite-settings,.account-danger){border-top:1px solid #b7976680!important}
.game-timing{display:flex;flex-direction:column;gap:3px;margin-top:8px;font-size:14px;color:#735b40;line-height:1.45}
.game-timing small{font-size:11px;letter-spacing:.02em;color:#806a51}
.game-timing time{font-variant-numeric:tabular-nums}
/* Leave breathing room between production content and the illustrated frame. */
body.faithful-target #modalbody>.production-summary{padding:8px 28px 20px!important;box-sizing:border-box}
.production-summary-footer{display:flex;justify-content:center;padding:24px 0 4px}
body.faithful-target .production-summary-footer button{min-width:120px;min-height:44px;background:transparent;color:#49382e;border:1px solid #b79766;box-shadow:none}
@media(max-width:700px){body.faithful-target #modalbody>.production-summary{padding:6px 14px 16px!important}}
/* Online parchment owns its text/surface tokens even over the Living Cosmos map. */
body.faithful-target #online-screen:not(.welcome-screen)>.online-card{--ink:#49382e;--soft-ink:#79634d;--muted:#79634d;--paper:#f8ecd7;--surface:#fff8eb;--accent:#268c91;--edge:#c8ac81;--copper:#b58b5d;color:var(--ink)}
body.faithful-target #online-screen:not(.welcome-screen)>.online-card :is(h1,h2,h3,label){color:#49382e}
