@font-face {
  font-family: Chettan;
  src: url(../fonts/BalooChettan2.woff2) format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
:root {
  --ink: #17202b;
  --ink2: #56616c;
  --paper: rgba(255, 255, 255, 0.88);
  --line: rgba(23, 32, 43, 0.1);
  --gold: #e2b23a;
  --gold2: #c7952a;
  --green: #2f6b4f;
  --r: 22px;
  --sh: 0 10px 34px rgba(16, 26, 36, 0.18);
  --safeT: env(safe-area-inset-top, 0px);
  --safeB: env(safe-area-inset-bottom, 0px);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  background: #cfe3ee;
  color: var(--ink);
  font-family: Chettan, system-ui, sans-serif;
  overscroll-behavior: none;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
}
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}
.hide {
  display: none !important;
}
.glass {
  background: var(--paper);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: var(--sh);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15.5px;
  white-space: nowrap;
  transition:
    transform 0.15s,
    background 0.2s;
}
.pill:active {
  transform: scale(0.96);
}
.pill.dark {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--sh);
}
.pill.gold {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(160, 110, 10, 0.3);
}
.pill.line {
  border: 1.5px solid var(--line);
  background: #fff;
}
.round {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#ui > * {
  pointer-events: auto;
}

/* loader */
#loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(#bcd9ea, #e8efe6);
  z-index: 50;
  transition: opacity 0.6s;
}
#loader.out {
  opacity: 0;
  pointer-events: none;
}
.lw {
  text-align: center;
  width: min(320px, 80vw);
}
.logo {
  font-weight: 800;
  font-size: 44px;
  letter-spacing: 4px;
  line-height: 1;
}
.logo em,
.brand em {
  font-style: normal;
  color: var(--gold2);
}
.bar {
  height: 6px;
  border-radius: 9px;
  background: rgba(23, 32, 43, 0.12);
  margin: 22px 0 12px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 5%;
  background: var(--ink);
  border-radius: 9px;
  transition: width 0.3s;
}
.msg {
  font-size: 15px;
  color: var(--ink2);
}

/* top */
#top {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(12px + var(--safeT));
  padding: 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
}
#top > * {
  pointer-events: auto;
}
.brand {
  display: flex;
  flex-direction: column;
  padding: 8px 18px 7px;
  border-radius: 18px;
  line-height: 1.15;
}
.brand b {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.brand span {
  font-size: 13px;
  color: var(--ink2);
  font-weight: 600;
}
.topR {
  display: flex;
  gap: 8px;
}

/* search */
#searchWrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(74px + var(--safeT));
  width: min(460px, calc(100vw - 28px));
}
#search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 18px;
  border-radius: 999px;
}
#search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  font-size: 16.5px;
  font-weight: 600;
  min-width: 0;
}
#search input::placeholder {
  color: #7b858e;
  font-weight: 500;
}
#results {
  margin-top: 8px;
  border-radius: 18px;
  overflow: hidden;
  max-height: 50vh;
  overflow-y: auto;
}
#results button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 15.5px;
}
#results button:hover,
#results button.sel {
  background: rgba(226, 178, 58, 0.16);
}
#results small {
  margin-left: auto;
  color: var(--ink2);
  font-size: 13px;
}
#results .empty {
  padding: 16px;
  font-size: 15px;
  color: var(--ink2);
  line-height: 1.4;
}
.av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}

/* house card */
#card {
  position: fixed;
  right: 16px;
  top: calc(140px + var(--safeT));
  width: 340px;
  border-radius: var(--r);
  padding: 20px;
  max-height: calc(var(--vh) - 230px);
  overflow: auto;
}
#card .x {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(23, 32, 43, 0.06);
}
#card .no {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold2);
  text-transform: uppercase;
}
#card h2 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  margin: 4px 0 2px;
  word-break: break-all;
}
#card .sub {
  color: var(--ink2);
  font-size: 14.5px;
}
#card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
#card .tag {
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(23, 32, 43, 0.06);
}
#card .tag.f {
  background: var(--gold);
  color: var(--ink);
}
#card .nb {
  display: flex;
  gap: 8px;
  margin: 6px 0 14px;
}
#card .nb button {
  flex: 1;
  text-align: left;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(23, 32, 43, 0.05);
  font-size: 13px;
  line-height: 1.25;
  min-width: 0;
}
#card .nb b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
#card .acts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#card .acts .pill {
  justify-content: center;
  font-size: 14.5px;
  height: 44px;
  padding: 0 10px;
}
#card .acts .wide {
  grid-column: 1/3;
}
#card p {
  font-size: 15px;
  line-height: 1.45;
  margin: 10px 0;
}

