/* Created by OrelAI - Brigagame 2.0 (https://github.com/ubriga/brigagame) */
/* Player menu v2 (body.nav2). Classic layout is untouched when the class is absent. */
#tabbar { display: none; }
.n2-only { display: none; }
body.nav2 .n2-only { display: inline-flex; align-items: center; gap: 6px; }
.n2-hide { display: none !important; }

/* top nav keeps only the four destinations; everything else lives in lobby / Me */
body.nav2 #topbar nav a[data-nav="custom"],
body.nav2 #topbar nav a[data-nav="war"],
body.nav2 #topbar nav a[data-nav="messages"],
body.nav2 #topbar nav a[data-nav="tags"],
body.nav2 #topbar nav a[data-nav="contact"] { display: none; }

/* lobby */
body.nav2 #view > h1 + p.sub { display: none; }
body.nav2 #view .ux-welcome { padding: 10px 12px; font-size: 13.5px; margin: 0 0 10px; }
.n2-grid { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin-inline: auto; }
.n2-card { padding: 14px; }
.n2-play { display: flex; flex-direction: column; gap: 10px; }
.n2-primary { width: 100%; min-height: 76px; font-size: 22px; font-weight: 900; }
.n2-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.n2-mode { min-height: 48px; font-size: 16px; font-weight: 800; }
.n2-mode.on { background: linear-gradient(145deg, #623415, #4d2810); box-shadow: inset 0 0 0 1px rgba(211,137,53,.5); }
.n2-panel { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid rgba(211,137,53,.28); border-radius: 12px; background: rgba(0,0,0,.14); }
.n2-panel.hidden { display: none !important; }
.n2-panel .ai-start { display: flex; flex-direction: column; gap: 8px; }
.n2-links { display: flex; justify-content: center; margin-top: 6px; }
.n2-link { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 14px; min-height: 44px; padding: 8px 14px; box-shadow: none; }
.n2-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.n2-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px; padding: 10px; text-align: center; }
.n2-tile b { font-size: 16px; }
.n2-tile small { color: var(--muted); font-size: 12px; font-weight: 400; }
.n2-daily .n2-daily-btn { width: 100%; margin: 0 !important; min-height: 48px; }
body.nav2 #fs-inline { margin: 6px auto 10px; max-width: 560px; padding: 8px 12px; font-size: 14px; }

/* Me screen */
.n2-me { display: flex; flex-direction: column; gap: 6px; max-width: 560px; margin-inline: auto; }
.n2-who { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.n2-who h2 { margin: 0; }
.n2-sec { margin: 14px 4px 4px; font-size: 14px; color: var(--muted); font-weight: 700; }
.n2-list { display: flex; flex-direction: column; border: 1px solid rgba(211,137,53,.24); border-radius: 14px; overflow: hidden; background: rgba(46,24,10,.55); }
.n2-item { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 14px; background: none; border: 0; border-bottom: 1px solid rgba(211,137,53,.14); color: var(--text); font: inherit; font-size: 16px; text-align: start; cursor: pointer; width: 100%; }
.n2-item:last-child { border-bottom: 0; }
.n2-item:active, .n2-item:hover { background: rgba(211,137,53,.12); }
.n2-item .il { flex: 1; }
.n2-item .iv { color: var(--muted); font-size: 14px; }
.n2-item .ia { color: var(--muted); font-size: 20px; }
.n2-item.danger .il { color: #ff9b8a; }
.n2-item .badge { position: static; }

/* mobile / tablet: bottom tab bar replaces the top nav and the secondary header chips */
@media (max-width: 899px) {
  body.nav2 #topbar nav { display: none; }
  body.nav2 #topbar { grid-template-columns: 1fr; }
  body.nav2 #topbar .user-chip { justify-content: space-between; width: 100%; }
  body.nav2 #lang-btn, body.nav2 #gfx-btn, body.nav2 #install-btn { display: none !important; }
  body.nav2:not(.game-active):not(.fs-mode):not(.login-active) #tabbar {
    display: flex; position: fixed; z-index: 70; left: 0; right: 0; bottom: 0;
    height: calc(62px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(36,19,10,.97); border-top: 1px solid rgba(211,137,53,.35);
    backdrop-filter: blur(10px); direction: rtl;
  }
  body.nav2 #tabbar.hidden { display: none !important; }
  #tabbar a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 12px; min-width: 0; -webkit-tap-highlight-color: transparent; }
  #tabbar a .ti { width: 26px; height: 26px; display: inline-flex; }
  #tabbar a .ti svg { width: 100%; height: 100%; }
  #tabbar a.on { color: var(--accent); }
  #tabbar a.on::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  #tabbar .badge { position: absolute; top: 6px; inset-inline-start: calc(50% + 6px); }
  body.nav2:not(.game-active):not(.fs-mode):not(.login-active) main { padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
  body.nav2:not(.game-active):not(.fs-mode):not(.login-active) footer { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  body.nav2:not(.game-active):not(.fs-mode) #toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  body.nav2:not(.game-active):not(.fs-mode) .install-card { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  body.nav2 #fs-float { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
}
/* short landscape phones: keep the bar slim, labels beside icons */
@media (max-width: 899px) and (max-height: 520px) {
  body.nav2:not(.game-active):not(.fs-mode):not(.login-active) #tabbar { height: calc(46px + env(safe-area-inset-bottom, 0px)); }
  #tabbar a { flex-direction: row; gap: 8px; font-size: 13px; }
  #tabbar a .ti { width: 22px; height: 22px; }
  body.nav2:not(.game-active):not(.fs-mode):not(.login-active) main { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 380px) { .n2-primary { font-size: 20px; min-height: 68px; } .n2-tile b { font-size: 14px; } }

/* polish */
body.nav2 #view.n2-lobby > p.sub, body.nav2 #view.n2-lobby > p.dim { display: none; }
body.nav2 #view.n2-lobby #fs-inline { display: none !important; }
.n2-modes { align-items: stretch; }
.n2-mode { margin: 0 !important; }
@media (max-width: 899px) { body.nav2 #topbar .brand { display: none; } }
body.nav2 #view.n2-lobby > .lobby-title, body.nav2 #view.n2-lobby > #tip-line { display: none; }
body.nav2 #view.n2-lobby > h1 { margin: 4px 0 10px; font-size: 24px; }
body.nav2 #mailtip { font-size: 12.5px; line-height: 1.5; }

/* back bar on inner screens */
body.nav2 .n2-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 8px 16px; margin: 4px 0 10px; border: 1px solid rgba(211,137,53,.45); border-radius: 12px; background: rgba(36,19,10,.55); color: var(--text, #f3e6d0); font: inherit; font-size: 16px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
body.nav2 .n2-back span { font-size: 20px; line-height: 1; color: var(--accent); }
body.nav2 .n2-back:hover, body.nav2 .n2-back:focus-visible { border-color: var(--accent); }

.n2-x { position: absolute; top: 8px; inset-inline-start: 8px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(211,137,53,.45); background: rgba(36,19,10,.8); color: var(--text, #f3e6d0); font-size: 20px; cursor: pointer; z-index: 2; }
body.nav2 .n2-back { position: sticky; top: 8px; z-index: 40; box-shadow: 0 2px 10px rgba(0,0,0,.45); }
