*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    --bg:        #0a0e1a;
    --bg2:       #131a2e;
    --bg3:       #1c2740;
    --accent:    #ff9500;
    --text:      #e8eaf2;
    --muted:     #8892a8;
    --atlas:     #3b82f6;
    --atlas-acc: #60a5fa;
    --void:      #ef4444;
    --void-acc:  #f87171;
    --good:      #06d6a0;
    --bad:       #e94560;
    --warn:      #ffd60a;
}

html, body { height: 100%; overflow: hidden; font-family: 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); user-select: none; }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }

#screen-loading { justify-content: center; align-items: center; background: linear-gradient(160deg, var(--bg), #1a0033); }
.load-box { text-align: center; }
.load-box h1 { font-size: 2.4rem; margin-bottom: .6rem; }
.load-box p  { color: var(--muted); margin-bottom: 1.2rem; }
.spinner { width: 44px; height: 44px; border: 4px solid rgba(255,255,255,.1); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === FORMULÁŘE === */
#screen-pick-profile, #screen-login, #screen-register { justify-content: flex-start; align-items: center; padding: 1.2rem; background: linear-gradient(160deg, var(--bg), var(--bg2)); overflow-y: auto; }
#screen-login { justify-content: center; }
#screen-register { justify-content: flex-start; padding-top: 1.5rem; }
#screen-pick-profile { padding: 0; background: radial-gradient(ellipse at top, #1c2740 0%, var(--bg) 50%, #050912 100%); }

/* === LANDING (Basecamp intro) === */
.landing-wrap { width: 100%; max-width: 540px; padding: 1.4rem 1.1rem 2rem; margin: 0 auto; }
.landing-hero { text-align: center; padding: 1.5rem 0 1.2rem; position: relative; }
.landing-hero::before { content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 60%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent); }
.landing-title {
    font-size: 3rem; font-weight: 900; letter-spacing: 6px;
    background: linear-gradient(180deg, #fff 0%, #ff9500 60%, #c1121f 100%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(255,149,0,.3);
    margin-bottom: .4rem;
}
.landing-sub { color: #d4af37; font-size: 1rem; font-style: italic; letter-spacing: 1px; }

.landing-lore { background: rgba(255,255,255,.04); border-left: 3px solid #d4af37; padding: 1rem 1.2rem; margin: 1rem 0 1.4rem; border-radius: 4px; }
.landing-lore p { color: #cbd0db; font-size: .92rem; line-height: 1.55; margin-bottom: .5rem; font-style: italic; }
.landing-lore p:last-child { margin-bottom: 0; }

/* Banner frakcí */
.faction-banner-wrap { margin-bottom: 1.4rem; }
.faction-banner { display: grid; grid-template-columns: 1fr auto 1fr; gap: .6rem; align-items: stretch; margin-bottom: .8rem; }
.fb-side { background: rgba(0,0,0,.4); border: 2px solid; border-radius: 12px; padding: .8rem .5rem; text-align: center; }
.fb-side.atlas { border-color: var(--atlas); background: linear-gradient(180deg, rgba(59,130,246,.18), rgba(0,0,0,.4)); }
.fb-side.void  { border-color: var(--void);  background: linear-gradient(180deg, rgba(239,68,68,.18),  rgba(0,0,0,.4)); }
.fb-emblem { font-size: 2.2rem; }
.fb-name { font-weight: 900; letter-spacing: 2px; font-size: 1.05rem; margin-top: .1rem; }
.fb-side.atlas .fb-name { color: var(--atlas-acc); }
.fb-side.void  .fb-name { color: var(--void-acc); }
.fb-mini { font-size: .72rem; color: var(--muted); margin-top: .3rem; }
.fb-vs { font-size: 1.4rem; font-weight: 900; align-self: center; color: #d4af37; padding: 0 .3rem; }

.faction-stats-grid { display: flex; flex-direction: column; gap: .35rem; background: rgba(0,0,0,.3); padding: .7rem .8rem; border-radius: 10px; }
.fs-row { display: grid; grid-template-columns: 130px 1fr; gap: .5rem; align-items: center; font-size: .8rem; }
.fs-lab { color: var(--muted); }
.vs-bar { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: #000; }
.vs-bar-a, .vs-bar-v { display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: #fff; min-width: 22px; }
.vs-bar-a { background: var(--atlas); }
.vs-bar-v { background: var(--void); }

.faction-lead { text-align: center; color: #d4af37; font-size: .9rem; font-style: italic; margin-top: .8rem; padding: .6rem; background: rgba(212,175,55,.08); border-radius: 8px; }

.section-h { text-align: center; color: #d4af37; letter-spacing: 2px; margin-bottom: .8rem; font-size: .95rem; }

/* Profile cards rich */
.profile-list-section { margin-top: 1.5rem; }
.profile-card-rich {
    background: var(--bg2); border: 1px solid; border-radius: 12px;
    padding: .65rem .8rem; margin-bottom: .5rem;
    display: flex; gap: .8rem; align-items: center; cursor: pointer;
    transition: transform .1s, border-color .15s;
}
.profile-card-rich:active { transform: scale(.98); }
.profile-card-rich.atlas { border-color: rgba(59,130,246,.4); }
.profile-card-rich.atlas:hover { border-color: var(--atlas); }
.profile-card-rich.void  { border-color: rgba(239,68,68,.4); }
.profile-card-rich.void:hover  { border-color: var(--void); }
.pcr-avatar { font-size: 2rem; flex-shrink: 0; }
.pcr-info { flex: 1; min-width: 0; }
.pcr-top { display: flex; gap: .5rem; align-items: center; margin-bottom: .15rem; }
.pcr-name { font-weight: 700; font-size: 1rem; }
.pcr-stats { font-size: .76rem; color: var(--muted); }
.pcr-time { font-size: .7rem; color: var(--muted); margin-top: .15rem; opacity: .7; }

/* Frakce v registraci - rich */
.faction-pick-rich { display: flex; flex-direction: column; gap: .8rem; margin-bottom: .5rem; }
.faction-card-rich {
    background: var(--bg2); border: 2px solid rgba(255,255,255,.1); border-radius: 14px;
    padding: 1rem; text-align: left; color: var(--text); cursor: pointer;
    transition: transform .1s, border-color .15s;
}
.faction-card-rich:active { transform: scale(.98); }
.faction-card-rich.atlas.selected { border-color: var(--atlas); background: linear-gradient(180deg, rgba(59,130,246,.18), var(--bg2)); }
.faction-card-rich.void.selected  { border-color: var(--void);  background: linear-gradient(180deg, rgba(239,68,68,.18),  var(--bg2)); }
.fcr-emblem { font-size: 2.2rem; text-align: center; margin-bottom: .2rem; }
.fcr-name { font-size: 1.4rem; font-weight: 900; letter-spacing: 3px; text-align: center; }
.faction-card-rich.atlas .fcr-name { color: var(--atlas-acc); }
.faction-card-rich.void  .fcr-name { color: var(--void-acc); }
.fcr-tagline { color: #d4af37; font-style: italic; text-align: center; font-size: .9rem; margin-bottom: .6rem; }
.fcr-lore { color: #cbd0db; font-size: .85rem; line-height: 1.45; margin-bottom: .6rem; }
.fcr-traits { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.fcr-trait { background: rgba(255,255,255,.08); padding: .15rem .55rem; border-radius: 8px; font-size: .75rem; font-weight: 600; }
.profile-box { width: 100%; max-width: 380px; text-align: center; }
.profile-box.wide { max-width: 460px; }
.profile-box h1 { font-size: 2rem; margin-bottom: .4rem; }
.profile-box p { color: var(--muted); margin-bottom: 1rem; }
.form-label { color: var(--text); font-weight: 600; text-align: left; margin: 1rem 0 .4rem; }
.form-error { color: var(--bad); min-height: 1.3rem; margin: .4rem 0; font-size: .9rem; }

input[type=text], input[type=password] {
    width: 100%; padding: .75rem 1rem; font-size: 1.05rem;
    border: 2px solid rgba(255,255,255,.15); border-radius: 10px;
    background: rgba(255,255,255,.04); color: var(--text);
    margin-bottom: .5rem; outline: none; text-align: center;
}
input:focus { border-color: var(--accent); }

button { cursor: pointer; border: none; border-radius: 10px; font-weight: 700; transition: transform .1s, opacity .15s; color: #fff; }
button:active { transform: scale(.96); }
button:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--accent); padding: .9rem; font-size: 1.1rem; width: 100%; margin-top: .8rem; color: #1a1410; }
.btn-ghost   { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); padding: .65rem; width: 100%; margin-top: .5rem; font-size: 1rem; }
.btn-back    { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); padding: .35rem .7rem; font-size: .85rem; }

/* === Výběr profilu === */
#pick-list { display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1rem; }
.profile-card { background: var(--bg2); border: 2px solid rgba(255,255,255,.08); border-radius: 12px; padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .7rem; cursor: pointer; }
.profile-card:active { transform: scale(.97); }
.pc-name { font-weight: 700; }
.pc-faction { font-size: .8rem; padding: .15rem .55rem; border-radius: 8px; font-weight: 700; }
.pc-faction.atlas { background: var(--atlas); color: #fff; }
.pc-faction.void  { background: var(--void); color: #fff; }
.pick-empty { color: var(--muted); padding: 1.5rem; }

/* === Frakce výběr === */
.faction-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .5rem; }
.faction-card { background: var(--bg2); border: 2px solid rgba(255,255,255,.08); border-radius: 14px; padding: 1rem .5rem; text-align: center; }
.faction-card.selected[data-faction=atlas] { border-color: var(--atlas); background: rgba(59,130,246,.18); }
.faction-card.selected[data-faction=void]  { border-color: var(--void);  background: rgba(239,68,68,.18); }
.fc-icon { font-size: 2rem; margin-bottom: .3rem; }
.fc-name { font-weight: 700; font-size: 1.05rem; }
.fc-desc { color: var(--muted); font-size: .78rem; margin-top: .2rem; }

/* === Avatary (panáčci) === */
.avatar-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-bottom: .5rem; }
.avatar-card { background: var(--bg2); border: 2px solid rgba(255,255,255,.08); border-radius: 12px; padding: .5rem .25rem; text-align: center; cursor: pointer; transition: transform .1s, border-color .15s; }
.avatar-card:active { transform: scale(.95); }
.avatar-card.selected { border-color: var(--accent); background: rgba(255,149,0,.18); }
.av-emoji { font-size: 1.7rem; }
.av-label { font-size: .65rem; color: var(--muted); margin-top: .15rem; }

/* avatar nad hráčovou tečkou */
.player-avatar { font-size: 1.6rem; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); margin-bottom: 1px; }
.player-avatar.small { font-size: 1.3rem; }
.player-marker-wrap { display: flex; flex-direction: column; align-items: center; }

/* === Barvy === */
.color-pick { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; justify-content: center; }
.color-dot { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: transform .1s; }
.color-dot.selected { border-color: #fff; transform: scale(1.15); }

/* === MAPA === */
#map { position: absolute; inset: 0; z-index: 1; background: #1a1a2e; }

#hud-top {
    position: absolute; top: 0; left: 0; right: 0; z-index: 1000;
    padding: .5rem .6rem; background: rgba(10,14,26,.92); backdrop-filter: blur(8px);
    display: flex; flex-direction: column; gap: .3rem;
    border-bottom: 1px solid rgba(255,255,255,.05);
}
.hud-player { display: flex; align-items: center; gap: .5rem; }
.hud-name { font-weight: 800; font-size: .95rem; }
.hud-faction { font-size: .7rem; padding: .12rem .5rem; border-radius: 6px; font-weight: 700; }
.hud-faction.atlas { background: var(--atlas); }
.hud-faction.void  { background: var(--void); }
.hud-resources { display: flex; flex-wrap: wrap; gap: .25rem; }
.hud-res-pill { background: rgba(255,255,255,.08); border-radius: 8px; padding: .15rem .45rem; font-size: .78rem; display: flex; gap: .15rem; align-items: center; }

#hud-bottom {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(10,14,26,.92); backdrop-filter: blur(8px);
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    border-top: 1px solid rgba(255,255,255,.05);
}
.hud-btn { background: transparent; padding: .55rem .25rem; font-size: 1.4rem; display: flex; flex-direction: column; align-items: center; gap: .15rem; border-radius: 0; }
.hud-btn:active { background: rgba(255,255,255,.08); }
.hud-lbl { font-size: .65rem; color: var(--muted); font-weight: 600; }

/* === Mapové prvky === */
.player-dot { width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 4px rgba(0,0,0,.4); animation: pulse 2s ease-in-out infinite; }

/* Tlačítko skrýt suroviny */
.map-toggle {
    position: absolute; top: 5rem; right: .5rem; z-index: 1000;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(10,14,26,.92); color: #fff; font-size: 1.3rem;
    border: 1px solid rgba(255,255,255,.2); cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.map-toggle:active { transform: scale(.92); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(0,0,0,.4); } 50% { box-shadow: 0 0 0 9px rgba(0,0,0,0); } }
.other-player-dot { width: 16px; height: 16px; border: 2.5px solid #fff; border-radius: 50%; box-shadow: 0 0 0 3px rgba(0,0,0,.4); }
.other-player-name { font-size: .7rem; padding: 1px 6px; background: rgba(0,0,0,.75); color: #fff; border-radius: 8px; white-space: nowrap; margin-bottom: 2px; font-weight: 600; text-align: center; }
.player-marker-wrap { display: flex; flex-direction: column; align-items: center; }

/* základna */
.base-marker { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.base-icon { font-size: 2.4rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); transition: transform .15s; }
.base-icon.atlas { filter: drop-shadow(0 0 8px var(--atlas-acc)) drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.base-icon.void  { filter: drop-shadow(0 0 8px var(--void-acc))  drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.base-icon.is-mine { font-size: 2.8rem; }
.base-icon.shielded { animation: shieldShine 1.2s ease-in-out infinite alternate; }
@keyframes shieldShine { from { filter: drop-shadow(0 0 6px #fff); } to { filter: drop-shadow(0 0 16px #fff); } }
.base-hpbar { width: 50px; height: 5px; background: rgba(0,0,0,.6); border-radius: 3px; overflow: hidden; margin-top: 2px; border: 1px solid rgba(255,255,255,.2); }
.base-hpfill { height: 100%; background: var(--good); transition: width .4s; }
.base-hpfill.mid { background: var(--warn); }
.base-hpfill.low { background: var(--bad); }
.base-name-tag { font-size: .7rem; color: #fff; background: rgba(0,0,0,.7); padding: 0 5px; border-radius: 6px; margin-top: 2px; font-weight: 600; white-space: nowrap; }

/* surovina */
.res-marker { font-size: 1.4rem; cursor: pointer; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); transition: transform .15s; }
.res-marker.bonus { animation: bonusGlow 1s ease-in-out infinite alternate; }
@keyframes bonusGlow { from { filter: drop-shadow(0 0 4px gold) drop-shadow(0 1px 3px rgba(0,0,0,.6)); } to { filter: drop-shadow(0 0 12px gold) drop-shadow(0 1px 3px rgba(0,0,0,.6)); } }
.res-marker.near { animation: resNear 1s ease-in-out infinite; }
@keyframes resNear { 0%,100% { transform: scale(1); } 50% { transform: scale(1.25); } }

/* raketa v letu */
.rocket-marker { font-size: 1.5rem; filter: drop-shadow(0 0 6px #ff9500) drop-shadow(0 2px 4px rgba(0,0,0,.5)); animation: rocketWobble .25s linear infinite; }
@keyframes rocketWobble { 0%,100% { transform: translateY(-1px); } 50% { transform: translateY(1px); } }

/* === Panely (sbírka, žebříček, atd.) === */
.panel-header { display: flex; align-items: center; gap: .8rem; padding: .6rem 1rem; background: var(--bg2); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid rgba(255,255,255,.06); }
.panel-header h2 { font-size: 1.1rem; }
.panel-content { padding: 1rem; overflow-y: auto; flex: 1; }

/* === Inventář === */
.bag-section { margin-bottom: 1.2rem; }
.bag-section h3 { font-size: .9rem; color: var(--muted); margin-bottom: .5rem; text-transform: uppercase; letter-spacing: 1px; }
.bag-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.bag-card { background: var(--bg2); border-radius: 10px; padding: .6rem .8rem; display: flex; gap: .5rem; align-items: center; }
.bag-icon { font-size: 1.5rem; }
.bag-text strong { font-size: .9rem; }
.bag-text small { color: var(--muted); display: block; font-size: .75rem; }
.bag-amount { margin-left: auto; font-weight: 800; font-size: 1rem; color: var(--accent); }

/* === Základna === */
.base-summary { background: var(--bg2); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; }
.base-summary h3 { margin-bottom: .5rem; }
.bs-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .8rem; font-size: .9rem; margin-bottom: .6rem; }
.bs-stats div { color: var(--muted); }
.bs-stats strong { color: var(--text); }
.bs-hp { background: rgba(0,0,0,.5); border-radius: 8px; height: 16px; position: relative; overflow: hidden; margin-bottom: .5rem; }
.bs-hp-fill { height: 100%; background: var(--good); transition: width .4s; }
.bs-hp-text { position: absolute; inset: 0; text-align: center; font-size: .75rem; line-height: 16px; font-weight: 700; }
.actions-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.actions-row button { flex: 1; min-width: 100px; padding: .55rem; font-size: .85rem; }
.btn-action { background: var(--bg3); border: 1px solid rgba(255,255,255,.15); }
.btn-action:disabled { background: var(--bg3); color: var(--muted); border-color: rgba(255,255,255,.05); }
.btn-action.primary { background: var(--accent); color: #1a1410; }

.section-title { font-size: .85rem; color: var(--muted); margin: 1rem 0 .5rem; text-transform: uppercase; letter-spacing: 1px; }

.tower-list { display: flex; flex-direction: column; gap: .5rem; }
.tower-row { background: var(--bg2); border-radius: 10px; padding: .6rem .8rem; display: flex; gap: .6rem; align-items: center; }
.tower-row.frozen { opacity: .6; }
.tower-row.dead { opacity: .4; filter: grayscale(1); }
.tw-icon { font-size: 1.6rem; }
.tw-info { flex: 1; }
.tw-name { font-weight: 700; font-size: .95rem; }
.tw-stats { color: var(--muted); font-size: .75rem; }
.tw-mini-hp { background: rgba(0,0,0,.5); border-radius: 4px; height: 5px; margin-top: .2rem; overflow: hidden; }
.tw-mini-hp-fill { background: var(--good); height: 100%; transition: width .3s; }
.tw-actions { display: flex; gap: .3rem; }
.tw-actions button { padding: .35rem .55rem; font-size: .75rem; background: var(--bg3); }

.empty-section { color: var(--muted); padding: 1rem; text-align: center; font-size: .9rem; background: var(--bg2); border-radius: 10px; }

/* === Modální okna === */
.modal { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; padding: 1rem; }
.modal.show { display: flex; }
.modal-bg { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(5px); }
.modal-box { position: relative; background: linear-gradient(160deg, var(--bg2), var(--bg)); border: 2px solid rgba(255,255,255,.1); border-radius: 16px; padding: 1.2rem 1rem; max-width: 400px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-box h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.modal-sub { color: var(--muted); font-size: .85rem; margin-bottom: .8rem; }
.modal-actions { display: flex; gap: .5rem; margin-top: 1rem; }
.modal-actions button { flex: 1; padding: .7rem; font-size: 1rem; }

.cost-line { display: flex; flex-wrap: wrap; gap: .35rem; margin: .35rem 0; }
.cost-pill { background: rgba(255,255,255,.07); padding: .15rem .5rem; border-radius: 8px; font-size: .8rem; }
.cost-pill.lacking { background: rgba(233,69,96,.2); color: var(--bad); }

.tower-pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .8rem 0; }
.tp-card { background: var(--bg3); border: 2px solid transparent; border-radius: 12px; padding: .6rem .5rem; cursor: pointer; text-align: left; color: var(--text); }
.tp-card.selected { border-color: var(--accent); }
.tp-card.disabled { opacity: .5; }
.tp-icon { font-size: 1.6rem; }
.tp-name { font-weight: 700; font-size: .9rem; }
.tp-desc { font-size: .72rem; color: var(--muted); }
.tp-stats { font-size: .7rem; color: var(--muted); margin-top: .25rem; }

/* === Notifikace === */
#notification {
    position: fixed; bottom: 4.5rem; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.88); color: #fff; padding: .55rem 1.1rem; border-radius: 20px;
    font-size: .88rem; z-index: 9000; opacity: 0; transition: opacity .3s; pointer-events: none;
    max-width: 92vw; text-align: center;
}
#notification.show { opacity: 1; }

#alert-area {
    position: absolute; top: 4.5rem; left: 50%; transform: translateX(-50%);
    z-index: 1500; display: flex; flex-direction: column; gap: .4rem; max-width: 90vw;
}
.alert-rocket { background: rgba(239,68,68,.92); color: #fff; padding: .5rem .9rem; border-radius: 10px; font-size: .85rem; font-weight: 700; box-shadow: 0 4px 12px rgba(239,68,68,.5); animation: alertPulse 1s ease-in-out infinite; }
@keyframes alertPulse { 0%,100% { box-shadow: 0 4px 12px rgba(239,68,68,.5); } 50% { box-shadow: 0 4px 20px rgba(239,68,68,.9); } }

/* === Žebříček === */
.lb-row { background: var(--bg2); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .4rem; display: flex; gap: .5rem; align-items: center; }
.lb-row.is-me { border: 2px solid var(--accent); }
.lb-rank { font-size: 1.3rem; min-width: 32px; text-align: center; }
.lb-name { font-weight: 700; flex: 1; }
.lb-faction { font-size: .7rem; padding: .12rem .45rem; border-radius: 6px; font-weight: 700; }
.lb-faction.atlas { background: var(--atlas); }
.lb-faction.void  { background: var(--void); }
.lb-stats { font-size: .75rem; color: var(--muted); text-align: right; }

/* === Nastavení === */
.set-section { background: var(--bg2); border-radius: 12px; padding: .8rem; margin-bottom: .7rem; }
.set-section h4 { margin-bottom: .5rem; font-size: .95rem; }
.set-section p { color: var(--muted); font-size: .83rem; margin-bottom: .5rem; }

/* =========================================================
   MOBIL / RESPONZIVITA — hraje se venku na telefonu s GPS.
   Nic nesmí přetékat vodorovně, ovládání musí jít prstem.
   Na PC (širší displeje) se nic nemění.
   ========================================================= */

/* Nikdy vodorovné rolování celé stránky */
html, body { max-width: 100%; overflow-x: hidden; }

/* Obrázky/plátna se vejdou do šířky */
img, canvas, svg { max-width: 100%; }

/* Mapa a Leaflet se vždy vejdou do obrazovky */
#map, .leaflet-container { max-width: 100%; }

/* Formulářové obrazovky respektují ořez displeje (notch) */
#screen-pick-profile, #screen-login, #screen-register,
.panel-content {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

/* Dolní HUD nad domovským indikátorem telefonu */
#hud-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* Ovládání reaguje na dotyk okamžitě (bez 300ms prodlevy),
   dvojklik nezoomuje tlačítka */
button, .hud-btn, .btn-primary, .btn-ghost, .btn-back, .btn-action,
.profile-card, .profile-card-rich, .faction-card, .faction-card-rich,
.avatar-card, .color-dot, .tp-card, .map-toggle,
.res-marker, .base-marker, .cost-pill {
    touch-action: manipulation;
}

/* Dlouhé bloky, které by mohly přetéct, radši scrollují uvnitř sebe */
.cost-line, .hud-resources, .fcr-traits { max-width: 100%; }

/* === Malé telefony (do 480 px) === */
@media (max-width: 480px) {
    /* Dotykové cíle v dolní liště pořádně velké na prst */
    .hud-btn { padding: .6rem .2rem; min-height: 56px; font-size: 1.5rem; }
    .hud-lbl { font-size: .68rem; }

    /* Tlačítko skrýt suroviny větší a dobře dosažitelné */
    .map-toggle { width: 50px; height: 50px; font-size: 1.4rem; }

    /* Landing titul se vejde i na úzký displej */
    .landing-title { font-size: 2.4rem; letter-spacing: 4px; }
    .landing-wrap { padding: 1.2rem .9rem 2rem; }

    /* Statistiky frakcí: užší popisek, ať se vejde bar */
    .fs-row { grid-template-columns: 96px 1fr; font-size: .74rem; }

    /* Karty věží/dolů v modalu do dvou sloupců, ale čitelné */
    .tower-pick-grid { gap: .4rem; }

    /* Avatary: 5 ve dvou řadách zůstává, ale menší mezery */
    .avatar-pick { gap: .3rem; }

    /* Modal skoro přes celou šířku */
    .modal { padding: .6rem; }
    .modal-box { padding: 1rem .85rem; }

    /* Barevné tečky větší na prst */
    .color-dot { width: 40px; height: 40px; }

    /* Akční tlačítka pohodlná na dotyk */
    .btn-action { min-height: 44px; }
    .tw-actions button { min-height: 40px; padding: .45rem .6rem; }
}

/* === Velmi úzké telefony (do 360 px) === */
@media (max-width: 360px) {
    .landing-title { font-size: 2rem; letter-spacing: 3px; }
    .avatar-pick { grid-template-columns: repeat(4, 1fr); }
    .hud-name { font-size: .88rem; }
    .fcr-name { font-size: 1.2rem; }
}

/* === Na výšku i šířku: mapové obrazovky drží plnou výšku ===
   (mobilní prohlížeče: použij dynamickou výšku, ať HUD nezakryje lišta) */
@supports (height: 100dvh) {
    html, body { height: 100dvh; }
}

/* Na krajině (landscape) na telefonu zmenši výšku dolní lišty,
   ať zbyde víc místa na mapu */
@media (max-height: 480px) and (orientation: landscape) {
    .hud-btn { padding: .35rem .2rem; min-height: 40px; font-size: 1.2rem; }
    .hud-lbl { font-size: .6rem; }
    #hud-top { padding: .3rem .5rem; }
}
