:root {
  --green: #00b050;
  --green-bright: #34e07a;
  --ink: #0b1411;
  --panel: #0f1a15;
  --panel-2: #14241c;
  --line: #1e3528;
  --text: #e8f3ec;
  --muted: #8fa89a;
  --radius: 18px;
  --card-aspect: 630 / 892;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 70% -10%, #0c2418 0%, transparent 60%),
    radial-gradient(900px 500px at 0% 100%, #07140d 0%, transparent 55%),
    var(--ink);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-bright); }
button { font: inherit; cursor: pointer; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 16, 12, 0.7);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: baseline; font-weight: 800; letter-spacing: -0.02em; }
.brand .wm span { color: var(--green-bright); }          /* "first" — color provides the split */
.brand .tag { color: var(--muted); font-weight: 600; font-size: 13px; letter-spacing: 0; margin-left: 8px; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav button {
  background: transparent; border: 0; color: var(--muted);
  padding: 8px 14px; border-radius: 10px; font-weight: 600;
}
.nav button:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav button.active { color: var(--ink); background: var(--green-bright); }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.who .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #0a6b34);
  display: grid; place-items: center; color: #021; font-weight: 800; font-size: 13px;
}

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 10px 16px; border-radius: 11px; font-weight: 600; transition: .15s;
}
.btn:hover { border-color: var(--green); }
.btn.primary { background: var(--green-bright); color: #042; border-color: transparent; }
.btn.primary:hover { background: var(--green); color: #021; }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff9a9a; border-color: #5a2326; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- layout ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 22px 80px; }
.page-head { margin: 6px 0 22px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.page-head p { margin: 0; color: var(--muted); }
.empty {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; color: var(--muted);
}

/* ---------- card grid ---------- */
.grid {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.tile { display: flex; flex-direction: column; gap: 10px; }
.tile .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile .name { font-weight: 700; }
.tile .sub { color: var(--muted); font-size: 12px; }
.pill {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(52,224,122,0.14); color: var(--green-bright); white-space: nowrap;
}
.pill.dim { background: rgba(255,255,255,0.06); color: var(--muted); }
.tile.locked .holo { filter: grayscale(1) brightness(.5); }
.tile.locked { opacity: .85; }
.count-badge {
  font-size: 11px; font-weight: 800; color: #042; background: var(--green-bright);
  border-radius: 999px; padding: 2px 8px;
}

/* =====================================================================
   HOLOGRAPHIC CARD
   ===================================================================== */
.holo {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --fx: 50%; --fy: 50%;
  --o: 0; --pos: 0; --flip: 0deg;
  position: relative;
  aspect-ratio: var(--card-aspect);
  width: 100%;
  perspective: 1300px;
  cursor: pointer;
  outline: none;
}
.holo:focus-visible { box-shadow: 0 0 0 3px var(--green-bright); border-radius: 22px; }

.holo__3d {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .15s ease-out;
  will-change: transform;
}
.holo__flip {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(var(--flip));
  transition: transform .6s cubic-bezier(.4, .15, .2, 1);
}
.holo.is-flipped { --flip: 180deg; }

.holo__face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 5% / 3.5%;
  overflow: hidden;
  box-shadow:
    0 18px 40px -12px rgba(0,0,0,.75),
    0 0 0 1px rgba(255,255,255,.04) inset;
}
.holo__face--back { transform: rotateY(180deg); }
.holo__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; user-select: none; -webkit-user-drag: none;
}

/* specular glare that tracks the pointer */
.holo__glare {
  position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(
    circle at var(--mx) var(--my),
    rgba(255,255,255,.55) 0%, rgba(255,255,255,.18) 18%,
    rgba(255,255,255,0) 45%);
  mix-blend-mode: soft-light;
  opacity: calc(.35 + var(--o) * .65);
  transition: opacity .2s;
}

/* rainbow holographic foil */
.holo__foil {
  position: absolute; inset: 0; border-radius: inherit;
  opacity: calc(var(--o) * (.30 + var(--pos) * .55));
  mix-blend-mode: color-dodge;
  transition: opacity .2s;
  background-blend-mode: color-dodge, overlay, screen;
  background-image:
    repeating-linear-gradient(
      115deg,
      #ff2f9b 0%, #ffec5e 12%, #36ffd2 24%,
      #3b6bff 36%, #b14bff 48%, #ff2f9b 60%),
    repeating-linear-gradient(
      -35deg,
      rgba(255,255,255,.18) 0px, rgba(255,255,255,.18) 2px,
      transparent 2px, transparent 7px),
    radial-gradient(
      circle at var(--mx) var(--my),
      rgba(255,255,255,.9), transparent 35%);
  background-size: 280% 280%, 180% 180%, 200% 200%;
  background-position:
    var(--fx) var(--fy),
    var(--mx) var(--my),
    var(--mx) var(--my);
  filter: saturate(1.4) contrast(1.1);
}
/* a touch of green-keyed glitter so it reads as "GiveFirst" not generic */
.holo__foil::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  mix-blend-mode: color-dodge;
  opacity: calc(var(--o) * .5);
  background-image:
    radial-gradient(rgba(52,224,122,.9) 9%, transparent 10%),
    radial-gradient(rgba(255,255,255,.7) 9%, transparent 10%);
  background-size: 7% 7%, 5.5% 5.5%;
  background-position: var(--fx) var(--fy), var(--mx) var(--my);
}
.holo[data-rarity="Common"] .holo__foil { opacity: calc(var(--o) * .12); }

/* a single big card on the detail view */
.stage { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 42px; align-items: start; }
.stage .holo { max-width: 360px; }
.detail h1 { margin: 0 0 2px; font-size: 30px; letter-spacing: -.02em; }
.detail .role { color: var(--green-bright); font-weight: 700; margin-bottom: 18px; }
.detail .flavor { font-size: 16px; line-height: 1.5; }
.detail .award-note {
  margin-top: 20px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel); color: var(--muted);
}
.detail .award-note b { color: var(--text); }
.statline { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 22px 0; }
.statbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); }
.statbox .v { font-size: 22px; font-weight: 800; color: var(--green-bright); }
.statbox .l { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.statbox .d { font-size: 12px; color: var(--muted); margin-top: 4px; }
.flip-hint { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login__card {
  width: 100%; max-width: 420px; text-align: center;
  border: 1px solid var(--line); border-radius: 24px; padding: 38px 32px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.8);
}
.login__card h1 { margin: 14px 0 6px; font-size: 26px; }
.login__card h1 span { color: var(--green-bright); }
.login__card p { color: var(--muted); margin: 0 0 24px; }
.login .logo-star {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #0a2c19, #04140c);
  display: grid; place-items: center; border: 1px solid var(--line);
}
.login .logo-star svg { width: 34px; height: 34px; fill: var(--green-bright); }
.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.input {
  width: 100%; padding: 12px 14px; border-radius: 11px;
  border: 1px solid var(--line); background: #0a130e; color: var(--text); font: inherit;
}
.input:focus { outline: none; border-color: var(--green); }
.login .btn { width: 100%; padding: 13px; }
.login .divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.login .divider::before, .login .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gbtn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #3c4043; border: 0; padding: 12px; border-radius: 11px; font-weight: 600;
}
.gbtn[disabled] { opacity: .55; }
.gbtn-host { display: flex; justify-content: center; min-height: 44px; margin-bottom: 4px; }
.soon { font-size: 11px; color: var(--muted); margin-top: 6px; }
.who .avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.err { color: #ff9a9a; font-size: 13px; min-height: 18px; margin: 4px 0 0; }

/* ---------- admin ---------- */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.card-panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 20px;
}
.card-panel h2 { margin: 0 0 4px; font-size: 17px; }
.card-panel .hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td .reason { color: var(--muted); font-size: 12px; }
select.input { appearance: none; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--green-bright); color: #042; font-weight: 700;
  padding: 12px 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.error { background: #ff6b6b; color: #2a0606; }

/* ---------- enlarge button on a tile ---------- */
.tile { position: relative; }
.tile__expand {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(6,16,11,.6); color: #eafff3; font-size: 15px;
  backdrop-filter: blur(4px); display: grid; place-items: center;
  opacity: 0; transition: opacity .15s, transform .15s;
}
.tile:hover .tile__expand, .tile__expand:focus-visible { opacity: 1; }
.tile__expand:hover { background: var(--green); color: #021; transform: scale(1.08); }

/* ---------- enlarge lightbox ---------- */
.holo-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3,8,5,.72); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow: auto;
}
.holo-modal__box {
  position: relative; width: 100%; max-width: 880px; max-height: 92vh; overflow: auto;
  border: 1px solid var(--line); border-radius: 22px; padding: 30px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.85);
}
.holo-modal__card { width: 100%; max-width: 340px; }
.holo-modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 15px;
}
.holo-modal__close:hover { border-color: var(--green); }

