:root{
  --credits-tab-size: 38px;
  --credits-tab-radius: 10px;

  --credits-panel-width: min(360px, calc(100% - 32px));
  --credits-panel-bottom: 74px;

  --credits-line: rgba(255,255,255,0.08);
  --credits-line-soft: rgba(255,255,255,0.06);
  --credits-line-gold: rgba(215,174,73,0.24);

  --credits-bg-top: rgba(255,255,255,0.03);
  --credits-bg-bottom: rgba(255,255,255,0.012);
  --credits-panel-bg: rgba(10,20,39,0.94);

  --credits-text: #edf4ff;
  --credits-text-soft: #9eb2ce;
  --credits-gold: #d7ae49;
  --credits-gold-soft: rgba(215,174,73,0.14);

  --credits-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    inset 0 -1px 0 rgba(0,0,0,0.22);

  --credits-panel-shadow: 0 24px 70px rgba(0,0,0,0.42);
}

/* =========================================================
   DOCK
   position stays shell-level
   ========================================================= */

.shell-account-dock{
  position: absolute;
  right: var(--shell-inset-x, 16px);
  bottom: 14px;
  z-index: 24;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* =========================================================
   CREDITS TAB
   ========================================================= */

.shell-credits-tab{
  position: relative;
  width: var(--credits-tab-size);
  height: var(--credits-tab-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 1px solid var(--credits-line);
  background:
    linear-gradient(180deg, var(--credits-bg-top), var(--credits-bg-bottom)),
    rgba(11,18,31,0.86);
  border-radius: var(--credits-tab-radius);
  padding: 0;
  cursor: pointer;
  box-shadow: var(--credits-shadow);
  transition:
    border-color var(--shell-transition, 180ms ease),
    background var(--shell-transition, 180ms ease),
    transform var(--shell-transition, 180ms ease),
    box-shadow var(--shell-transition, 180ms ease);
}

.shell-credits-tab::before,
.shell-credits-tab::after{
  content: none;
}

.shell-credits-tab:hover,
.shell-credits-tab:focus-visible{
  border-color: var(--credits-line-gold);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)),
    rgba(12,20,35,0.92);
  outline: none;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 -1px 0 rgba(0,0,0,0.22),
    0 10px 24px rgba(0,0,0,0.22);
}

.shell-credits-tab:active{
  transform: translateY(0);
}

.shell-credits-tab__icon{
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  opacity: 0.92;
}

/* optional tiny count badge */
.shell-credits-tab__count{
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #e5cb63, #b78729);
  color: #111;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow:
    0 0 0 2px rgba(8,12,18,0.92),
    0 4px 10px rgba(0,0,0,0.24);
}

/* =========================================================
   CREDITS PANEL / WINDOW
   use with .shell-window and .shell-window--credits
   ========================================================= */

.shell-window--credits{
  right: 16px;
  width: var(--credits-panel-width);
  bottom: var(--credits-panel-bottom);
}

/* =========================================================
   PANEL HEADER HELPERS
   ========================================================= */

.credits-balance{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--credits-gold-soft);
  border: 1px solid var(--credits-line-gold);
  color: #f4dfad;
  font-size: 0.8rem;
  font-weight: 600;
}

.credits-balance__value{
  color: #fff3ca;
  font-weight: 800;
}

/* =========================================================
   QUICK PURCHASE GRID
   ========================================================= */

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

.credits-pack{
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--credits-line-soft);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.012)),
    rgba(255,255,255,0.02);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    inset 0 0 0 1px rgba(255,255,255,0.012);
}

.credits-pack--featured{
  border-color: rgba(215,174,73,0.26);
  background:
    radial-gradient(120% 120% at 20% 20%, rgba(215,174,73,0.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.012)),
    rgba(255,255,255,0.02);
}

.credits-pack__top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.credits-pack__amount{
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  color: var(--credits-text);
}

.credits-pack__tag{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(215,174,73,0.24);
  background: rgba(215,174,73,0.10);
  color: #f4dfad;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.credits-pack__copy{
  margin: 0;
  color: var(--credits-text-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.credits-pack__price{
  margin: 0;
  color: var(--credits-text);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1;
}

/* =========================================================
   MINI CREDIT BUTTONS
   ========================================================= */

.credit-pack{
  width: 52px;
  min-width: 52px;
  padding: var(--btn-shell-pad, 2px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.credit-pack .btn__face{
  min-width: 0;
  padding: 0;
  gap: 0;
}

.credit-pack__coin{
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
}

.credit-pack__value{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   PANEL MICROCOPY
   ========================================================= */

.credits-note{
  margin: 0;
  color: var(--credits-text-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}

.credits-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 820px){
  .shell-window--credits{
    left: 10px !important;
    right: 10px !important;
    width: auto;
    bottom: 64px;
  }
}

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