/* ==========================================================================
   UIB & Resource · Lucky Red Envelope Wall — English UI
   Palette: deep festive red + gold, dark warm backdrop.
   ========================================================================== */

:root {
  --red-900: #6d060c;
  --red-800: #8e0d14;
  --red-700: #a3111a;
  --red-600: #c0161f;
  --red-500: #d8232a;
  --red-400: #e84a4f;

  --gold-100: #fff6dc;
  --gold-200: #ffe9a3;
  --gold-300: #f7d774;
  --gold-400: #f2c94c;
  --gold-500: #d19b22;
  --gold-700: #8a6410;

  --ink-000: #ffffff;
  --ink-100: #f7ede4;
  --ink-300: #e3cfc4;
  --ink-500: #b99a90;

  --panel: rgba(38, 6, 9, 0.72);
  --panel-solid: #2a070a;
  --line: rgba(247, 215, 116, 0.18);
  --line-strong: rgba(247, 215, 116, 0.4);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-1: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 14px 40px rgba(0, 0, 0, 0.5);

  --font: "Segoe UI", "Inter", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Georgia", "Palatino Linotype", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-100);
  background: #1a0407;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.gold { color: var(--gold-300); }
.empty { color: var(--ink-500); font-style: italic; }

/* ===================== backdrop ===================== */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, #5d0910 0%, #35060b 45%, #1a0407 100%);
}

.backdrop-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  animation: drift 22s ease-in-out infinite alternate;
}
.backdrop-glow--a {
  width: 46vw; height: 46vw; left: -8vw; top: -12vw;
  background: radial-gradient(circle, rgba(232, 74, 79, 0.6), transparent 68%);
}
.backdrop-glow--b {
  width: 40vw; height: 40vw; right: -6vw; bottom: -14vw;
  background: radial-gradient(circle, rgba(242, 201, 76, 0.28), transparent 68%);
  animation-delay: -8s;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3vw, 2vw, 0) scale(1.15); }
}

.backdrop-grid {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-image:
    repeating-linear-gradient(45deg, rgba(247, 215, 116, 0.5) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-45deg, rgba(247, 215, 116, 0.35) 0 1px, transparent 1px 22px);
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}

.lanterns { position: absolute; inset: 0; }
.lantern {
  position: absolute;
  top: -40px;
  width: 34px;
  height: 44px;
  border-radius: 50% / 42%;
  background: radial-gradient(circle at 34% 30%, #ff6a63, #c0161f 55%, #7d0b12 100%);
  box-shadow: 0 0 26px rgba(232, 74, 79, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.25);
  opacity: 0.75;
  animation: sway 9s ease-in-out infinite alternate;
}
.lantern::before {
  content: "";
  position: absolute;
  left: 50%; bottom: 100%;
  width: 1px; height: 90px;
  background: linear-gradient(180deg, transparent, rgba(247, 215, 116, 0.55));
}
.lantern::after {
  content: "";
  position: absolute;
  left: 50%; top: 100%;
  transform: translateX(-50%);
  width: 4px; height: 16px;
  background: linear-gradient(180deg, var(--gold-400), transparent);
}
.l1 { left: 6%;  animation-delay: -1s; }
.l2 { left: 24%; animation-delay: -4s; animation-duration: 11s; }
.l3 { left: 52%; animation-delay: -2s; animation-duration: 10s; }
.l4 { left: 74%; animation-delay: -6s; animation-duration: 12s; }
.l5 { left: 91%; animation-delay: -3s; animation-duration: 13s; }
@keyframes sway {
  from { transform: translateY(0) rotate(-4deg); }
  to   { transform: translateY(14px) rotate(4deg); }
}

/* ===================== shell ===================== */

.topbar,
.identity,
.layout,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(14px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 3, 5, 0.86), rgba(20, 3, 5, 0.35));
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 42px; height: 42px;
  flex: 0 0 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--red-800);
  background: linear-gradient(150deg, var(--gold-200), var(--gold-400) 60%, var(--gold-500));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), var(--shadow-1);
}
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.3px;
  color: var(--gold-200);
  white-space: nowrap;
}
.brand-copy span {
  font-size: 12px;
  color: var(--ink-500);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ===================== buttons ===================== */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink-100);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.14s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(160deg, var(--red-500), var(--red-700));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 18px rgba(160, 12, 20, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover { background: linear-gradient(160deg, var(--red-400), var(--red-600)); }

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  color: var(--gold-200);
}
.btn-outline:hover { background: rgba(247, 215, 116, 0.12); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
  color: var(--ink-300);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn-ghost[aria-pressed="true"] {
  background: rgba(242, 201, 76, 0.16);
  border-color: var(--line-strong);
  color: var(--gold-200);
}
.btn-block { width: 100%; justify-content: center; }
.btn-ico { font-size: 15px; line-height: 1; }
.is-playing .btn-ico { animation: pulse 1.1s ease-in-out infinite; display: inline-block; }
@keyframes pulse { 50% { transform: scale(1.35); opacity: 0.7; } }

/* ===================== identity bar ===================== */

.identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 16px clamp(14px, 3vw, 34px) 0;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
}
.identity-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.identity-right { display: flex; gap: 10px; flex-wrap: wrap; }
.identity-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--ink-500); }

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.28);
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-200);
}
.account-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-500);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.account-chip.is-live .account-dot { background: #57d38c; box-shadow: 0 0 0 3px rgba(87, 211, 140, 0.18); }
.account-type {
  font-style: normal;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--ink-500);
  border-left: 1px solid var(--line);
  padding-left: 8px;
}

