/* Deep City: the walkable street (street.html). Uses the tokens in site.css. */
.street-page { --pw: min(37vw, 210px); --bottom: 292px; height: 100vh; height: 100dvh; overflow: hidden; background: var(--ink1); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* the world behind the doors */
.sky { position: fixed; inset: 0; z-index: 0; background: linear-gradient(180deg, #0a2a52 0%, #0d3766 45%, #11426f 100%); overflow: hidden; }
.sky::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.d-gardens .sky::after { background: radial-gradient(70% 30% at 50% 62%, rgba(93, 255, 176, 0.16), transparent 70%); }
.d-glass .sky::after { background: radial-gradient(80% 45% at 50% 30%, rgba(142, 232, 255, 0.12), transparent 70%); }
.d-next .sky::after { background: radial-gradient(60% 60% at 100% 55%, rgba(255, 59, 48, 0.28), transparent 70%), rgba(90, 6, 20, 0.22); }
.arc { position: absolute; left: 0; right: 0; bottom: var(--bottom); width: 100%; height: 78%; }
.towers { position: absolute; left: 0; bottom: var(--bottom); height: 46%; width: 100%; overflow: hidden; }
.towers svg { position: absolute; left: 0; bottom: 0; height: 100%; width: auto; will-change: transform; }
.pave { position: absolute; left: 0; right: 0; bottom: 0; height: var(--bottom); background: linear-gradient(180deg, #0e2f55, #050f20 70%); border-top: 2px solid rgba(142, 232, 255, 0.35); }
.d-next .pave { border-top-color: rgba(255, 138, 138, 0.4); }

/* the street itself: one plot per door, snapping to the middle */
.scroller { position: fixed; left: 0; right: 0; top: 0; bottom: calc(var(--bottom) - var(--pw) * 0.1667); z-index: 2; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; outline: none; }
.scroller::-webkit-scrollbar { display: none; }
.row { display: flex; align-items: flex-end; height: 100%; padding: 0 calc(50vw - var(--pw) / 2); width: max-content; }
.plot { flex: none; width: var(--pw); scroll-snap-align: center; cursor: pointer; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.plot .knock-g { transform-box: fill-box; transform-origin: 50% 100%; }
.plot.knocked .knock-g { animation: knock 0.42s ease-out; }
@keyframes knock { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-2.5%); } 35% { transform: translateX(2.5%); } 55% { transform: translateX(-1.5%); } 75% { transform: translateX(1%); } }

.swipe { position: fixed; left: 0; right: 0; bottom: calc(var(--bottom) - 52px); z-index: 3; text-align: center; font: 800 13px/1 var(--display); letter-spacing: 4px;
  color: rgba(156, 200, 238, 0.75); pointer-events: none; transition: opacity 0.6s; }
.swipe.gone { opacity: 0; }

/* top: where you are, and find */
.where { position: fixed; left: 14px; top: calc(14px + env(safe-area-inset-top)); z-index: 4; max-width: calc(100vw - 92px); padding: 8px 14px 6px; border-radius: 14px; text-decoration: none;
  background: rgba(4, 14, 32, 0.88); border: 1.5px solid rgba(255, 195, 90, 0.35); }
.where b { display: block; font: 800 15px/1.2 var(--display); letter-spacing: 2px; color: var(--dc, var(--amber)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.where span { display: block; font-size: 12.5px; color: var(--label); }
.d-glass { --dc: var(--glass); } .d-gardens { --dc: var(--garden); } .d-next { --dc: var(--red); }
.find-btn { position: fixed; right: 14px; top: calc(14px + env(safe-area-inset-top)); z-index: 4; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(4, 14, 32, 0.88); border: 1.5px solid var(--line); color: var(--label); cursor: pointer; }

/* bottom: the focused door's card and the menu */
.card { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 4; width: min(calc(100vw - 28px), 460px);
  padding: 12px 15px 13px; border-radius: 18px; background: rgba(4, 14, 32, 0.95); border: 1.5px solid rgba(255, 195, 90, 0.35); }
.card.red { border-color: rgba(255, 107, 107, 0.55); }
.card .nm { font: 800 21px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.red .nm { color: var(--red); }
.card .sub { font-size: 13.5px; color: var(--muted); margin-top: 1px; min-height: 1.4em; }
.row2 { display: flex; gap: 8px; margin-top: 10px; }
.row2:empty { display: none; }
.b { flex: 1; min-height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 4px 10px 1px; font: 800 16px/1.1 var(--display);
  text-decoration: none; cursor: pointer; border: 0; text-align: center; }
.b.amber { background: linear-gradient(180deg, var(--amber-hi), var(--amber) 55%, var(--amber-lo)); color: #0a1526; }
.b.ghost { background: transparent; border: 2px solid var(--line); color: #cfe3f7; }
.b.redb { background: rgba(90, 6, 20, 0.4); border: 2px solid var(--red); color: #ff9a9a; }
.b:disabled { opacity: 0.6; }
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 4; width: min(calc(100vw - 24px), 470px); height: 66px;
  display: flex; padding: 5px; gap: 4px; border-radius: 20px; background: rgba(4, 14, 32, 0.96); border: 1.5px solid var(--edge); }
.nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 15px; background: none; cursor: pointer;
  color: var(--faint); font: 800 11.5px/1 var(--display); letter-spacing: 1px; }
.nav button svg { width: 22px; height: 22px; color: var(--label); }
.nav button.x svg { color: var(--red); }
.nav button.on { background: linear-gradient(180deg, var(--amber-hi), var(--amber) 55%, var(--amber-lo)); color: #0a1526; }
.nav button.on svg { color: #0a1526; }

/* sheets */
#findDlg .plate { margin-top: 2px; }
.mapnote { margin: -4px 0 12px; color: var(--muted); font-size: 14.5px; }
.dist { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 8px; padding: 12px 14px; border-radius: 14px; cursor: pointer; text-align: left;
  background: rgba(4, 14, 32, 0.72); border: 2px solid var(--edge); color: #fff; font: inherit; }
.dist:hover { border-color: var(--amber); }
.dist .dot { background: var(--c); box-shadow: 0 0 12px var(--c); }
.dist b { display: block; font: 800 18px/1.25 var(--display); }
.dist span { font-size: 13.5px; color: var(--muted); }
.dist[data-d="glass"] { --c: var(--glass); } .dist[data-d="gardens"] { --c: var(--garden); } .dist[data-d="next"] { --c: var(--red); }
#mapDlg .btn { margin-top: 14px; min-height: 52px; }
#mapDlg a.ghost { text-align: center; }

.toast { position: fixed; left: 50%; top: calc(80px + env(safe-area-inset-top)); z-index: 9; transform: translate(-50%, -10px); max-width: calc(100vw - 32px); padding: 10px 16px 8px;
  border-radius: 14px; background: rgba(4, 14, 32, 0.96); border: 1.5px solid var(--amber); font: 800 15px/1.3 var(--display); text-align: center; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-height: 640px) { .street-page { --bottom: 262px; } .card { padding: 9px 13px 10px; } .card .nm { font-size: 18px; } }
@media (min-width: 900px) { .street-page { --bottom: 270px; } }
@media (prefers-reduced-motion: reduce) { .plot.knocked .knock-g { animation: none; } .towers svg { transform: none !important; } }

/* the shop sheet */
#shopDlg { width: min(94vw, 460px); }
#shopDlg .mode { margin: -4px 0 10px; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; background: rgba(4, 14, 32, 0.8); border: 1.5px solid var(--line); color: var(--muted); }
#shopDlg .mode[data-mode="test"] { border-color: var(--glass); color: #dff6ff; }
#shopDlg .mode[data-mode="nokey"] { border-color: var(--red); color: #ffd6d6; }
.shop-door { margin: 0 auto; width: 62%; max-width: 250px; border-radius: 16px; background: radial-gradient(70% 60% at 50% 70%, rgba(255, 200, 103, 0.18), transparent 70%), #0d3766; }
.shop-door svg { display: block; width: 100%; height: auto; }
.tryhint { margin: 6px 0 2px; text-align: center; font-size: 13px; color: var(--faint); }
#shopList h3 { margin: 14px 0 4px; font: 800 13px/1.3 var(--display); letter-spacing: 2.5px; text-transform: uppercase; color: var(--label); }
.item { display: flex; align-items: center; gap: 11px; margin-top: 6px; padding: 9px 10px; border-radius: 14px; cursor: pointer; background: rgba(4, 14, 32, 0.72); border: 2px solid var(--edge); }
.item.trying { border-color: var(--amber); }
.item:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.item .sw { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 2px solid rgba(255, 255, 255, 0.25); }
.item .itx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item .itx b { font: 800 16.5px/1.2 var(--display); }
.item .itx span { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.item .itx em { font-style: normal; font: 800 11px/1.4 var(--display); letter-spacing: 1.5px; color: var(--garden); }
.item .b { flex: none; min-height: 40px; min-width: 92px; font-size: 15px; }
#shopDlg .check { margin-top: 14px; }

/* the 3D street (test) */
.s3d { touch-action: none; overscroll-behavior: none; }
.s3d #c3d { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; z-index: 1; touch-action: none; }
.s3d .hint { position: fixed; left: 50%; top: calc(76px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 4; padding: 6px 12px 4px; border-radius: 12px; background: rgba(4, 14, 32, 0.7);
  font: 800 12.5px/1.2 var(--display); letter-spacing: 1px; color: var(--label); white-space: nowrap; pointer-events: none; }
.s3d .joy { position: fixed; left: 22px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 4; width: 112px; height: 112px; border-radius: 50%;
  background: rgba(4, 14, 32, 0.45); border: 2px solid rgba(156, 200, 238, 0.45); touch-action: none; }
.s3d .joy .knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  background: linear-gradient(180deg, var(--amber-hi), var(--amber) 60%, var(--amber-lo)); box-shadow: 0 0 18px rgba(255, 195, 90, 0.45); pointer-events: none; }
.s3d.carded .joy { display: none; }
.s3d .card { z-index: 5; }
.s3d .card .cclose { position: absolute; right: 8px; top: 6px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--label); font: 800 26px/1 var(--display); cursor: pointer; }
.s3d .nav button { flex: 1; }
.s3d .hint { transition: opacity 0.6s; }
.s3d .hint.gone { opacity: 0; }
.s3d .find-btn { z-index: 4; }

/* invite rewards in the shop */
.invites { margin: 6px 0 4px; padding: 10px 12px 12px; border-radius: 14px; border: 2px dashed var(--garden); background: rgba(4, 30, 26, 0.45); }
.invites h3 { margin: 0 0 4px !important; color: var(--garden) !important; }
.invtxt { margin: 0 0 10px; font-size: 14px; color: #dff6ee; }
.invbar { position: relative; height: 10px; margin: 6px 6px 14px; border-radius: 6px; background: #0b2140; border: 1px solid #1f3d63; }
.invbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--garden); box-shadow: 0 0 10px rgba(93, 255, 176, 0.6); }
.invbar b { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #0b2140; border: 3px solid #4f6a8c; }
.invbar b.done { background: var(--garden); border-color: #d9fff0; }
.reward { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 14px; color: var(--muted); }
.reward .sw { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid rgba(255, 255, 255, 0.25); opacity: 0.55; }
.reward span:nth-child(2) { flex: 1; }
.reward em { font-style: normal; font: 800 11px/1 var(--display); letter-spacing: 1.5px; color: #7f97b5; }
.reward.got { color: #fff; } .reward.got .sw { opacity: 1; } .reward.got em { color: var(--garden); }
.invites .b { width: 100%; margin-top: 10px; }
.invnote { margin: 8px 0 0; font-size: 12px; color: var(--faint); }

/* the map of streets */
.dtabs { display: flex; gap: 6px; margin: 0 0 10px; }
.dtab { flex: 1; padding: 8px 6px 6px; border-radius: 12px; border: 2px solid var(--edge); background: rgba(4, 14, 32, 0.7); color: var(--muted); font: 800 13px/1.15 var(--display); cursor: pointer; }
.dtab.on { border-color: var(--c, var(--amber)); color: #fff; background: rgba(10, 21, 38, 0.95); }
.dtab[data-d="glass"] { --c: var(--glass); } .dtab[data-d="gardens"] { --c: var(--garden); } .dtab[data-d="next"] { --c: var(--red); }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; max-height: 42vh; overflow-y: auto; padding: 2px; }
.sbtn { display: flex; flex-direction: column; align-items: center; padding: 7px 2px 5px; border-radius: 12px; border: 2px solid var(--edge); background: rgba(4, 14, 32, 0.75); color: var(--faint); cursor: pointer; }
.sbtn b { font: 800 18px/1.1 var(--display); color: #cfe3f7; }
.sbtn span { font-size: 11px; }
.sbtn.lit { border-color: rgba(255, 195, 90, 0.55); } .sbtn.lit span { color: var(--amber); }
.sbtn.mine { box-shadow: 0 0 0 3px var(--amber) inset; }
.mapnote.small { font-size: 12.5px; color: var(--faint); margin-top: 8px; }

/* Top list */
.toplist { list-style: none; margin: 8px 0 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.toplist li { margin-top: 6px; }
.toplist li.empty { color: var(--muted); font-size: 14px; }
.toplist button { display: grid; grid-template-columns: 30px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; width: 100%; padding: 8px 10px; text-align: left; border-radius: 12px;
  border: 2px solid var(--edge); background: rgba(4, 14, 32, 0.75); color: #fff; cursor: pointer; font: inherit; }
.toplist .rk { grid-row: span 2; align-self: center; font: 800 18px/1 var(--display); color: var(--amber); text-align: center; }
.toplist .nm { font: 800 16px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist .wh { grid-column: 2; font-size: 12.5px; color: var(--muted); }
.toplist .kn { grid-row: 1 / span 2; grid-column: 3; align-self: center; font: 800 13px/1 var(--display); color: var(--label); }
.toplist button.x { border-color: rgba(255, 107, 107, 0.55); } .toplist button.x .rk, .toplist button.x .nm { color: var(--red); }
/* the vote at 100,001 */
dialog.vote { border-color: rgba(255, 107, 107, 0.55); }
dialog.vote h2 { color: var(--red); }
.vtxt { margin: 0 0 12px; font-size: 15px; color: #f1dede; }
.vbar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; border: 1px solid #3a2030; }
.vbar i { display: block; height: 100%; transition: width 0.6s; }
#vOpen { background: linear-gradient(90deg, #ff3b30, #ff6b6b); } #vSeal { background: linear-gradient(90deg, #4f6a8c, #8ee8ff); }
.vcount { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.vlines { margin: 12px 0 0; padding-left: 20px; font: 800 15px/1.5 var(--display); color: #ffd6d6; }
.vlines li { animation: vin 0.5s ease-out; }
@keyframes vin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* PIN */
.pinbox { margin: 4px 0 10px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(4, 14, 32, 0.7); }
.pinbox p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.pinform { display: flex; gap: 8px; }
.pinform input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--plate); color: var(--amber); font: 800 20px/1 var(--display); letter-spacing: 8px; }
.pinform .b { flex: none; }
.s3d .nav button { font-size: 10.5px; letter-spacing: 0.5px; }

/* the night shift */
.s3d .moon { right: 70px; color: var(--amber); }
dialog.shift { width: min(96vw, 440px); padding: 14px 14px 16px; }
.sh-top { display: flex; align-items: center; justify-content: space-between; }
.sh-top h2 { margin: 0; color: var(--amber); }
.sh-top .cclose { position: static; width: 36px; height: 36px; border: 0; background: none; color: var(--label); font: 800 26px/1 var(--display); cursor: pointer; }
dialog.shift p { font-size: 14.5px; color: #dbe8f5; margin: 8px 0; }
dialog.shift .daily { color: var(--amber); font-weight: 600; }
dialog.shift h3 { margin: 10px 0 6px; font: 800 18px/1.25 var(--display); }
.sh-hud { display: flex; justify-content: space-between; margin: 8px 2px; font: 800 18px/1 var(--display); color: var(--amber); }
.sh-hud #shDead { color: #ff9a9a; }
.sh-stage { position: relative; display: flex; gap: 10px; align-items: flex-end; padding: 14px 10px 10px; border-radius: 16px; overflow: hidden;
  background: radial-gradient(90% 60% at 50% 0%, #1a4f7c, #08203f 70%), #08203f; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.sh-house { flex: 1; padding: 10px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #16406f, #0f3360); border-top: 4px solid rgba(142, 232, 255, 0.45); }
.sh-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.win { aspect-ratio: 5 / 6; border-radius: 8px; border: 3px solid #16304f; padding: 0; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.win.lit { background: radial-gradient(70% 60% at 50% 55%, #fff1c9, #ffc867 55%, #e08a2a); box-shadow: 0 0 12px rgba(255, 179, 71, 0.45); }
.win.saved { transform: scale(1.08); transition: transform 0.15s; }
.win.flicker { animation: flick2 0.28s steps(2) infinite; border-color: #ff6b6b; }
@keyframes flick2 { 0% { background: #ffc867; box-shadow: 0 0 14px rgba(255, 107, 107, 0.7); } 100% { background: #23324a; box-shadow: none; } }
.win.dead { background: #071528; border-color: #0b1a30; box-shadow: none; }
.sh-x { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 4px; }
.sh-x span { font: 800 11px/1 var(--display); color: #ff8a8a; letter-spacing: 1px; }
.sh-red { width: 44px; height: 54px; border-radius: 8px; border: 3px solid #4a1420; background: #ff3b30; box-shadow: 0 0 30px 10px rgba(255, 59, 48, 0.7); transition: opacity 0.4s; }
.sh-dark { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 100% 100%, rgba(0, 0, 0, 0.9), transparent 70%); transition: opacity 0.6s; }
#shFind .note { margin: 8px 0; padding: 12px 14px; border-left: 4px solid var(--red); background: rgba(40, 6, 14, 0.5); border-radius: 8px; font: 600 15px/1.45 "Courier New", monospace; color: #ffe1e1; }
#shFind .rare { margin: 8px 0; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--amber); background: rgba(40, 28, 6, 0.5); }
#shFind .rare b { display: block; font: 800 18px/1.2 var(--display); color: var(--amber); }
#shFind .rare span { font-size: 13.5px; color: #ffeac2; }
.sh-notes { margin: 0; padding-left: 20px; font: 600 13.5px/1.45 "Courier New", monospace; color: var(--faint); }
.sh-notes li { margin: 5px 0; } .sh-notes li.got { color: #ffe1e1; }
#shRare { list-style: none; padding-left: 0; font-family: var(--display); }
