/* /passes/styles.css — Battlepasses styled like Guilds (background + panels + topbar/meta) */

:root{
  --bg-x: 0px;
  --bg-y: 0px;
  --zoom: 1;

  --panel: rgba(10, 12, 16, 0.78);
  --panel2: rgba(10, 12, 16, 0.88);
  --line: rgba(255,255,255,0.12);
  --line2: rgba(255,255,255,0.18);
  --txt: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.66);
  --hover: rgba(255,255,255,0.06);

  --bg-overlay: rgba(0,0,0,0.58);

  --scrollbar-size: 12px;
  --scroll-track: rgba(0,0,0,0.40);
  --scroll-track-border: rgba(255,255,255,0.10);
  --scroll-thumb: rgba(255,255,255,0.16);
  --scroll-thumb-border: rgba(255,255,255,0.14);
  --scroll-thumb-hover: rgba(255,255,255,0.24);
  --scroll-thumb-hover-border: rgba(255,255,255,0.20);
  --scroll-thumb-active: rgba(34,197,94,0.28);
  --scroll-thumb-active-border: rgba(34,197,94,0.38);

  /* ✅ 2× icon sizing */
  --tier-size: 60px;      /* was 44px */
  --tier-gap: 10px;       /* was 8px */
  --main-icon-size: 52px; /* was 26px */
}

html,body{
  height:100%;
  margin:0;
  background:#05070a;
}

body{
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  color: var(--txt);
  background: transparent;
  image-rendering: pixelated;
  position: relative;
}

/* Fixed background layer (doesn't scroll) */
.bg{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("https://myfo2.com/zones/noob-island.png");
  background-repeat: no-repeat;

  background-size: calc(4096px / var(--zoom)) calc(3072px / var(--zoom));
  background-position: var(--bg-x) var(--bg-y);
  background-color: #05070a;
  image-rendering: pixelated;
}

.bg::after{
  content:"";
  position:absolute;
  inset:0;
  background: var(--bg-overlay);
  pointer-events:none;
}

.wrap{
  margin: 0 auto;
  padding: 14px;
  position: relative;
  z-index: 1;
}

.passes-shell{
  margin-top: 10px;
}

/* Header rows (match guilds) */
.topbar{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  backdrop-filter: blur(4px);
  flex-wrap: wrap;
}

.leftbar{
  display:flex;
  gap:10px;
  align-items:center;
  min-width: 240px;
  flex: 1 1 520px;
}

.title{
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}

.searchwrap{
  display:flex;
  align-items:center;
  gap:8px;
  flex: 1 1 380px;
  min-width: 220px;
}

.search{
  font-family: inherit;
  font-size: 1rem;
  color: var(--txt);
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.search::placeholder{ color: rgba(255,255,255,0.45); }

.actions{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  flex: 0 0 auto;
}

.btn{
  font-family: inherit;
  font-size: 1rem;
  color: var(--txt);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 10px;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, opacity .12s ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover{
  background: rgba(255,255,255,0.10);
  border-color: var(--line2);
  transform: translateY(-1px);
}
.btn:active{ transform: translateY(0px); }
.btn[disabled]{
  pointer-events:none;
  opacity:.45;
  transform:none !important;
}

.meta{
  margin-top: 10px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
}
.meta small{
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.4;
}

.row-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 1rem;
  white-space: nowrap;
}

.muted{ color: var(--muted); }

/* App container */
#fo2-battlepasses-app{
  margin-top: 10px;
}

.passes-loading{
  font-size: 12px;
  color: var(--muted);
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
}

.passes-error{
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 120, 120, 0.5);
  color: #ffd2d2;
  margin-bottom: 10px;
}

/* Groups + grid */
.passes-list{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.passes-group{
  margin-top: 10px;
}

.passes-group-heading{
  margin: 0 0 10px 0;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.80);
}

.passes-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1100px){
  .passes-grid{ grid-template-columns: 1fr; }
}

.passes-empty{
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
}

/* Card (guild-like) */
.battlepass-card{
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 12px;
  padding: 12px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  display:flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
}

.battlepass-card:hover{
  background: rgb(0 0 0 / 11%);
  border-color: var(--line2);
  transform: translateY(-1px);
}

.battlepass-card-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
}

