:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07120b;
  color: #f7ffe9;
  --ink: #f7ffe9;
  --muted: #b8c8ad;
  --line: rgba(247, 255, 233, 0.14);
  --panel: #101d15;
  --panel-2: #14261a;
  --green: #16a34a;
  --lime: #7dff91;
  --navy: #25255f;
  --gold: #f4cf68;
  --coral: #ff7d66;
  --teal: #57dfcf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(22, 163, 74, 0.22), transparent 26rem),
    linear-gradient(135deg, rgba(37, 37, 95, 0.44), transparent 34rem),
    #07120b;
}

button,
input {
  font: inherit;
}

img,
svg {
  max-width: 100%;
}

button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #13251a;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.15;
  overflow-wrap: anywhere;
  white-space: normal;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 255, 145, 0.45);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 14px 96px;
}

.topbar,
.brand-lockup,
.panel-title,
.actions,
.leader-row,
.quick-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  animation: slideDown 420ms ease both;
}

.brand-lockup {
  gap: 12px;
}

.brand-lockup img {
  width: 58px;
  aspect-ratio: 1;
  border-radius: 18px;
  border: 1px solid rgba(125, 255, 145, 0.32);
  box-shadow: 0 0 28px rgba(22, 163, 74, 0.35);
  object-fit: cover;
}

.topbar h1,
.panel h3,
.hero-panel h2,
.system-card h3,
.leader-row h4 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(36px, 9vw, 66px);
  line-height: 0.9;
  text-shadow: 0 0 24px rgba(125, 255, 145, 0.25);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--lime);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.icon-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: #172012;
}

.premium-pulse {
  animation: pulseBorder 1.9s ease-in-out infinite;
}

.identity-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 0;
  scrollbar-width: none;
}

.identity-strip span {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: rgba(247, 255, 233, 0.07);
  border-radius: 999px;
  padding: 9px 12px;
  color: #edffe6;
  font-size: 13px;
  font-weight: 850;
  animation: popIn 360ms ease both;
}

.screen {
  display: grid;
  gap: 14px;
}

.hero-panel,
.panel,
.leaderboard-panel,
.mini-stat,
.system-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 29, 21, 0.92);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.28);
}

.hero-panel {
  position: relative;
  min-height: 292px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  overflow: hidden;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(22, 163, 74, 0.42), transparent 50%),
    linear-gradient(225deg, rgba(244, 207, 104, 0.22), transparent 42%),
    #0d1711;
  animation: riseUp 420ms ease both;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--lime), var(--gold), var(--teal));
  animation: scanLine 2.4s linear infinite;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-panel h2 {
  max-width: 11ch;
  font-size: clamp(42px, 12vw, 78px);
  line-height: 0.88;
}

.hero-panel p,
.panel p,
.system-card span,
.mini-stat span,
.leader-row p {
  color: var(--muted);
  line-height: 1.5;
}

.logo-stage {
  position: relative;
  width: min(230px, 60vw);
  aspect-ratio: 1;
  justify-self: center;
  border: 1px solid rgba(125, 255, 145, 0.36);
  border-radius: 38px;
  display: grid;
  place-items: center;
  background: rgba(7, 18, 11, 0.54);
  transform: rotate(-2deg);
  animation: floatLogo 3.2s ease-in-out infinite;
}

.logo-stage img {
  width: 82%;
  border-radius: 28px;
  object-fit: cover;
}

.logo-stage span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border: 1px solid rgba(247, 255, 233, 0.24);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--navy);
  background: var(--lime);
  font-weight: 950;
}

.actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.actions button,
.choice-grid button,
.quick-row button {
  min-width: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 900;
}

.actions button:first-child {
  flex: 1 1 150px;
  background: #17361f;
}

.actions button:last-child {
  flex: 1 1 120px;
  color: #1c190c;
  background: var(--gold);
}

.stats-grid,
.system-grid,
.studio-grid {
  display: grid;
  gap: 12px;
}

.stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-stat,
.system-card,
.panel,
.leaderboard-panel {
  padding: 16px;
}

.mini-stat {
  animation: popIn 360ms ease both;
}

.mini-stat p,
.system-card p {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-stat strong {
  display: block;
  font-size: 26px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.system-card {
  animation: riseUp 420ms ease both;
  animation-delay: var(--delay);
}

.system-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--lime);
  background: rgba(125, 255, 145, 0.12);
  margin-bottom: 12px;
}

.system-icon svg {
  width: 20px;
}

.panel-title {
  gap: 8px;
  margin-bottom: 12px;
  color: var(--lime);
}

.tall {
  min-height: 58vh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
}

.chat-bubble {
  align-self: end;
  max-width: 720px;
  border-radius: 8px;
  padding: 16px;
  background: #17261c;
  color: #efffe7;
  line-height: 1.6;
  border: 1px solid rgba(125, 255, 145, 0.18);
}

.quick-row {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quick-row button {
  flex: 1 1 128px;
  min-height: 34px;
  color: var(--teal);
  background: rgba(87, 223, 207, 0.08);
}

.composer {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 10px;
  margin-top: 14px;
}

.composer input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07120b;
  color: var(--ink);
  padding: 0 14px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span,
.small-note {
  color: var(--muted);
  font-size: 12px;
}

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07120b;
  color: var(--ink);
  padding: 0 12px;
}

.form-grid button {
  min-height: 46px;
  color: #1c190c;
  background: var(--gold);
  font-weight: 950;
}

.small-note {
  margin-bottom: 0;
}

.studio-item {
  position: relative;
  min-height: 154px;
  overflow: hidden;
}

.studio-item > svg:first-child {
  color: var(--teal);
}

.studio-item > svg:last-child {
  position: absolute;
  right: 14px;
  bottom: 14px;
  color: var(--lime);
}

.leaderboard-panel {
  display: grid;
  gap: 10px;
}

.leader-row {
  gap: 12px;
  min-height: 70px;
  padding: 10px;
  border: 1px solid rgba(247, 255, 233, 0.1);
  border-radius: 8px;
  background: rgba(247, 255, 233, 0.045);
}

.leader-button {
  width: 100%;
  color: inherit;
  text-align: left;
}

.leader-button:hover {
  background: rgba(125, 255, 145, 0.08);
}

.leader-row img {
  width: 46px;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(125, 255, 145, 0.42);
}

.rank {
  color: var(--gold);
  min-width: 34px;
}

.leader-row div:nth-child(3) {
  min-width: 0;
  flex: 1;
}

.leader-row h4,
.leader-row p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  color: #211b0a;
  background: var(--gold);
  font-size: 12px;
  font-weight: 950;
}

.leader-detail strong {
  color: var(--lime);
}

.empty {
  color: var(--muted);
  margin: 0;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.choice-grid button {
  min-height: 54px;
  background: #0d1711;
}

.system-card h3,
.prediction h3,
.studio-item h3 {
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(620px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 18, 11, 0.91);
  backdrop-filter: blur(16px);
}

.tabbar button {
  min-width: 0;
  height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.tabbar button.active {
  color: #06110a;
  background: var(--lime);
  border-color: rgba(247, 255, 233, 0.18);
}

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

@keyframes riseUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes floatLogo {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

@keyframes pulseBorder {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(125, 255, 145, 0);
  }
  50% {
    box-shadow: 0 0 28px rgba(125, 255, 145, 0.38);
  }
}

@keyframes scanLine {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@media (min-width: 760px) {
  .app-shell {
    padding-inline: 24px;
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .stats-grid,
  .system-grid,
  .studio-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
