/* Простая карта Techpoly. Цвета взяты с выбранного логотипа: песчаник, терракота, зелень. */

:root {
  --sand: #f4e6cf;
  --sand-dark: #e6d2b3;
  --paper: #fbf4e6;
  --stone: #8a7a66;
  --ink: #3a2e27;
  --terracotta: #c5623b;
  --terracotta-dark: #9d4a2a;
  --green: #6e8f3c;
  --green-dark: #55702c;
  --red: #b3372f;
  --line: #cdb794;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

h1, h2 { margin: 0; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--stone); margin-bottom: 10px; }

/* --- Экраны: телефон и вход --- */

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}

.screen img { max-width: 80vw; height: auto; }
.screen h1 { font-size: 24px; }
.screen p { max-width: 460px; margin: 0; }

.phone { display: none; }

.login form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 320px;
  text-align: left;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--stone);
  padding: 18px;
}

.login label { font-weight: 600; }
.rules { max-width: 520px; margin: 0; padding: 0; list-style: none; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.lead { font-size: 17px; }
.hint { color: var(--stone); font-size: 13px; }
.message { min-height: 1.4em; margin: 0; color: var(--red); }

input {
  font: inherit;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
}

button {
  font: inherit;
  font-weight: 600;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--stone);
}

button:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--stone); }
button:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--stone); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--green); color: #fff; border-color: var(--green-dark); }
button.quiet { box-shadow: none; padding: 4px 10px; font-weight: 400; }
button.danger { background: var(--red); color: #fff; border-color: #7f241e; }

/* --- Игра --- */

.game { min-width: 960px; }

.bar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 8px 20px;
  background: var(--ink);
  color: var(--paper);
}

.bar-logo { height: 54px; width: auto; background: var(--sand); border: 2px solid var(--paper); }
.bar-item { display: flex; flex-direction: column; }
.bar-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--line); }
.bar-value { font-size: 18px; font-weight: 700; }
.bar-right { margin-left: auto; flex-direction: row; align-items: center; gap: 12px; }
.bar .quiet { background: transparent; color: var(--paper); border-color: var(--line); }
.debt { color: #ff9d8f; }
.bar-sub { font-size: 11px; color: var(--line); }

.notice {
  margin: 0;
  padding: 10px 20px;
  background: #f8d9a8;
  border-bottom: 2px solid var(--terracotta);
  font-weight: 600;
}

.notice.bad { background: #f3c2bb; border-color: var(--red); }
.hour-note { margin: 0; padding: 6px 20px; background: var(--sand-dark); border-bottom: 1px solid var(--line); font-size: 14px; }
.deals-note { margin: 0; padding: 8px 20px; background: #e9f0d8; border-bottom: 2px solid var(--green-dark); font-size: 14px; font-weight: 600; }

.help { margin: 16px 20px 0; padding: 10px 14px; background: var(--paper); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--stone); }
.help summary { cursor: pointer; font-weight: 700; }
.help ul { margin: 10px 0 2px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

.startup { margin: 16px 20px 0; border-color: var(--green-dark); }
.startup p { margin: 0 0 10px; }
.startup-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.startup-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--sand); border: 2px solid var(--line); }
.startup-card h3 { margin: 0; font-size: 17px; }
.startup-card p { margin: 0; font-size: 13px; }
.startup-card .startup-cost { font-size: 14px; font-weight: 600; }
.startup-card button { margin-top: auto; }
.startup .startup-note { margin: 10px 0 0; font-size: 13px; color: var(--terracotta-dark); }

/* Короткие сведения о виде бизнеса: слева что, справа сколько. */
.kind-facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 0; font-size: 13px; }
.kind-facts dt { color: var(--stone); white-space: nowrap; }
.kind-facts dd { margin: 0; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr);
  gap: 16px;
  padding: 16px 20px 28px;
  align-items: start;
}

.panel {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--stone);
  padding: 14px;
}

/* --- Карта --- */

.map { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.district { background: var(--sand-dark); border: 2px solid var(--line); padding: 8px; }
.district-name { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 6px; }
.district-price { font-weight: 400; color: var(--stone); font-size: 13px; }
.district-holder { margin: -2px 0 6px; font-size: 12px; font-weight: 600; color: var(--green-dark); }
.lots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }

.lot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 74px;
  padding: 4px;
  background: var(--paper);
  border: 2px solid var(--stone);
  box-shadow: none;
  font-weight: 400;
  color: var(--ink);
}

