:root{
  --bg:#0b0f14;
  --bg2:#0f1620;
  --card:#111a24;
  --card2:#0e141d;
  --text:#e6edf3;
  --muted:#93a4b6;
  --gold:#d6b25e;
  --gold2:#a88233;
  --red:#ff5a6a;
  --green:#4ee38a;
  --outline:rgba(214,178,94,.35);
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(214,178,94,.10), transparent 60%),
    radial-gradient(900px 500px at 90% 20%, rgba(78,227,138,.08), transparent 55%),
    radial-gradient(900px 700px at 60% 95%, rgba(255,90,106,.07), transparent 55%),
    linear-gradient(180deg, var(--bg), #070a0f 60%, #06080c);
	background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  background-position: center top;
}

a{color:inherit; text-decoration:none}
a:hover{color:var(--gold)}

.container{max-width:1200px; margin:0 auto; padding:22px 18px 44px}
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; margin-bottom:18px;
}
.brand{
  display:flex; align-items:center; gap:14px;
}
.logo{
  width:44px; height:44px; border-radius:14px;
  background: radial-gradient(circle at 30% 30%, rgba(214,178,94,.75), rgba(214,178,94,.15) 45%, rgba(17,26,36,.0) 70%),
              linear-gradient(135deg, rgba(214,178,94,.35), rgba(17,26,36,.0));
  border:1px solid var(--outline);
  box-shadow: var(--shadow);
  position:relative;
}
.logo:after{
  content:"";
  position:absolute; inset:10px 12px;
  border:1px solid rgba(214,178,94,.45);
  border-left-color:transparent;
  border-bottom-color:transparent;
  border-radius:10px;
  transform:rotate(18deg);
}
.title h1{margin:0; font-size:20px; letter-spacing:.4px}
.title .sub{margin-top:2px; font-size:12px; color:var(--muted)}

.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(17,26,36,.65);
  backdrop-filter: blur(10px);
  color:var(--muted);
  font-size:12px;
}
.dot{width:8px; height:8px; border-radius:999px; background:var(--gold); box-shadow:0 0 12px rgba(214,178,94,.35)}

.grid{display:grid; grid-template-columns: 1.4fr .9fr; gap:16px}
@media (max-width: 960px){ .grid{grid-template-columns:1fr} }

.card{
  background: linear-gradient(180deg, rgba(17,26,36,.92), rgba(12,18,26,.82));
  border:1px solid rgba(214,178,94,.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card .head{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  background: linear-gradient(180deg, rgba(214,178,94,.10), rgba(17,26,36,.0));
  border-bottom:1px solid rgba(255,255,255,.06);
}
.card .head h2{margin:0; font-size:14px; letter-spacing:.3px}
.card .body{padding:14px 16px}

.table{width:100%; border-collapse:collapse}
.table th,.table td{padding:10px 10px; border-bottom:1px solid rgba(255,255,255,.06); font-size:13px}
.table th{color:var(--muted); font-weight:600; letter-spacing:.2px; text-align:left; font-size:12px}
.table tr:hover td{background:rgba(255,255,255,.02)}
.right{text-align:right}

.kpi{
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  color:var(--muted); font-size:12px;
}
.kpi strong{color:var(--text)}
.progress{
  width:180px; height:8px; border-radius:999px;
  background: rgba(255,255,255,.06);
  overflow:hidden; border:1px solid rgba(255,255,255,.06);
}
.progress > span{display:block; height:100%; background: linear-gradient(90deg, rgba(214,178,94,.9), rgba(214,178,94,.25)); width:0%}

/* Green timer bar */
.progress.green{border-color: rgba(78,227,138,.28); background: rgba(78,227,138,.08)}
.progress.green > span{background: linear-gradient(90deg, rgba(78,227,138,.92), rgba(78,227,138,.25))}

.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:9px 12px; border-radius:12px;
  background: rgba(214,178,94,.14);
  border:1px solid rgba(214,178,94,.30);
  color: var(--text);
  font-size:13px;
}
.btn:hover{background: rgba(214,178,94,.22); border-color: rgba(214,178,94,.45)}
.btn.secondary{background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.10); color:var(--muted)}
.btn.secondary:hover{background: rgba(255,255,255,.08); color:var(--text)}

