#menuDiv {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(88%, 340px, 94cqh); color: #fff1cb;
    font: 700 15px/1.22 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
#menuDiv *, .challenge-card { box-sizing: border-box; }
#menuDiv[inert] { visibility: hidden; }
#menuDiv [hidden] { display: none !important; }
#menuDiv button { color: inherit; font: inherit; cursor: pointer; touch-action: manipulation; }
#menuDiv img { display: block; opacity: 1; pointer-events: none; }
#menuDiv button:focus-visible, #menuDiv a:focus-visible, #playerName:focus-visible {
    outline: 3px solid #ffdc84; outline-offset: 2px;
}
.city-card, .challenge-card {
    background: #a34b24 url("img/city-panel.svg") center / cover;
    border: 3px solid #302119; border-radius: 15px;
    box-shadow: inset 0 0 0 2px #eb9959, 0 4px 0 #4d2c1c, 0 8px 16px #160e0a59;
}
.city-card { padding: clamp(10px, 2.7cqh, 20px); max-height: 94cqh; overflow-y: auto; touch-action: pan-y; }
.city-logo { width: 86%; height: clamp(64px, 19cqh, 105px); margin: 0 auto 5px; }
.player-strip { margin: 4px 0 11px;
    background: #301f18f2; border: 1px solid #e69757; border-radius: 6px; padding: 7px 12px; }
#personalRecords { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 6px 0 2px; border-top: 1px solid #885634; }
#personalRecords dt { font-size: 12px; color: #e9c5a1; }
#personalRecords dd { margin: 2px 0 0; font-size: 18px; color: #ffce76; font-variant-numeric: tabular-nums; }
#menuDiv #openAccount { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; min-height: 34px;
    background: transparent; border: 0; padding: 0 3px 0 0; color: #ffefd5; text-align: left; font-size: 18px; }
#openAccount::after { content: ""; flex: none; width: 6px; height: 6px; border: solid #e0a565; border-width: 2px 2px 0 0; transform: rotate(45deg); }
#accountLabel { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.city-action { width: 100%; display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 3px 12px;
    border: 2px solid #442718; border-radius: 7px; box-shadow: inset 0 1px 0 #ffe0a45c, 0 2px 0 #442718; }
#menuDiv #btnStart, #menuDiv #guestEnter { justify-content: center; background: linear-gradient(#ffd485, #ffad39 52%, #ed952a 53%, #e88821);
    color: #3c2417; font-size: 19px; font-weight: 900; }
#btnStart img { width: 34px; height: 34px; }
.award-action { margin-top: 7px; background: #56301c; }
#entryChoices .city-action { justify-content: center; }
#guestEnter { margin-top: 7px; }
#googleWidget { display: flex; justify-content: center; margin-top: 7px; }
#googleWidget:empty, #entryStatus:empty { display: none; }
#entryStatus { margin: 8px 0 0; font-size: 14px; text-align: center; }
.award-action svg { width: 24px; height: 24px; color: #ffbf55; }
.award-action b { margin-left: auto; color: #ffce87; font: 800 16px/1 Arial, sans-serif; }
.menu-tools { display: flex; justify-content: center; gap: 8px; margin-top: 5px; }
.menu-tools button, #pausemenu button, .sheet-header button, .settings-controls button {
    display: grid; place-items: center; padding: 0; background: transparent; border: 0;
}
.menu-tools button, .sheet-header button { width: 42px; height: 38px; }
.menu-tools img, .sheet-header img { width: 32px; }
#menuDiv[data-menu="achievementsMenu"] { width: min(92%, 410px); }
.sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-header h2 { margin: 0; font-size: 23px; text-shadow: 1px 2px 0 #4b2818; }
#awardList { display: grid; gap: 7px; }
.award-group { padding: 5px 8px 8px; border-radius: 5px; background: #302019f0; }
.award-group header { display: flex; gap: 5px; align-items: center; color: #ffc66c; margin-bottom: 4px; }
.award-group header svg { width: 19px; height: 19px; }
.award-group h3 { margin: 0; font-size: 14px; }
.award-record { margin-left: auto; font-size: 12px; }
.award-group ul { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; list-style: none; padding: 0; margin: 0; }
.award-group li { display: grid; text-align: center; padding: 5px 1px; border: 1px solid #84684e; border-radius: 4px; background: #513d32; color: #dbcabc; }
.award-group strong { font-size: 12px; }
.award-group small { font-size: 11px; font-weight: 500; }
.award-group li.earned { background: #ffcd78; color: #41261b; border-color: #ffdb91; }
.award-group .earned strong::before { content: '✓ '; }
.settings-controls { display: flex; justify-content: center; gap: 28px; margin: 12px auto; }
.settings-controls img { width: 52px; margin-bottom: 3px; }
#musicCredits { display: block; text-align: center; color: #fff2d5; padding: 9px; }
#menuDiv[data-menu="pausemenu"] { top: 3%; right: 2%; bottom: auto; left: auto; width: auto; transform: none; }
#btnMenu { position: absolute; display: block; padding: 0; border: 0; background: transparent; cursor: pointer; }
#btnMenu img { width: 100%; height: 100%; object-fit: contain; }
#btnMenu:focus-visible { outline: 2px solid #ffda84; border-radius: 50%; }
#pausemenu { padding: 4px 8px; background: #38271de8; border: 2px solid #dda659; border-radius: 40px; box-shadow: 0 3px 0 #342118; }

#pausemenu button { display: inline-grid; width: clamp(45px, 9cqh, 64px); height: clamp(45px, 9cqh, 64px); vertical-align: middle; }
#pausemenu img, #pausemenu svg { width: 92%; height: 92%; object-fit: contain; }
#awardToast { position: absolute; z-index: 49; top: 4%; left: 50%; transform: translateX(-50%); pointer-events: none;
    max-width: 80%; padding: 6px 13px; border: 1px solid #f3c167; border-radius: 6px; background: #322016ee; color: #ffe3a3;
    text-align: center; font: bold clamp(12px, 2.4cqh, 16px)/1.25 "Microsoft YaHei", sans-serif; }
@container court (max-height: 400px) {
    .city-card { padding: 8px 14px; }
    .player-strip { margin-bottom: 7px; padding: 5px 10px; }
    .menu-tools { margin-top: 2px; }
    .menu-tools button { height: 31px; }
    .menu-tools img { width: 28px; }
    .award-group { padding: 4px 7px 5px; }
}
@media (hover: hover) { #menuDiv button:hover { filter: brightness(1.13); } }
#menuDiv button:active { transform: translateY(1px); }


.club-shortcuts, .board-tabs { display:flex; gap:7px; margin-top:7px; }
.club-shortcuts button, #clubDialog button:not(#closeClub) { min-height:34px; padding:4px 10px; cursor:pointer; border:1px solid #cc955e; color:#fff2cf; border-radius:5px; background:#4d2e20; font-size:14px; line-height:1.2; font-family:inherit; font-weight:700; }
.club-shortcuts button, .board-tabs button { flex:1; }
#clubDialog { inset:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); width:min(90cqw,390px); max-height:90cqh; box-sizing:border-box; color:#fff1cf; font:700 15px/1.4 "Microsoft YaHei",Arial,sans-serif; }
#clubDialog::backdrop { background:#20110bcc; }
#clubDialog [hidden] { display:none; }
#clubDialog section { padding:10px; border-radius:7px; background:#302019ed; }
#clubDialog p { margin:.45em 0; }
#identityChoices { display:grid; gap:8px; }
#memberDetails label { display:block; margin-bottom:4px; font-size:13px; color:#e9c5a1; }
#playerName { box-sizing:border-box; width:100%; padding:6px 8px; background:#221813; color:#ffefd5; border:1px solid #ba8352; border-radius:4px; font:inherit; }
#googleWidget:empty, #clubStatus:empty, #myRank:empty { display:none; }
#clubDialog .board-tabs [aria-pressed="true"] { color:#382014; background:#ffc370; }
#boardRule, #saveSummary, #clubStatus, #myRank { font-size:13px; }
#rankList { padding:0; list-style:none; overflow-y:auto; max-height:42cqh; }
#rankList li { display:grid; grid-template-columns:2.7em 1fr auto; align-items:center; gap:5px; padding:6px 0; border-top:1px solid #79523c; }
#rankList li.mine { color:#ffd680; }
#rankList strong { overflow-wrap:anywhere; }
#clubDialog #closeClub img { width:30px; }
@container court (max-height:400px) { .club-shortcuts button {min-height:30px;} }
