/* Layout: the city fills the screen; brand and search float on top. */
:root {
  color-scheme: dark;
  --navy: #0E1B2C;
  --navy-2: #16283F;
  --navy-3: #1F3653;
  --yellow: #FFC21A;
  --coral: #FF5A3C;
  --teal: #19B5A5;
  --cream: #FFF4DC;
  --muted: #9FB0C6;
  --display: "Rubik", "Cairo", system-ui, sans-serif;
  --body: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: #060C14; color: var(--cream); font-family: var(--body); overflow: hidden; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

#stage { position: absolute; inset: 0; margin: auto; background: var(--navy); overflow: hidden; }
body.portrait #stage { height: 100%; width: auto; aspect-ratio: 9 / 16; max-width: 100%; }
#scene { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#scene:active { cursor: grabbing; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tag {
  position: absolute; left: 0; top: 0; direction: ltr; white-space: nowrap;
  background: var(--cream); color: var(--navy); font-weight: 700; font-size: 12px; line-height: 1;
  padding: 5px 9px; border-radius: 20px; transform: translate(-50%, -100%); will-change: transform;
}
.tag::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px;
  border: 5px solid transparent; border-top-color: var(--cream); border-bottom: 0;
}
.tag.mayor, .tag.hit { background: var(--yellow); }
.tag.clock { background: var(--navy-2); color: var(--cream); border: 1px solid var(--yellow); }
.tag.clock::after { border-top-color: var(--yellow); }
.tag.mayor::after, .tag.hit::after { border-top-color: var(--yellow); }
/* paid looks from the shop */
.tag.gold { background: linear-gradient(135deg, #FFE58A, #F2A900); }
.tag.gold::after { border-top-color: #F2A900; }
.tag.neon { background: var(--navy); color: #3FF2E0; box-shadow: 0 0 0 1.5px #3FF2E0, 0 0 14px rgba(63, 242, 224, .75); text-shadow: 0 0 6px rgba(63, 242, 224, .8); }
.tag.neon::after { border-top-color: #3FF2E0; }
.tag.gold.neon { color: #FFD75A; box-shadow: 0 0 0 1.5px #FFD75A, 0 0 14px rgba(255, 215, 90, .75); text-shadow: 0 0 6px rgba(255, 215, 90, .8); }
.tag.gold.neon::after { border-top-color: #FFD75A; }
.tag.gold.hit, .tag.neon.hit { background: var(--yellow); color: var(--navy); text-shadow: none; }

.hud { position: absolute; z-index: 2; }
#brand { top: 16px; right: 16px; display: flex; align-items: center; gap: 12px; }
#brand .name { font-family: var(--display); font-weight: 900; font-size: 34px; color: var(--yellow); line-height: 1; margin: 0; }
#brand .sky { background: var(--navy-2); border: 1px solid var(--navy-3); border-radius: 50%; width: 34px; height: 34px; font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
#brand .sky:hover { border-color: var(--yellow); }
#count { background: var(--navy-2); border: 1px solid var(--navy-3); border-radius: 20px; padding: 6px 14px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
#search { top: 70px; right: 16px; display: flex; gap: 8px; }
#search input { width: 190px; direction: ltr; background: var(--navy-2); color: var(--cream); border: 1px solid var(--navy-3); border-radius: 22px; padding: 8px 14px; font-size: 14px; }
#search input::placeholder { color: var(--muted); }
.btn { background: var(--yellow); color: var(--navy); border: 0; border-radius: 22px; padding: 8px 16px; font-weight: 700; font-size: 14px; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--navy-3); color: var(--cream); }
#hint { bottom: 14px; right: 16px; left: 16px; text-align: center; color: var(--muted); font-size: 13px; pointer-events: none; }
#site-links { bottom: 12px; left: 12px; z-index: 3; display: flex; flex-wrap: wrap; gap: 2px 12px; max-width: calc(100% - 24px); font-size: 13px; background: rgba(8, 19, 32, .78); border: 1px solid var(--navy-3); border-radius: 14px; padding: 4px 12px; }
#site-links a { color: var(--cream); text-decoration: none; font-weight: 700; }
#site-links a:hover, #site-links a:focus-visible { color: var(--yellow); text-decoration: underline; text-underline-offset: 3px; }
#site-links a[href$="/shop"] { color: var(--yellow); }

/* the shop button and the contest pill, top left */
#shop-btn { top: 16px; left: 16px; text-decoration: none; font-size: 15px; padding: 8px 16px; box-shadow: 0 0 0 2px rgba(255, 194, 26, .35), 0 6px 18px rgba(0, 0, 0, .35); }
#contest-pill { top: 62px; left: 16px; background: var(--navy-2); color: var(--yellow); border: 1.5px solid var(--yellow); border-radius: 20px; padding: 5px 14px; font-weight: 700; font-size: 14px; text-decoration: none; }
#contest-pill:hover { background: var(--yellow); color: var(--navy); }

/* try a shop look on the building, inside the card */
#card .try { margin: 0 0 12px; padding: 10px 0 0; border-top: 1px solid var(--navy-3); }
#card .try[hidden] { display: none; }
#card .try-title { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
#card .chips { display: flex; flex-wrap: wrap; gap: 6px; }
#card .chip { background: var(--navy); color: var(--cream); border: 1px solid var(--navy-3); border-radius: 18px; padding: 4px 11px; font-size: 13px; font-weight: 700; cursor: pointer; }
#card .chip:hover { border-color: var(--yellow); }
#card .chip.on { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }
#card .chip.owned { opacity: .55; cursor: default; }
#card .btn.try-buy { display: block; margin-top: 10px; text-align: center; background: #3FF2E0; }
#card .btn.try-buy[hidden] { display: none; }
#toast { bottom: 44px; left: 50%; transform: translateX(-50%); background: var(--cream); color: var(--navy); font-weight: 700; font-size: 14px; padding: 8px 16px; border-radius: 20px; opacity: 0; transition: opacity .25s; pointer-events: none; white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
#toast.show { opacity: 1; }

#notice { top: 122px; right: 16px; max-width: min(360px, calc(100% - 32px)); background: var(--cream); color: var(--navy); border-radius: 16px; padding: 12px 14px 12px 40px; font-size: 14px; line-height: 1.6; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
#notice strong { font-family: var(--display); font-weight: 900; display: block; font-size: 16px; }
#notice bdi { direction: ltr; unicode-bidi: isolate; font-weight: 700; }
#notice .close { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--navy); color: var(--cream); cursor: pointer; line-height: 1; font-size: 16px; }
#notice[hidden] { display: none; }

/* the card of the building you tapped or searched for */
#card { top: 122px; right: 16px; z-index: 3; width: min(320px, calc(100% - 32px)); background: var(--navy-2); color: var(--cream); border: 1px solid var(--navy-3); border-radius: 18px; padding: 14px 16px 16px; box-shadow: 0 10px 28px rgba(0,0,0,.4); font-size: 14px; line-height: 1.7; }
#card[hidden] { display: none; }
#card .close { position: absolute; top: 10px; left: 10px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--navy-3); color: var(--cream); cursor: pointer; line-height: 1; font-size: 17px; }
#card-handle { display: block; font-family: var(--display); font-weight: 900; font-size: 19px; color: var(--yellow); text-align: right; padding-left: 34px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#card-job { color: var(--muted); }
#card .lvl { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
#card-level { font-family: var(--display); font-weight: 900; font-size: 17px; white-space: nowrap; }
#card .bar { flex: 1; height: 10px; border-radius: 6px; background: var(--navy-3); overflow: hidden; direction: rtl; }
#card .bar i { display: block; height: 100%; border-radius: 6px; background: var(--yellow); transition: width .4s; }
#card p { margin: 0 0 12px; color: var(--cream); }
#card #card-rank { margin: 0 0 4px; color: var(--yellow); font-weight: 700; }
#card #card-rank:empty, #card #card-role:empty { display: none; }
#card #card-role { margin: 4px 0 2px; color: var(--cream); font-weight: 700; }
.tag.minister { box-shadow: 0 0 0 2px var(--yellow); }
.tag.minister::before { content: '🏛️ '; }
#card a.plain { color: var(--muted); font-size: 13px; padding: 4px; }
#card .actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#card .btn { background: var(--yellow); color: var(--navy); font-weight: 700; text-decoration: none; border-radius: 22px; padding: 7px 18px; }
#card .btn.story { border: 0; font: inherit; font-weight: 700; cursor: pointer; background: var(--glow, #3FF2E0); width: 100%; padding: 9px 18px; }
#card .btn.story:disabled { opacity: .6; cursor: progress; }
#card .plain { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 4px; }

kbd { background: var(--navy-3); border-radius: 5px; padding: 1px 6px; color: var(--cream); font-family: inherit; }
body.clean .hud { display: none !important; }
/* Below this width the centred hint would run into the page links, so it moves up a line. */
@media (max-width: 1150px) {
  #hint { bottom: 40px; }
  #toast { bottom: 70px; }
}
@media (max-width: 720px) {
  #brand .name { font-size: 26px; }
  #shop-btn { top: 14px; left: 12px; font-size: 14px; padding: 7px 12px; }
  #contest-pill { top: 116px; left: auto; right: 16px; font-size: 13px; padding: 4px 12px; }
  #site-links { font-size: 12px; gap: 2px 10px; }
  #search input { width: 140px; }
  #hint { display: none; }
  #notice { top: auto; bottom: 90px; right: 16px; left: 16px; max-width: none; }
  #card { top: auto; bottom: 56px; right: 12px; left: 12px; width: auto; }
}
/* a phone keeps the card short: the level hint is on /top too */
@media (max-width: 720px) {
  #card #card-next { display: none; }
}
