* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --gold: #d4a94e;
  --gold-bright: #f3cd6f;
  --parchment: #e8d9b0;
  --ink: #2b1d0e;
  --wood: #3a2716;
  --wood-dark: #241708;
  --stone: #6b6660;
  --red: #8c2f23;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #12100c;
  font-family: 'Alegreya', Georgia, serif;
  color: var(--parchment);
  user-select: none;
  -webkit-user-select: none;
}

#app { width: 100%; height: 100%; position: relative; }

/* ---------- экраны ---------- */
.screen {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(212,169,78,.08), transparent 60%),
    linear-gradient(#1a140c, #0f0c08);
}
.screen.active { display: flex; }

#screen-menu { flex-direction: column; }
#menu-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.menu-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  padding: 36px 60px 28px;
  background: linear-gradient(rgba(20,14,7,.82), rgba(20,14,7,.88));
  border: 3px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 0 0 3px var(--wood-dark), 0 0 60px rgba(0,0,0,.8), inset 0 0 40px rgba(0,0,0,.6);
}

.game-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(38px, 7vw, 72px);
  letter-spacing: .06em;
  color: var(--gold-bright);
  text-shadow: 0 2px 0 #6b4b12, 0 6px 18px rgba(0,0,0,.9);
}
.game-title span { color: #fff2cf; }
.game-subtitle {
  font-style: italic;
  color: #b9a577;
  margin-bottom: 18px;
  letter-spacing: .2em;
}

.menu-buttons { display: flex; flex-direction: column; gap: 12px; width: 280px; }
.mp-status { text-align: center; color: #e08a7a; min-height: 1.2em; margin: 0 0 12px; }
.mp-wait-text {
  text-align: center;
  color: var(--gold-bright);
  font-size: 18px;
  margin: 12px 0 16px;
  animation: mpPulse 1.2s ease-in-out infinite;
}
@keyframes mpPulse {
  0%, 100% { opacity: .7; }
  50% { opacity: 1; }
}
.menu-crowns { margin-top: 18px; color: var(--gold); font-size: 18px; display: inline-flex; align-items: center; }
.account-bar {
  margin-top: 10px;
  display: flex; align-items: center; gap: 12px;
  color: #cbb889; font-size: 15px;
}
.btn-small { font-size: 13px; padding: 6px 12px; }
.auth-lead { text-align: center; color: #cbb889; margin-bottom: 16px; }
.auth-error { text-align: center; color: #e08a7a; margin: 0 0 12px; }
.auth-hint {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
  color: #8f7c4d;
  line-height: 1.45;
}
.auth-hint code, .admin-hint code { color: var(--gold-bright); }

#screen-auth .panel { width: min(420px, 94vw); }
#screen-auth .setting { flex-direction: column; align-items: stretch; gap: 6px; }
#screen-auth .setting input[type=text],
#screen-auth .setting input[type=password] { width: 100%; }
#screen-auth .pass-field { width: 100%; }

.pass-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 200px;
  flex-shrink: 0;
}
.pass-field input[type=text],
.pass-field input[type=password] {
  width: 100%;
  padding-right: 40px;
}
.pass-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  box-shadow: none;
  filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pass-toggle:hover,
.pass-toggle:active {
  filter: brightness(1.35);
  transform: translateY(-50%);
}
.pass-toggle.on { opacity: .85; }
.pass-toggle .ico { width: 18px; height: 18px; margin: 0; }

.settings-heading {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 20px;
  margin: 22px 0 8px;
  text-align: center;
}
.account-who { text-align: center; color: #cbb889; margin: 0 0 10px; }
.account-block { display: flex; flex-direction: column; gap: 16px; }
#acc-msg.ok { color: #8fce7a; }

/* ---------- кнопки ---------- */
.ico {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
  overflow: visible;
  vertical-align: -0.18em;
  flex-shrink: 0;
}
.ico path { fill: currentColor; }
.ico-lg { width: 1.7em; height: 1.7em; }
.btn .ico { margin-right: 0.4em; }
.menu-crowns .ico,
.shop-crowns .ico,
#hud-gold .ico,
.ap-crowns .ico,
.uc-cost .ico,
.big-crowns .ico { color: var(--gold-bright); margin-right: 0.2em; }
.help-text .ico { margin-right: 0.35em; color: var(--gold); }
.ap-eye .ico { margin: 0; width: 16px; height: 16px; }
.hud-btn .ico { width: 16px; height: 16px; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 17px;
  padding: 11px 26px;
  color: var(--parchment);
  background: linear-gradient(#5a3d20, #3a2716 55%, #2c1d0e);
  border: 2px solid var(--gold);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--wood-dark), 0 6px 14px rgba(0,0,0,.5);
  transition: transform .08s, filter .12s;
}
.btn:hover { filter: brightness(1.25); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--wood-dark); }
.btn-big { font-size: 21px; padding: 14px 30px; background: linear-gradient(#8a5a22, #5f3d15 55%, #472c0c); }
.btn-danger { border-color: #a05045; color: #f0c0b5; }

/* ---------- панели ---------- */
.panel {
  position: relative; z-index: 2;
  width: min(560px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: 28px 34px;
  background: linear-gradient(rgba(26,18,9,.96), rgba(18,12,6,.97));
  border: 3px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 0 0 3px var(--wood-dark), 0 20px 70px rgba(0,0,0,.85);
}
.panel-wide { width: min(1060px, 96vw); }

.panel-title {
  font-family: 'Cinzel', serif;
  font-size: 30px;
  color: var(--gold-bright);
  text-align: center;
  margin-bottom: 20px;
  text-shadow: 0 2px 8px rgba(0,0,0,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ---------- выбор боя ---------- */
.setup-row { margin-bottom: 20px; }
.setup-row h3 { font-family: 'Cinzel', serif; color: var(--gold); margin-bottom: 10px; }
.choice-row { display: flex; gap: 12px; flex-wrap: wrap; }
[hidden] { display: none !important; }
.choice {
  flex: 1; min-width: 170px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 10px;
  background: rgba(58,39,22,.5);
  border: 2px solid #5a4326;
  border-radius: 8px;
  color: var(--parchment);
  font-family: inherit; font-size: 15px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.choice small { color: #a8955f; font-size: 12.5px; text-align: center; }
.choice .choice-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
}
.choice .choice-icon .ico { width: 28px; height: 28px; color: var(--gold-bright); }
.choice:hover { border-color: var(--gold); }
.choice.active { border-color: var(--gold-bright); background: rgba(140,95,35,.35); box-shadow: 0 0 14px rgba(212,169,78,.25); }
.choice.zombie-mode { border-color: #4a6a32; }
.choice.zombie-mode:hover { border-color: #8cbc4a; }
.choice.zombie-mode.active { border-color: #b6e06a; background: rgba(50,80,24,.45); box-shadow: 0 0 14px rgba(90,160,40,.3); }
.choice.naval-mode { border-color: #2a5a7a; }
.choice.naval-mode:hover { border-color: #4aa0d0; }
.choice.naval-mode.active { border-color: #7ec8f0; background: rgba(24, 50, 80, .5); box-shadow: 0 0 14px rgba(60, 140, 200, .3); }
.choice.boss-mode:hover { border-color: #d06040; }
.choice.boss-mode.active { border-color: #ff8860; background: rgba(90,28,18,.5); box-shadow: 0 0 14px rgba(200,60,30,.35); }
.choice.locked,
.choice:disabled {
  filter: grayscale(.8) brightness(.55);
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}
.choice.boss-mode.locked,
.choice.boss-mode.locked:hover {
  border-color: #4a3a32;
  background: rgba(40, 28, 22, .4);
  box-shadow: none;
}

.setup-row.hidden-row { display: none; }
.setup-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.setup-actions.column { flex-direction: column; align-items: stretch; }

/* ---------- магазин ---------- */
.shop-header { display: flex; justify-content: space-between; align-items: baseline; }
.shop-crowns { font-size: 22px; color: var(--gold-bright); display: inline-flex; align-items: center; }
.shop-tabs { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.tab {
  font-family: 'Cinzel', serif; font-size: 15px;
  padding: 8px 20px;
  background: transparent;
  color: #a8955f;
  border: 2px solid #5a4326; border-radius: 6px 6px 0 0;
  cursor: pointer;
}
.tab.active { color: var(--gold-bright); border-color: var(--gold); background: rgba(140,95,35,.25); }

.era-block { margin-bottom: 22px; }
.era-title {
  font-family: 'Cinzel', serif; font-size: 19px; color: var(--gold);
  border-bottom: 1px solid #5a4326;
  padding-bottom: 5px; margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.era-title small { color: #8f7c4d; font-family: 'Alegreya', serif; font-style: italic; font-size: 13px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.shop-card {
  display: flex; gap: 10px;
  padding: 10px;
  background: rgba(58,39,22,.45);
  border: 2px solid #5a4326;
  border-radius: 8px;
  align-items: center;
}
.shop-card.locked { filter: saturate(.35) brightness(.75); }
.shop-card.equipped { border-color: var(--gold); background: rgba(80, 58, 22, .62); }
.shop-card canvas { width: 72px; height: 72px; background: radial-gradient(circle at 50% 35%, #4c3a20, #2a1d0e); border-radius: 6px; border: 1px solid #6b512d; flex-shrink: 0; }
.shop-card .card-info { flex: 1; min-width: 0; }
.shop-card .card-name { font-weight: 700; color: var(--gold-bright); font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.shop-card .card-title { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.shop-card .card-title .ico { margin: 0; }
.shop-card .card-hp { color: #e07070; font-size: 13px; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.shop-card .card-hp .ico { width: 0.9em; height: 0.9em; color: #e07070; }
.shop-card .card-desc { font-size: 12px; color: #b3a075; line-height: 1.25; margin: 2px 0 6px; }
.shop-card .card-stats { font-size: 11.5px; color: #8f7c4d; }
.shop-card .card-stats .ico { width: 0.95em; height: 0.95em; }
.buy-btn {
  font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700;
  margin-top: 6px;
  padding: 5px 12px;
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(#6d4a1c, #4a300f);
  border: 1.5px solid var(--gold); border-radius: 5px;
  color: var(--parchment); cursor: pointer;
}
.buy-btn:hover { filter: brightness(1.3); }
.buy-btn:disabled { filter: grayscale(.8) brightness(.6); cursor: default; }
.use-btn {
  font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700;
  margin-top: 6px;
  padding: 5px 12px;
  background: linear-gradient(#3d5a28, #2a3e1a);
  border: 1.5px solid #7a9a4a; border-radius: 5px;
  color: var(--parchment); cursor: pointer;
}
.use-btn:hover { filter: brightness(1.25); }
.owned-mark { color: #8fce7a; font-size: 13px; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- настройки ---------- */
.settings-list { display: flex; flex-direction: column; gap: 16px; }
.setting { display: flex; justify-content: space-between; align-items: center; font-size: 17px; gap: 20px; }
.setting-hint { display: block; font-size: 12px; color: #9b8a5c; font-weight: 400; margin-top: 2px; }
.setting input[type=range] { width: 200px; accent-color: var(--gold); }
.setting input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gold); }
.setting select,
.setting input[type=number],
.setting input[type=text],
.setting input[type=password] {
  background: var(--wood); color: var(--parchment);
  border: 1.5px solid var(--gold); border-radius: 5px;
  font-family: inherit; font-size: 15px; padding: 8px 10px;
  width: 140px;
  color-scheme: dark;
}
.setting input[type=text],
.setting input[type=password] { width: 200px; }
.setting input:-webkit-autofill,
.setting input:-webkit-autofill:hover,
.setting input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--parchment);
  caret-color: var(--parchment);
  box-shadow: 0 0 0 1000px var(--wood) inset;
  transition: background-color 9999s ease-out;
}
.admin-hint { font-size: 13px; color: #8f7c4d; margin: 0; line-height: 1.45; }
.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #5a4326;
}
.admin-hero .panel-title { margin-bottom: 8px; text-align: left; }
.admin-stats { display: flex; gap: 8px; flex-shrink: 0; }
.admin-stat {
  min-width: 76px;
  padding: 8px 10px;
  text-align: center;
  background: rgba(20, 12, 6, .55);
  border: 1px solid #5a4326;
  border-radius: 8px;
}
.admin-stat b {
  display: block;
  font-family: 'Cinzel', serif;
  color: var(--gold-bright);
  font-size: 20px;
}
.admin-stat span { font-size: 11px; color: #8f7c4d; letter-spacing: .04em; }
.admin-stat.on { border-color: #6a8a3a; }
.admin-stat.on b { color: #8fce7a; }
.admin-toolbar { margin: 0 0 12px; }
#admin-search {
  width: 100%;
  background: var(--wood);
  color: var(--parchment);
  border: 1.5px solid var(--gold);
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  padding: 8px 12px;
}
#admin-players { display: flex; flex-direction: column; gap: 12px; margin: 4px 0; }
.admin-player {
  padding: 14px 16px 16px;
  background:
    linear-gradient(180deg, rgba(72, 48, 22, .35), rgba(28, 18, 8, .72));
  border: 2px solid #5a4326;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(243, 205, 111, .08);
}
.admin-player.is-banned { border-color: #a05045; }
.admin-player.is-online { border-color: #6a8a3a; }
.admin-player.is-admin { border-color: var(--gold); }
.ap-id { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.ap-ava {
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 18px;
  color: var(--gold-bright);
  background: radial-gradient(circle at 40% 30%, #6a4a22, #2a1a0c);
  border: 2px solid var(--gold);
  border-radius: 50%;
}
.ap-who { min-width: 0; flex: 1; }
.ap-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ap-name b { font-size: 18px; color: #f3e6c4; }
.ap-tag {
  font-size: 11px; letter-spacing: .04em;
  color: var(--gold-bright); border: 1px solid var(--gold); border-radius: 4px; padding: 1px 6px;
}
.ap-tag.gold { background: rgba(212, 169, 78, .15); }
.ap-tag.bad { color: #f0c0b5; border-color: #a05045; }
.ap-dot { font-size: 13px; color: #8f7c4d; }
.admin-player.is-online .ap-dot { color: #8fce7a; }
.ap-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 4px; font-size: 14px; }
.ap-crowns { color: var(--gold-bright); display: inline-flex; align-items: center; }
.ap-cheat { color: #cbb889; }
.ap-grid { display: grid; gap: 10px; }
.ap-row label {
  display: block;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8f7c4d;
  margin-bottom: 4px;
}
.ap-inline, .ap-pass-line {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}
.ap-inline.wrap { flex-wrap: wrap; }
.ap-grid input[type=number],
.ap-grid input[type=text],
.ap-grid input[type=password] {
  background: var(--wood); color: var(--parchment);
  border: 1.5px solid var(--gold); border-radius: 5px;
  font-family: inherit; font-size: 14px; padding: 6px 10px;
  min-width: 0;
}
.ap-pass-view { flex: 1; }
.ap-new-pass { flex: 1; }
.ap-crown-amt, .ap-gold { width: 110px; }
.ap-reason { width: min(220px, 100%); }
.ap-check { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.ap-eye.on { filter: brightness(1.4); }
.btn-small { font-size: 13px; padding: 6px 12px; }

.shop-ico {
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold-bright);
}
.shop-ico .ico { width: 40px; height: 40px; margin: 0; }
.card-name .ico { margin-right: 0.3em; }
.help-text p { margin-bottom: 12px; line-height: 1.5; font-size: 16px; }

/* ---------- игра ---------- */
#screen-game { background: #000; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#game-canvas.nuke-aim { cursor: crosshair; }

#hud { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; }
#hud-top {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 10px 14px;
}
.hp-wrap { flex: 1; max-width: 420px; }
.hp-wrap.right { text-align: right; }
.hp-label { font-family: 'Cinzel', serif; font-size: 13px; color: #f0e2b8; text-shadow: 0 1px 3px #000; margin-bottom: 3px; }
.hp-bar {
  height: 16px; border: 2px solid #241708; border-radius: 8px;
  background: rgba(0,0,0,.55);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.6);
}
.hp-fill { height: 100%; width: 100%; background: linear-gradient(#7ec96a, #3f8f2e); transition: width .25s; border-radius: 5px; }
.hp-fill.enemy { background: linear-gradient(#e06550, #9c2e1d); float: right; }

#hud-center { display: flex; flex-direction: column; align-items: center; gap: 5px; margin: 0 auto; }
#hud-gold {
  display: inline-flex;
  align-items: center;
  font-size: 22px; font-weight: 700; color: var(--gold-bright);
  background: rgba(15,10,5,.75);
  border: 2px solid var(--gold); border-radius: 8px;
  padding: 3px 18px;
  text-shadow: 0 1px 2px #000;
}
#hud-info { font-family: 'Cinzel', serif; font-size: 13px; color: #e8d9b0; text-shadow: 0 1px 3px #000; min-height: 16px; }
.hud-btns { display: flex; gap: 6px; pointer-events: auto; }
.hud-btn {
  width: 40px; height: 32px;
  font-size: 15px; font-family: 'Cinzel', serif; font-weight: 700;
  background: rgba(40,28,14,.85); color: var(--parchment);
  border: 2px solid var(--gold); border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.hud-btn:hover { filter: brightness(1.3); }

#hud-bottom { padding: 8px 10px 10px; display: flex; justify-content: center; }
#unit-bar {
  display: flex; gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(rgba(30,20,10,.88), rgba(18,12,6,.92));
  border: 2px solid var(--gold); border-radius: 10px;
  pointer-events: auto;
  box-shadow: 0 6px 24px rgba(0,0,0,.6);
  max-width: 96vw; overflow-x: auto;
}
.unit-card {
  position: relative;
  width: 84px;
  display: flex; flex-direction: column; align-items: center;
  padding: 5px 4px 4px;
  background: rgba(70,48,25,.45);
  border: 2px solid #6b512d; border-radius: 8px;
  cursor: pointer;
  transition: border-color .12s, filter .12s;
  flex-shrink: 0;
}
.unit-card:hover { border-color: var(--gold-bright); filter: brightness(1.15); }
.unit-card canvas { width: 52px; height: 52px; }
.unit-card .uc-name { font-size: 10.5px; color: #e5d5a8; white-space: nowrap; overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
.unit-card .uc-cost { font-size: 12px; font-weight: 700; color: var(--gold-bright); display: inline-flex; align-items: center; gap: 2px; }
.unit-card .uc-key {
  position: absolute; top: 2px; left: 4px;
  font-size: 10px; color: #9b8a5c;
  font-family: 'Cinzel', serif;
}
.unit-card.disabled { filter: grayscale(.7) brightness(.55); cursor: default; }
.unit-card.strike-card { border-color: #8a5a22; }
.unit-card.aiming {
  border-color: #f3cd6f;
  box-shadow: 0 0 14px rgba(255, 180, 60, .55);
  filter: brightness(1.2);
}
.unit-card .uc-cd {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.62);
  border-radius: 6px;
  transform-origin: bottom;
  pointer-events: none;
}

/* Режим для телефона: короткие карточки, панель у самого низа */
body.phone-mode,
body.phone-mode #app {
  height: 100%;
  height: 100dvh;
}
body.phone-mode #hud-bottom {
  padding: 0;
  width: 100%;
}
body.phone-mode #unit-bar {
  gap: 2px;
  padding: 2px 3px 1px;
  border-width: 1px 0 0;
  border-radius: 0;
  width: 100%;
  max-width: none;
  justify-content: center;
  box-shadow: 0 -4px 16px rgba(0,0,0,.45);
}
body.phone-mode .unit-card {
  width: 42px;
  padding: 1px 1px 1px;
  border-width: 1px;
  border-radius: 4px;
}
body.phone-mode .unit-card canvas { width: 18px; height: 18px; }
body.phone-mode .unit-card .uc-name { display: none; }
body.phone-mode .unit-card .uc-cost { font-size: 8px; line-height: 1; }
body.phone-mode .unit-card .uc-cost .ico { width: 8px; height: 8px; }
body.phone-mode .unit-card .uc-key { display: none; }
body.phone-mode .unit-card .uc-cd { border-radius: 3px; }
body.phone-mode #hud-top { padding: 4px 8px; gap: 6px; }
body.phone-mode #hud-gold { font-size: 14px; padding: 1px 8px; }
body.phone-mode .hp-label { font-size: 10px; }
body.phone-mode .hp-bar { height: 10px; }
body.phone-mode .hud-btn { width: 30px; height: 22px; font-size: 12px; }

/* ---------- оверлеи ---------- */
.overlay {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(8,5,2,.7);
  z-index: 10;
}
.overlay.active { display: flex; }
#overlay-banned { z-index: 40; }
#overlay-friend-invite, #overlay-friend-wait { z-index: 35; }

.menu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35em;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 99px;
  background: #8c2f23;
  border: 1px solid #c07060;
  color: #f3e6c4;
  font-size: 12px;
  line-height: 1.4;
}
.friends-search {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.friends-search input {
  flex: 1;
  min-width: 0;
  background: var(--wood);
  color: var(--parchment);
  border: 1.5px solid var(--gold);
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  padding: 8px 12px;
}
.friends-h {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 16px;
  margin: 12px 0 8px;
}
.friends-empty { color: #8f7c4d; font-size: 14px; margin: 0 0 8px; }
.friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, rgba(72, 48, 22, .35), rgba(28, 18, 8, .72));
  border: 2px solid #5a4326;
  border-radius: 10px;
}
.friend-row.is-online { border-color: #6a8a3a; }
.friend-row.is-busy { border-color: #a05045; }
.friend-row.is-busy .ap-dot { color: #f0c0b5; }
.fr-who { min-width: 0; flex: 1; }
.fr-who b { display: block; font-size: 16px; color: #f3e6c4; }
.friend-row .ap-dot { font-size: 13px; }
.fr-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.fr-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.result-body { text-align: center; font-size: 18px; line-height: 1.7; margin: 6px 0 10px; }
.result-body .big-crowns { font-size: 30px; color: var(--gold-bright); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #1a120a; }
::-webkit-scrollbar-thumb { background: #5a4326; border-radius: 5px; }
