:root {
  --text: #f6f3ea;
  --muted: rgba(246, 243, 234, 0.62);
  --gold: #e8c27a;
  --ok: #7ee0b0;
  --pad: 16px;
  --glass: rgba(20, 18, 28, 0.82);
  --stroke: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background: #07060c;
}

body {
  padding: calc(10px + env(safe-area-inset-top)) 0 calc(88px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(700px 420px at 0% 0%, rgba(255, 214, 120, 0.22), transparent 62%),
    radial-gradient(640px 400px at 100% 8%, rgba(110, 140, 255, 0.2), transparent 58%),
    radial-gradient(560px 340px at 80% 100%, rgba(70, 230, 190, 0.14), transparent 55%),
    #0b0a12;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.35;
  animation: drift 18s ease-in-out infinite;
}

.orb-a {
  width: 180px;
  height: 180px;
  left: -70px;
  top: 20px;
  background: #ffd27a;
}

.orb-b {
  width: 200px;
  height: 200px;
  right: -80px;
  top: 120px;
  background: #7b8cff;
  animation-delay: -6s;
}

.orb-c {
  width: 170px;
  height: 170px;
  left: 60%;
  bottom: -50px;
  background: #4de0b8;
  animation-delay: -11s;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

body.ready .app {
  opacity: 1;
  transform: none;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #050508;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.splash.out {
  opacity: 0;
  visibility: hidden;
}

.splash-logo {
  width: 168px;
  height: 168px;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(232, 194, 122, 0.28));
  animation: splash-float 2.2s ease-in-out infinite;
}

.splash-bar {
  width: 72px;
  height: 2px;
  margin-top: 18px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.splash-bar i {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: 99px;
  background: #f3e2b0;
  animation: splash-bar 1.1s ease-in-out infinite;
}

@keyframes splash-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes splash-bar {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(280%);
  }
}

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 var(--pad);
  padding: 14px 16px;
  border-radius: 22px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mark {
  width: 10px;
  height: 34px;
  border-radius: 99px;
  background: linear-gradient(180deg, #fff3c8, var(--gold) 40%, #8a5a12);
  box-shadow: 0 0 18px rgba(232, 194, 122, 0.55);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 21px;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin: 20px 0 10px;
}

#who,
.muted {
  color: var(--muted);
  font-size: 13px;
}

button {
  border: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
}

.ghost,
.chips button,
.tabs button {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
}

.ghost:active,
.chips button:active,
.tabs button:active {
  transform: scale(0.97);
}

#refresh.spin {
  animation: spin 0.7s ease;
}

.view {
  padding: 16px var(--pad) 12px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card,
.sheet,
.banner,
.totals,
.empty {
  border-radius: 20px;
}

.card,
.sheet,
.totals,
.banner {
  background: var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
}

.card {
  padding: 14px;
  min-height: 92px;
  animation: rise 0.55s ease backwards;
  animation-delay: calc(var(--d, 0) * 60ms);
}

.card b {
  display: block;
  font-size: 20px;
  letter-spacing: -0.03em;
  margin-top: 6px;
}

.note {
  margin-top: 14px;
  color: var(--muted);
  animation: rise 0.55s ease 0.28s backwards;
}

.banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  color: var(--gold);
  font-size: 13px;
  animation: rise 0.45s ease;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.chips button.on,
.tabs button.on {
  background: linear-gradient(180deg, #f3dd9d, var(--gold));
  color: #2a1c06;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(232, 194, 122, 0.28);
}

.sheet {
  overflow: hidden;
  animation: rise 0.5s ease backwards;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

tr:last-child td {
  border-bottom: 0;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.totals {
  margin-top: 12px;
  padding: 14px 16px;
  animation: rise 0.55s ease 0.12s backwards;
}

.totals p + p {
  margin-top: 8px;
}

.ok {
  color: var(--ok);
}

.empty {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

.panel {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--stroke);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.field {
  display: block;
  margin: 10px 0;
}

.field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.field input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
}

.gold {
  width: 100%;
}

.history {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.history li + li {
  margin-top: 6px;
}

.guide {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--stroke);
}

.guide ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.guide li + li {
  margin-top: 6px;
}

.tabs {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px;
  border-radius: 22px;
  z-index: 2;
}

.tabs button {
  padding: 11px 4px;
  font-size: 12px;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(30px, -24px, 0) scale(1.12);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .card,
  .sheet,
  .banner,
  .note,
  .totals,
  #refresh.spin,
  .splash-logo,
  .splash-bar i {
    animation: none;
  }
}