/* ===================== layout ===================== */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 20px;
  align-items: start;
  padding: 20px clamp(14px, 3vw, 34px) 8px;
}

/* ===================== wall panel ===================== */

.wall-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(72, 8, 13, 0.66), rgba(26, 4, 7, 0.82));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-2);
  padding: clamp(14px, 2vw, 22px);
  overflow: hidden;
}

.wall-head { margin-bottom: 16px; }
.wall-head h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(19px, 2vw, 27px);
  letter-spacing: 0.2px;
  color: var(--ink-100);
}
.wall-sub { margin: 0; font-size: 13px; color: var(--ink-500); max-width: 76ch; }
.wall-sub strong { color: var(--gold-200); }

.wall-scroll { overflow: visible; }

.wall {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: clamp(5px, 0.72vw, 11px);
  perspective: 900px;
}

.wall-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-500); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.swatch--sealed { background: linear-gradient(150deg, var(--red-500), var(--red-800)); }
.swatch--open { background: linear-gradient(150deg, var(--gold-200), var(--gold-400)); }
.swatch--taken { background: linear-gradient(150deg, #d9cbb6, #b49a76); }
.wall-foot-note { font-size: 12.5px; color: var(--gold-300); }

/* ===================== one envelope ===================== */

.env {
  position: relative;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  aspect-ratio: 3 / 4;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.18s ease;
  font-family: inherit;
}
.env:not(.is-open):hover { transform: translateY(-4px) scale(1.035); }
.env:not(.is-open):hover .env-flap { filter: brightness(1.12); }
.env.is-open { cursor: default; }
.env:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 3px; border-radius: 12px; }
.env.is-locked { cursor: not-allowed; }
.env.is-locked:hover { transform: none; }

/* ---- the closed envelope artwork ---- */
.env-art {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(155deg, #e2434a 0%, var(--red-600) 42%, var(--red-800) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -8px 16px rgba(0, 0, 0, 0.28),
    0 5px 12px rgba(70, 0, 4, 0.5);
  overflow: hidden;
  transition: opacity 0.35s ease, filter 0.35s ease;
}
/* left + right folds of the pocket */
.env-art::before,
.env-art::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 54%;
  height: 58%;
  background: linear-gradient(210deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.03));
}
.env-art::before { left: 0; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.env-art::after { right: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); }

/* the top flap */
.env-flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56%;
  z-index: 5;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #f0595e 0%, var(--red-600) 62%, var(--red-700) 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0%;
  transform: rotateX(0deg);
  transition: transform 0.5s cubic-bezier(0.42, 0, 0.2, 1), opacity 0.3s 0.22s;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}
/* the gold seal */
.env-seal {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 43%;
  transform: translate(-50%, -50%);
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--red-800);
  font-size: clamp(9px, 1.05vw, 17px);
  background: radial-gradient(circle at 33% 27%, #fff3c9, var(--gold-400) 48%, var(--gold-500) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 2px 5px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s;
}

/* ---- the hidden amount card ---- */
.env-card {
  position: absolute;
  z-index: 4;
  left: 8%;
  right: 8%;
  top: 5%;
  height: 78%;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  text-align: center;
  background: linear-gradient(165deg, #fffaf0, var(--gold-100) 55%, #f3dfb1 100%);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(209, 155, 34, 0.5);
  opacity: 0;
  transform: translateY(46%) scale(0.9);
  transition: transform 0.42s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.3s;
  pointer-events: none;
  overflow: hidden;
}
.env-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(10px, 1.2vw, 19px);
  color: var(--red-700);
  line-height: 1.05;
  white-space: nowrap;
}
.env-who {
  font-size: clamp(6.5px, 0.62vw, 10px);
  font-weight: 600;
  color: #6a4a12;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.env-badge {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  padding: 1px 6px 2px;
  border-radius: 0 0 6px 6px;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--red-800);
  background: linear-gradient(180deg, var(--gold-300), var(--gold-400));
}

