/* Aurelia (/aurelia): the VizionWall ad game. It uses the site's colours and light/dark
   theme (pages.css); every rule is scoped inside .city. See aurelia.js. */
/* Layout: one wall at a time, like walking through Aurelia: the wall big in the middle,
   ◀ ▶ by rank under it, a map of the whole tower below; wallet and rent desk on the right;
   boards below. Billboards have no fixed place: the highest boost sits at the top of the tower, front. */
.city{
  /* The site's own colours (pages.css: --bg, --paper, --ink, --muted, --line, --accent),
     plus a few game colours for light and dark. */
  --panel:var(--paper); --panel-2:var(--bg); --accent-ink:#ffffff;
  --good:#1e8e3e; --warn:#a86400; --bad:#a3261d; --red:#e0202e; --plasma:#9b6bff; --moon:#d8d1ac;
  --display:"Jost","Inter",system-ui,sans-serif; --body:"Jost","Inter",system-ui,sans-serif; --mono:ui-monospace,"SF Mono",Menlo,monospace;
}
:root[data-theme="dark"] .city{--accent-ink:#11131a; --good:#52d39a; --warn:#ffc35a; --bad:#f08a80; --red:#ff2d3d}
@media (prefers-color-scheme:dark){ :root:not([data-theme="light"]) .city{--accent-ink:#11131a; --good:#52d39a; --warn:#ffc35a; --bad:#f08a80; --red:#ff2d3d} }
.city *{box-sizing:border-box}
.city{background:var(--bg); color:var(--ink)}
.city{font:15px/1.5 var(--body); padding-inline:16px; padding-block:16px 40px; min-height:calc(100vh - 80px)}
.city h1,.city h2,.city h3{font-family:var(--display); font-weight:700; letter-spacing:.01em; text-wrap:balance; margin:0}
.city a{color:var(--accent)}
.city button,.city input,.city select{font:inherit; color:inherit}
.city button{cursor:pointer; border:1px solid var(--line); background:var(--panel-2); border-radius:8px; padding:7px 12px}
.city button:hover{border-color:var(--accent)}
.city button:focus-visible,.city input:focus-visible,.city select:focus-visible,.city a:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
.city button.primary{background:var(--accent); color:var(--accent-ink); border-color:var(--accent); font-weight:600}
.city button.danger{color:var(--bad)}
.city button[disabled]{opacity:.45; cursor:not-allowed}
.city .num{font-family:var(--mono); font-variant-numeric:tabular-nums}
.city .muted{color:var(--muted)}
.city .small{font-size:13px}

.city header.top{max-width:1320px; margin:0 auto 14px; display:flex; flex-wrap:wrap; align-items:center; gap:10px 18px}
.city header.top h1{font-size:clamp(22px,3.4vw,34px)}
.city header.top h1 span{color:var(--accent)}
.city .tag{font-size:12px; letter-spacing:.06em; text-transform:uppercase; border:1px solid var(--warn); color:var(--warn); border-radius:999px; padding:3px 10px}
.city header.top p{flex-basis:100%; margin:0; color:var(--muted); max-width:74ch}
.city .today{margin-left:auto; display:flex; gap:8px; align-items:center; font-size:13px}

.city .layout{max-width:1320px; margin:0 auto; display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:16px; align-items:start}
@media (max-width:980px){ .city .layout{grid-template-columns:minmax(0,1fr)} }
.city .panel{background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:16px; min-width:0}
.city .panel h2{font-size:15px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-bottom:10px}

/* ---- the walk: one billboard at a time */
.city .walk{display:grid; grid-template-columns:120px minmax(0,1fr); gap:14px}
.city .where{display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 12px; margin-bottom:8px}
.city .where .rank{font-family:var(--display); font-size:22px}
.city .where .pos{color:var(--muted)}
.city .wall{position:relative; aspect-ratio:16/8; max-width:100%; border-radius:10px; overflow:hidden; border:4px solid var(--line); background:var(--bg) center/cover no-repeat}
.city .wall.blank{display:grid; place-items:center; text-align:center; color:var(--muted); border-style:dashed; background-image:radial-gradient(var(--line) 1.5px, transparent 2px); background-size:22px 22px}
.city .wall.top{animation:redframe 1s steps(2,end) infinite}
@keyframes redframe{0%,100%{border-color:var(--red); box-shadow:0 0 18px var(--red), 0 0 40px #ff2d3d66} 50%{border-color:#7a0010; box-shadow:none}}
.city .wall video{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; background:#000}
.city .wall .loading{position:absolute; inset:0; display:grid; place-items:center; color:var(--muted)}
.city .foot{z-index:2; position:absolute; left:10px; right:10px; bottom:8px; display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; font-size:12px; background:#0b0d19cc; color:#f2f0e8; border-radius:8px; padding:6px 10px}
.city .foot a{color:#a9c4ff} .city .foot .muted{color:#c9c6bb} .city .foot button{background:#ffffff1a; color:#f2f0e8; border-color:#ffffff33}
.city .foot a{font-weight:600}
.city .foot button{padding:2px 8px; font-size:12px}
.city .levelpill{display:inline-flex; align-items:center; gap:6px; padding:2px 8px; border-radius:999px; background:#0008}
.city .levelpill i{width:10px; height:10px; border-radius:50%; display:inline-block}
.city .badge{position:absolute; top:8px; right:8px; font-size:11px; font-weight:600; padding:2px 8px; border-radius:999px; background:var(--warn); color:#221a00}
.city .nav{display:flex; justify-content:space-between; gap:8px; margin-top:10px}
.city .strip{display:grid; grid-template-columns:repeat(16,minmax(0,1fr)); gap:3px; margin-top:10px}
.city .strip button{height:16px; padding:0; border-radius:3px; border:1px dashed var(--line); background:transparent}
.city .strip button.taken{border-style:solid}
.city .strip button[aria-current="true"]{outline:2px solid var(--ink); outline-offset:1px}
.city .strip button.top{animation:redframe 1s steps(2,end) infinite}
.city .editbar{display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-top:10px}
.city .editbar input{min-width:0; padding:7px 10px; border-radius:8px; border:1px solid var(--line); background:var(--panel-2)}
.city .editbar input[type=color]{width:36px; height:34px; padding:0}

/* ---- colour levels */
.city .levels{display:grid; grid-template-columns:repeat(11,minmax(0,1fr)); gap:3px; margin-top:6px}
.city .levels span{height:14px; border-radius:3px}
.city .levels span.on{outline:2px solid var(--ink); outline-offset:1px}

/* ---- wallet and desk */
.city .coins{display:grid; gap:6px}
.city .coin{display:grid; grid-template-columns:28px 1fr auto auto; gap:8px; align-items:center; padding:6px 8px; border-radius:8px; background:var(--panel-2)}
.city .coin .dot{width:24px; height:24px; border-radius:50%; display:grid; place-items:center; font-size:14px}
.city .coin .name{font-weight:600}
.city .coin .name small{display:block; font-weight:400; color:var(--muted); font-size:11px}
.city .coin .count{font-family:var(--mono); font-size:16px; min-width:3ch; text-align:right}
.city .coin .ex{display:flex; gap:3px}
.city .coin .ex button{padding:2px 6px; font-size:11px}
.city .total{display:flex; justify-content:space-between; align-items:baseline; gap:8px; margin-top:10px; padding-top:10px; border-top:1px solid var(--line)}
.city .earnbuy{display:flex; flex-wrap:wrap; gap:6px; margin-top:10px}
.city .desk{display:grid; gap:10px}
.city .field{display:grid; gap:4px}
.city .field span{font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted)}
.city .field input{background:var(--panel-2); border:1px solid var(--line); border-radius:8px; padding:8px 10px; width:100%; min-width:0}
.city .row{display:flex; flex-wrap:wrap; gap:6px; align-items:center}
.city .chip{padding:4px 10px; border-radius:999px; font-size:13px}
.city .chip[aria-pressed="true"]{background:var(--accent); color:var(--accent-ink); border-color:var(--accent); font-weight:600}
.city .pricebox{background:var(--panel-2); border-radius:10px; padding:10px 12px; display:grid; gap:4px}
.city .pricebox .big{font-family:var(--mono); font-size:20px; color:var(--warn)}
.city .msg{font-size:13px; padding:8px 10px; border-radius:8px; background:color-mix(in srgb,var(--good) 14%,transparent); color:var(--good)}
.city .msg.err{background:color-mix(in srgb,var(--bad) 14%,transparent); color:var(--bad)}
.city .myads{display:grid; gap:6px}
.city .myad{display:flex; gap:8px; align-items:center; font-size:13px; background:var(--panel-2); border-radius:8px; padding:6px 8px; flex-wrap:wrap}
.city .myad b{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}

.city .boards{max-width:1320px; margin:16px auto 0; display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:16px}
.city .board ol{margin:0; padding:0; list-style:none; display:grid; gap:6px}
.city .board li{display:grid; grid-template-columns:28px minmax(0,1fr) auto; gap:8px; align-items:center; font-size:14px}
.city .board li span:nth-child(2){overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.city .board li .rank{font-family:var(--mono); color:var(--muted)}
.city .board li .val{font-family:var(--mono); color:var(--warn)}
.city .rules{max-width:1320px; margin:16px auto 0}
.city .rules dl{display:grid; grid-template-columns:max-content 1fr; gap:6px 16px; margin:0}
.city .rules dt{color:var(--muted)}
.city .rules dd{margin:0}
.city .open{color:var(--warn)}
@media (max-width:560px){ .city .rules dl{grid-template-columns:1fr} .city .rules dt{margin-top:6px} }
@media (prefers-reduced-motion:reduce){ .city .wall.top,.city .strip button.top{animation:none; border-color:var(--red)} }

/* ---- watch & earn */
.city .watchbar{display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; margin-bottom:12px; padding:10px 12px; border-radius:10px; background:var(--panel-2)}
.city .watchbar b{font-family:var(--display); font-size:14px}
.city .progress{height:6px; border-radius:999px; background:var(--line); overflow:hidden; margin-top:8px}
.city .progress i{display:block; height:100%; width:0; background:var(--good)}
.city .watching .nav,.city .watching .strip,.city .watching #editbar{display:none}
.city .human{position:absolute; z-index:5; padding:10px 14px; border-radius:10px; background:#ffc35a; color:#221a00; font-weight:700; border:0; box-shadow:0 6px 20px #000a}
.city .paused-note{position:absolute; inset:0; display:grid; place-items:center; background:#000a; color:#fff; font-weight:600; z-index:4}
.city .stats{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; margin-top:8px}
.city .stat{background:var(--panel-2); border-radius:8px; padding:6px 8px; display:grid}
.city .stat b{font-family:var(--mono); font-size:16px}
.city .stat small{font-size:11px; color:var(--muted)}
@media (max-width:560px){ .city .stats{grid-template-columns:repeat(2,minmax(0,1fr))} }
.city .ledger{display:grid; gap:4px; max-height:220px; overflow:auto; font-size:12px}
.city .ledger div{display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:8px; padding:4px 6px; border-radius:6px; background:var(--panel-2)}
.city .ledger .plus{color:var(--good)} .city .ledger .minus{color:var(--bad)}
.city .ledger span:nth-child(2){overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.city .tabs{display:flex; gap:6px; margin-bottom:10px}
.city .pool{font-size:12px; color:var(--muted); margin-top:8px}
/* ---- two coins */
.city .coin{grid-template-columns:28px 1fr auto}
.city .coin .act{grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:6px; align-items:center; font-size:12px; color:var(--muted)}
.city .coin .act button{padding:3px 10px; font-size:12px}

/* ---- admin */
.city .admin-btn[aria-pressed="true"]{background:#ffc35a; color:#221a00; border-color:#ffc35a; font-weight:600}
.city #admin{max-width:1320px; margin:0 auto; display:grid; gap:16px}
.city.admin-on .layout,.city.admin-on .boards,.city.admin-on .rules{display:none}
.city:not(.admin-on) #admin{display:none}
.city .kpis{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px}
.city .kpi{background:var(--panel-2); border-radius:10px; padding:10px 12px; display:grid; gap:2px}
.city .kpi small{font-size:12px; color:var(--muted)}
.city .kpi b{font-family:var(--mono); font-size:20px}
.city .kpi.good b{color:var(--good)} .city .kpi.warn b{color:var(--warn)}
.city .admin-head{display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; justify-content:space-between; margin-bottom:12px}
.city .tablewrap{overflow:auto; max-height:420px}
.city table.traffic{width:100%; border-collapse:collapse; font-size:13px; min-width:640px}
.city table.traffic th,.city table.traffic td{padding:6px 8px; border-bottom:1px solid var(--line); text-align:right; white-space:nowrap}
.city table.traffic th:nth-child(2),.city table.traffic td:nth-child(2){text-align:left}
.city table.traffic th{position:sticky; top:0; background:var(--panel); color:var(--muted); font-weight:500}
.city table.traffic tr.me td{color:var(--accent)}
.city .two{display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:16px}
.city .qlist{display:grid; gap:6px}
.city .qitem{display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; background:var(--panel-2); border-radius:8px; padding:8px 10px; font-size:13px}
.city .qitem b{flex:1; min-width:120px}
.city .qitem .thumb{width:64px; height:32px; border-radius:4px; background:var(--bg) center/cover no-repeat; flex:none}
.city .state{font-size:11px; padding:2px 8px; border-radius:999px; background:var(--bg)}
.city .state.blocked,.city .state.held{background:color-mix(in srgb,var(--bad) 18%,transparent); color:var(--bad)} .city .state.paid,.city .state.ok{background:color-mix(in srgb,var(--good) 18%,transparent); color:var(--good)}
.city select{background:var(--panel-2); border:1px solid var(--line); border-radius:8px; padding:5px 8px}
/* pages.css sizes <main> for reading pages; the game panel fills its grid cell instead */
.city main.panel{max-width:none; margin:0; padding:16px}
.city .packs{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px}
.city .pack{display:grid; gap:2px; text-align:left; padding:8px 10px; border-radius:10px; background:var(--panel-2)}
.city .pack b{font-size:17px}
.city .pack .bonus{color:var(--good); font-weight:600; font-size:13px}
.city .pack small{color:var(--muted); font-size:12px}
.city .pack .flag{font-size:11px; font-weight:600; color:var(--warn)}
@media (max-width:400px){ .city .packs{grid-template-columns:repeat(2,minmax(0,1fr))} }

/* ---- 🏢 Aurelia in 3D: a tower of billboards that turns and rises like a spiral */
.city .b3d{position:fixed; inset:0; z-index:50; display:grid; place-items:center; padding:16px; background:color-mix(in srgb,var(--bg) 70%,transparent); backdrop-filter:blur(4px)}
.city .b3d[hidden]{display:none}
.city .b3d-box{width:min(1100px,100%); max-height:100%; overflow:auto; background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:14px; display:grid; gap:10px; box-shadow:0 20px 60px #0006}
.city .b3d-head{display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px}
.city .b3d-head h2{font-size:18px; text-transform:none; letter-spacing:0; color:var(--ink); margin:0}
.city .b3d-close{margin-left:auto}
.city .b3d-body{display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:12px}
@media (max-width:760px){ .city .b3d-body{grid-template-columns:minmax(0,1fr)} }
/* the stage: sky above, ground at the bottom hiding the part of the tower still underground */
.city .b3d-stage{position:relative; height:560px; perspective:1500px; perspective-origin:50% 30%; overflow:hidden; border-radius:10px; cursor:grab; touch-action:none; user-select:none;
  background:linear-gradient(to bottom, color-mix(in srgb,var(--accent) 18%,var(--bg)), var(--bg) 85%)}
.city .b3d-stage:active{cursor:grabbing}
@media (max-width:560px){ .city .b3d-stage{height:440px} }
.city .b3d-rot{position:absolute; left:50%; top:18%; width:0; height:0; transform-style:preserve-3d}
.city .b3d-tier{position:absolute; left:0; top:0; width:0; height:0; transform-style:preserve-3d}
.city .b3d-face{position:absolute; box-sizing:border-box; display:flex; align-items:center; justify-content:center; background:#2a2f3a; border-radius:2px; backface-visibility:hidden; box-shadow:inset 0 -3px 0 #1d2129}
.city .b3d-roof{position:absolute; display:grid; place-items:center; transform:rotateX(90deg); background:#3a404d; border-radius:2px}
.city .b3d-roof span{font-weight:700; letter-spacing:.3em; font-size:28px; color:#ffc35a}
.city .b3d-earth{position:absolute; left:0; right:0; bottom:0; height:16%; z-index:2;
  background:linear-gradient(to bottom, #5b4a3a 0, #3f3226 18%, #2a2119 100%); box-shadow:0 -10px 24px #0005}
.city .pane{position:relative; flex:none; box-sizing:border-box; padding:0; margin:0; border:2px solid var(--c,transparent); border-radius:3px; overflow:hidden;
  background-color:color-mix(in srgb,var(--c,#8899aa) 55%,#0b1220); background-size:cover; background-position:center; font-size:18px; color:#fff; min-width:0}
.city .pane.empty{background:#9fb6d018; border:2px dashed #ffffff55}
.city .pane:hover,.city .pane.on{outline:3px solid #fff; outline-offset:-3px}
.city .pane.pane-top{animation:redframe 1s steps(2,end) infinite}
.city .pane-rank{position:absolute; left:4px; top:3px; padding:0 5px; border-radius:5px; background:#000a; color:#fff; font-size:11px; font-weight:700}
.city .pane-free{font-size:13px; color:#ffffffaa}
.city .b3d-info{display:grid; gap:6px; align-content:start; background:var(--panel-2); border-radius:10px; padding:12px; min-width:0}
.city .b3d-info a{font-weight:600; overflow-wrap:anywhere}
.city .b3d-shot{aspect-ratio:2/1; border:3px solid var(--line); border-radius:8px; overflow:hidden; background:#000}
.city .b3d-shot img,.city .b3d-shot video{width:100%; height:100%; object-fit:cover; display:block}
.city .b3d-info .levelpill{background:var(--panel); justify-self:start}
.city .b3d-bar{display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:center}
.city .b3d-where{flex-basis:100%; text-align:center}
@media (prefers-reduced-motion:reduce){ .city .pane.pane-top{animation:none; border-color:var(--red)} }

/* The boards sit under the wall, stacked, filling the space beside the tall wallet column */
.city .layout{grid-template-areas:"main aside" "boards aside"; grid-template-rows:auto 1fr}
.city .layout > main{grid-area:main}
.city .layout > aside{grid-area:aside}
.city .layout > .boards{grid-area:boards; align-self:start; max-width:none; margin:0; grid-template-columns:minmax(0,1fr); gap:16px}
@media (max-width:980px){ .city .layout{grid-template-areas:"main" "aside" "boards"; grid-template-rows:auto} }
.city .walk{grid-template-columns:minmax(0,1fr)}
.city .strip{grid-template-columns:none; grid-template-rows:repeat(4,12px); grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:2px}
.city .strip button{height:auto; border-radius:2px}
.city .adpreview{aspect-ratio:2/1; border-radius:8px; border:1px solid var(--line); background:center/cover no-repeat}
.city .human-ask{place-items:start center; padding-top:10px; background:#000c; z-index:4}
.city .human{font-size:24px; min-width:52px; min-height:52px}
