/* Меню FLUX — раскладка под ЛОГИЧЕСКИ ландшафтный экран (fake landscape).
   Никаких vw/vh/@media по ширине: они видят ФИЗИЧЕСКИЙ портрет и врут.
   position: absolute (не fixed) — внутри повёрнутого контейнера. */
* { box-sizing: border-box; }
html, body { width:100%; height:100%; margin:0; overflow:hidden; background:#05070f;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif; color:#fff;
  -webkit-user-select:none; user-select:none; touch-action:none; }
canvas { display:block; }
.panel { position:absolute; z-index:10; pointer-events:none; }

/* экран загрузки */
#load { position:absolute; inset:0; background:#05070f; display:flex; flex-direction:column;
  align-items:center; justify-content:center; z-index:100; gap:14px; }
#load .lt { font-size:18px; font-weight:900; letter-spacing:3px; color:#7ee8fa; }
#load .lb { width:min(70%,300px); height:8px; border-radius:4px; background:#141b30; overflow:hidden; }
#load .lf { height:100%; width:0%; background:linear-gradient(90deg,#7ee8fa,#b388ff); transition:width .2s; }
#load .lm { color:#5a6ea0; font-size:12px; }

/* верхняя панель: профиль слева, деньги справа */
#topbar { position:absolute; top:10px; left:12px; right:12px; display:flex;
  justify-content:space-between; align-items:flex-start; pointer-events:none; }
.glass { background:rgba(10,14,28,.85); border:1px solid rgba(126,232,250,.28); border-radius:14px; }
#pcard { display:flex; align-items:center; gap:10px; padding:8px 14px 8px 8px; pointer-events:auto; }
#pava { width:40px; height:40px; border-radius:10px; background:linear-gradient(160deg,#2a3b66,#101830);
  border:1px solid rgba(126,232,250,.5); display:flex; align-items:center; justify-content:center; font-size:20px; }
#pname { font-size:14px; font-weight:900; letter-spacing:.5px; color:#eef4ff; }
#currencies { display:flex; gap:8px; pointer-events:auto; }
.cur { padding:9px 14px; border-radius:14px; font-weight:900; font-size:14px;
  display:flex; align-items:center; gap:7px; }

/* боковые колонки — по центрам краёв */
.sidebtn { pointer-events:auto; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:8px; width:104px; height:92px; border-radius:16px;
  cursor:pointer; font-family:inherit; font-size:13px; font-weight:900; letter-spacing:.5px;
  color:#eef4ff; text-shadow:0 1px 3px rgba(0,0,0,.9); transition:transform .1s;
  border:1px solid rgba(126,232,250,.35); background:rgba(10,14,28,.85); }
.sidebtn:active { transform:scale(.93); }
.sidebtn .bico { width:44px; height:44px; border-radius:12px; display:flex; align-items:center;
  justify-content:center; font-size:22px; flex:none; }
