/* Only explicitly opted-in buttons receive the light-to-dark treatment. */
:is(#main,#modal,#chat-panel,.game-popup310) .light-dark310{color:#382719!important;-webkit-text-fill-color:currentColor;text-shadow:none!important;background:#e9d6b1!important;isolation:isolate;border:1px solid #b3956c!important;border-radius:5px!important;box-shadow:none!important;overflow:hidden}
:is(#main,#modal,#chat-panel,.game-popup310) .light-dark310 .kg-frame{display:none!important}
:is(#main,#modal,#chat-panel,.game-popup310) .light-dark310::before,:is(#main,#modal,#chat-panel,.game-popup310) .light-dark310::after{content:none!important}
:is(#main,#modal,#chat-panel,.game-popup310) .light-dark310>.kg-surface{border-radius:4px}
:is(#main,#modal,#chat-panel,.game-popup310) .light-dark310[aria-pressed="true"],:is(#main,#modal,#chat-panel,.game-popup310) .light-dark310[aria-current="page"],:is(#main,#modal,#chat-panel,.game-popup310) .light-dark310[aria-selected="true"]{color:#f3e2bc!important;background:#3b100b!important;border-color:#895a32!important;box-shadow:inset 0 1px 2px #16080366!important}
:is(#main,#modal,#chat-panel,.game-popup310) .light-dark310:focus-visible{outline:2px solid #c2954f;outline-offset:2px}
#modal .ladder-ui>.arena-tabs310{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:10px 0}
#modal .ladder-ui>.arena-tabs310>button{min-width:0;padding:8px 3px!important;min-height:35px!important;font-size:clamp(11px,2.7vw,16px)!important;line-height:1.15;white-space:nowrap}
:is(#main,#modal) .navigation-nested310{display:grid!important;grid-template-columns:42px minmax(0,1fr) 42px!important;align-items:center;gap:8px;padding:10px 12px!important}
:is(#main,#modal) .navigation-nested310 :is(h1,h2){text-align:center!important;justify-content:center!important;font-size:clamp(20px,4.7vw,28px);line-height:1.15;margin:0;min-width:0}
:is(#main,#modal) .navigation-nested310>.kg-round{width:40px;height:40px;min-width:0;margin:0}
:is(#main,#modal) .navigation-primary310{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto!important;align-items:center;gap:8px}
:is(#main,#modal) .navigation-primary310 :is(h1,h2){text-align:left!important;justify-content:flex-start!important}
#modal.navigation-popup310,#help-modal.navigation-popup310{position:fixed!important;inset:0!important;margin:auto!important;width:min(620px,calc(100vw - 24px))!important;height:fit-content!important;max-height:calc(100dvh - 32px)!important;max-width:calc(100vw - 24px)!important;overflow:auto!important;border:0}
#modal.navigation-popup310::backdrop,#help-modal.navigation-popup310::backdrop{background:rgba(12,8,5,.72)}
.game-popup310{border:0;padding:0;background:transparent;color:#332519;width:min(440px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);overflow:auto;margin:auto;font-family:Georgia,'Times New Roman',serif;box-sizing:border-box}
.game-popup310::backdrop{background:rgba(12,8,5,.72)}
.game-popup310,.game-popup310 *{box-sizing:border-box}
.game-popup310{color:#332519!important;text-shadow:none!important}
.game-popup310 .popup-body310 :is(p,h3,h4,small,label){color:#332519!important;text-shadow:none!important}
.game-popup310 .popup-head310 h2{color:#f2dfb8!important;text-shadow:none!important}
.game-popup310 .kg-surface{position:absolute;display:block;inset:0;z-index:-1;pointer-events:none;background-repeat:repeat;border-radius:6px}
.game-popup310 .kg-frame{position:absolute;inset:0;z-index:3;display:grid;grid-template-columns:var(--kg-corner) minmax(0,1fr) var(--kg-corner);grid-template-rows:var(--kg-corner) minmax(0,1fr) var(--kg-corner);pointer-events:none}
.game-popup310 .kg-frame img{display:block;width:100%;height:100%;min-width:0;min-height:0;max-width:none;filter:none}
.game-popup310 .kg-round{position:relative;isolation:isolate;display:inline-grid;place-items:center;border:0;background:none;padding:0;cursor:pointer}
.game-popup310 .kg-base{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;z-index:-1}
.game-popup310 .kg-icon{width:24px;height:24px;object-fit:contain}
.game-popup310 .kg-button>.kg-frame{z-index:3}
.game-popup310 .gm200-item .slot-symbol{display:block;width:105px;height:120px;margin:auto}
.game-popup310 .gm200-item .slot-symbol :is(img,svg){width:100%;height:100%;object-fit:contain}
.game-popup310 .gm200-message,.game-popup310 .gm200-attachment{position:relative;isolation:isolate}
.popup-card310{position:relative;isolation:isolate;padding:12px;min-width:0;box-sizing:border-box}
.popup-card310>.kg-surface,.popup-card310>.kg-frame{pointer-events:none}
.popup-head310{display:flex;align-items:center;gap:8px;position:relative;isolation:isolate;padding:10px 12px;min-height:48px;color:#f2dfb8}
.popup-head310 h2{font-size:22px;line-height:1.2;flex:1;min-width:0;margin:0}
.popup-head310>.kg-round{width:38px;height:38px;min-width:38px}
.popup-body310{position:relative;padding:12px 4px 4px;font-size:17px;line-height:1.4;overflow-wrap:anywhere}
.popup-body310 .kg-button{position:relative;isolation:isolate;min-height:44px;width:100%;padding:9px 10px;color:#f3e2bc;font-family:inherit;font-size:17px;border:0;background:none;cursor:pointer}
.popup-body310 .kg-button>.kg-surface,.popup-body310 .kg-button>.kg-frame{z-index:-1;pointer-events:none}
.popup-body310 .kg-button:disabled{opacity:.6;cursor:wait}
.popup-actions310{display:grid;grid-template-columns:1fr 1.2fr;gap:8px;margin-top:14px}
.arena-confirm-product310{text-align:center}.arena-confirm-product310>img{width:130px;height:110px;object-fit:contain}.arena-confirm-product310 h3{font-size:23px;margin:4px 0 10px;line-height:1.2}.arena-confirm-product310 p{margin:7px 0;font-size:16px}
.arena-confirm-price310{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 4px;border-top:1px solid #a58453;border-bottom:1px solid #a58453}.arena-confirm-price310 b{display:flex;align-items:center;gap:6px;font-size:23px}.arena-confirm-error310{color:#812b20}
.game-popup310 .gm200-message{margin:0}.game-popup310 .gm200-message>header{display:block;text-align:center;padding:4px;margin-bottom:10px}.game-popup310 .gm200-message>header img{display:none}.game-popup310 .gm200-message>header h3{font-size:19px;margin:5px 0}.game-popup310 .gm200-message>header small{font-size:14px}.game-popup310 .gm200-body{font-size:16px}.game-popup310 .gm200-attachment{padding:8px!important;text-align:center}.game-popup310 .gm200-chest{max-width:150px;height:120px!important;object-fit:contain}.game-popup310 .gm200-attachment h3{font-size:22px}.game-popup310 .gm200-attachment p{font-size:16px}.game-popup310 .gm200-item{max-width:100%}.game-popup310 .gm200-item .equipment-visual{max-width:110px;max-height:130px}.game-popup310 .gm200-error:empty{display:none}
@media(max-width:360px){.popup-head310 h2{font-size:20px}.popup-actions310{gap:5px}.popup-body310 .kg-button{font-size:15px;padding:9px 6px}}

/* The entire difficulty header opens its existing entry preview. */
.mayor-choice310{text-align:center}
.mayor-choice-intro310{margin:4px 0 20px;font-size:21px;font-weight:700}
.mayor-choice-cards310{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.mayor-choice-card310{position:relative;min-width:0;display:flex;flex-direction:column;justify-content:space-between;align-items:center;padding:14px 5px 18px;background:transparent;border:0;isolation:isolate;cursor:pointer}
.mayor-choice-card310>span:not(.kg-surface):not(.kg-frame),.mayor-choice-card310>b{position:relative;z-index:1}
.mayor-choice-card310>b{font-size:18px;white-space:nowrap;overflow-wrap:normal}
.mayor-choice-art310{display:flex;align-items:center;justify-content:center;width:100%;height:165px;margin:5px 0 14px}
.mayor-choice-art310 .slot-symbol{display:block;width:100%;height:100%}
.mayor-choice-art310 img,.mayor-choice-art310 svg{display:block;width:100%;height:100%;object-fit:contain}
.mayor-choice-card310[aria-pressed=true]{box-shadow:0 0 0 2px #c49341,0 0 9px #ae7a27;border-radius:9px}
.mayor-choice-card310 .mayor-choice-tick310{position:absolute!important;right:10px;top:8px;color:#f7d78f;font-size:24px;display:none}
.mayor-choice-card310[aria-pressed=true] .mayor-choice-tick310{display:block}
.mayor-choice-note310{margin:22px auto;max-width:30em;line-height:1.45}
.mayor-choice310>[data-mail-claim]{width:90%;min-height:50px}
.mayor-choice-preview310{display:flex;align-items:center;gap:14px}
.mayor-choice-preview310>img{width:32%;max-width:150px;object-fit:contain}
.mayor-choice-preview310 h4{margin:0}
@media(max-width:420px){.mayor-choice-intro310{font-size:18px;margin-bottom:14px}.mayor-choice-cards310{gap:5px}.mayor-choice-card310{padding:9px 4px 12px}.mayor-choice-card310>b{font-size:12px}.mayor-choice-art310{height:104px;margin:12px 0}.mayor-choice-note310{font-size:17px;margin:18px 0}.mayor-choice-card310 .mayor-choice-tick310{font-size:18px;right:5px;top:5px}}
.underground-ui .ku-stop.ug-entry-row310{grid-template-columns:38px 48px minmax(0,1fr) auto;gap:10px}
/* Match the approved choice sheet: flush centred header and fine card rims. */
.game-popup310:has(.mayor-choice310){width:min(620px,calc(100vw - 24px));border-radius:11px}
.game-popup310:has(.mayor-choice310) .popup-card310{padding:3px;border:1px solid #8b5c29;border-radius:11px;overflow:hidden}
.game-popup310:has(.mayor-choice310) .popup-card310>.kg-frame{display:none}
.game-popup310:has(.mayor-choice310) .popup-head310{min-height:58px;padding:9px 44px;border-radius:8px 8px 4px 4px}
.game-popup310:has(.mayor-choice310) .popup-head310 h2{text-align:center;font-size:clamp(24px,5vw,31px)}
.game-popup310:has(.mayor-choice310) .popup-head310>.kg-round{position:absolute;right:10px;width:34px;height:34px;min-width:0}
.game-popup310:has(.mayor-choice310) .popup-body310{padding:16px 16px 20px}
.mayor-choice-intro310{display:flex;align-items:center;gap:12px;font-size:clamp(13px,3.3vw,20px);margin:0 4px 23px;white-space:nowrap}
.mayor-choice-intro310::before,.mayor-choice-intro310::after{content:'';height:1px;background:#b99467;flex:1;min-width:8px}
.mayor-choice-cards310{gap:9px}
#game-mail-popup310 .mayor-choice-card310.light-dark310{padding:16px 7px 14px;aspect-ratio:.76;border:3px double #98632e!important;border-radius:12px!important;overflow:visible;gap:9px}
.game-popup310 .mayor-choice-card310>.kg-surface{border-radius:9px}
.mayor-choice-art310{height:auto;flex:1;min-height:0;width:100%;margin:5px 0 0}
.mayor-choice-card310>b{font-size:clamp(11px,2.7vw,21px);line-height:1.2}
#game-mail-popup310 .mayor-choice-card310.light-dark310[aria-pressed=true]{border:3px double #ffde8c!important;box-shadow:0 0 0 1px #b47b21,0 0 8px #f1b92b,inset 0 0 3px #f3bd4e!important}
.mayor-choice-card310 .mayor-choice-tick310{font-size:clamp(22px,5vw,35px);right:9px;top:2px;color:#ffe38c;text-shadow:0 1px 2px #3b1d03}
.mayor-choice-note310{max-width:27em;font-size:clamp(14px,3.2vw,19px);font-weight:700;line-height:1.35;margin:21px auto 25px}
.game-popup310 .mayor-choice310>[data-mail-claim]{width:68%;min-height:45px;font-size:clamp(16px,3.6vw,26px);padding:9px 13px}
@media(max-width:420px){.game-popup310:has(.mayor-choice310) .popup-body310{padding:12px 9px 14px}.game-popup310:has(.mayor-choice310) .popup-head310{min-height:50px}.mayor-choice-cards310{gap:6px}.game-popup310 .mayor-choice-card310.light-dark310{padding:13px 4px 11px;gap:5px}.mayor-choice-intro310{gap:6px;margin-bottom:17px}.mayor-choice-note310{margin:17px auto 20px}.game-popup310 .mayor-choice310>[data-mail-claim]{min-height:42px}}
.underground-ui .ug-entry310{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:5px;width:84px;min-width:0;min-height:42px;padding:8px 12px;color:#f4e5ca;font-size:18px;white-space:nowrap;justify-self:end}
.underground-ui .ug-entry310>span:not(.kg-surface):not(.kg-frame),.underground-ui .ug-entry310>img{position:relative;z-index:1}
.underground-ui .ug-entry310 img{width:18px;height:18px;object-fit:contain}
@media(max-width:420px){.underground-ui .ku-stop.ug-entry-row310{grid-template-columns:28px 32px minmax(0,1fr) auto;gap:6px;padding:12px 10px}.underground-ui .ug-entry310{min-width:68px;padding:7px 8px;font-size:16px}.underground-ui .ug-entry-row310>span>small{font-size:12px}.underground-ui .ug-entry-row310>span>strong{font-size:20px}}

/* Compact Mayor ranking tabs use the approved light/dark surfaces. */
#modal .mayor110-rank-tabs{display:flex;flex-wrap:wrap;gap:5px;margin:10px 0}
#modal .mayor110-rank-tabs .mayor-rank-button312{flex:1 1 0;min-width:58px;height:40px!important;min-height:40px!important;padding:5px!important;font-size:clamp(12px,2.7vw,15px)!important;line-height:1.2!important;font-weight:600}
#modal .mayor-rank-button312 .kg-frame{display:none!important}
