/* =================================================================
   THE ARENA — Shell chrome
   Topbar (eye + wordmark + ramp ring + rep + territory + bell),
   bottom 4-tab nav (Forge / Gate / Floor / Wins), the gated-tab
   lock screen, and the scroll container. Room views render INTO
   #view; they should not touch this file.
   ================================================================= */

.arena-app {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  max-width: var(--maxw); margin: 0 auto;
  position: relative;
}

/* ---------- Top bar ---------- */
.arena-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  background: var(--bg-glass); backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.arena-top .eye {
  width: 30px; height: 30px; flex-shrink: 0; color: var(--accent);
  display: grid; place-items: center;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.arena-top .eye svg { width: 100%; height: 100%; display: block; }
.arena-top .wordmark {
  font-family: var(--font); font-weight: 900; font-size: 15px;
  letter-spacing: .14em; color: var(--text-0); white-space: nowrap;
}
.arena-top .spacer { flex: 1; }

/* Ramp progress ring */
.ramp-ring { position: relative; width: 34px; height: 34px; flex-shrink: 0; }
.ramp-ring svg { width: 34px; height: 34px; transform: rotate(-90deg); }
.ramp-ring .ring-bg { stroke: var(--bg-3); }
.ramp-ring .ring-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.ramp-ring .ring-fg.done { stroke: var(--good); }
.ramp-ring .ring-label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 9.5px; font-weight: 800; color: var(--text-1); font-variant-numeric: tabular-nums;
}

/* Rep identity cluster */
.arena-top .rep-id { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; line-height: 1.15; }
.arena-top .rep-id .rn { font-size: 12.5px; font-weight: 700; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.terr-chip {
  margin-top: 2px; display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 650; padding: 2px 7px; border-radius: var(--radius-pill);
  background: var(--hot-wash); color: var(--hot-2); border: 1px solid rgba(255,45,70,.25); white-space: nowrap;
}
.terr-chip.empty { background: var(--bg-3); color: var(--text-3); border-color: var(--line); }

.arena-top .bell {
  position: relative; width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px;
  display: grid; place-items: center; font-size: 17px; color: var(--text-2);
  background: var(--bg-2); border: 1px solid var(--line);
}
.arena-top .bell .dot {
  position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--hot); box-shadow: 0 0 8px var(--hot-glow); border: 1.5px solid var(--bg-1);
}

/* ---------- Scroll body ---------- */
.arena-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 18px 16px calc(var(--bottomnav-h) + var(--safe-bottom) + 24px);
}

/* ---------- Bottom nav (4 gated tabs) ---------- */
.arena-bottomnav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 40;
  width: 100%; max-width: var(--maxw);
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--bottomnav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-glass-strong); backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--line);
}
.arena-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--text-3);
  position: relative; transition: color .15s var(--ease);
}
.arena-tab .ti { font-size: 19px; line-height: 1; }
.arena-tab .tlabel { text-transform: uppercase; }
.arena-tab.active { color: var(--accent-2); }
.arena-tab.active .ti { filter: drop-shadow(0 0 8px var(--accent-glow)); }
.arena-tab.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--grad-sacred);
}
.arena-tab.locked { color: var(--text-dim); }
.arena-tab .lockpip { position: absolute; top: 8px; right: calc(50% - 18px); font-size: 10px; opacity: .8; }
.arena-tab .nbadge {
  position: absolute; top: 7px; right: calc(50% - 22px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
  background: var(--hot); color: #fff; font-size: 10px; font-weight: 800;
  display: grid; place-items: center; box-shadow: 0 0 8px var(--hot-glow);
}

/* ---------- Locked-tab screen (Floor / Wins before cert) ---------- */
.arena-lock { text-align: center; padding: 40px 18px; }
.arena-lock .lk-badge {
  width: 84px; height: 84px; margin: 0 auto 22px; border-radius: 26px;
  display: grid; place-items: center; font-size: 38px;
  background: radial-gradient(circle at 30% 30%, rgba(255,45,70,.18), rgba(196,18,48,.08));
  border: 1px solid rgba(196,18,48,.3); box-shadow: 0 0 40px rgba(196,18,48,.18);
}
.arena-lock h2 { font-family: var(--font); font-size: 22px; font-weight: 800; color: var(--text-0); margin-bottom: 8px; letter-spacing: -.01em; }
.arena-lock p { font-size: 14px; color: var(--mut); max-width: 380px; margin: 0 auto 26px; line-height: 1.6; }

/* Ramp checklist on the lock screen */
.lock-ramp { max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.ramp-step {
  display: flex; align-items: center; gap: 13px; text-align: left;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.ramp-step .rs-ic {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 15px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text-3);
}
.ramp-step.done .rs-ic { background: rgba(52,211,153,.14); border-color: rgba(52,211,153,.35); color: var(--good); }
.ramp-step.now .rs-ic { background: var(--hot-wash); border-color: rgba(255,45,70,.35); color: var(--hot-2); }
.ramp-step .rs-body { flex: 1; min-width: 0; }
.ramp-step .rs-t { font-size: 13.5px; font-weight: 700; color: var(--text-1); }
.ramp-step .rs-s { font-size: 12px; color: var(--mut); margin-top: 1px; }
.ramp-step .rs-go { font-size: 11px; font-weight: 800; color: var(--accent-2); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Unlock celebration banner ---------- */
.arena-unlock {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 90% at 50% 30%, rgba(196,18,48,.22), rgba(10,11,16,.92));
  backdrop-filter: blur(8px); animation: arenaFade .4s var(--ease);
}
.arena-unlock .uc { text-align: center; max-width: 360px; }
.arena-unlock .ueye { width: 92px; height: 92px; margin: 0 auto 24px; color: var(--accent); filter: drop-shadow(0 0 26px var(--accent-glow)); animation: arenaPop .6s var(--ease-bounce); }
.arena-unlock .ueye svg { width: 100%; height: 100%; }
.arena-unlock h1 { font-family: var(--font); font-size: 30px; font-weight: 900; letter-spacing: -.02em; color: #fff; margin-bottom: 10px; }
.arena-unlock p { font-size: 15px; color: var(--text-2); margin-bottom: 28px; }
@keyframes arenaFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes arenaPop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- Coming-soon placeholder (room stubs) ---------- */
.arena-soon { text-align: center; padding: 48px 20px; }
.arena-soon .ic { width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 22px; display: grid; place-items: center; font-size: 32px; background: var(--bg-2); border: 1px solid var(--line); }
.arena-soon h2 { font-family: var(--font); font-size: 21px; font-weight: 800; color: var(--text-0); margin-bottom: 8px; }
.arena-soon p { font-size: 13.5px; color: var(--mut); max-width: 360px; margin: 0 auto; line-height: 1.6; }

/* ---------- Toasts ---------- */
.toast-host { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 16px); z-index: 90; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--bg-glass-strong); border: 1px solid var(--line-strong); color: var(--text-1);
  padding: 11px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-md); animation: toastIn .25s var(--ease); max-width: 90vw;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (min-width: 640px) {
  .arena-app { box-shadow: 0 0 0 1px var(--line); }
}