.badge{
  display:inline-flex; align-items:center; padding:3px 8px;
  border-radius:999px; font-size:12px;
  border:1px solid rgba(255,255,255,.10);
  color:var(--muted);
}
.badge.ok{color:var(--green); border-color: rgba(78,227,138,.30); background: rgba(78,227,138,.08)}
.badge.no{color: rgba(147,164,182,.8); background: rgba(255,255,255,.03)}

.small{font-size:12px; color:var(--muted)}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}

.search{
  display:flex; gap:10px; align-items:center;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:10px 12px;
}
.search input{
  width:100%;
  background: transparent; border:0; outline:0; color:var(--text);
}

/* Generic form controls (used by the builder) */
input, select, textarea{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  outline: none;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(214,178,94,.35);
  box-shadow: 0 0 0 3px rgba(214,178,94,.10);
}
select{padding-right: 34px;}


.itemcell{display:flex; gap:10px; align-items:center;}
.itemicon{
  width:32px; height:32px; border-radius:10px; overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  flex:0 0 auto;
}
.itemicon img{width:32px; height:32px; object-fit:cover; display:block}
.itemmeta strong{display:block}
.itemmeta .subline{font-size:12px; color: var(--muted)}

/* ---- Tile cards ---- */
.tile-grid{display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:12px;}
@media (max-width: 1100px){ .tile-grid{grid-template-columns: repeat(2, minmax(0, 1fr));} }
@media (max-width: 720px){ .tile-grid{grid-template-columns: 1fr;} }

.boss-section{margin-bottom:12px;}
.boss-summary{
  cursor:pointer;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px;
  border-radius:14px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
}
.boss-summary:hover{border-color: rgba(214,178,94,.25); background: rgba(255,255,255,.05);}
.boss-summary .name{font-weight:750; letter-spacing:.2px}
.boss-summary .meta{color:var(--muted); font-size:12px}
.boss-summary .chev{opacity:.75}

.tile{
  position:relative;
  border-radius:16px;
  padding:12px;
  background: linear-gradient(180deg, rgba(17,26,36,.92), rgba(12,18,26,.82));
  border:1px solid rgba(255,255,255,.08);
  overflow:hidden;
  transition: transform .12s ease, border-color .12s ease;
}
.tile:hover{transform: translateY(-1px); border-color: rgba(214,178,94,.28);}

.tile .row{display:flex; gap:10px; align-items:flex-start;}
.tile .icon{
  width:44px; height:44px; border-radius:14px; overflow:hidden;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.10);
  flex:0 0 auto;
}
.tile .icon img{width:44px; height:44px; object-fit:cover; display:block}
.tile .title{font-weight:800; line-height:1.1}
.tile .sub{color:var(--muted); font-size:12px; margin-top:2px}
.tile .tags{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px}
.tag{font-size:12px; color:var(--muted); border:1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.03); padding:3px 8px; border-radius:999px}
.tag.points{color: rgba(214,178,94,.95); border-color: rgba(214,178,94,.25); background: rgba(214,178,94,.08)}
.tag.done{color: var(--green); border-color: rgba(78,227,138,.28); background: rgba(78,227,138,.08)}

.tile[data-tier="1"]{box-shadow:none;}
.tile[data-tier="2"]{box-shadow: 0 0 24px rgba(214,178,94,.08);}
.tile[data-tier="3"]{box-shadow: 0 0 28px rgba(214,178,94,.14);}
.tile[data-tier="4"]{box-shadow: 0 0 34px rgba(255,90,106,.12);}
.tile[data-tier="5"]{box-shadow: 0 0 38px rgba(255,90,106,.18);}

.tile.completed{border-color: rgba(78,227,138,.35);}
.tile.completed::before{
  content:"";
  position:absolute;
  inset:0;                  /* stay inside tile */
  border-radius:inherit;    /* match tile rounding */
  background: radial-gradient(
    circle at 30% 30%,
    rgba(78,227,138,.15),
    transparent 100%
  );
  pointer-events:none;
  opacity:.9;
}


.tile .check{
  position:absolute; top:10px; right:10px;
  width:26px; height:26px;
  border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid rgba(78,227,138,.35);
  background: rgba(78,227,138,.10);
  color: var(--green);
  font-weight:900;
}

@keyframes goldPulse {
  0%{ box-shadow: 0 0 0 rgba(214,178,94,0); }
  35%{ box-shadow: 0 0 36px rgba(214,178,94,.30); }
  100%{ box-shadow: 0 0 0 rgba(214,178,94,0); }
}
.tile.just-completed{
  animation: goldPulse 1.15s ease-out 1;
  border-color: rgba(214,178,94,.45);
}


