/* Inner pages: one page head (the title and one sentence; History and Your tabs carry their scene under it, at most
   480 px tall), then the sections in the one container, the same glass cards and tables as the Browser page. */

.page-head { position: relative; }
.page-head .wrap { padding-top: 48px; padding-bottom: 32px; }
.page-head h1 { font-size: 80px; line-height: 1; }
.page-head p { margin-top: 16px; max-width: 64ch; color: var(--ink-2); }
.city-head .scene { height: 360px; }
@media (max-width: 760px) { .page-head h1 { font-size: 56px; } .page-head .wrap { padding-top: 32px; } .city-head .scene { height: 220px; } }

.scene { position: relative; width: 100%; height: 100%; overflow: hidden; }
.scene canvas { position: absolute; inset: 0; display: block; }
.tower-label {
  position: absolute; left: 0; top: 0; z-index: 2; transform: translate(-50%, -100%); white-space: nowrap; pointer-events: none;
  padding: 8px 18px; border-radius: 999px; font-size: 16px; font-weight: 700; color: #fff;
  background: var(--glass-2); border: 2px solid transparent;
}
.tower-label:empty { display: none; }
.tower-label .pct { color: var(--cyan); }
.frozen-label { position: absolute; left: 0; top: 0; z-index: 3; transform: translate(-50%, -50%); padding: 8px 18px; border-radius: 999px; font-size: 16px; font-weight: 800; color: #062a35; background: linear-gradient(180deg, #C8FBFF, #6FE9F5); white-space: nowrap; }
.fx-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.fx-pop { position: absolute; transform: translate(-50%, -50%); padding: 6px 16px; border-radius: 999px; white-space: nowrap; font-size: 16px; font-weight: 800; animation: popfly 1.1s ease-out forwards; }
.fx-pop.ctrlw { color: #2a1200; background: linear-gradient(180deg, #FFC27A, var(--orange)); }
.fx-pop.burned { color: #fff; background: linear-gradient(180deg, #E070FF, #9A2BE2); }
@keyframes popfly { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.8); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(10%, -90%); } }

/* Tabs: tables left, the tower right and sticky */
.tabs-sec { padding-top: 32px; }
.page-head-in { margin-bottom: 32px; }
.page-head-in h1 { font-size: 80px; line-height: 1; }
.page-head-in p { margin-top: 16px; max-width: 64ch; color: var(--ink-2); }
.side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 32px; align-items: start; }
.side-main { min-width: 0; }
.side-scene { position: sticky; top: calc(var(--head-h) + 16px); height: min(700px, calc(100svh - var(--head-h) - 32px)); border-radius: 24px; overflow: hidden; border: 2px solid rgba(63, 240, 255, 0.3); background: linear-gradient(180deg, rgba(6, 16, 54, 0.5), rgba(8, 40, 80, 0.55)); }
.sec-head.sub { margin-top: 48px; }
.sec-head.sub h2 { font-size: 40px; }
@media (max-width: 1100px) { .side { grid-template-columns: 1fr; } .side-scene { position: relative; top: 0; order: -1; height: 440px; } }
@media (max-width: 760px) { .page-head-in h1 { font-size: 56px; } }
.sum b .sub { display: block; font-size: 16px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }

/* the summary row: three numbers at most */
.sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 32px; }
.sum div { background: var(--glass); border: 2px solid transparent; border-radius: var(--r); padding: 16px 32px; }
.sum span { display: block; font-size: 16px; font-weight: 600; color: var(--ink-2); }
.sum b { display: block; font: 800 28px/1.2 "Text", sans-serif; margin-top: 4px; }
.sum b small { display: block; font-size: 16px; font-weight: 600; color: var(--ink-2); }
.sum div.glow { box-shadow: 0 0 26px rgba(210, 60, 255, 0.6); }
@media (max-width: 760px) { .sum { grid-template-columns: 1fr; } }

