/* City Building: a showcase of the city-building game's buildings and their building effects. The whole
   screen is the game's plot (a Roblox Studio recording); the toolbar copies the game's. One slot holds the
   building you can build; the roll next to it unlocks another (a silhouette roll, then the reveal). */
:root {
  --ground: #2DB247;
  --ui-font: "Fredoka", "Segoe UI", system-ui, sans-serif;
  --num-font: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --sign-font: "Overpass", "Segoe UI", system-ui, sans-serif;   /* stands in for the game's Highway Gothic */
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: #fff; font-family: var(--ui-font); -webkit-font-smoothing: antialiased; overflow: hidden; }
img, video { display: block; }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; color: #111; padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { left: 8px; }

.game { position: relative; width: 100%; height: 100vh; overflow: hidden; }
@supports (height: 100dvh) { .game { height: 100dvh; } }

/* The plot fills the screen (the building is in the middle of it, so cropping the edges is fine). The empty
   plot is the background; the finished building sits on top; the recording plays over both. */
.view {
  position: absolute; inset: 0;
  background: var(--ground) url("images/city/plot-wide.webp") center / cover no-repeat;
}
.view-built, .view-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.view-video { opacity: 0; transition: opacity 0.12s linear; }
.view-video.is-on { opacity: 1; }
@media (max-aspect-ratio: 4/5) {
  .view { background-image: url("images/city/plot-tall.webp"); }
}

/* Back to the profile page (like leaving a game) */
.back-btn {
  position: absolute; z-index: 5; left: 18px; top: 16px;
  display: inline-flex; align-items: center; gap: 0.3em; padding: 0.4em 0.85em 0.4em 0.6em;
  font: 700 16px/1.1 var(--ui-font); color: #fff; text-decoration: none;
  background: rgba(25, 27, 29, 0.6); border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.back-btn svg { width: 1em; height: 1em; flex: none; }
.back-btn:hover { background: rgba(25, 27, 29, 0.78); }
.back-btn:active { transform: scale(0.95); }
.back-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.is-client .back-btn { display: none; }

/* The game's toolbar (BuildMenu.Toolbar): see-through black slots (25%) with a thin white edge and rounded
   corners, the building's sprite and its name in Highway Gothic with a black outline, and the key. */
.toolbar-wrap {
  position: absolute; z-index: 4; left: 50%; bottom: 22px; translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.toolbar { display: flex; gap: 10px; }
.slot {
  --edge: 1.5px;
  position: relative; flex: none; width: 104px; height: 92px; padding: 4px 4px 5px; border: 0; border-radius: 20%; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  background: rgba(0, 0, 0, 0.25); color: #EBEBEB;
  box-shadow: inset 0 0 0 var(--edge) rgba(255, 255, 255, 0.9);
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.slot:hover { background-color: rgba(0, 0, 0, 0.36); }
.slot:active { transform: scale(0.95); }
.slot[aria-pressed="true"] { box-shadow: inset 0 0 0 var(--edge) rgba(255, 255, 255, 0.9), 0 0 0 4px #EBEBEB; }
.slot:focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
.slot.is-new { animation: slot-new 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes slot-new { from { transform: scale(0.6); } }
.slot-img { width: 74px; height: 60px; object-fit: contain; }
.slot-name { margin-top: 1px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 14px/1.1 var(--sign-font); text-transform: lowercase; -webkit-text-stroke: 3px #000; paint-order: stroke fill; }
.slot-key { position: absolute; left: 8px; top: 5px; font: 800 14px/1 var(--num-font); color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; }
.slot-count { position: absolute; right: 8px; top: 6px; font: 800 12px/1 var(--num-font); color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; }
.roll-icon { width: 46px; height: 46px; margin-bottom: 8px; fill: #000; }
.slot--roll:disabled { cursor: default; }
.slot--roll.is-rolling .roll-icon { animation: dice 0.5s linear infinite; }
@keyframes dice { to { rotate: 360deg; } }

.toolbar-hint {
  margin: 0; padding: 6px 12px; border-radius: 999px; font: 600 14px/1.2 var(--ui-font);
  background: rgba(20, 28, 48, 0.72); color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  animation: hint 1.6s ease-in-out infinite;
}
@keyframes hint { 50% { transform: translateY(-4px); } }

/* The roll: a card over the toolbar. Silhouettes of the locked buildings flick by, slowing down,
   then the last one lights up with its name. */
.reveal {
  width: 220px; padding: 12px 12px 10px; border-radius: 18px; text-align: center;
  background: rgba(30, 32, 36, 0.82);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 0 3px #000, 0 10px 26px rgba(0, 0, 0, 0.4);
  animation: pop-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop-in { from { transform: translateY(10px) scale(0.85); opacity: 0; } }
.reveal-img { width: 160px; height: 130px; margin: 0 auto; object-fit: contain; filter: brightness(0); }
.reveal.is-revealed .reveal-img { filter: none; transition: filter 0.35s ease; animation: reveal 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes reveal { 0% { transform: scale(0.85); } 60% { transform: scale(1.12); } }
.reveal-name { margin: 6px 0 0; font: 800 22px/1.1 var(--sign-font); -webkit-text-stroke: 4px #000; paint-order: stroke fill; }
.reveal-note { margin: 2px 0 0; font: 900 13px/1.2 var(--num-font); color: #8EFA00; -webkit-text-stroke: 3px #000; paint-order: stroke fill; visibility: hidden; }
.reveal.is-revealed .reveal-note { visibility: visible; }

/* The small print */
.scene-note {
  position: absolute; z-index: 4; right: 14px; bottom: 10px;
  display: flex; flex-direction: column; align-items: flex-end;
  font: 600 12px/1.35 var(--ui-font); color: rgba(255, 255, 255, 0.9); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

@media (max-width: 760px) {
  .back-btn { left: 12px; top: 12px; font-size: 14px; }
  .toolbar-wrap { bottom: 34px; }
  .scene-note { left: 0; right: 0; bottom: 6px; flex-direction: row; justify-content: center; gap: 0 8px; font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .toolbar-hint, .reveal, .reveal.is-revealed .reveal-img, .slot.is-new, .slot--roll.is-rolling .roll-icon { animation: none; }
  .view-video, .slot, .back-btn, .reveal.is-revealed .reveal-img { transition: none; }
}