/* milestones */
#mile {
  position: fixed;
  left: 16px;
  bottom: calc(84px + var(--safeB));
  width: 270px;
  border-radius: 18px;
  padding: 12px 14px;
  cursor: pointer;
}
#mile .h {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink2);
}
#mile .n {
  font-size: 16px;
  font-weight: 800;
  margin: 2px 0 8px;
}
#mile .tr {
  height: 7px;
  border-radius: 9px;
  background: rgba(23, 32, 43, 0.1);
  overflow: hidden;
}
#mile .tr i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold2), var(--gold));
  border-radius: 9px;
}
#mile ul {
  list-style: none;
  margin-top: 10px;
  display: none;
}
#mile.open ul {
  display: block;
}
#mile li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
  padding: 4px 0;
  border-top: 1px solid var(--line);
}
#mile li.ok {
  color: var(--green);
  font-weight: 700;
}

/* bottom bar */
#bottom {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + var(--safeB));
  display: flex;
  gap: 8px;
}

/* walk hud */
#walkHud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#walkHud > * {
  pointer-events: auto;
}
#stick {
  position: fixed;
  left: 28px;
  bottom: calc(28px + var(--safeB));
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  touch-action: none;
  display: grid;
  place-items: center;
}
#stick i {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--sh);
  transition: transform 0.08s;
}
#stick.on i {
  transition: none;
}
.wbtns {
  position: fixed;
  right: 16px;
  bottom: calc(22px + var(--safeB));
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.hint {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(74px + var(--safeT));
  padding: 9px 16px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.8s;
  white-space: nowrap;
}

/* studio */
#studio {
  position: fixed;
  right: 16px;
  top: calc(74px + var(--safeT));
  width: 320px;
  border-radius: var(--r);
  padding: 18px;
  max-height: calc(var(--vh) - 180px);
  overflow: auto;
}
#studio h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}
#studio .row {
  margin-top: 12px;
}
#studio .row > span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink2);
  text-transform: uppercase;
  letter-spacing: 1px;
}
#studio .opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
#studio .opts button {
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(23, 32, 43, 0.06);
  font-size: 14px;
  font-weight: 600;
}
#studio .opts button.on {
  background: var(--ink);
  color: #fff;
}
#studio .sw {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  padding: 0 !important;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--line);
}
#studio .sw.on {
  box-shadow: 0 0 0 2.5px var(--ink);
}
#studio .note {
  font-size: 13px;
  color: var(--ink2);
  margin-top: 12px;
  line-height: 1.4;
}

/* labels */
#labels {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.lab {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13.5px;
  padding: 5px 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(10, 20, 30, 0.2);
  transform-origin: 50% 100%;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
}
.lab:after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  margin-left: -6px;
  border: 6px solid transparent;
  border-bottom: 0;
  border-top-color: rgba(255, 255, 255, 0.92);
}
.lab b {
  color: var(--gold2);
  margin-right: 4px;
}
.lab.sel {
  background: var(--gold);
  font-size: 16px;
  padding: 7px 14px;
  z-index: 2;
}
.lab.sel:after {
  border-top-color: var(--gold);
}
.lab.sel b {
  color: var(--ink);
}
.lab.me {
  background: var(--ink);
  color: #fff;
}
.lab.me:after {
  border-top-color: var(--ink);
}
.lab.p {
  font-size: 12px;
  padding: 3px 9px;
  background: rgba(23, 32, 43, 0.78);
  color: #fff;
  pointer-events: none;
}
.lab.p:after {
  display: none;
}

