/* Долгое нажатие на телефоне не выделяет текст и не показывает «Скопировать / Найти / Перевести». */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
/* Двойное касание не увеличивает страницу (особенно в браузере внутри Instagram). */
html, body, button, input, .sheet, .social-bar, .walk-hud { touch-action: manipulation; }
#city { touch-action: none; }
input, textarea { -webkit-user-select: text; user-select: text; }

#labels { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }

/* Золотая монетка (вместо серого смайлика 🪙) */
.coin-icon {
  display: inline-block;
  position: relative;
  width: 1em;
  height: 1em;
  margin: 0 0.08em;
  border-radius: 50%;
  vertical-align: -0.16em;
  background: radial-gradient(circle at 34% 30%, #fff6c4 0 14%, #ffd84a 36%, #f2b51c 66%, #c98a0c 100%);
  box-shadow: inset 0 0 0 0.07em #b97c0a, 0 0.04em 0 rgba(0, 0, 0, .18);
  font-style: normal;
}
.coin-icon::after {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  border: 0.06em solid rgba(160, 105, 8, .55);
}
.nick {
  position: absolute;
  left: 0;
  top: 0;
  padding: 2px 8px;
  border-radius: 9px;
  background: var(--paper);
  border: 1px solid rgba(35, 48, 74, .75);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  will-change: transform;
}
.nick.mine { background: var(--tomato); color: #fff; }
.nick.leader { background: var(--sun); }
/* Мэр недели: золотой ник и звезда до конца срока. */
.nick.gold, .nick.player.gold { background: linear-gradient(180deg, #ffe680, #f2c230 55%, #d9a514); color: #4a3200; border: 2px solid #8a6400; font-size: 12px; font-weight: 800; box-shadow: 0 0 10px rgba(242, 194, 48, .8); }
.nick.gold::after { content: ' ★'; color: #fff6c2; -webkit-text-stroke: .6px #8a6400; }
.gold-text { color: #b8860b; }

.rooms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.room-pick { border: var(--line); border-radius: 11px; background: #fff; padding: 8px 5px; text-align: center; }
.room-pick b { display: block; font-size: 13px; }
.room-pick small { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; margin-top: 2px; }
.room-pick[aria-checked="true"] { background: var(--sun); box-shadow: inset 0 0 0 2px var(--ink); }
.mayor-history { margin: 12px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.mayor-history li { margin-top: 3px; }

.inside-hud { display: none; position: fixed; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; justify-content: space-between; align-items: center; gap: 10px; }
.inside-hud b { background: var(--paper); border: var(--line); border-radius: 12px; box-shadow: var(--hard); padding: 9px 12px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inside-hud .btn { padding: 10px 14px; flex: none; }
body[data-mode="inside"] .inside-hud { display: flex; }
body[data-mode="inside"] #labels { display: none; }
body[data-mode="inside"] .walk-hud { display: block; }
body[data-mode="inside"] .walk-top,
body[data-mode="inside"] .online,
body[data-mode="inside"] #tableBtn { display: none; }
.inside-tools { display: flex; gap: 6px; flex: none; }

.move-btn { display: none; position: fixed; bottom: calc(66px + var(--safe-b)); width: 68px; height: 68px; padding: 0; border: var(--line); border-radius: 50%; background: var(--paper); box-shadow: var(--hard); font: 800 14px var(--head); touch-action: none; }
#jumpBtn { right: 22px; background: var(--sun); }
#runBtn { right: 100px; }
#runBtn[aria-pressed="true"] { background: var(--tomato); color: #fff; }
@media (pointer: coarse) { .move-btn { display: block; } body[data-mode="drive"] .move-btn { display: none; } }

.emote { position: absolute; left: 0; top: 0; font-size: 34px; line-height: 1; will-change: transform; }
.emote-panel { position: fixed; left: 50%; transform: translateX(-50%); top: calc(110px + var(--safe-t)); z-index: 3; display: grid; grid-template-columns: repeat(4, 46px); gap: 4px; padding: 6px; background: var(--paper); border: var(--line); border-radius: 14px; box-shadow: var(--hard); }
.land .emote-panel { top: calc(112px + var(--safe-t)); grid-template-columns: repeat(6, 44px); }
.emote-pick { height: 44px; padding: 0; border: 0; border-radius: 10px; background: none; font-size: 26px; line-height: 1; }
.emote-pick:active { background: #f3e9d3; }
body:not([data-mode="walk"]):not([data-mode="drive"]) .emote-panel { display: none; }

/* Планшет для кода от двери */
.pad-wrap { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(35, 48, 74, .5); }
.tablet { padding: 12px; border-radius: 26px; background: var(--ink); box-shadow: 0 8px 0 rgba(0, 0, 0, .28); }
.tablet.shake { animation: pad-shake .32s; }
@keyframes pad-shake { 25% { transform: translateX(-9px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-5px); } }
@media (prefers-reduced-motion: reduce) { .tablet.shake { animation: none; outline: 3px solid var(--tomato); } }
.tablet-screen { position: relative; width: 236px; padding: 12px; border-radius: 15px; background: linear-gradient(#e3f4f8, #fffaf0); text-align: center; }
.pad-close { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(35, 48, 74, .12); font-size: 19px; line-height: 1; }
.pad-title { margin: 3px 34px 7px; font: 800 14px/1.2 var(--head); overflow-wrap: anywhere; }
.pad-dots { display: flex; justify-content: center; gap: 13px; margin-bottom: 9px; }
.pad-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.pad-dots i.on { background: var(--ink); }
.pad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pad-key { height: 44px; border: var(--line); border-radius: 12px; background: #fff; box-shadow: 0 2px 0 var(--ink); font: 800 19px var(--head); }
.pad-key:active { transform: translateY(2px); box-shadow: none; }
.home-sheet { z-index: 5; }

/* Клавиатура внутри игры */
.kbd { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: var(--kbd-h); display: flex; flex-direction: column; gap: 4px; padding: 5px 44px; background: var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; }
.kbd-row { flex: 1; display: flex; gap: 4px; min-height: 0; }
.kbd button { flex: 1 1 0; min-width: 0; padding: 0; border: 0; border-radius: 8px; background: var(--paper); color: var(--ink); font: 600 17px var(--body); }
.kbd button.alt { background: #b9c3d6; font-size: 15px; }
.kbd button.wide { flex-grow: 5; }
.kbd button.go, .kbd button.on { background: var(--sun); }
.kbd-open .sheet { bottom: var(--kbd-h); max-height: calc(var(--view-h) - var(--kbd-h) - 4px); padding-top: 8px; padding-bottom: 8px; border-radius: 14px; }
.kbd-open .social-sheet h2 { display: none; }
.kbd-open .chat-list { min-height: 36px; max-height: none; }
.kbd-open .social-bar { display: none; }

/* Телефон: игра идёт горизонтально */
body { --kbd-h: 176px; }
body.rotated {
  position: fixed;
  top: 0;
  left: var(--view-h);
  width: var(--view-w);
  height: var(--view-h);
  transform: rotate(90deg);
  transform-origin: 0 0;
  --safe-t: 0px;
  --safe-b: 0px;
}
.land .tools { top: calc(10px + var(--safe-t)); left: 170px; right: 110px; max-width: 400px; margin: 0 auto; }
.land .ticker { margin-top: 5px; font-size: 11.5px; padding: 3px 9px; }
.land .demo { top: calc(112px + var(--safe-t)); }
/* Справа внизу живёт значок Netlify, поэтому кнопки стоят левее и выше него. */
.land .bottom { left: 12px; right: 196px; bottom: calc(8px + var(--safe-b)); max-width: none; display: flex; align-items: center; gap: 8px; }
.land .goal { flex: 0 1 180px; min-width: 110px; margin: 0; }
.land .goal-text { display: block; }
.land .goal-text b { display: block; }
.land .actions { flex: 1; }
.land .bottom .btn { padding: 10px 12px; }
.land .social-bar, body.land[data-mode="walk"] .social-bar, body.land[data-mode="drive"] .social-bar { top: calc(68px + var(--safe-t)); bottom: auto; flex-direction: row; }
.land .online { top: calc(112px + var(--safe-t)); }
.land .city-tools { bottom: calc(68px + var(--safe-b)); }
.land .sheet { left: 12px; right: auto; width: min(520px, calc(var(--view-w) - 200px)); margin: 0; max-height: calc(var(--view-h) - 10px); }
.land .picker { left: 8px; right: auto; bottom: 8px; width: min(370px, 48%); margin: 0; border: var(--line); border-radius: 18px; }
.kbd-row:last-child { flex: 1.4; margin-right: 151px; }
.land .social-sheet { max-height: calc(var(--view-h) - 10px); }
.land .chat-list { min-height: 110px; max-height: calc(var(--view-h) * .46); }
.land .table-btn { left: auto; right: 22px; bottom: calc(144px + var(--safe-b)); transform: none; padding: 15px 20px; }
.land .joy { bottom: calc(18px + var(--safe-b)); }
.land .gboard { width: min(100%, calc(var(--view-h) - 176px)); margin: 0 auto; }
.land .piece { font-size: min(calc(var(--view-h) / 13), 44px); }
.land .piece.disc { font-size: min(calc(var(--view-h) / 24), 26px); }

.city-tools {
  position: fixed;
  right: 12px;
  bottom: calc(136px + var(--safe-b));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.city-tools .btn { padding: 10px 14px; }
.city-tools .walk { background: var(--sun); font-family: var(--head); font-weight: 800; font-size: 14px; padding: 12px 18px; }

.walk-hud { display: none; }
.walk-top {
  position: fixed;
  top: calc(12px + var(--safe-t));
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.walk-top .btn { padding: 10px 14px; }
.walk-left { display: flex; gap: 6px; }
.switch { display: flex; background: var(--paper); border: var(--line); border-radius: 13px; box-shadow: var(--hard); padding: 3px; }
.switch button { border: 0; background: none; border-radius: 9px; padding: 8px 14px; font-weight: 700; }
.switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.joy {
  position: fixed;
  left: 22px;
  bottom: calc(28px + var(--safe-b));
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background: rgba(255, 250, 240, .55);
  border: var(--line);
  touch-action: none;
  display: none;
}
.joy i {
  position: absolute;
  left: 40px;
  top: 40px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--tomato);
  border: var(--line);
  box-shadow: var(--hard);
}
.walk-hint {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  transform: translateX(-50%);
  background: rgba(35, 48, 74, .86);
  color: var(--paper);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
@media (pointer: coarse) {
  .joy { display: block; }
  .walk-hint { display: none; }
}

body[data-mode="walk"] .walk-hud,
body[data-mode="drive"] .walk-hud { display: block; }
body:not([data-mode="city"]) .top,
body:not([data-mode="city"]) .tools,
body:not([data-mode="city"]) .bottom,
body:not([data-mode="city"]) .demo,
body:not([data-mode="city"]) .city-tools { display: none; }
body[data-mode="pick"] #labels { display: none; }

.nick.player { background: var(--ink); color: var(--paper); border-color: var(--paper); }
.online { position: fixed; top: calc(68px + var(--safe-t)); left: 12px; background: rgba(35, 48, 74, .86); color: var(--paper); font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; }
.table-btn { position: fixed; left: 50%; bottom: calc(190px + var(--safe-b)); transform: translateX(-50%); background: var(--sun); font-family: var(--head); font-weight: 800; font-size: 14px; }
@media (pointer: fine) { .table-btn { bottom: calc(108px + var(--safe-b)); } }

/* Компактные кнопки на прогулке и в машине: мир виден лучше, кнопки не налезают друг на друга. */
.walk-top { top: calc(8px + var(--safe-t)); left: 8px; right: 8px; gap: 6px; }
.walk-top .btn { padding: 6px 11px; font-size: 13px; border-radius: 11px; }
.walk-top .switch { padding: 2px; border-radius: 11px; }
.walk-top .switch button { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
#onlineCount { font-size: 11px; padding: 3px 8px; }
.chip-btn { padding: 5px 9px; font-size: 12px; border-radius: 10px; }
body[data-mode="walk"] .social-bar, body[data-mode="drive"] .social-bar { top: calc(52px + var(--safe-t)); left: 8px; gap: 6px; }
.land .social-bar, body.land[data-mode="walk"] .social-bar, body.land[data-mode="drive"] .social-bar { top: calc(50px + var(--safe-t)); left: 8px; gap: 6px; }
/* Кнопки стоят выше значка Netlify (он внизу справа) и чуть дальше от краёв экрана. */
.move-btn { width: 56px; height: 56px; font-size: 12px; bottom: calc(78px + var(--safe-b)); }
#jumpBtn { right: 40px; }
#runBtn { right: 110px; }
.joy { width: 116px; height: 116px; left: 38px; bottom: calc(26px + var(--safe-b)); }
.joy i { left: 33px; top: 33px; width: 46px; height: 46px; }
.land .joy { bottom: calc(26px + var(--safe-b)); }
.car-key { width: 56px; height: 56px; font-size: 21px; border-radius: 15px; }
#carUp { left: 44px; bottom: calc(104px + var(--safe-b)); }
#carDown { left: 44px; bottom: calc(34px + var(--safe-b)); }
#carLeft { right: 110px; bottom: calc(78px + var(--safe-b)); }
#carRight { right: 40px; bottom: calc(78px + var(--safe-b)); }
.land .table-btn { right: 40px; bottom: calc(148px + var(--safe-b)); padding: 10px 14px; font-size: 13px; }

/* Home settings у своего дома и House shop */
.home-set { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); z-index: 2; border: var(--line); border-radius: 999px; background: var(--sun); box-shadow: var(--hard); padding: 7px 14px; font: 800 13px var(--head); }
.home-set[hidden] { display: none; }
@media (pointer: fine) { .home-set { bottom: calc(160px + var(--safe-b)); } }
.land .home-set { left: auto; right: 40px; transform: none; bottom: calc(196px + var(--safe-b)); }
body:not([data-mode="walk"]) .home-set { display: none; }
.shop-tabs .tab { padding: 7px 4px; font-size: 12.5px; }
.shop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: var(--line); border-radius: 12px; background: #fff; padding: 8px 10px; margin-top: 7px; }
.shop-row > div:first-child { min-width: 0; }
.shop-row b { display: block; font-size: 14.5px; }
.shop-row small { display: block; color: var(--muted); font-size: 12px; }
.shop-row .btn { padding: 7px 12px; font-size: 13px; flex: none; }
.shop-actions { display: flex; gap: 6px; flex: none; }
.shop-tag { flex: none; font-weight: 800; font-size: 13px; color: #2f8a4c; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin: 6px 0 10px; }
.shop-item { border: var(--line); border-radius: 11px; background: #fff; padding: 7px 8px; text-align: left; }
.shop-item b { display: block; font-size: 13px; }
.shop-item small { color: var(--muted); font-weight: 700; font-size: 12px; }
.shop-item.on { background: var(--sun); box-shadow: inset 0 0 0 2px var(--ink); }
.social-body .swatches { flex-wrap: wrap; }

/* Вкладки чатов с друзьями */
.dm-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.dm-tabs::-webkit-scrollbar { display: none; }
.dm-tab { position: relative; flex: none; border: var(--line); border-radius: 999px; background: #fff; padding: 5px 11px; font-size: 12.5px; font-weight: 700; }
.dm-tab.on { background: var(--ink); color: var(--paper); }
.dm-tab .dot { position: absolute; right: -2px; top: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--tomato); border: 2px solid var(--paper); }

/* Онлайн рядом с Exit */
.walk-left { align-items: center; }
#onlineCount { position: static; flex: none; }
#onlineCount[hidden] { display: none; }

/* Чат: маленькая кнопка внизу по центру. Пока чат открыт, её нет. */
.chat-fab { display: none; position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); z-index: 2; border: var(--line); border-radius: 999px; background: var(--paper); box-shadow: var(--hard); padding: 5px 12px; font-weight: 800; font-size: 12px; }
@media (pointer: fine) { .chat-fab { bottom: calc(56px + var(--safe-b)); } }
body[data-mode="walk"] .chat-fab, body[data-mode="drive"] .chat-fab { display: block; }
body.chat-open .chat-fab, body.kbd-open .chat-fab { display: none; }
body:not([data-mode="city"]) .city-only { display: none; }

/* Меню над головой: стиль, питомец или машина, эмоции */
.self-menu { position: fixed; left: 0; top: 0; z-index: 3; display: flex; gap: 6px; padding: 5px; background: rgba(255, 250, 240, .92); border: var(--line); border-radius: 16px; box-shadow: var(--hard); will-change: transform; }
.self-menu[hidden] { display: none; }
.self-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 0; border: var(--line); border-radius: 11px; background: #fff; }
.self-btn b { font-size: 19px; line-height: 1; }
.self-btn small { font-size: 9px; font-weight: 800; margin-top: 2px; }
.self-btn:active { background: var(--sun); }
body:not([data-mode="walk"]):not([data-mode="drive"]) .self-menu { display: none; }

/* Стрелки машины на телефоне */
.car-pad { display: none; }
.car-key { position: fixed; z-index: 2; width: 56px; height: 56px; padding: 0; border: var(--line); border-radius: 15px; background: rgba(255, 250, 240, .9); box-shadow: var(--hard); font-size: 21px; line-height: 1; touch-action: none; user-select: none; -webkit-user-select: none; }
.car-key.on { background: var(--sun); transform: translateY(2px); box-shadow: none; }
#carUp { left: 44px; bottom: calc(104px + var(--safe-b)); }
#carDown { left: 44px; bottom: calc(34px + var(--safe-b)); }
#carLeft { right: 110px; bottom: calc(78px + var(--safe-b)); }
#carRight { right: 40px; bottom: calc(78px + var(--safe-b)); }
@media (pointer: coarse) {
  body[data-mode="drive"] .car-pad { display: block; }
  body[data-mode="drive"] .joy { display: none; }
}

/* Карта */
.map-sheet { position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column; background: var(--paper); padding: calc(10px + var(--safe-t)) 12px calc(10px + var(--safe-b)); }
.map-sheet[hidden] { display: none; }
.map-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.map-head h2 { margin: 0; font: 800 20px var(--head); }
.map-head .close { position: static; }
.map-body { position: relative; flex: 1; min-height: 0; }
.map-canvas { display: block; width: 100%; height: 100%; border: var(--line); border-radius: 14px; touch-action: none; background: #58cbc4; }
.map-tools { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-btn { width: 44px; height: 44px; padding: 0; border: var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--hard); font: 800 22px var(--head); }
.map-legend { position: absolute; left: 10px; bottom: 10px; margin: 0; padding: 4px 10px; border-radius: 999px; background: rgba(35, 48, 74, .82); color: var(--paper); font-size: 12px; font-weight: 700; white-space: pre; }

.game {
  position: fixed;
  inset: 0;
  z-index: 6;
  overflow-y: auto;
  background: var(--paper);
  padding: calc(14px + var(--safe-t)) 14px calc(16px + var(--safe-b));
  display: flex;
  flex-direction: column;
  align-items: center;
}
.game[hidden] { display: none; }
.game-head { width: 100%; max-width: 480px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.game-head h2 { font: 800 21px/1.2 var(--head); margin: 0; }
.game-head .close { position: static; }
.game-list { width: 100%; max-width: 480px; display: grid; gap: 10px; }
.game-pick { display: block; width: 100%; text-align: left; border: var(--line); border-radius: 14px; box-shadow: var(--hard); background: #fff; padding: 15px; }
.game-pick b { display: block; font: 800 17px/1.2 var(--head); margin-bottom: 3px; }
.game-pick span { color: var(--muted); font-size: 13.5px; }
#gamePlay { width: 100%; max-width: 480px; }
.game-status { font-weight: 700; min-height: 22px; text-align: center; margin: 0 0 9px; }
.gboard { display: grid; grid-template-columns: repeat(8, 1fr); width: 100%; aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 8px; overflow: hidden; }
.cell { position: relative; border: 0; padding: 0; aspect-ratio: 1; display: grid; place-items: center; min-width: 0; }
.cell.light { background: #f3e2bd; }
.cell.dark { background: #a8743f; }
.cell.moved { box-shadow: inset 0 0 0 100px rgba(242, 194, 48, .42); }
.cell.picked { box-shadow: inset 0 0 0 3px var(--tomato), inset 0 0 0 100px rgba(232, 85, 58, .3); }
.cell.target::after { content: ''; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(35, 48, 74, .46); }
.piece { font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', 'Apple Symbols', 'DejaVu Sans', serif; font-size: min(9.4vw, 44px); line-height: 1; }
.piece.white { color: #fffaf0; -webkit-text-stroke: 1.2px var(--ink); }
.piece.black { color: var(--ink); }
.piece.disc { width: 76%; height: 76%; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-size: min(5.6vw, 26px); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.piece.disc.white { background: #fffaf0; color: var(--ink); -webkit-text-stroke: 0; }
.piece.disc.black { background: var(--tomato); color: #fff; }
.game-actions { display: flex; gap: 8px; margin-top: 10px; }
.game-actions .btn { flex: 1; }
.game-actions .btn[hidden] { display: none; }
.game-list .hint { margin: 4px 2px 0; }
.gbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 2px; }
.gbar b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gclock { flex: none; min-width: 64px; text-align: center; border: var(--line); border-radius: 9px; background: #fff; padding: 3px 8px; font: 800 16px var(--head); font-variant-numeric: tabular-nums; }
.gclock.on { background: var(--ink); color: var(--paper); }
.gclock.low { background: var(--tomato); color: #fff; }
.gboard-wrap { position: relative; }
.gover { position: absolute; inset: 0; display: grid; place-items: center; padding: 10%; background: rgba(35, 48, 74, .35); border-radius: 8px; }
.gover[hidden] { display: none; }
.gover-card { width: 100%; max-width: 300px; background: var(--paper); border: var(--line); border-radius: 16px; box-shadow: var(--hard); padding: 14px; text-align: center; }
.gover-card > b { display: block; font: 800 22px/1.2 var(--head); }
.gover-card p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.gover-coins { margin-top: 8px; font: 800 20px var(--head); }
.gover-coins.won { color: #2f8a4c; }
.gover-coins.lost { color: var(--tomato); }
.gover-actions { display: flex; gap: 8px; margin-top: 12px; }
.gover-actions .btn { flex: 1; padding: 9px 8px; }
.land #gamePlay { display: grid; grid-template-columns: calc(var(--view-h) - 84px) minmax(180px, 1fr); grid-auto-rows: min-content; column-gap: 16px; max-width: calc(var(--view-h) + 300px); }
.land #gamePlay > .gboard-wrap { grid-column: 1; grid-row: 1 / span 5; }
.land #gamePlay > :not(.gboard-wrap) { grid-column: 2; }
.land #gamePlay .gboard { width: 100%; }
.land .game { padding-top: 8px; padding-bottom: 8px; }
.land .game-head { max-width: calc(var(--view-h) + 300px); margin-bottom: 6px; }
.land .game-actions { flex-wrap: wrap; }
.bet-chips .style-chip:disabled { opacity: .4; }

.picker { max-height: 58dvh; }
.style-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.style-chip { border: var(--line); border-radius: 10px; background: #fff; padding: 7px 11px; font-weight: 700; font-size: 13px; }
.style-chip[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.picker .field { margin-bottom: 9px; }
.picker .swatch { width: 30px; height: 30px; }

body.covering .top, body.covering .tools, body.covering .bottom, body.covering .demo, body.covering .city-tools, body.covering #labels, body.covering #city { visibility: hidden; }
body.covering { overflow: auto; background: var(--paper); }
#coverCanvas { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); height: min(58dvh, 620px); width: auto; border: var(--line); border-radius: 12px; }
.cover-panel { position: fixed; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; padding: 10px 14px calc(12px + var(--safe-b)); background: var(--paper); }
.cover-panel h1 { display: none; }
.cover-panel label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.cover-panel input { flex: 1; min-width: 0; border: var(--line); border-radius: 9px; padding: 7px 9px; font-size: 16px; background: #fff; }
.cover-row { display: flex; gap: 8px; margin: 8px 0; }
.cover-row .btn { flex: 1; padding: 10px; }
.house-actions .btn, #houseSheet .actions { flex-wrap: wrap; }
#houseSheet .actions .btn { flex: 1 1 42%; }
.mayor-note { width: 100%; border: var(--line); border-radius: 10px; padding: 9px; font-size: 16px; }
.social-bar { position: fixed; left: 12px; bottom: calc(136px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; z-index: 2; }
body[data-mode="walk"] .social-bar, body[data-mode="drive"] .social-bar { top: calc(100px + var(--safe-t)); bottom: auto; }
body[data-mode="city"] .walk-only, body[data-mode="inside"] .social-bar, body[data-mode="pick"] .social-bar, body.covering .social-bar { display: none; }
.chip-btn { position: relative; border: var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--hard); padding: 8px 12px; font-weight: 700; font-size: 13px; }
.badge { position: absolute; right: -7px; top: -7px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px; background: var(--tomato); color: #fff; font: 700 11px/19px var(--body); text-align: center; }
.social-sheet { z-index: 4; max-height: 72dvh; display: flex; flex-direction: column; }
.social-body { display: flex; flex-direction: column; min-height: 0; }
.social-body h3 { font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tab { flex: 1; border: var(--line); border-radius: 10px; background: #fff; padding: 8px; font-weight: 700; }
.tab.on { background: var(--ink); color: var(--paper); }
.chat-list { flex: 1; min-height: 190px; max-height: 42dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.chat-row { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; font-size: 14px; }
.chat-row span { overflow-wrap: anywhere; }
.chat-row.own { justify-content: flex-end; color: var(--tomato); }
.report { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 11px; text-decoration: underline; }
.composer { display: flex; gap: 6px; margin-top: 8px; }
.composer input { flex: 1; min-width: 0; border: var(--line); border-radius: 10px; padding: 9px; font-size: 16px; background: #fff; }
.composer .btn { padding: 8px 14px; }
.person { display: flex; align-items: center; gap: 6px; padding: 6px 0; }
.person.wrap { flex-wrap: wrap; }
.person b { flex: 1; min-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.person .btn { padding: 7px 10px; font-size: 13px; }
.link-btn { align-self: flex-start; border: 0; background: none; font-weight: 700; color: var(--muted); padding: 0 0 6px; }
.field-gap { height: 12px; }
/* Монеты, награда дня и работа */
.coins { border: var(--line); border-radius: 11px; background: var(--paper); box-shadow: var(--hard); padding: 5px 10px; font: 800 13px var(--head); white-space: nowrap; }
.wallet-big { font: 800 26px var(--head); margin: 2px 0 6px; }
.daily-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 8px 0 10px; }
.daily-day { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border: var(--line); border-radius: 10px; background: #fff; font-size: 12px; }
.daily-day small { color: var(--muted); font-size: 10px; }
.daily-day b { font-size: 17px; line-height: 1.1; }
.daily-day span { font-weight: 800; }
.daily-day.done { background: #dff1d6; opacity: .7; }
.daily-day.now { background: var(--sun); box-shadow: inset 0 0 0 2px var(--ink); font: inherit; font-size: 12px; color: var(--ink); cursor: pointer; animation: daily-pulse 1.2s ease-in-out infinite; }
.daily-day.now small { color: var(--ink); font-weight: 800; }
@keyframes daily-pulse { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .daily-day.now { animation: none; } }
.daily-day.chest { border-color: #b8860b; }
.hint.center { text-align: center; }
.job-card { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; border: var(--line); border-radius: 12px; background: #fff; padding: 9px 11px; margin-top: 8px; }
.job-card b { font-size: 15px; }
.job-card span { grid-column: 1; color: var(--muted); font-size: 12.5px; }
.job-card small { grid-column: 1; font-size: 11.5px; font-weight: 700; }
.job-card .btn { grid-column: 2; grid-row: 1 / span 3; padding: 8px 14px; }
.job-card.on { background: #fff6d6; box-shadow: inset 0 0 0 2px var(--sun); }
.job-banner { position: fixed; left: 50%; top: calc(92px + var(--safe-t)); transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: 7px; max-width: calc(100% - 24px); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 4px 11px 4px 6px; font-size: 12px; font-weight: 700; pointer-events: none; }
.job-banner[hidden] { display: none; }
.job-banner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-banner b { color: var(--sun); white-space: nowrap; }
.job-arrow { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--sun); color: var(--ink); font-style: normal; font-size: 13px; }
.land .job-banner { top: calc(50px + var(--safe-t)); left: auto; right: 8px; transform: none; max-width: 40%; }
.coin-gain { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 9; font: 800 34px var(--head); color: #f2c230; -webkit-text-stroke: 1.5px var(--ink); pointer-events: none; }
.coin-gain.pop { animation: coin-pop 2.2s ease-out forwards; }
@keyframes coin-pop { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -120%) scale(1); } }
@media (prefers-reduced-motion: reduce) { .coin-gain.pop { animation: none; } }
body:not([data-mode="walk"]):not([data-mode="drive"]) .job-banner { display: none; }

.invite { position: fixed; left: 12px; right: 12px; top: calc(70px + var(--safe-t)); max-width: 420px; margin: 0 auto; z-index: 7; background: var(--paper); border: var(--line); border-radius: 14px; box-shadow: var(--hard); padding: 12px; font-weight: 700; }
.invite p { margin: 0 0 10px; }
.invite-actions { display: flex; gap: 8px; }
.invite-actions .btn { flex: 1; padding: 9px; }