/* ---- opened state ---- */
/* the flap swings open and fades out, so an opened envelope never bleeds
   into the row above it */
.env.is-open .env-flap {
  transform: rotateX(-112deg);
  opacity: 0;
  transition: transform 0.46s cubic-bezier(0.42, 0, 0.2, 1), opacity 0.34s 0.16s ease;
}
.env.is-open .env-seal { transform: translate(-50%, -50%) scale(0); opacity: 0; }
.env.is-open .env-card { opacity: 1; transform: translateY(0) scale(1); }
.env.is-open .env-art { filter: saturate(0.85); }

.env.is-mine .env-card {
  box-shadow:
    0 0 0 2px var(--gold-400),
    0 6px 16px rgba(242, 201, 76, 0.35),
    inset 0 0 0 1px rgba(209, 155, 34, 0.6);
}
.env.is-mine .env-art { filter: saturate(1.1) brightness(1.05); }

/* freshly opened: one-shot pop */
.env.just-opened .env-card { animation: cardPop 0.6s cubic-bezier(0.34, 1.5, 0.64, 1); }
@keyframes cardPop {
  0% { transform: translateY(46%) scale(0.86); }
  60% { transform: translateY(-8%) scale(1.1); }
  100% { transform: translateY(0) scale(1); }
}
.env.just-opened .env-flap { animation: flapShine 0.7s ease; }
@keyframes flapShine {
  0% { filter: brightness(1) drop-shadow(0 0 0 var(--gold-400)); }
  45% { filter: brightness(1.6) drop-shadow(0 0 12px var(--gold-300)); }
  100% { filter: brightness(1) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3)); }
}
.env.is-locked .env-art { filter: grayscale(0.55) brightness(0.72); }

/* ===================== sidebar ===================== */

.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  padding: 15px 16px;
  box-shadow: var(--shadow-1);
}
.card h2 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gold-200);
  font-weight: 700;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--ink-300);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill--gold { color: var(--red-800); background: linear-gradient(160deg, var(--gold-200), var(--gold-400)); border-color: var(--gold-500); }

.progress {
  height: 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--line);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red-400), var(--gold-400));
  box-shadow: 0 0 12px rgba(242, 201, 76, 0.5);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 13px; }
.metric { display: flex; flex-direction: column; gap: 2px; }
.metric-value { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--ink-000); }
.metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-500); }

.claim-list, .me-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.claim-list { max-height: 258px; overflow-y: auto; }
.claim-list li, .me-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  font-size: 13px;
}
.claim-list .who, .me-list .who {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.claim-list .who span, .me-list .who span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-100);
}
.rank {
  flex: 0 0 20px;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
  color: var(--red-800);
  background: linear-gradient(160deg, var(--gold-200), var(--gold-400));
}
.claim-list .amt, .me-list .amt {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-300);
  white-space: nowrap;
}
.claim-list .tag-you {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.5px;
  padding: 1px 5px; border-radius: 4px;
  background: var(--gold-400); color: var(--red-800);
}

.card--me { border-color: var(--line-strong); background: linear-gradient(180deg, rgba(94, 12, 18, 0.72), rgba(38, 6, 9, 0.8)); }
.me-meta { font-size: 12px; color: var(--ink-500); margin-bottom: 10px; }
.me-list:empty { display: none; }

.card--info .rules {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 12.2px;
  color: var(--ink-300);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.card--info .rules li::marker { color: var(--gold-400); font-weight: 700; }

/* ===================== footer ===================== */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px clamp(14px, 3vw, 34px) 28px;
  font-size: 12px;
  color: var(--ink-500);
}
.footer-mode { font-size: 11.5px; color: var(--gold-500); }

/* ===================== modals ===================== */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 2, 3, 0.72);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal-box {
  position: relative;
  width: min(440px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #3d080e, #23040733);
  background-color: #2a070a;
  box-shadow: var(--shadow-2);
  padding: 24px 22px 20px;
  animation: popIn 0.24s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.modal-box--wide { width: min(760px, 100%); }
.modal-box h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold-200);
}
.modal-sub { margin: 0 0 16px; font-size: 12.5px; color: var(--ink-500); }
.modal-x {
  position: absolute; top: 10px; right: 12px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-300);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.modal-x:hover { background: rgba(255, 255, 255, 0.12); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; justify-content: center; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
}