/* modal */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 30, 0.42);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 16px;
}
#modal .sheet {
  width: min(420px, 100%);
  border-radius: 26px;
  padding: 24px;
  position: relative;
  max-height: calc(var(--vh) - 32px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.96);
}
#modal h2 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}
#modal p {
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--ink2);
  margin: 8px 0 14px;
}
#modal .x {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(23, 32, 43, 0.06);
}
.amts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.amts button {
  border-radius: 16px;
  padding: 12px 6px;
  background: rgba(23, 32, 43, 0.05);
  border: 2px solid transparent;
  text-align: center;
  line-height: 1.2;
}
.amts button b {
  display: block;
  font-size: 20px;
}
.amts button span {
  font-size: 12.5px;
  color: var(--ink2);
}
.amts button.on {
  border-color: var(--ink);
  background: #fff;
}
.payBtns {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.payBtns .pill {
  justify-content: center;
  height: 50px;
  font-size: 16px;
}
.fine {
  font-size: 12.5px;
  color: var(--ink2);
  margin-top: 12px;
  line-height: 1.4;
  text-align: center;
}

/* settings */
#settings {
  position: fixed;
  right: 14px;
  top: calc(68px + var(--safeT));
  width: 280px;
  border-radius: 20px;
  padding: 16px;
  z-index: 15;
}
#settings h4 {
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink2);
  margin: 6px 0;
}
#settings .seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(23, 32, 43, 0.06);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 12px;
}
#settings .seg button {
  padding: 7px 0;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
}
#settings .seg button.on {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
#settings label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  padding: 6px 0;
}
#settings .fps {
  font-size: 12.5px;
  color: var(--ink2);
  margin-top: 8px;
}
#settings a {
  color: var(--ink);
  font-weight: 700;
}

#toast {
  position: fixed;
  left: 50%;
  top: calc(134px + var(--safeT));
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 99px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--sh);
  max-width: calc(100vw - 32px);
  text-align: center;
  z-index: 30;
}

/* phones */
@media (max-width: 720px) {
  .pill span {
    font-size: 14.5px;
  }
  #supportBtn span {
    display: none;
  }
  #supportBtn {
    width: 46px;
    padding: 0;
    justify-content: center;
  }
  #card {
    left: 10px;
    right: 10px;
    width: auto;
    top: auto;
    bottom: calc(10px + var(--safeB));
    max-height: 62vh;
    border-radius: 24px;
    z-index: 6;
  }
  #mile {
    left: 10px;
    bottom: auto;
    top: calc(134px + var(--safeT));
    width: auto;
    max-width: 230px;
    padding: 9px 12px;
  }
  #mile .n {
    font-size: 14px;
    margin-bottom: 6px;
  }
  #bottom {
    width: calc(100vw - 20px);
    justify-content: center;
  }
  #bottom .pill {
    padding: 0 14px;
    height: 48px;
  }
  #cityBtn span {
    display: none;
  }
  .wbtns .pill span {
    display: none;
  }
  .wbtns .pill {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
  }
  .hint {
    font-size: 12.5px;
    white-space: normal;
    width: calc(100vw - 40px);
    text-align: center;
  }
  #studio {
    left: 10px;
    right: 10px;
    width: auto;
    top: auto;
    bottom: calc(170px + var(--safeB));
    max-height: 46vh;
  }
  #walkHud .hint {
    top: calc(128px + var(--safeT));
  }
}
@media (max-width: 720px) {
  body.walking #mile,
  body.walking #searchWrap {
    display: none;
  }
}
body.walking #bottom,
body.walking #mile {
  display: none;
}