.lot.free { border-style: dashed; color: var(--stone); }
.lot.mine { border-width: 4px; border-color: var(--ink); }
.lot.selected { outline: 3px solid var(--terracotta); outline-offset: 2px; }
.lot.on-sale { border-style: double; border-width: 4px; border-color: var(--terracotta-dark); }
.lot.offered { box-shadow: 0 0 0 3px var(--green); }
.lot-number { position: absolute; top: 2px; left: 5px; font-size: 11px; color: var(--stone); }
.lot-size { position: absolute; top: 2px; right: 5px; font-size: 10px; color: var(--stone); }
.lot-sign { font-size: 20px; font-weight: 800; letter-spacing: 0.02em; }
.lot-level { font-size: 11px; }
.lot-owner { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.legend { margin: 10px 0 0; color: var(--stone); font-size: 13px; }

/* --- Карточка участка --- */

/* Слева идут друг под другом карта, торги, сделки, таблица и лента; справа во всю высоту — место карточки участка.
   Карточка не уезжает вместе со страницей: длинный список прокручивается внутри неё, а она остаётся на виду. */
.layout > .panel { grid-column: 1; }
.layout > .card-panel { grid-column: 2; grid-row: 1 / span 5; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }

.card { display: flex; flex-direction: column; gap: 10px; }
.card p { margin: 0; }
.card .facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.card .facts dt { color: var(--stone); }
.card .facts dd { margin: 0; font-weight: 600; }
.card .choice { display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.card .choice small { color: var(--stone); }
.card .why { color: var(--terracotta-dark); font-size: 13px; }
.card .group { margin: 6px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--stone); }
.card .danger-zone { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); align-items: flex-start; }
.card label { font-weight: 600; }
.card .row { display: flex; gap: 8px; align-items: center; }
.card .row input { width: 110px; }
.card .row input.wide { width: 170px; }
.card .row input.short { width: 72px; }
.report { margin: 0; padding: 10px; background: var(--sand); border: 1px solid var(--line); white-space: pre-wrap; font-size: 13px; }
.muted { color: var(--stone); }

/* --- Торги --- */

.auctions-panel .auctions-lead { margin: 0 0 10px; }
.auctions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.auction { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--sand); border: 2px solid var(--line); }
.auction p, .auction small { margin: 0; font-size: 13px; }
.auction .auction-lot { text-align: left; box-shadow: none; }
.auction .auction-mine { color: var(--green-dark); font-weight: 600; }
.auction .why { color: var(--terracotta-dark); }
.auction .row { display: flex; gap: 8px; align-items: center; }
.auction .row input { width: 150px; min-width: 0; flex: 1; }

/* --- Сделки --- */

.deals-panel .deals-lead { margin: 0 0 6px; }
.deals { display: flex; flex-direction: column; gap: 8px; }
.deals .group, .card .deal .group { margin: 6px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--stone); }
.deals p, .deals small { margin: 0; font-size: 13px; }
.deal { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--sand); border: 2px solid var(--line); align-items: flex-start; }
.deal p, .deal small { margin: 0; font-size: 13px; }
.deal .auction-lot { text-align: left; box-shadow: none; }
.deal .row { display: flex; gap: 8px; align-items: center; }
.deal .row input { width: 190px; min-width: 0; }
.deal .why { color: var(--terracotta-dark); }
.deal-mine { color: var(--green-dark); font-weight: 600; }
.card .deal-mine { margin: 0; }

/* --- Таблица и лента --- */

table { width: 100%; border-collapse: collapse; }
th, td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--line); }
th:nth-child(2), td:nth-child(2) { text-align: left; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--stone); }
tr.me td { background: #e9f0d8; font-weight: 700; }
tr.out td { color: var(--stone); }
.swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 1px solid var(--ink); vertical-align: -1px; }

.feed { margin: 0; padding: 0; list-style: none; max-height: 340px; overflow-y: auto; font-size: 14px; }
.feed li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.feed time { color: var(--stone); font-size: 12px; margin-right: 6px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: 640px;
  padding: 12px 18px;
  background: var(--green-dark);
  color: #fff;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--stone);
  font-weight: 600;
  z-index: 10;
  cursor: pointer;
}

.toast.bad { background: var(--red); }

/* --- Телефон: вместо игры одно сообщение. Версии для телефона у игры нет. --- */

@media (max-width: 959px), (pointer: coarse) and (max-height: 540px) {
  .phone { display: flex; }
  .login, .game, .toast { display: none !important; }
}