/* ---------- admin sub-navigation (underline tabs, not action buttons) ---------- */
.subnav {
  display: flex; gap: 2px; margin: 4px 0 24px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.subnav button {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 10px 16px; font-weight: 700; border-radius: 0;
  margin-bottom: -1px; /* sit on the container's bottom border */
}
.subnav button:hover { color: var(--text); }
.subnav button.active { color: var(--green-bright); border-bottom-color: var(--green-bright); }

/* ---------- searchable recipient combobox ---------- */
.combo { position: relative; }
.combo__menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 8;
  background: #0a130e; border: 1px solid var(--line); border-radius: 11px;
  max-height: 240px; overflow: auto; box-shadow: 0 18px 40px rgba(0,0,0,.5);
}
.combo__opt { padding: 9px 12px; cursor: pointer; }
.combo__opt:hover, .combo__opt.active { background: rgba(52,224,122,.14); }
.combo__opt .e { color: var(--muted); font-size: 12px; }
.combo__opt.add { color: var(--green-bright); font-weight: 700; }

/* ---------- visual card picker ---------- */
.cardpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.cardpick__item {
  border: 2px solid transparent; border-radius: 10px; padding: 4px; cursor: pointer;
  background: var(--panel-2); text-align: center; transition: .12s;
}
.cardpick__item:hover { border-color: var(--line); }
.cardpick__item.sel { border-color: var(--green-bright); box-shadow: 0 0 0 3px rgba(52,224,122,.2); }
.cardpick__item img { width: 100%; border-radius: 6px; display: block; }
.cardpick__item .n { font-size: 11px; margin-top: 4px; color: var(--muted); line-height: 1.2; }
.cardpick__empty { color: var(--muted); font-size: 13px; }