/* ---------- game ---------- */
#top {
  justify-content: flex-start;
}
.topR {
  margin-left: auto;
}
#gameHud {
  display: flex;
  gap: 8px;
  align-items: center;
}
#gameHud .pill {
  height: 44px;
  padding: 0 14px;
  position: relative;
}
#gameHud .pill b {
  font-size: 16px;
}
#gameHud svg {
  color: var(--gold2);
}
#gameHud .dot {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e2483a;
  box-shadow: 0 0 0 2px #fff;
}
.rallyT {
  gap: 6px;
}
.rallyT span {
  font-variant-numeric: tabular-nums;
  min-width: 52px;
}
.rallyT small {
  opacity: 0.7;
  font-size: 12px;
}
.tasks {
  display: grid;
  gap: 8px;
  margin: 6px 0 4px;
}
.task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(23, 32, 43, 0.05);
}
.task > svg {
  width: 26px;
  height: 26px;
  color: var(--gold2);
}
.task div {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.task div b {
  display: block;
  font-size: 15.5px;
}
.task div span {
  font-size: 13.5px;
  color: var(--ink2);
}
.task .pill {
  height: 38px;
  padding: 0 14px;
  font-size: 14px;
}
.task.done {
  opacity: 0.6;
}
.task.done > svg:last-child {
  color: var(--green);
}
.payBtns.two {
  grid-template-columns: 1fr 1fr;
}
.shop {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}
.shop .item {
  padding: 12px;
  border-radius: 16px;
  background: rgba(23, 32, 43, 0.05);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.shop .item b {
  font-size: 15px;
}
.shop .item span {
  font-size: 12.5px;
  color: var(--ink2);
  margin-bottom: 8px;
}
.shop .item .pill {
  height: 36px;
  justify-content: center;
  font-size: 14px;
  margin-top: auto;
}
.board {
  list-style: none;
  margin: 4px 0 12px;
}
.board li {
  display: flex;
  justify-content: space-between;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
#modal h4 {
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink2);
  margin-top: 14px;
}
.rooms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 14px;
  max-height: 150px;
  overflow: auto;
}
.rooms button {
  padding: 6px 10px;
  border-radius: 99px;
  background: rgba(226, 178, 58, 0.18);
  font-size: 13.5px;
  font-weight: 600;
}
.rooms button b {
  margin-right: 6px;
  color: var(--gold2);
}
.rooms span {
  font-size: 14px;
  color: var(--ink2);
}
.pill.small {
  height: 34px;
  font-size: 13px;
  padding: 0 12px;
}
.about {
  font-size: 14px;
  line-height: 1.45;
}
#actBtn {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(40px + var(--safeB));
  height: 54px;
  padding: 0 26px;
  font-size: 17px;
}
#studio .x {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(23, 32, 43, 0.06);
}
#studio .sub {
  font-size: 14px;
  color: var(--ink2);
}
@media (max-width: 720px) {
  #gameHud .pill {
    height: 40px;
    padding: 0 11px;
  }
  .shop {
    grid-template-columns: 1fr 1fr;
  }
  #actBtn {
    bottom: calc(170px + var(--safeB));
  }
}

/* ---------- run, jump, speed ---------- */
.abtns {
  position: fixed;
  right: 150px;
  bottom: calc(24px + var(--safeB));
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.abtns button {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 11.5px;
  font-weight: 700;
  touch-action: none;
  user-select: none;
}
.abtns svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#jumpBtn {
  background: var(--ink);
  color: #fff;
}
#runBtn.on {
  background: var(--gold);
  color: var(--ink);
}
#jumpBtn .bl,
body.driving #jumpBtn .jl,
body.driving #runBtn {
  display: none;
}
body.driving #jumpBtn .bl {
  display: inline;
}
#speedo {
  position: fixed;
  left: 50%;
  bottom: calc(104px + var(--safeB));
  transform: translateX(-50%);
  display: none;
  align-items: baseline;
  gap: 4px;
  padding: 5px 15px;
  border-radius: 99px;
  font-variant-numeric: tabular-nums;
}
#speedo b {
  font-size: 23px;
}
#speedo small {
  font-size: 12px;
  color: var(--ink2);
}
body.driving #speedo {
  display: flex;
}
.lab.n {
  font-size: 12.5px;
  padding: 3px 11px;
  line-height: 1.2;
  text-align: center;
}
.lab.n small {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink2);
}
.lab.say {
  white-space: normal;
  width: 230px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 14px;
  line-height: 1.3;
  padding: 9px 13px;
  background: #fff;
  pointer-events: none;
}
.lab.say:after {
  border-top-color: #fff;
}
.lab.say b {
  display: block;
  font-size: 12px;
  margin: 0 0 2px;
  color: var(--gold2);
}

/* ---------- shop pictures + fitting room ---------- */
.shop .pic {
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 4px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 38%, #e9e2d3 0, #b9ae97 100%);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.shop .pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.shop .pic img:not([src]) {
  visibility: hidden;
}
.shop .item .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: auto;
}
.shop .item .row .pill {
  margin: 0;
  padding: 0 6px;
  font-size: 13px;
  min-width: 0;
}
.fit {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
  align-items: stretch;
}
.fitView {
  min-height: 360px;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #fff 0, #e6e0d2 80%);
}
.fitInfo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.fitInfo .seg {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(23, 32, 43, 0.06);
}
.fitInfo .seg button {
  flex: 1;
  height: 34px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13.5px;
}
.fitInfo .seg button.on {
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 26, 36, 0.14);
}
.fitActs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}
.fitActs .pill {
  justify-content: center;
  height: 46px;
}
@media (max-width: 720px) {
  .abtns {
    right: 80px;
    bottom: calc(22px + var(--safeB));
  }
  .abtns button {
    width: 58px;
    height: 58px;
  }
  .fit {
    grid-template-columns: 1fr;
  }
  .fitView {
    min-height: 300px;
  }
  #speedo {
    bottom: calc(232px + var(--safeB));
  }
}

