:root {
  --bg: #07122a;
  --bg2: #0e2248;
  --card: #132b57;
  --card-border: #2f4f89;
  --text: #eaf3ff;
  --muted: #9fb5d9;
  --accent: #29d7ff;
  --accent-2: #5fff9a;
  --danger: #ff5f7d;
  --warn: #ffd26e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 500px at 15% -10%, #1a3c7e 0%, transparent 70%),
    radial-gradient(800px 400px at 100% 10%, #10386b 0%, transparent 70%),
    linear-gradient(170deg, var(--bg), #030b1d 70%);
  min-height: 100vh;
}

.app-shell { max-width: 1120px; margin: 24px auto; padding: 0 16px 28px; }
.auth-card {
  max-width: 480px;
  margin: 8vh auto 0;
  display: grid;
  gap: 10px;
}
.auth-card input {
  width: 100%;
  background: #091e41;
  color: var(--text);
  border: 1px solid #4166a1;
  border-radius: 10px;
  padding: 10px;
}
.error { color: #ffc0cb; }
.card {
  background: linear-gradient(160deg, rgba(20, 46, 95, 0.95), rgba(17, 37, 78, 0.94));
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.topbar h1 { margin: 0 0 4px; font-size: 1.35rem; }
.sub { margin: 0; color: var(--muted); }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.tab-btn, .btn {
  border: 1px solid #3f5f99;
  color: #041026;
  background: linear-gradient(180deg, #3be7ff, #10bee8);
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, filter .2s ease, opacity .2s ease;
}
.tab-btn { background: #203f72; color: #d3e6ff; }
.tab-btn.active { background: linear-gradient(180deg, #34e6ff, #0ebeea); color: #081125; }
.btn.secondary { background: #2b4d87; color: #dbeaff; }
.btn.tertiary { background: #3a4f77; color: #e3edff; }
.btn.danger { background: linear-gradient(180deg, #ff7e95, #ff4e72); color: #2a0710; border-color: #ff84a0; }
button:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }

.grid { display: grid; gap: 14px; margin-top: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.balance {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: .02em;
  color: var(--accent-2);
  margin: 8px 0;
}
.stats-line { display: flex; gap: 12px; flex-wrap: wrap; color: #d1e4ff; }
.xp-wrap { margin-top: 10px; background: #0a1f42; border: 1px solid #355890; border-radius: 999px; height: 12px; overflow: hidden; }
.xp-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #35ffc3, #35dbff); transition: width .2s ease; }

.timer { margin: 6px 0; font-size: 1.15rem; font-weight: 800; color: #ffef9f; }
.hint { color: var(--muted); margin: 8px 0 0; }

.list { display: grid; gap: 10px; margin-top: 10px; }
.job-row, .item-row {
  background: rgba(10, 24, 52, 0.72);
  border: 1px solid #2f4f8b;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 6px;
}
.row-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.row-meta { color: #bad2f5; font-size: .92rem; }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge.processing { background: #595f72; color: #f2f2f2; }
.badge.shipped { background: #2f5fa0; color: #ddebff; }
.badge.out_for_delivery { background: #8d6d21; color: #fff4d2; }
.badge.delivered { background: #216640; color: #d8ffe6; }

.rarity-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  border: 1px solid transparent;
}
.rarity-pill.common { background: #304766; color: #d7e4ff; border-color: #4f6d98; }
.rarity-pill.uncommon { background: #225942; color: #d7ffe7; border-color: #3a9d78; }
.rarity-pill.rare { background: #294574; color: #d8e9ff; border-color: #4b7fc8; }
.rarity-pill.epic { background: #563574; color: #efd8ff; border-color: #9a6ccc; }
.rarity-pill.legendary { background: #6f5223; color: #fff1cc; border-color: #bf9444; }
.rarity-pill.mythic { background: #7d223e; color: #ffd6e6; border-color: #d2618b; }

.tx-list { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.tx-list li { color: #d4e6ff; }

input[type="number"] {
  width: 100%;
  background: #091e41;
  color: var(--text);
  border: 1px solid #4166a1;
  border-radius: 10px;
  padding: 9px;
}

input[type="text"] {
  background: #091e41;
  color: var(--text);
  border: 1px solid #4166a1;
  border-radius: 10px;
  padding: 9px;
}

select {
  width: 100%;
  background: #091e41;
  color: var(--text);
  border: 1px solid #4166a1;
  border-radius: 10px;
  padding: 9px;
}

.skill-grid { margin-top: 10px; display: grid; gap: 8px; }
.skill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: rgba(10, 24, 52, 0.7);
  border: 1px solid #355890;
  border-radius: 10px;
  padding: 8px;
}

.mini-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hidden { display: none; }
.track-panel { display: grid; gap: 8px; }
.progress-wrap { height: 10px; border-radius: 999px; overflow: hidden; border: 1px solid #34598f; background: #0a1f42; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #35ffc3, #35dbff); transition: width .2s ease; }
.timeline { margin: 0; padding-left: 16px; color: #cde2ff; }

.business-workspace { grid-column: 1 / -1; }
.business-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
}
.business-sidebar {
  display: grid;
  gap: 8px;
  align-content: start;
}
.biz-tab-btn {
  border: 1px solid #3f5f99;
  color: #d3e6ff;
  background: #1b3766;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: filter .2s ease, transform .08s ease, opacity .2s ease;
}
.biz-tab-btn.active {
  background: linear-gradient(180deg, #34e6ff, #0ebeea);
  color: #081125;
}
.biz-tab-btn:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.biz-tab-btn:disabled { opacity: .55; cursor: not-allowed; }

.business-main {
  background: rgba(8, 22, 48, 0.5);
  border: 1px solid #2f4f89;
  border-radius: 14px;
  padding: 12px;
}
.business-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.business-head h2 { margin: 0; }
.business-money {
  border: 1px solid #3d62a0;
  background: #122a54;
  color: #d7ebff;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
}

.business-tile.locked {
  opacity: .65;
  filter: grayscale(.2);
}
.business-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .73rem;
  font-weight: 700;
  border: 1px solid #48679e;
  background: #1b396a;
  color: #d8e8ff;
}
.business-progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #34598f;
  background: #0a1f42;
}
.business-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #35ffc3, #35dbff);
}
.coming-soon {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 320px;
  background: rgba(17, 41, 87, 0.98);
  border: 1px solid #3c62a1;
  border-radius: 12px;
  color: #ecf4ff;
  padding: 10px 12px;
  z-index: 30;
}

#confettiLayer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 20;
}
.confetti {
  position: absolute;
  width: 7px;
  height: 13px;
  border-radius: 2px;
  animation: burst .9s ease-out forwards;
}

@keyframes burst {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(360deg); opacity: 0; }
}

@media (max-width: 900px) {
  .grid.two { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .business-layout { grid-template-columns: 1fr; }
  .business-sidebar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .biz-tab-btn {
    text-align: center;
    padding: 8px;
    border-radius: 10px;
    font-size: .9rem;
  }
}