/* ---- Disclosure tiles (default collapsed) ---- */
.tile-disclosure{padding:0;}
.tile-disclosure > summary{
  list-style:none;
}
.tile-disclosure > summary::-webkit-details-marker{display:none;}
.tile-summary{
  padding:12px;
  cursor:pointer;
}
.tile-body{
  padding:0 12px 12px 12px;
  border-top:1px solid rgba(255,255,255,.06);
}

/* closed look (matches your "disclosure-closed" vibe) */
.tile-disclosure:not([open]){
  background: linear-gradient(180deg, rgba(15,22,32,.92), rgba(10,15,22,.82));
}
.tile-disclosure[open]{
  border-color: rgba(214,178,94,.25);
}
[hidden] { display: none !important; }
.tag {
  display: none;
}
/* Smooth collapse/expand (tiles + boss sections) */
.anim-collapse{
  overflow: hidden;
  transition: height .22s ease, opacity .22s ease, transform .22s ease;
  will-change: height, opacity, transform;
}
.is-collapsing,
.is-collapsed{
  opacity: 0;
  transform: translateY(-4px);
}
.is-collapsed{ pointer-events: none; }

/* ---- RS Switch ---- */
.rs-switch{
  display:inline-flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  user-select:none;
}

.rs-switch-track{
  width:46px;
  height:24px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  position:relative;
  transition: all .25s ease;
  box-shadow: inset 0 0 8px rgba(0,0,0,.35);
}

.rs-switch-thumb{
  width:20px;
  height:20px;
  border-radius:50%;
  position:absolute;
  top:1.5px;
  left:2px;
  background: linear-gradient(145deg, var(--gold), var(--gold2));
  box-shadow: 0 4px 10px rgba(0,0,0,.4);
  transition: all .25s ease;
}

.rs-switch-label{
  font-size:12px;
  color: var(--muted);
}

/* ACTIVE STATE */
.rs-switch.active .rs-switch-track{
  background: rgba(78,227,138,.12);
  border-color: rgba(78,227,138,.45);
  box-shadow: 0 0 12px rgba(78,227,138,.25);
}

.rs-switch.active .rs-switch-thumb{
  left:22px;
  background: linear-gradient(145deg, #4ee38a, #2bbf6c);
}

/* Hide scrollbar globally but allow scrolling */
html, body {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge legacy */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;                  /* Chrome / Edge / Safari */
}
/* Active nav button (green highlight like completed tiles) */
.btn.secondary.nav-active{
  color: var(--text);
  border-color: rgba(78,227,138,.40);
  background: rgba(78,227,138,.10);
  box-shadow: 0 0 0 1px rgba(78,227,138,.20);
  position: relative;
  overflow: hidden;
}

.btn.secondary.nav-active::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  pointer-events:none;
  background: radial-gradient(circle at 30% 30%, rgba(78,227,138,.18), transparent 60%);
  opacity:.9;
}


/* Sticky table headers (for admin ledger + long lists) */
.table.sticky thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(17,26,36,.95), rgba(14,20,29,.92));
  backdrop-filter: blur(10px);
}


/* ---- Builder visual picker ---- */
.picker-grid{
  display:grid;
  grid-template-columns: 1fr 1.4fr;
  gap:12px;
}

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

.picker-col{
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.02);
  overflow: hidden;
}

.picker-list{
  overflow:auto;
  padding: 10px;
}

.picker-row{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 8px 10px;
  border-radius: 12px;
}

.picker-row:hover{
  background: rgba(255,255,255,.04);
}

.picker-row .pname{
  flex:1;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.picker-row .pillpts{
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(214,178,94,.22);
  color: rgba(214,178,94,.95);
  background: rgba(214,178,94,.08);
}

.picker-icon{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  flex: 0 0 auto;
}

.picker-icon img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* ============================= */
/* Themed Scrollbars (Picker)    */
/* ============================= */

.picker-list {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(214,178,94,.6) rgba(255,255,255,.05);
}

/* WebKit (Chrome / Edge) */
.picker-list::-webkit-scrollbar {
  width: 10px;
}

.picker-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
  border-radius: 10px;
}

.picker-list::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(214,178,94,.85),
    rgba(214,178,94,.55)
  );
  border-radius: 10px;
  border: 2px solid rgba(12,18,32,.9); /* inset effect */
}

.picker-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(214,178,94,1),
    rgba(214,178,94,.75)
  );
}
