/* Top panel (header.asp): player card, city clock and product finder. Loaded after Master.css
   and game-select.css. Vault note: Painel superior. */

/* Player card */
/* No frame: drop-shadow follows the image's alpha, so transparent avatars keep their own outline. */
#headerbar .avatar { cursor: pointer; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .55)); transition: filter .15s ease; }
#headerbar .avatar:hover { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .55)) brightness(1.08); }
#headerbar .avatar img { display: block; object-fit: cover; }
/* min-height: when the clock wraps to the next row it starts below the avatar, not over it. */
#player-card { width: auto !important; min-height: 80px; margin-right: 6px; }
#username { width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); padding-top: 2px; }
#superusername { text-shadow: 0 1px 3px rgba(0, 0, 0, .7); opacity: .85; }
#countryflag { clear: left; width: auto; height: auto; margin-top: 2px; }
/* The flag PNGs are 32x32 with transparent margins and their own soft shadow: a CSS box-shadow
   would outline the whole square and show as a stray line under the flag. */
#countryflag img { display: block; width: auto; height: 22px; }
#mail { display: flex; align-items: center; gap: 2px; height: 22px; margin: 3px 0 0 6px; padding: 0 8px; border-radius: 11px; background: rgba(0, 40, 40, .55); border: 1px solid rgba(255, 255, 255, .18); width: auto !important; }
#mail a { display: flex; align-items: center; color: #FFFFFF; text-decoration: none; }
#mail a img, #mail > img { width: 16px !important; padding-left: 0 !important; }
#mail > img { margin-left: 8px; }
#mail a.mail-signatures, #mail a.mail-polls { margin-left: 8px; }
#mail a div, #alertscount { margin: 0 0 0 4px !important; font-weight: 600; font-variant-numeric: tabular-nums; }

/* City clock and product finder, side by side */
#city-tools { float: left; display: flex; align-items: center; gap: 10px; margin: 14px 10px 0 5px; }
#city-tools #product-finder { float: none; margin: 0; }
#city-tools #product-finder select, #city-tools #product-finder .gs-trigger { height: 42px; border-radius: 21px; padding-left: 16px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }

.city-clock { display: flex; align-items: center; gap: 9px; box-sizing: border-box; height: 42px; padding: 0 14px 0 9px; border-radius: 21px; background: rgba(0, 40, 40, .6); border: 1px solid rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); color: #FFFFFF; font-family: Segoe UI, sans-serif; white-space: nowrap; cursor: default; }
.city-clock .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.city-clock__body { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; line-height: 1.15; }
.city-clock__top { display: flex; align-items: baseline; gap: 7px; }
.city-clock__time { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.city-clock__city { font-size: 12px; opacity: .8; }
.city-clock__line { font-size: 12px; opacity: .92; }
/* #game-date keeps its old Master.css rules (float, margin, 22px line); inside the clock they must go. */
.city-clock #game-date { float: none; display: inline; margin: 0; font: inherit; line-height: inherit; color: inherit; }

/* Sun by day, moon by night (the 3D map's sun, -3 degrees). */
.city-clock__icon { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #FFF6B0 0, #FFD23F 55%, #F5A623 100%); box-shadow: 0 0 10px 2px rgba(255, 200, 60, .7); transition: background .4s ease, box-shadow .4s ease; }
.city-clock__icon--button { cursor: pointer; }
.city-clock__icon--button:focus-visible { outline: 2px solid #E8EEF8; outline-offset: 2px; }
.city-clock--night .city-clock__icon {background: transparent; box-shadow: inset -6px -2px 0 0 #E8EEF8; transform: rotate(-20deg); filter: drop-shadow(0 0 4px rgba(200, 220, 255, .6)); }

@media (max-width: 600px) {
    #city-tools { clear: left; width: calc(100vw - 20px); margin: 6px 10px 0; gap: 8px; }
    #city-tools #product-finder { flex: 1 1 auto; width: auto; min-width: 0; margin: 0; }
    #city-tools #product-finder select, #city-tools #product-finder .gs-trigger { height: 42px; font-size: 15px; }
    .city-clock { flex: none; padding: 0 10px 0 7px; gap: 7px; }
    .city-clock__city { display: none; }
    .city-clock__time { font-size: 16px; }
    .city-clock__line { font-size: 11px; }
}
/* Master.css shrinks the avatar to 50px on portrait screens, whatever their width. */
@media only screen and (max-device-aspect-ratio: 1/1) {
    #countryflag { margin-left: 62px; }
    #player-card { min-height: 58px; }
}
@media (prefers-reduced-motion: reduce) {
    .city-clock__icon { transition: none; }
}