/* History: the pinned wall */
.why { margin-top: 12px; }
.wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pinned-card { background: var(--glass); border-radius: var(--r); padding: 24px 32px; display: grid; gap: 6px; }
.pinned-card .row { display: flex; align-items: center; gap: 10px; }
.pinned-card .disp { font-size: 28px; line-height: 1.1; }
.pinned-card p { font-size: 16px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pinned-card b { font-size: 18px; }
.pinned-card.fresh { animation: rowIn .8s ease-out; }
.wall .empty { grid-column: 1 / -1; padding: 24px; color: var(--ink-2); }
.more.bare { border-top: 0; }
@media (max-width: 1100px) { .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .wall { grid-template-columns: 1fr; } }

/* Your tabs: the lookup */
.city-head .scene.tower-city { height: clamp(420px, calc(100svh - var(--head-h) - var(--reh-h) - 290px), 520px); }
.city-head:has(.tower-city) .wrap { padding-top: 24px; padding-bottom: 16px; }
.city-head:has(.tower-city) h1 { font-size: 68px; }
.city-head:has(.tower-city) .look { padding: 24px 32px; gap: 10px; }
.look { display: grid; gap: 12px; margin-bottom: 32px; }
.look label { font-weight: 700; }
.look-row { display: flex; gap: 12px; }
.look input { flex: 1 1 auto; min-width: 0; height: 56px; padding: 0 20px; border-radius: 999px; color: var(--ink); font-size: 16px; background: linear-gradient(#0A1748, #0A1748) padding-box, var(--tube) border-box; border: 2px solid transparent; }
.look input::placeholder { color: #8FA3CC; }
.city-head .scene.tower-city .tower-label { font-size: 18px; padding: 10px 20px; }
.look-hint { font-size: 16px; color: var(--ink-2); }
.look-hint.bad { color: var(--orange); }
@media (max-width: 640px) { .look-row { flex-direction: column; } .look-row .key { width: 100%; } .look input { flex: none; width: 100%; } .city-head .scene.tower-city { height: 300px; } }

/* Rules: the calculator and its mini tower, the eight rules */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: stretch; }
.calc { display: grid; gap: 12px; align-content: start; min-width: 0; }
.calc h2 { font-size: 40px; line-height: 1.1; margin-bottom: 8px; }
.calc label { font-weight: 700; }
.calc input { height: 56px; padding: 0 20px; border-radius: 999px; color: #fff; font: 800 20px "Text", sans-serif; background: linear-gradient(#0A1748, #0A1748) padding-box, var(--tube) border-box; border: 2px solid transparent; min-width: 0; }
.calc-out { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.calc-out div { background: var(--glass-2); border-radius: 16px; padding: 12px 24px; min-width: 0; }
.calc-out span { display: block; font-size: 16px; color: var(--ink-2); font-weight: 600; }
.calc-out b { display: block; font: 800 22px/1.3 "Text", sans-serif; white-space: nowrap; }
.calc-out p { grid-column: 1 / -1; font-size: 16px; color: var(--ink-2); }
.formula { font-size: 16px; color: var(--cyan); background: var(--glass-2); border-radius: 16px; padding: 12px 20px; }
.calc-scene { display: flex; flex-direction: column; padding: 0; overflow: hidden; min-height: 460px; }
.calc-scene .scene { flex: 1; }
.calc-read { padding: 14px 24px; font-size: 16px; font-weight: 600; border-top: 1px solid rgba(138, 43, 226, 0.35); }
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } .calc-out { grid-template-columns: 1fr; } .calc-scene { min-height: 400px; } }

.rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; counter-reset: r; }
.rules li { counter-increment: r; display: grid; gap: 8px; align-content: start; transition: box-shadow .2s ease; }
.rules li h3 { font-size: 30px; line-height: 1.15; }
.rules li h3::before { content: counter(r) ". "; color: var(--lilac); -webkit-text-stroke: 0.12em #5B17C9; }
.rules li p { color: var(--ink-2); }
.rules li.lit { box-shadow: 0 0 0 2px var(--yellow), 0 0 30px rgba(255, 216, 74, 0.45); }
@media (max-width: 900px) { .rules { grid-template-columns: 1fr; } }

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.two .glass { display: grid; gap: 12px; align-content: start; }
.two h3 { font-size: 32px; }
.two p { color: var(--ink-2); }
.two .mono { color: var(--ink); word-break: break-all; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }

/* 404 */
.lost-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; min-height: calc(100svh - var(--head-h) - var(--reh-h) - 66px); padding-top: 32px; padding-bottom: 32px; }
.lost-copy { display: grid; gap: 16px; justify-items: start; }
.lost-copy h1 { font-size: 76px; line-height: 1; }
.lost-copy p { color: var(--ink-2); max-width: 44ch; }
.lost-scene { height: 480px; border-radius: 24px; overflow: hidden; border: 2px solid rgba(63, 240, 255, 0.3); }
@media (max-width: 900px) { .lost-wrap { grid-template-columns: 1fr; } .lost-copy h1 { font-size: 52px; } .lost-scene { height: 340px; } }

/* History and Your tabs: the head split, the title left, the numbers or the lookup right */
.head-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 600px); gap: 40px; align-items: center; }
.head-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.head-stats div { position: relative; background: var(--glass); border-radius: var(--r); padding: 20px 32px 24px; }
.head-stats div:last-child { grid-column: 1 / -1; }
.head-stats span { display: block; font-size: 16px; font-weight: 600; color: var(--ink-2); }
.head-stats b { display: block; font: 800 40px/1.15 "Text", sans-serif; margin-top: 4px; }
.head-stats b small { font-size: 18px; font-weight: 600; color: var(--ink-2); margin-left: 8px; }
.head-stats div.glow { box-shadow: 0 0 26px rgba(210, 60, 255, 0.6); }
.head-stats div::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; background: var(--tube); pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.head-split .look { margin-bottom: 0; }
@media (max-width: 1000px) { .head-split { grid-template-columns: 1fr; gap: 24px; } }
