@font-face {
  font-family: Inter;
  src: url("inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #101e24;
  --line: #30474c;
  --muted: #b1c3bf;
  --cream: #f7f3e7;
  --green: #aff0c4;
  --gold: #ffaf6e;
  font-family: Inter, system-ui, sans-serif;
  color: var(--cream);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 58px; padding: 0 clamp(12px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 19px; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: #342a26; color: var(--gold); font-size: 13px; }
.ig { color: var(--cream); text-decoration: none; padding: 10px 0 10px 10px; font-size: 13px; font-weight: 650; }
.ig span { color: var(--green); }

main { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
#lookup { padding: 8px clamp(10px, 3vw, 36px); border-bottom: 1px solid var(--line); }
.form-row { display: flex; gap: 7px; max-width: 520px; margin: auto; }
.form-row input { flex: 1; min-width: 0; border: 1px solid #4a6369; border-radius: 9px; background: #17292f; color: var(--cream); padding: 0 11px; min-height: 44px; font-size: 16px; }
.form-row input::placeholder { color: var(--muted); opacity: 1; }
.form-row button { border: 0; border-radius: 9px; background: var(--green); color: #132c22; font-weight: 750; padding: 0 13px; font-size: 13px; white-space: nowrap; }
#lookup-status { max-width: 520px; margin: 6px auto 0; color: var(--muted); font-size: 13px; }

.world { min-width: 0; position: relative; overflow: hidden; background: #0b2836; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#view:active { cursor: grabbing; }
.world-top, .world-bottom { position: absolute; z-index: 2; pointer-events: none; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: flex-start; }
.world-top { top: 12px; }
.world-bottom { bottom: 10px; align-items: flex-end; }
.map-title, .view-switch, .zoom, .world-bottom p, .detail { background: #102830ed; border: 1px solid #58766f; border-radius: 9px; }
.map-title { padding: 9px 11px; font-size: 12px; font-weight: 700; color: #e1f3e8; }
.pin-dot { display: inline-block; margin-right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.view-switch, .zoom { pointer-events: auto; display: flex; gap: 2px; padding: 3px; }
.view-switch button, .zoom button { border: 0; border-radius: 6px; background: transparent; color: var(--cream); min-width: 44px; min-height: 40px; padding: 5px 8px; font-size: 13px; }
.view-switch button[aria-pressed=true], .zoom button:hover { background: #36534b; color: var(--green); }
.zoom button { font-size: 19px; }
.world-bottom p { margin: 0; padding: 7px 9px; font-size: 11px; color: var(--muted); }
.world-bottom p span { color: var(--green); }

.markers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.marker { position: absolute; left: 0; top: 0; pointer-events: auto; background: #122c32f5; color: #effce9; white-space: nowrap; border: 1px solid #91c6a6a0; border-radius: 100px; padding: 5px 9px; font-size: 11px; box-shadow: 0 3px 12px #0006; }
.marker::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: var(--gold); vertical-align: 1px; }
.building-marker { z-index: 2; border-radius: 7px; padding: 5px 9px; font-size: 13px; font-weight: 750; line-height: 16px; text-align: center; }
.building-marker::before { display: none; }
.building-marker::after { content: ""; position: absolute; top: 100%; left: calc(50% + var(--anchor-x, 0px)); height: var(--stem-height, 10px); border-left: 1px solid #b4ebc6; pointer-events: none; }
.building-marker small { display: block; color: #ffda9b; font-size: 11px; line-height: 16px; font-weight: 650; }
.building-marker:hover, .building-marker:focus-visible { border-color: var(--green); }
.house-marker { font-size: 12px; font-weight: 650; border-radius: 6px; }
.house-marker::before { display: none; }
.house-marker::after { content: ""; position: absolute; left: 50%; top: 100%; height: 6px; border-left: 1px solid #ddffdf; }
.selected-house { background: var(--green); color: #132c22; border-color: #d8ffe4; z-index: 1; }
.detail { position: absolute; left: 14px; bottom: 63px; z-index: 2; padding: 8px 10px; max-width: min(330px, calc(100% - 28px)); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.detail strong { display: block; color: var(--cream); font-size: 14px; }
.fallback { position: absolute; inset: 0; background: #0b2836 center/contain no-repeat; }
.fallback p { position: absolute; bottom: 54px; left: 15px; background: #0a2028; padding: 8px; border-radius: 5px; }

.places-bar { min-width: 0; border-top: 1px solid var(--line); }
#places { display: flex; gap: 6px; overflow-x: auto; padding: 5px 10px max(5px, env(safe-area-inset-bottom)); }
.place { flex: 0 0 auto; min-height: 40px; background: #17292f; color: var(--cream); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.place:hover, .place[aria-pressed=true] { background: #26433e; border-color: #7a9d88; }
.explore-button { position:absolute; z-index:3; left:50%; bottom:20px; transform:translateX(-50%); background:var(--green); color:#132c22; min-height:46px; border:1px solid #d2ffe0; padding:0 19px; border-radius:10px; box-shadow:0 4px 18px #0619199c; font-weight:750; white-space:nowrap; }
.walking .explore-button { display:none; }
#join-dialog { color:var(--cream); background:#142a32; border:1px solid #55736c; border-radius:14px; width:min(370px,calc(100% - 32px)); padding:22px; }
#join-dialog::backdrop { background:#07141ac4; }
#join-dialog h2 { margin:0 0 16px; font-size:22px; }
#join-dialog label { display:block; margin-bottom:6px; font-weight:650; }
#visitor-name { width:100%; min-height:45px; padding:8px 10px; color:var(--cream); background:#0e2027; border:1px solid #58766f; border-radius:8px; font-size:16px; }
#join-dialog p { color:var(--muted); margin:8px 0 16px; font-size:13px; }
.join-actions { display:flex; justify-content:flex-end; gap:8px; }
.join-actions button { min-height:44px; border-radius:8px; padding:0 12px; border:1px solid #58766f; color:var(--cream); background:#102830; font-weight:650; }
.join-actions button[type=submit] { background:var(--green); color:#132c22; }
#player-labels { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.player-label { position:absolute; top:0; left:0; padding:3px 7px; border-radius:5px; border:1px solid #6e9c8a; background:#122c32f5; color:var(--cream); font-size:12px; font-weight:700; white-space:nowrap; }
.walking .world-bottom { display: none; }
.walk-tip, .touch-tip { position: absolute; bottom: 13px; right: 12px; background: #102830ed; border: 1px solid #58766f; border-radius: 8px; padding: 8px 10px; font-size: 12px; pointer-events: none; }
.touch-tip { display: none; }
#walk-stick { position:absolute; z-index:3; bottom:14px; left:14px; display:none; width:118px; height:118px; border:1px solid #8cdab1aa; border-radius:50%; background:radial-gradient(circle,#102830df 0 60%,#294842e8 61%); box-shadow:0 5px 20px #0006; touch-action:none; user-select:none; -webkit-user-select:none; }
#walk-stick span { position:absolute; top:50%; left:50%; width:48px; height:48px; margin:-24px; border-radius:50%; background:#9bdcb9; border:1px solid #d7ffeb; box-shadow:0 3px 12px #0008; pointer-events:none; }
@media (pointer: coarse), (max-width: 760px) {
  #walk-stick { display:block; }
  .walk-tip { display: none; }
  .touch-tip { display: block; bottom: 143px; left: 14px; right: auto; }
}
@media (min-width: 761px) { #places { justify-content: safe center; } }
@media (max-width: 760px) {
  .explore-button { bottom:63px; }
  .top { min-height: 46px; }
  .brand { font-size: 17px; }
  .world-top, .world-bottom { left: 8px; right: 8px; }
  .world-top { top: 8px; }
  .world-bottom { bottom: 8px; justify-content: flex-end; }
  .world-bottom p { display: none; }
  .detail { left: 8px; bottom: 61px; }
  .view-switch button, .zoom button { min-height: 44px; }
  #places { scrollbar-width: thin; }
}

/* Lobby and in-game controls */
#game-shell { display:flex; flex:1; min-height:0; flex-direction:column; }
.in-lobby #game-shell { visibility:hidden; }
.lobby { position:fixed; inset:0; z-index:10; overflow:auto; background:#102930; }
.lobby-art, .lobby-art img, .lobby-shade { position:fixed; inset:0; width:100%; height:100%; }
.lobby-art img { object-fit:cover; object-position:62% 50%; }
.lobby-shade { background:radial-gradient(ellipse at 50% 50%,#061917e8 0%,#081c19b5 36%,transparent 86%),linear-gradient(0deg,#061411b3,transparent 42%); }
.lobby-content { position:relative; z-index:1; display:grid; grid-template-rows:auto 1fr auto; place-items:center; text-align:center; gap:clamp(16px,3vh,32px); min-height:100%; padding:max(29px,env(safe-area-inset-top)) max(6vw,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(6vw,env(safe-area-inset-left)); }
.lobby-brand { width:clamp(224px,23vw,300px); }
.lobby-brand img { display:block; width:100%; height:auto; filter:drop-shadow(0 4px 12px #061513a0); }
.lobby-main { width:100%; }
.lobby-main h1 { margin:0; font-size:clamp(48px,6.8vw,96px); font-weight:800; letter-spacing:-.058em; line-height:.98; }
.lobby-main h1 em { color:#f6bd79; font-style:normal; }
.lobby-main > p { margin:22px 0 26px; color:#e9eee2; font-size:clamp(15px,1.5vw,20px); }
#join-form { display:grid; max-width:410px; margin-inline:auto; gap:9px; }
#join-form label { font-size:13px; font-weight:750; color:#f5f3ec; }
#visitor-name { min-height:52px; border-color:#8faf95aa; padding:0 15px; background:#0a211fed; border-radius:9px; text-align:center; }
#visitor-name::placeholder { color:#b0c3b8; }
#enter-world { position:relative; display:grid; place-items:center; background:#f5bf78; border:1px solid #ffdb9f; border-radius:9px; padding:0 38px; min-height:53px; color:#21251a; font-size:16px; font-weight:800; box-shadow:0 6px 0 #83633f5e; }
#enter-world span { position:absolute; inset-inline-end:16px; }
#enter-world:hover { background:#ffce8c; }
#enter-world:active { transform:translateY(2px); }
#join-note, #join-status { margin:4px 0 0; color:#d3e2d4; font-size:12px; }
.lobby-controls { color:#dce6d8; font-size:13px; }
kbd { display:inline-block; min-width:25px; padding:4px 6px; margin-right:4px; border:1px solid #849b86; border-radius:4px; background:#213a2d; color:#f9f3df; font:700 10px/1 Inter,system-ui,sans-serif; text-align:center; }
.lobby-controls kbd:not(:first-child), .walk-tip kbd:not(:first-child) { margin-left:12px; }
.mobile-only,.touch-actions { display:none; }
.walk-tip { color:#edf4e6; }
.walk-tip > span { margin-left:14px; color:#bdd3c8; }
.walking .detail { bottom:61px; }
body.in-game .top { min-height:46px; }
body.in-game #lookup { display:none; }
body.in-game main { grid-template-rows:minmax(0,1fr) auto; }
body.in-game .map-title { background:#0d2527dc; }
body.in-game .pin-dot { box-shadow:0 0 8px #9dffc268; }
.world.walking { background:linear-gradient(180deg,#83b0c7 0%,#adc9ce 24%,#e2dbc4 56%,#567d84 77%); }
@media (pointer:coarse), (max-width:760px) {
  .keyboard-only { display:none; }
  .mobile-only { display:inline; }
  #walk-stick { width:108px; height:108px; left:max(14px,env(safe-area-inset-left)); bottom:14px; background:radial-gradient(circle,#102c31a8 0 56%,#294842da 57%); }
  #walk-stick span { width:44px; height:44px; margin:-22px; background:#b5e4ca; }
  .touch-actions { position:absolute; z-index:3; display:flex; align-items:flex-end; gap:9px; right:max(14px,env(safe-area-inset-right)); bottom:14px; }
  .touch-actions button { touch-action:none; user-select:none; width:58px; height:58px; border-radius:50%; border:1px solid #afdfc6; background:#163839eb; color:#eefff2; font-size:13px; font-weight:800; box-shadow:0 5px 13px #05121570; }
  .touch-actions button[data-held], .touch-actions button:active { background:#a4e2bb; color:#142c25; }
  #walk-jump { display:grid; place-content:center; width:68px; height:68px; font-size:23px; line-height:1; }
  #walk-jump span { font-size:11px; margin-top:3px; }
  .walking .detail { bottom:134px; }
  body.in-game #places { padding-bottom:max(5px,env(safe-area-inset-bottom)); }
  #places { scrollbar-width:none; }
}
@media (max-width:700px) {
  .lobby-art img { height:66%; object-position:center 38%; }
  .lobby-shade { background:linear-gradient(180deg,#04191642,transparent 19%,#081c1960 33%,#081a17f0 59%,#081a17 100%); }
  .lobby-content { grid-template-rows:auto 1fr auto; align-items:end; padding-left:max(24px,env(safe-area-inset-left)); padding-right:max(24px,env(safe-area-inset-right)); gap:22px; }
  .lobby-brand { align-self:start; justify-self:center; width:clamp(208px,60vw,276px); }
  .lobby-main h1 { font-size:clamp(36px,12vw,62px); }
  .lobby-main h1 em { display:block; }
  .lobby-main > p { margin:16px 0 20px; }
}
@media (max-height:620px) and (orientation:landscape) {
  .lobby-content { gap:12px; padding-top:12px; padding-bottom:12px; }
  .lobby-brand { width:clamp(116px,28vh,165px); }
  .lobby-main h1 { font-size:clamp(32px,9vh,58px); }
  .lobby-main > p { margin:8px 0 12px; }
  #visitor-name, #enter-world { min-height:44px; }
}

main { grid-template-rows:minmax(0,1fr) auto; }
#vehicle-action { position:absolute; z-index:4; left:50%; bottom:24px; transform:translateX(-50%); min-height:46px; white-space:nowrap; padding:0 17px; border:1px solid #ffdb9f; border-radius:9px; background:#f5bf78; color:#18231c; font-weight:800; box-shadow:0 3px 10px #06161583; }
.drive-tip { display:none; }
.driving .walk-tip:not(.drive-tip) { display:none; }
.driving #walk-jump { display:none; }
@media (pointer:fine) and (min-width:761px) {
  .driving .drive-tip { display:block; }
}
@media (pointer:coarse), (max-width:760px) {
  #vehicle-action { bottom:129px; }
  .walking:has(#vehicle-action:not([hidden])) .detail { bottom:183px; }
}
.top-actions { display:flex; align-items:center; gap:14px; }
#find-home, #home-form button {
  color:#172529; background:#ffd18a; border:0; border-radius:9px;
  min-height:38px; padding:0 12px; font:inherit; font-weight:750; cursor:pointer;
}
#home-dialog {
  box-sizing:border-box; width:min(620px,calc(100vw - 24px)); max-height:calc(100dvh - 24px);
  max-width:none; padding:18px; border:1px solid #4b6467; border-radius:18px;
  color:#edf6f4; background:#14252a; box-shadow:0 24px 80px #000a; overflow:auto;
}
#home-dialog::backdrop { background:#061319c9; }
.home-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.home-heading h2 { margin:0; font-size:1.4rem; }
#home-close { width:42px; height:42px; border:1px solid #526a6a; border-radius:10px; color:inherit; background:#20363a; font-size:1.45rem; cursor:pointer; }
#home-form label { display:block; font-size:.86rem; margin-bottom:7px; }
.home-input { display:flex; gap:8px; }
#home-name { flex:1; min-width:0; min-height:44px; background:#0e1c20; color:inherit; border:1px solid #526a6a; border-radius:9px; padding:0 12px; font:inherit; font-size:16px; }
#home-status { margin:10px 0; font-size:.88rem; color:#d5e4df; }
#home-status:empty { display:none; }
#home-map { display:block; width:100%; height:min(48dvh,390px); min-height:155px; border-radius:10px; }
#home-map[hidden], .home-legend[hidden] { display:none; }
.home-legend { display:flex; justify-content:center; gap:16px; margin-top:10px; font-size:.82rem; }
.home-legend i { display:inline-block; width:9px; height:9px; border-radius:50%; background:#80e9fb; }
.home-legend span+span i { background:#ffd18a; }
@media (max-width:480px) {
  .top-actions { gap:8px; }
  #find-home { font-size:.78rem; padding-inline:9px; }
  .top-actions .ig { display:none; }
  #home-dialog { padding:14px; }
}
#mini-map {
  position:absolute; z-index:2; top:62px; right:14px; width:156px;
  border:1px solid #63797a; border-radius:12px; overflow:hidden;
  background:#14252aeb; color:#edf6f4; box-shadow:0 4px 18px #091d245f;
}
#mini-map-view { display:block; width:100%; height:auto; aspect-ratio:1.21; }
.mini-map-caption {
  display:flex; justify-content:space-between; align-items:center;
  min-height:26px; padding:0 7px 0 9px; font-size:.72rem; font-weight:700;
}
#mini-map-clear { border:0; background:none; color:inherit; min-width:30px; min-height:30px; font-size:1rem; }
@media (max-width:760px) {
  #mini-map { top:53px; right:8px; width:clamp(105px,27vw,143px); }
}
.top-actions .ig { display:none; }
#open-menu { min-height:38px;padding:0 12px;border:1px solid #58766f;border-radius:9px;background:#173037;color:#f7f3e7;font-weight:750; }
#mini-map-open { width:100%;display:block;border:0;padding:0;background:none; }
#mini-map-open:focus-visible { outline-offset:-3px; }
.game-dialog {
  box-sizing:border-box;width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 24px);
  padding:18px;border:1px solid #4b6467;border-radius:18px;color:#edf6f4;background:#14252a;overflow:auto;
}
.game-dialog::backdrop { background:#061319c9; }
.dialog-close { width:42px;height:42px;border:1px solid #526a6a;border-radius:10px;color:inherit;background:#20363a;font-size:1.45rem; }
#game-menu h3 { font-size:.95rem; margin:14px 0 8px; }
#game-menu #places { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:0; }
#game-menu .place { min-height:42px;white-space:normal; }
.sound-settings label { display:flex;align-items:center;gap:10px;min-height:39px; }
.sound-settings input { width:20px;height:20px;accent-color:#ffcc82; }
.menu-instagram { display:inline-block;margin-top:14px;color:#e2bd80; }
#players-map { width:min(850px,calc(100vw - 20px)); }
#players-map-view { display:block;width:100%;height:min(61dvh,560px);min-height:220px;border-radius:11px; }
.map-key { display:flex;gap:16px;margin-top:9px;font-size:.8rem; }
.map-key i { display:inline-block;background:#53caff;width:9px;height:9px;border-radius:50%; }
.map-key span+span i { background:#ffdc64; }
#map-player-list { list-style:none;display:flex;flex-wrap:wrap;gap:6px 11px;padding:0;margin:8px 0 0;font-size:.8rem;max-height:72px;overflow:auto; }
#fleet-status { position:absolute;z-index:3;left:50%;bottom:calc(28% + 58px);transform:translateX(-50%);background:#14252adf;color:white;border:1px solid #65817c;border-radius:9px;padding:5px 9px;font-size:12px;font-weight:700;pointer-events:none;white-space:nowrap; }
.passenger :is(#walk-stick,.touch-actions,.walk-tip) { display:none; }
@media(max-width:480px) {
  #open-menu { padding-inline:8px;font-size:.78rem; }
  .top-actions { gap:5px; }
}