/* ---------- KSRTC ---------- */
#busChip {
  position: fixed;
  left: 50%;
  top: calc(84px + var(--safeT));
  transform: translateX(-50%);
  padding: 7px 15px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
#tripHud {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safeB));
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 18px;
  border-radius: 20px;
  max-width: calc(100vw - 24px);
}
body.riding #tripHud {
  display: flex;
}
#tripHud small {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #a9241c;
}
#tripHud b {
  display: block;
  font-size: 16px;
  white-space: nowrap;
}
#tripHud span {
  display: block;
  font-size: 12.5px;
  color: var(--ink2);
  white-space: nowrap;
}
#tripHud .pill {
  height: 42px;
  flex: none;
}
body.riding #stick,
body.riding .wbtns,
body.riding .abtns,
body.riding #actBtn,
body.riding #walkHint,
body.riding #busChip,
body.riding #searchWrap {
  display: none !important;
}
#tripCard {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #07090c;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  animation: tripIn 1.1s ease both;
}
#tripCard.hide {
  display: none;
}
#tripCard small {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
}
#tripCard h2 {
  font-size: clamp(34px, 7vw, 66px);
  margin: 10px 0 8px;
}
#tripCard p {
  color: #c5c8cc;
}
@keyframes tripIn {
  from {
    opacity: 0;
  }
}
.fares {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}
.fare {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(23, 32, 43, 0.06);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
.fare b {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fare.short {
  opacity: 0.62;
}
.fare.short b {
  color: #a9241c;
}
.fare svg,
.pack svg,
.placeCard svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.packs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}
.pack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 8px 12px;
  border-radius: 16px;
  background: rgba(23, 32, 43, 0.06);
}
.pack b {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 21px;
}
.pack span {
  font-size: 12.5px;
  color: var(--ink2);
}
.pack i {
  font-style: normal;
  font-weight: 800;
  margin-top: 6px;
  padding: 4px 18px;
  border-radius: 99px;
  background: var(--ink);
  color: #fff;
}
.pack em {
  position: absolute;
  top: -6px;
  right: 8px;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--gold);
}
.places {
  display: grid;
  gap: 8px;
  margin: 8px 0;
}
.placeCard {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  background: rgba(23, 32, 43, 0.05);
}
.placeCard img {
  width: 112px;
  height: 74px;
  object-fit: cover;
  border-radius: 10px;
  background: #15120e;
}
.placeCard b,
.placeCard span {
  display: block;
}
.placeCard span {
  font-size: 13px;
  color: var(--ink2);
}
.placeCard small {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-weight: 700;
}

/* ---------- level ---------- */
.lv {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font:
    800 12px Chettan,
    system-ui,
    sans-serif;
}
.lvlCard {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin: 8px 0;
  padding: 11px 13px;
  border-radius: 16px;
  background: rgba(226, 178, 58, 0.17);
  text-align: left;
}
.lvlCard em {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold);
  font:
    800 20px Chettan,
    system-ui,
    sans-serif;
}
.lvlCard div {
  flex: 1;
  min-width: 0;
}
.lvlCard b {
  display: block;
  font-size: 16px;
}
.lvlCard span {
  display: block;
  font-size: 12.5px;
  color: var(--ink2);
}
.lvlCard .tr {
  height: 7px;
  margin-top: 5px;
  border-radius: 9px;
  background: rgba(23, 32, 43, 0.1);
  overflow: hidden;
}
.lvlCard .tr i {
  display: block;
  height: 100%;
  background: var(--gold2);
}
.perks {
  list-style: none;
  margin: 8px 0;
}
.perks li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line);
}
.perks span {
  flex: 1;
}
.perks i {
  font-style: normal;
  font-size: 12.5px;
  color: var(--green);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 6px 0 10px;
}
.stats div {
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(23, 32, 43, 0.05);
  text-align: center;
}
.stats b {
  display: block;
  font-size: 18px;
}
.stats span {
  font-size: 11.5px;
  color: var(--ink2);
}