.battlepass-card-title-row{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.battlepass-card-title{
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battlepass-card-right{
  display:flex;
  align-items:center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Active/inactive badge (guild badge vibe) */
.battlepass-card-status{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 0.6rem;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}
.battlepass-card-status.is-active{
  border-color: rgba(34,197,94,0.35);
  background: linear-gradient(
    90deg,
    rgba(34,197,94,0.34) 0%,
    rgba(34,197,94,0.10) 60%,
    rgba(34,197,94,0.00) 100%
  );
  color: rgba(255,255,255,0.92);
}

.battlepass-card-sub{
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main item pill (fits the guild tag language) */
.battlepass-main-item-pill{
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(255,255,255,0.06);
  color: var(--txt);
  font-size: 0.8rem;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 420px;
}
.battlepass-main-item-pill:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

.battlepass-main-item-icon{
  width: var(--main-icon-size);   /* ✅ 2× */
  height: var(--main-icon-size);  /* ✅ 2× */
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.20);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  image-rendering: pixelated;
  flex: 0 0 auto;
}
.battlepass-main-item-icon-missing{
  background-image: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(0,0,0,0.30));
}
.battlepass-main-item-label{
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1rem;
}

/* ✅ Tiers: wrap onto new lines (NO SCROLL) + allow tooltip to escape */
.battlepass-tiers{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.16);
  border-radius: 12px;
  padding: 10px;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tier-size), var(--tier-size)));
  gap: var(--tier-gap);
  justify-content: start;
  align-content: start;

  /* ✅ critical: no overflow clipping, so tooltips show */
  overflow: visible;
}

.battlepass-card-empty{
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* ✅ Tier pill (2×) */
.battlepass-tier{
  position: relative;
  width: var(--tier-size);
  height: var(--tier-size);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  padding: 0;
  cursor: pointer;
  outline: none;
  display:flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: visible;
}

.battlepass-tier:hover,
.battlepass-tier:focus-visible{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.16), 0 12px 22px rgba(0,0,0,0.25);

  /* ✅ ensure tooltip draws above neighboring tiles */
  z-index: 80;
}

.battlepass-tier-icon{
  width: 100%;
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  image-rendering: pixelated;
}

.battlepass-tier-icon-missing{
  background-image: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(0,0,0,0.30));
}

.battlepass-tier-badge{
  position: absolute;
  right: 0px;
  bottom: 0px;
  padding: 2px 4px;
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1.2;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 0 #000;
  background: rgba(0,0,0,0.38);
  border: 1px solid rgba(255,255,255,0.10);
}

/* Amount badge (top) for gems / coins */
.battlepass-tier-amount{
  position: absolute;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
  background: rgba(0,0,0,0.38);
  border: 1px solid rgba(255,255,255,0.10);
  text-shadow: 0 1px 0 #000;
}

.battlepass-tier-amount.is-gems{ color: #fc61fc; }
.battlepass-tier-amount.is-coins{ color: #fbf236; }

/* ✅ coins icon “image” was sized 22px, double it */
.battlepass-tier-icon-coins{
  background-size: 44px;
}

/* Tooltip bubble */
.battlepass-tier::after,
.battlepass-tier::before{
  pointer-events:none;
  opacity: 0;
  transition: opacity 0.12s ease-out, transform 0.12s ease-out;
}

.battlepass-tier::after{
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, 6px);
  margin-bottom: 12px;
  max-width: 320px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(10, 12, 16, 0.96);
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.92);
  font-size: 1rem;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(0,0,0,0.55);
  z-index: 9999; /* ✅ make absolutely sure it’s on top */
}

.battlepass-tier::before{
  content:'';
  position:absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, 6px);
  width: 12px;
  height: 8px;
  background: rgba(10, 12, 16, 0.96);
  border-left: 1px solid rgba(255,255,255,0.16);
  border-right: 1px solid rgba(255,255,255,0.16);
  border-top: 1px solid rgba(255,255,255,0.16);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  z-index: 9998;
}

.battlepass-tier:hover::after,
.battlepass-tier:hover::before,
.battlepass-tier:focus-visible::after,
.battlepass-tier:focus-visible::before{
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Mobile */
@media (max-width: 820px){
  .topbar{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .actions{
    width: 100%;
    justify-content: flex-start;
  }

  .passes-grid{
    grid-template-columns: 1fr;
  }

  .battlepass-main-item-label{
    max-width: 200px;
  }
}