.b-blue .bico { background:linear-gradient(160deg,#1d5f8a,#0e2c4a); box-shadow:0 0 14px rgba(126,232,250,.35); }
.b-purple .bico { background:linear-gradient(160deg,#5b3d8f,#2a1a4e); box-shadow:0 0 14px rgba(179,136,255,.35); }
.b-orange .bico { background:linear-gradient(160deg,#8f5a1d,#4e2c0e); box-shadow:0 0 14px rgba(255,138,61,.35); }
.b-pink .bico { background:linear-gradient(160deg,#8f2a4e,#4e0e2a); box-shadow:0 0 14px rgba(255,138,158,.35); }
#leftcol { position:absolute; left:14px; top:50%; transform:translateY(-60%);
  display:flex; flex-direction:column; gap:14px; }
#rightcol { position:absolute; right:14px; top:50%; transform:translateY(-60%);
  display:flex; flex-direction:column; gap:14px; }

/* нижний блок: выбранный уровень + кнопка */
#playwrap { position:absolute; bottom:22px; left:50%; transform:translateX(-50%);
  text-align:center; pointer-events:auto; }
#selinfo { display:flex; align-items:center; gap:8px; justify-content:center; margin-bottom:8px;
  padding:7px 14px; border-radius:12px; background:rgba(10,14,28,.85);
  border:1px solid rgba(255,213,74,.4); font-size:12.5px; font-weight:800; color:#ffd9a0;
  white-space:nowrap; }
#selinfo .si { font-size:16px; }
#playbtn { min-width:220px; max-width:300px; padding:15px 34px; border:0; border-radius:20px;
  cursor:pointer; font-family:inherit; font-size:19px; font-weight:900; letter-spacing:1.5px;
  color:#04121e; background:linear-gradient(180deg,#8df0ff,#38b6d8 60%,#1f8ab0);
  box-shadow:0 0 28px rgba(126,232,250,.55), 0 6px 0 #13648a, inset 0 2px 0 rgba(255,255,255,.5); }
#playbtn:active { transform:translateY(4px); box-shadow:0 0 18px rgba(126,232,250,.45), 0 2px 0 #13648a; }

/* тост */
#toast { position:absolute; top:22%; left:50%; transform:translateX(-50%);
  padding:11px 20px; border-radius:13px; background:rgba(16,22,42,.92);
  border:1px solid rgba(126,232,250,.5); color:#bfe9ff; font-size:14px; font-weight:800;
  opacity:0; pointer-events:none; transition:opacity .25s; white-space:nowrap; z-index:70; }
#toast.show { opacity:1; }

/* ===== оверлеи (карты / уровни / улучшения) ===== */
.modal { position:absolute; inset:0; z-index:50; display:none; align-items:center;
  justify-content:center; background:rgba(4,6,12,.86); }
.modal.active { display:flex; }
.secbox { width:min(92%, 480px); max-height:92%; padding:20px 22px; border-radius:20px;
  background:rgba(14,18,34,.97); border:1px solid rgba(126,232,250,.35);
  display:flex; flex-direction:column; }
.secbox h3 { margin:0 0 14px; text-align:center; font-size:17px; letter-spacing:1.5px;
  color:#bfe9ff; overflow-wrap:break-word; }
.scrollist { max-height:52%; overflow-y:auto; margin:0 -6px; padding:0 6px; }
.mbtn-wide { width:100%; margin:12px 0 0; min-height:44px; border:0; border-radius:12px;
  background:#2c3f66; color:#c6d4f5; font-weight:800; font-family:inherit; font-size:14px;
  cursor:pointer; }
.mbtn-wide:active { transform:scale(.98); }

/* карточки карт и уровней */
.lvlcard { display:flex; align-items:center; gap:12px; padding:11px 12px; margin-bottom:8px;
  border-radius:13px; border:1px solid rgba(126,232,250,.22); background:#141f3a; cursor:pointer; }
.lvlcard.sel { border-color:#ffd54a; background:#2a2a14; }
.lvlcard.locked { opacity:.4; cursor:default; }
.lvlcard .lic { width:44px; height:44px; border-radius:11px; display:flex; align-items:center;
  justify-content:center; font-size:20px; font-weight:900; flex:none;
  background:linear-gradient(160deg,#1d5f8a,#0e2c4a); }
.lvlcard .ln { font-size:13.5px; font-weight:900; color:#eef4ff; }
.lvlcard .ld { font-size:11px; color:#9db1dd; margin-top:2px; }
.lvlcard .lr { margin-left:auto; font-size:12px; font-weight:900; color:#ffd54a; white-space:nowrap; }

/* карточки улучшений */
.upgcard { display:flex; align-items:center; gap:12px; padding:11px 12px; margin-bottom:8px;
  border-radius:13px; border:1px solid rgba(179,136,255,.25); background:#181436; }
.upgcard .uic { width:42px; height:42px; border-radius:11px; display:flex; align-items:center;
  justify-content:center; font-size:20px; flex:none; background:linear-gradient(160deg,#5b3d8f,#2a1a4e); }
.upgcard .un { font-size:13.5px; font-weight:900; color:#eef4ff; }
.upgcard .ud { font-size:11px; color:#9db1dd; margin-top:2px; }
.upgcard .pips { font-size:10px; color:#b388ff; letter-spacing:2px; margin-top:3px; }
.upgcard button { margin-left:auto; min-height:38px; padding:0 14px; border:0; border-radius:10px;
  background:linear-gradient(180deg,#ffd54a,#f5a623); color:#3a2500; font-weight:900;
  font-family:inherit; font-size:12.5px; cursor:pointer; }
.upgcard button:disabled { opacity:.4; }