/* ---------- phone held sideways: little height, plenty of width ---------- */
@media (max-height: 500px) {
  #top {
    top: 6px;
    left: 8px;
    right: 8px;
  }
  .brand {
    padding: 4px 11px;
  }
  .brand b {
    font-size: 15px;
  }
  .brand span {
    font-size: 11px;
  }
  #gameHud .pill,
  #supportBtn {
    height: 36px;
    padding: 0 11px;
    font-size: 13.5px;
  }
  #supportBtn span {
    display: none;
  }
  #menuBtn {
    width: 36px;
    height: 36px;
  }
  #searchWrap {
    top: 6px;
    width: min(250px, 30vw);
  }
  #search {
    height: 36px;
  }
  #bottom {
    bottom: 8px;
  }
  #bottom .pill {
    height: 38px;
    padding: 0 13px;
    font-size: 13.5px;
  }
  #mile {
    display: none;
  }
  #card {
    top: 48px;
    bottom: 8px;
    right: 8px;
    left: auto;
    width: 300px;
    max-height: none;
    overflow-y: auto;
  }
  body.walking #searchWrap,
  body.driving #searchWrap {
    display: none;
  }
  #stick {
    left: 14px;
    bottom: 12px;
    width: 104px;
    height: 104px;
  }
  .wbtns {
    right: 8px;
    bottom: 8px;
    top: 48px;
    gap: 5px;
    justify-content: flex-end;
  }
  .wbtns .pill {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }
  .wbtns .pill span {
    display: none;
  }
  .abtns {
    right: 58px;
    bottom: 10px;
    gap: 8px;
  }
  .abtns button {
    width: 62px;
    height: 62px;
  }
  .hint {
    display: none;
  }
  #actBtn {
    bottom: 12px;
    height: 44px;
    padding: 0 20px;
    font-size: 15px;
  }
  #speedo {
    bottom: auto;
    top: 8px;
  }
  #busChip {
    top: 8px;
    font-size: 13px;
    padding: 5px 12px;
  }
  #tripHud {
    bottom: 8px;
    padding: 6px 8px 6px 14px;
  }
  #modal .sheet {
    width: min(640px, calc(100vw - 20px));
    max-height: calc(100dvh - 14px);
    padding: 16px 18px;
    overflow-y: auto;
  }
  .shop {
    grid-template-columns: repeat(4, 1fr);
  }
  .packs {
    grid-template-columns: repeat(4, 1fr);
  }
  .fit {
    grid-template-columns: 240px 1fr;
  }
  .fitView {
    min-height: 240px;
  }
  .fares {
    grid-template-columns: 1fr 1fr;
  }
  .stats {
    margin-bottom: 6px;
  }
  #studio {
    top: 48px;
    bottom: 8px;
    right: 56px;
    left: auto;
    width: 320px;
    max-height: none;
    overflow-y: auto;
  }
  .lab {
    font-size: 11.5px;
    padding: 3px 9px;
  }
  .lab.say {
    width: 210px;
    font-size: 12.5px;
  }
}

.codeIn {
  width: 100%;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.codeIn:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

/* touch driving: wheel on the left, pedals on the right */
#wheel,
#pedals {
  display: none;
}
body.touch.driving #stick,
body.touch.driving .abtns {
  display: none;
}
body.touch.driving #wheel {
  display: block;
  position: fixed;
  left: 22px;
  bottom: calc(22px + var(--safeB));
  width: 148px;
  height: 148px;
  color: #f4f1ea;
  touch-action: none;
  user-select: none;
}
#wheel svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
  will-change: transform;
}
body.touch.driving #pedals {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  position: fixed;
  right: 74px; /* clear of the emote buttons */
  bottom: calc(22px + var(--safeB));
}
#pedals button {
  width: 78px;
  height: 104px;
  border-radius: 14px;
  background: rgba(23, 32, 43, 0.86);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  touch-action: none;
  user-select: none;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35);
}
#pedals #gasPedal {
  height: 128px;
  background: #1f7a5c;
}
#pedals #brakePedal {
  background: #a8322c;
}
#pedals button.on {
  transform: translateY(4px) scale(0.97);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  filter: brightness(1.2);
}
@media (max-height: 500px) {
  body.touch.driving #wheel {
    width: 124px;
    height: 124px;
  }
  #pedals button {
    width: 68px;
    height: 84px;
  }
  #pedals #gasPedal {
    height: 104px;
  }
}