/* ---- claim modal ---- */
.modal-box--claim { text-align: center; overflow: hidden; }
.claim-visual {
  position: relative;
  height: 148px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}
.claim-env { position: absolute; inset: 0; display: grid; place-items: center; }
.claim-body {
  position: absolute;
  width: 96px; height: 120px;
  border-radius: 12px;
  background: linear-gradient(155deg, #e2434a, var(--red-700));
  box-shadow: var(--shadow-1);
}
.claim-flap {
  position: absolute;
  top: 20px; left: 50%;
  transform: translateX(-50%) rotateX(0deg);
  width: 96px; height: 62px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #f0595e, var(--red-600));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0%;
  animation: bigFlap 0.7s 0.12s cubic-bezier(0.42, 0, 0.2, 1) forwards;
  z-index: 3;
}
@keyframes bigFlap {
  to { transform: translateX(-50%) rotateX(-124deg); }
}
.claim-seal {
  position: absolute;
  top: 60px; left: 50%;
  transform: translate(-50%, -50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--red-800);
  background: radial-gradient(circle at 33% 27%, #fff3c9, var(--gold-400) 50%, var(--gold-500));
  animation: sealPop 0.4s 0.3s forwards;
}
@keyframes sealPop { to { transform: translate(-50%, -50%) scale(0); opacity: 0; } }
.claim-amount {
  position: relative;
  z-index: 4;
  align-self: end;
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 4px 18px rgba(242, 201, 76, 0.45);
  animation: amountIn 0.5s 0.42s backwards;
}
@keyframes amountIn {
  from { opacity: 0; transform: translateY(18px) scale(0.8); }
}
.claim-line { margin: 6px 0 4px; font-size: 13.5px; color: var(--ink-300); }
.claim-line strong { color: var(--gold-200); }
.claim-sub { margin: 0 0 18px; font-size: 12.5px; color: var(--ink-500); }

/* ---- forms ---- */
.field { display: block; margin-bottom: 13px; }
.field > span { display: block; font-size: 12px; color: var(--ink-500); margin-bottom: 5px; }
.field > span em { font-style: normal; opacity: 0.75; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.34);
  color: var(--ink-000);
  font-family: inherit;
  font-size: 14px;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.16);
}
.field--inline { display: flex; align-items: center; gap: 10px; margin: 0; }
.field--inline > span { margin: 0; white-space: nowrap; }
.field--inline select { width: auto; min-width: 150px; }
.form-error { margin: 0 0 12px; font-size: 12.5px; color: #ff9a92; }

/* ---- admin ---- */
.admin-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.26);
  padding: 11px;
  display: flex; flex-direction: column; gap: 3px;
}
.kpi-value { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--ink-000); }
.kpi-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-500); }
.admin-h4 { margin: 0 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--gold-200); }
.admin-h4 + .table-wrap { margin-bottom: 18px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid rgba(247, 215, 116, 0.1); white-space: nowrap; }
.data-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-500); background: rgba(0, 0, 0, 0.3); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(247, 215, 116, 0.05); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .total { color: var(--gold-300); font-weight: 700; }

/* ---- toast ---- */
.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(14px);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(42, 7, 10, 0.96);
  color: var(--gold-200);
  font-size: 13px;
  box-shadow: var(--shadow-2);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: none; }

/* ---- confetti ---- */
.confetti-layer { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute;
  top: -14px;
  width: 9px; height: 14px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(102vh) rotate(720deg); opacity: 0.15; }
}

/* ===================== responsive ===================== */

@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .stats-panel { position: static; }
  .claim-list { max-height: 220px; }
}

@media (max-width: 900px) {
  .wall { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .env-amount { font-size: clamp(11px, 2.6vw, 18px); }
  .env-seal { font-size: clamp(11px, 2.6vw, 18px); }
  .env-who { font-size: clamp(8px, 1.7vw, 10px); }
  .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-copy span { display: none; }
}

@media (max-width: 620px) {
  .wall { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .identity { flex-direction: column; align-items: stretch; }
  .identity-right { justify-content: stretch; }
  .identity-right .btn { flex: 1; justify-content: center; }
  .metric-value { font-size: 18px; }
  .claim-amount { font-size: 40px; }
  #musicLabel { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.06s !important; }
}