/* ---------- add-card stats editor ---------- */
.statlabel { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin: 6px 0 8px; }
.statrow { display: grid; grid-template-columns: 1.2fr .5fr 2fr; gap: 8px; margin-bottom: 8px; }
/* no spinner arrows on the stat value fields */
.statrow input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.statrow input[type="number"]::-webkit-outer-spin-button,
.statrow input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- card designs list ---------- */
.design-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.design-row img { width: 54px; border-radius: 6px; flex: none; }
.design-row.archived img { filter: grayscale(1) brightness(.6); }
.design-row .info { flex: 1; min-width: 0; }
.design-row .info .n { font-weight: 700; }
.design-row .info .s { color: var(--muted); font-size: 12px; }
.design-row .actions { display: flex; gap: 8px; flex: none; }

/* ---------- public share page ---------- */
.share-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 22px 80px; }
.share-head { display: flex; justify-content: center; padding: 8px 0 26px; }
.share-foot { text-align: center; margin-top: 44px; }

/* ---------- share-my-cards bar ---------- */
.share-bar { margin-top: 16px; max-width: 560px; }
.share-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.share-link { display: flex; gap: 8px; }
.share-link .input { flex: 1; }

@media (max-width: 820px) {
  .stage { grid-template-columns: 1fr; }
  .stage .holo { max-width: 300px; margin: 0 auto; }
  .admin-grid { grid-template-columns: 1fr; }
  .nav .label { display: none; }
}