/* Ammu */
#guide {
  position: fixed;
  z-index: 40;
  left: 16px;
  bottom: calc(84px + var(--safeB));
  display: flex;
  gap: 12px;
  width: min(380px, calc(100vw - 32px));
  padding: 14px;
  border-radius: 18px;
  background: rgba(251, 248, 241, 0.97);
  color: var(--ink);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}
.gFace {
  flex: 0 0 58px;
}
.gFace svg {
  display: block;
  width: 58px;
  height: 58px;
}
.gBody {
  flex: 1;
  min-width: 0;
}
.gBody b {
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #a4792a;
}
.gBody p {
  margin: 2px 0 8px;
  font-size: 15px;
  line-height: 1.35;
}
.gFoot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink2);
}
.gFoot span {
  margin-right: auto;
}
.gFoot button {
  padding: 7px 13px;
  border-radius: 99px;
  font-weight: 700;
}
.gFoot .next {
  background: var(--ink);
  color: #fff;
}
.guideOn {
  outline: 3px solid #e2b23a;
  outline-offset: 3px;
  animation: guidePulse 1.3s ease-in-out infinite;
}
@keyframes guidePulse {
  50% {
    outline-offset: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .guideOn {
    animation: none;
  }
}
@media (max-height: 500px) {
  #guide {
    top: calc(60px + var(--safeT));
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    width: min(460px, calc(100vw - 32px));
    padding: 10px 12px;
  }
}

/* phone browsers show and hide their toolbars, so use the height that is really visible */
:root {
  --vh: 100vh;
}
@supports (height: 100dvh) {
  :root {
    --vh: 100dvh;
  }
}
html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}
/* iPhones zoom the whole page into any text box smaller than this, and it stays zoomed */
@media (pointer: coarse) {
  input {
    font-size: 16px !important;
  }
}
/* upright phones: the wheel and pedals share the bottom of the screen */
@media (orientation: portrait) and (max-width: 720px) {
  body.touch.driving #wheel {
    left: 12px;
    width: 132px;
    height: 132px;
  }
  body.touch.driving #pedals {
    right: 12px;
    gap: 10px;
  }
  #pedals button {
    width: 72px;
    height: 96px;
  }
  #pedals #gasPedal {
    height: 118px;
  }
}

.onTouch,
body.touch .onKeys {
  display: none;
}
body.touch .onTouch {
  display: inline;
}
/* while driving on a phone the wheel, pedals and Get out are all you need */
body.touch.driving .wbtns,
body.touch.driving #exitWalk {
  display: none;
}
/* the top bar on an upright phone stays on one line, whatever the width */
@media (orientation: portrait) and (max-width: 720px) {
  .brand {
    flex: 0 1 auto;
    min-width: 0;
    padding: 6px 11px;
  }
  .brand b {
    font-size: 13.5px;
    white-space: nowrap;
  }
  .brand span {
    display: block;
    font-size: 11px;
    white-space: nowrap;
  }
  #top {
    gap: 6px;
  }
  #gameHud {
    flex: none;
  }
}
/* the smallest phones */
@media (max-width: 380px) {
  .brand b {
    font-size: 12.5px;
  }
  .brand span {
    font-size: 10px;
  }
  #gameHud .pill {
    padding: 0 8px;
  }
  #bottom .pill {
    padding: 0 12px;
  }
  #bottom .pill span {
    font-size: 13px;
  }
  .topR {
    gap: 6px;
  }
  #top .round,
  #supportBtn {
    width: 40px;
    height: 40px;
  }
}

/* the search stays reachable: above name tags, and typeable on iPhones */
#searchWrap {
  z-index: 12;
}
input {
  -webkit-user-select: text;
  user-select: text;
}
#findBtn {
  display: none;
}
body.walking #findBtn {
  display: grid;
  place-items: center;
}
body.riding #findBtn,
body.walking #searchWrap {
  display: none;
}
#findBtn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* real players */
.lab.live {
  padding-left: 22px;
  pointer-events: auto;
  cursor: pointer;
}
.lab.live:before {
  content: '';
  position: absolute;
  left: 9px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: #21b26b;
  box-shadow: 0 0 0 2px rgba(33, 178, 107, 0.3);
}
.sayList {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.sayList .pill {
  height: 38px;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 700;
}
