:root {
  --bg: #0b0f1a;
  --panel: rgba(15, 22, 38, 0.88);
  --panel-strong: rgba(18, 28, 50, 0.96);
  --line: rgba(112, 245, 255, 0.18);
  --line-hot: rgba(168, 85, 247, 0.42);
  --text: #edf7ff;
  --muted: #8ea6bf;
  --cyan: #18f5ff;
  --blue: #4aa8ff;
  --purple: #a855f7;
  --gold: #ffd166;
  --danger: #ff4d7d;
  --ok: #5cffb5;
  --card-radius: 8px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.hidden {
  display: none !important;
}

html {
  background: #0b0f1a;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 4%, rgba(24, 245, 255, 0.13), transparent 34%),
    radial-gradient(circle at 82% 22%, rgba(168, 85, 247, 0.16), transparent 32%),
    linear-gradient(180deg, #070a12 0%, var(--bg) 42%, #070912 100%);
  overflow: hidden;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 20% 4%, rgba(24, 245, 255, 0.13), transparent 34%),
    radial-gradient(circle at 82% 22%, rgba(168, 85, 247, 0.16), transparent 32%),
    linear-gradient(180deg, #070a12 0%, var(--bg) 42%, #070912 100%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-brand {
  justify-content: center;
  margin-bottom: 4px;
}

.auth-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.auth-discord-button {
  background: #5865f2;
  border-color: #5865f2;
}

.auth-discord-button:active {
  background: #4752c4;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-email-row {
  display: flex;
  gap: 8px;
}

.auth-email-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.9rem;
}

.auth-email-input::placeholder {
  color: var(--muted);
}

.auth-status {
  margin: 0;
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.2em;
}

.shell {
  width: 100%;
  max-width: 520px;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    linear-gradient(rgba(24, 245, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 245, 255, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(9px, env(safe-area-inset-top)) 12px 8px;
  background: rgba(6, 10, 18, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.dev-indicator {
  align-self: center;
  padding: 6px 7px;
  border: 1px solid rgba(255, 209, 102, 0.42);
  border-radius: 6px;
  color: #06111e;
  background: var(--gold);
  font-size: 9px;
  font-weight: 1000;
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.32);
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border: 1px solid rgba(24, 245, 255, 0.65);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 45%, rgba(24, 245, 255, 0.95) 47%, rgba(24, 245, 255, 0.95) 53%, transparent 55%),
    linear-gradient(0deg, transparent 45%, rgba(168, 85, 247, 0.95) 47%, rgba(168, 85, 247, 0.95) 53%, transparent 55%),
    radial-gradient(circle, rgba(24, 245, 255, 0.28), transparent 62%);
  box-shadow: 0 0 24px rgba(24, 245, 255, 0.45);
  animation: spinMark 7s linear infinite;
}

.brand strong {
  display: block;
  font-size: clamp(13px, 3.6vw, 17px);
  line-height: 1;
  letter-spacing: 1.8px;
}

.brand-word {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  text-transform: uppercase;
}

.brand-word span:first-child {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(24, 245, 255, 0.55);
}

.brand-word span:last-child {
  color: #f2e8ff;
  text-shadow: 0 0 12px rgba(168, 85, 247, 0.55);
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
}

.meters {
  display: flex;
  gap: 4px;
  min-width: 0;
}

.meter {
  width: clamp(58px, 15vw, 72px);
  min-width: 0;
  padding: 6px 6px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: rgba(14, 22, 39, 0.72);
  box-shadow: inset 0 0 18px rgba(24, 245, 255, 0.045);
}

.meter-label {
  display: block;
  color: var(--muted);
  overflow: hidden;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter strong {
  display: block;
  margin-top: 1px;
  color: var(--cyan);
  font-size: 13px;
}

.viewport {
  min-height: 0;
  overflow: hidden auto;
  padding: 8px 10px 10px;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.viewport::-webkit-scrollbar {
  display: none;
}

.tab-panel {
  display: none;
  animation: panelIn 170ms ease-out;
}

.tab-panel.active {
  display: block;
}

#tab-scan.active {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  overflow: hidden;
}

.scan-stage {
  width: 100%;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 14px 0 0;
}

.tutorial-card {
  width: min(calc(100% - 24px), 420px);
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0 auto 14px;
  padding: 8px 10px;
  border: 1px solid rgba(24, 245, 255, 0.28);
  border-radius: var(--card-radius);
  background:
    linear-gradient(90deg, rgba(24, 245, 255, 0.08), transparent 44%),
    radial-gradient(circle at 10% 20%, rgba(24, 245, 255, 0.18), transparent 42%),
    rgba(8, 17, 32, 0.92);
  box-shadow:
    inset 0 0 34px rgba(24, 245, 255, 0.055),
    0 12px 34px rgba(0, 0, 0, 0.22);
}

.tutorial-agent {
  width: 58px;
  aspect-ratio: 1;
  border: 1px solid rgba(24, 245, 255, 0.28);
  border-radius: 8px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 0 18px rgba(24, 245, 255, 0.16);
}

.tutorial-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.tutorial-actions {
  display: flex;
  gap: 6px;
}

.daily-card {
  width: min(100%, 420px);
  justify-self: center;
  padding: 7px 8px;
  border: 1px solid rgba(24,245,255,.22);
  border-radius: var(--card-radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(200,92,255,.14), transparent 44%),
    rgba(8, 17, 32, .72);
}

.daily-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  cursor: pointer;
}

.daily-head::-webkit-details-marker {
  display: none;
}

.daily-head strong {
  display: block;
  margin-top: 2px;
  color: var(--cyan);
  font-size: 13px;
}

.daily-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}

.daily-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 6px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 6px;
  background: rgba(255,255,255,.035);
}

.daily-item span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
}

.daily-item strong {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-item em {
  color: var(--cyan);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.daily-item.done {
  border-color: rgba(24,245,255,.32);
  box-shadow: inset 0 0 18px rgba(24,245,255,.08);
}

.crew-dock {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 8px;
  z-index: 18;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transform: none;
  pointer-events: auto;
}

#tab-scan.active > .scan-stage,
#tab-scan.active > .roll-panel,
#tab-scan.active > .camera-card {
  min-width: 0;
}

.crew-button {
  position: relative;
  width: 58px;
  min-height: 66px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--cyan);
  background: transparent;
  box-shadow: none;
  filter: saturate(1.24) contrast(1.18) brightness(1.12) drop-shadow(0 0 9px rgba(24,245,255,.58)) drop-shadow(0 7px 12px rgba(0,0,0,.62));
}

.crew-button img {
  width: 58px;
  height: 54px;
  border-radius: 0;
  object-fit: contain;
  opacity: 1;
}

.crew-button span,
.crew-button em {
  font-size: 9px;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0 8px rgba(0,0,0,.9), 0 0 10px currentColor;
}

.crew-button.brass {
  color: var(--gold);
  filter: saturate(1.2) contrast(1.16) brightness(1.1) drop-shadow(0 0 10px rgba(255,209,102,.52)) drop-shadow(0 7px 12px rgba(0,0,0,.62));
}

.crew-button.daily {
  margin-left: auto;
  color: #f2e8ff;
  filter: drop-shadow(0 0 9px rgba(200,92,255,.4)) drop-shadow(0 7px 12px rgba(0,0,0,.62));
}

.crew-button.daily.daily-active::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 17px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,209,102,.98), rgba(24,245,255,.78) 42%, transparent 72%);
  box-shadow: 0 0 18px rgba(255,209,102,.72), 0 0 28px rgba(24,245,255,.42);
  animation: coreBeat 1.45s ease-in-out infinite;
}

.crew-button.daily.daily-complete {
  filter: saturate(.88) brightness(.88) drop-shadow(0 0 7px rgba(200,92,255,.28)) drop-shadow(0 7px 12px rgba(0,0,0,.62));
}

.command-badge {
  margin-left: auto;
  min-width: 24px;
  padding: 4px 6px;
  border: 1px solid rgba(24,245,255,.45);
  border-radius: 999px;
  color: #06111e;
  background: var(--cyan);
  font-size: 10px;
  font-style: normal;
  font-weight: 1000;
  box-shadow: 0 0 14px rgba(24,245,255,.45);
}

.command-badge.ready {
  background: var(--gold);
  box-shadow: 0 0 16px rgba(255,209,102,.6);
}

.crew-button em {
  position: absolute;
  right: 0;
  top: 2px;
  min-width: 22px;
  padding: 3px 4px;
  border: 1px solid rgba(24,245,255,.45);
  border-radius: 999px;
  color: #06111e;
  background: var(--cyan);
}

.crew-button em.ready {
  background: var(--gold);
  box-shadow: 0 0 14px rgba(255,209,102,.55);
}

.signal-orb {
  width: min(16dvh, 28vw, 104px);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(237, 247, 255, 0.98) 0 4%, rgba(24, 245, 255, 0.78) 5% 11%, transparent 12%),
    radial-gradient(circle, rgba(24, 245, 255, 0.20), transparent 58%);
  filter: drop-shadow(0 0 26px rgba(24, 245, 255, 0.38));
  transition: width 360ms cubic-bezier(.2,.9,.2,1), filter 260ms ease, transform 260ms ease;
}

.signal-orb.captured {
  width: min(19dvh, 34vw, 132px);
  filter: drop-shadow(0 0 34px color-mix(in srgb, var(--capture-type, var(--cyan)), transparent 42%));
  transform: translateY(2px);
}

.capture-slot {
  position: absolute;
  inset: -10%;
  z-index: 4;
  display: grid;
  place-items: center;
  border-radius: 8px;
  opacity: 0;
  transform: scale(0.68);
  transition: opacity 220ms ease, transform 320ms cubic-bezier(.2,.9,.2,1);
  pointer-events: none;
}

.signal-orb.searching .capture-slot {
  opacity: 1;
}

.signal-orb.searching .capture-slot::before {
  content: "";
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid rgba(24, 245, 255, 0.26);
  border-top-color: var(--cyan);
  animation: spinMark 780ms linear infinite;
}

.signal-orb.captured .capture-slot {
  opacity: 1;
  transform: scale(1);
}

.capture-slot .entity-art {
  width: min(92%, 210px);
  aspect-ratio: 1;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--type), transparent 58%), transparent 62%),
    #07111f;
  overflow: hidden;
}

.capture-slot .creature-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: translateY(0) scale(1.02);
  filter: saturate(1.2) contrast(1.1) drop-shadow(0 0 20px color-mix(in srgb, var(--type), transparent 25%));
  animation: revealFloat 2.8s ease-in-out infinite;
}

.capture-slot .creature-aura {
  inset: 10%;
  filter: blur(12px);
}

.signal-orb.captured::before {
  border-color: color-mix(in srgb, var(--capture-rarity, var(--cyan)), transparent 20%);
  box-shadow: 0 0 22px color-mix(in srgb, var(--capture-rarity, var(--cyan)), transparent 45%);
}

.signal-orb.captured::after {
  border-color: color-mix(in srgb, var(--capture-type, var(--purple)), transparent 15%);
  box-shadow: 0 0 28px color-mix(in srgb, var(--capture-type, var(--purple)), transparent 42%);
}

.signal-orb::before,
.signal-orb::after,
.signal-orb span {
  content: "";
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(24, 245, 255, 0.5);
  border-radius: 50%;
  animation: pulseRing 2.4s ease-out infinite;
}

.signal-orb::after {
  inset: 26%;
  border-color: rgba(168, 85, 247, 0.58);
  animation-delay: 0.55s;
}

.signal-orb span:nth-child(1) {
  inset: 5%;
  border-style: dashed;
  animation: spinMark 11s linear infinite;
}

.signal-orb span:nth-child(2) {
  inset: 34%;
  animation-delay: 1.1s;
}

.signal-orb span:nth-child(3) {
  inset: 42%;
  background: radial-gradient(circle, rgba(24, 245, 255, 0.35), transparent 65%);
  border: 0;
  animation: coreBeat 1.3s ease-in-out infinite;
}

.signal-orb.captured span:nth-child(3),
.signal-orb.searching span:nth-child(3) {
  opacity: 0.35;
}

.scan-modes {
  width: min(100%, 420px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.scan-mode-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-height: 126px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: linear-gradient(180deg, rgba(18, 28, 50, 0.86), rgba(10, 15, 28, 0.88));
}

.scan-mode-card *,
.quick-actions *,
.tabs * {
  min-width: 0;
}

.scan-mode-card strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.05;
}

.scan-mode-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.mode-kicker {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.real-mode {
  border-color: rgba(24, 245, 255, 0.38);
}

.charge-mode {
  border-color: rgba(168, 85, 247, 0.44);
}

.start-badge {
  position: absolute;
  right: 8px;
  top: 8px;
  padding: 4px 6px;
  border: 1px solid rgba(255,209,102,.55);
  border-radius: 999px;
  color: #06111e;
  background: var(--gold);
  font-size: 9px;
  font-weight: 1000;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(255,209,102,.38);
}

.scan-button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid rgba(24, 245, 255, 0.72);
  border-radius: var(--card-radius);
  color: #03131d;
  font-weight: 1000;
  font-size: 14px;
  letter-spacing: 0.8px;
  background: linear-gradient(135deg, var(--cyan), #8ef6ff 46%, var(--purple));
  box-shadow: 0 0 28px rgba(24, 245, 255, 0.42), 0 10px 34px rgba(0, 0, 0, 0.42);
  cursor: pointer;
}

.scan-button:disabled {
  opacity: 0.5;
  filter: grayscale(0.65);
  cursor: not-allowed;
}

.real-scan-button {
  background: linear-gradient(135deg, var(--cyan), #bffbff);
}

.charge-scan-button {
  background: linear-gradient(135deg, #9c6bff, #f3c6ff);
}

.scan-button:active,
.primary-action:active,
.ghost-button:active,
.mini-button:active,
.tab-button:active {
  transform: translateY(1px) scale(0.99);
}

.timer-line {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.quick-actions {
  width: min(100%, 420px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 0;
}

.quick-actions .ghost-button {
  border-color: rgba(255, 209, 102, 0.42);
  background:
    linear-gradient(90deg, rgba(255, 209, 102, 0.14), rgba(24, 245, 255, 0.06)),
    rgba(14, 22, 39, 0.86);
  color: #f8e7a8;
  box-shadow:
    inset 0 0 18px rgba(255, 209, 102, 0.08),
    0 0 18px rgba(255, 209, 102, 0.08);
}

.ghost-button,
.mini-button,
.primary-action,
.danger-action {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: rgba(14, 22, 39, 0.76);
  box-shadow: inset 0 0 18px rgba(24, 245, 255, 0.05);
  cursor: pointer;
}

.primary-action {
  width: 100%;
  color: #03131d;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), #b277ff);
}

.danger-action {
  width: 100%;
  border-color: rgba(255, 77, 125, 0.44);
  color: #ffd5df;
  background: rgba(255, 77, 125, 0.1);
}

#buyChargeButton {
  border-color: rgba(255, 209, 102, 0.42);
  color: #fff3c2;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.20), rgba(24, 245, 255, 0.08)),
    rgba(14, 22, 39, 0.82);
  box-shadow: inset 0 0 18px rgba(255, 209, 102, 0.08), 0 0 18px rgba(255, 209, 102, 0.08);
}

#buyChargeButton:disabled {
  opacity: 0.55;
  filter: grayscale(0.45);
}

.mini-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.mini-button.danger {
  border-color: rgba(255, 77, 125, 0.44);
  color: #ffd5df;
  background: rgba(255, 77, 125, 0.1);
}

.roll-panel,
.camera-card,
.entity-card,
.raid-card,
.slot-card,
.archive-card,
.modal-card {
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: linear-gradient(180deg, rgba(18, 28, 50, 0.92), rgba(10, 15, 28, 0.9));
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.roll-panel {
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 8px;
  align-self: stretch;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.roll-panel.rolling {
  animation: scanSurge 900ms ease-in-out infinite;
}

.roll-panel.hit-rare {
  animation: hitPulse 700ms ease-out 2;
}

.roll-panel.hit-legendary {
  animation: legendaryBurst 950ms ease-out 2;
}

.roll-pointer {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 2;
  width: 2px;
  height: 82px;
  background: linear-gradient(var(--gold), var(--cyan), transparent);
  box-shadow: 0 0 18px var(--cyan);
}

.roll-track-wrap {
  height: clamp(70px, 12dvh, 86px);
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.28);
  mask-image: linear-gradient(90deg, transparent, #000 13%, #000 87%, transparent);
}

.roll-track {
  display: flex;
  gap: 8px;
  height: 100%;
  align-items: center;
  will-change: transform;
}

.roll-item {
  width: 86px;
  height: 74px;
  flex: 0 0 86px;
  display: grid;
  place-items: center;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 24%, color-mix(in srgb, var(--rarity), transparent 86%), transparent 58%),
    rgba(255, 255, 255, 0.045);
  text-align: center;
}

.roll-item.winning {
  transform: scale(1.08);
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rarity), transparent 52%), rgba(255, 255, 255, 0.06)),
    linear-gradient(180deg, color-mix(in srgb, var(--rarity), transparent 86%), rgba(0,0,0,.18));
  box-shadow:
    inset 0 0 24px color-mix(in srgb, var(--rarity), transparent 62%),
    0 0 24px color-mix(in srgb, var(--rarity), transparent 55%);
}

.roll-item strong {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.05;
}

.reward-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #06111d;
  font-size: 25px;
  font-weight: 1000;
  background: rgba(255, 255, 255, 0.2);
}

.reward-icon.image-icon {
  overflow: hidden;
  border: 1px solid rgba(35, 199, 255, 0.45);
  background:
    radial-gradient(circle at 50% 28%, rgba(35,199,255,.34), transparent 56%),
    linear-gradient(180deg, rgba(20, 52, 90, .72), rgba(5, 12, 24, .92));
  box-shadow: inset 0 0 14px rgba(35,199,255,.28), 0 0 12px rgba(35,199,255,.18);
}

.reward-icon.image-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.roll-face {
  width: 58px;
  height: 50px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: radial-gradient(circle, color-mix(in srgb, var(--rarity), transparent 78%), rgba(0, 0, 0, 0.2));
}

.roll-face .entity-art {
  width: 58px;
  aspect-ratio: 1;
  background: transparent;
}

.roll-face .creature-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
}

.rarity-common { --rarity: #aab3bd; }
.rarity-rare { --rarity: #23c7ff; }
.rarity-epic { --rarity: #c85cff; }
.rarity-legendary { --rarity: #ffd166; }
.rarity-glitched { --rarity: #39ffef; }

.rarity-common,
.rarity-rare,
.rarity-epic,
.rarity-legendary,
.rarity-glitched {
  border-color: color-mix(in srgb, var(--rarity), transparent 42%);
  box-shadow: inset 0 0 16px color-mix(in srgb, var(--rarity), transparent 82%), 0 0 12px color-mix(in srgb, var(--rarity), transparent 82%);
}

.rarity-rare,
.rarity-epic,
.rarity-legendary,
.rarity-glitched {
  background-image:
    radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--rarity), transparent 84%), transparent 46%),
    linear-gradient(180deg, rgba(18, 28, 50, 0.92), rgba(10, 15, 28, 0.9));
}

.rarity-glitched {
  animation: glitchFlicker 900ms steps(2) infinite;
}

.scan-result {
  min-height: 0;
  padding-top: 7px;
  text-align: center;
  font-size: 13px;
  display: grid;
  place-items: center;
  align-content: center;
  overflow: hidden;
}

.scan-result.reveal-copy strong {
  display: block;
  font-size: clamp(18px, 4.4vw, 26px);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-shadow: 0 0 18px currentColor;
}

.scan-result.reveal-copy .card-meta {
  color: rgba(237, 247, 255, 0.78);
  font-size: 12px;
}

.result-creature {
  width: min(118px, 18dvh);
  margin: 0 auto 4px;
  display: none;
}

.result-creature .entity-art {
  aspect-ratio: 1;
}

.scan-result strong {
  color: var(--cyan);
}

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

.camera-card {
  display: none;
  margin-top: 0;
  padding: 10px;
}

.camera-card.active {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(24,245,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24,245,255,.045) 1px, transparent 1px),
    #020711;
  background-size: 26px 26px;
}

body.camera-active {
  overflow: hidden;
}

.camera-head,
.modal-head,
.entity-top,
.slot-top,
.raid-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#cameraVideo {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
  background: #02050a;
}

.scanner-video-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(24,245,255,.26);
  border-radius: 8px;
  background: #02050a;
  box-shadow: 0 0 40px rgba(24,245,255,.09);
}

.scanner-frame {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 28%;
  height: 34%;
  border: 2px solid rgba(24,245,255,.72);
  border-radius: 10px;
  box-shadow: 0 0 0 999px rgba(2, 7, 17, .28), inset 0 0 24px rgba(24,245,255,.12), 0 0 24px rgba(24,245,255,.18);
  pointer-events: none;
}

.scanner-frame::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,209,102,.92), rgba(24,245,255,.92), transparent);
  box-shadow: 0 0 16px rgba(24,245,255,.45);
}

.camera-status {
  min-height: 20px;
  margin-top: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 12px;
}

.collection-tools {
  display: flex;
  gap: 6px;
}

.bulk-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid rgba(24,245,255,.2);
  border-radius: var(--card-radius);
  background: rgba(8,17,32,.82);
}

.bulk-bar.hidden {
  display: none;
}

.bulk-bar strong {
  min-width: 0;
  color: var(--cyan);
  font-size: 12px;
  line-height: 1.2;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 23px;
  letter-spacing: 0;
}

h2 {
  margin: 16px 0 10px;
  font-size: 16px;
}

.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.entity-grid,
.archive-grid,
.slot-grid,
.raid-types,
.list-stack,
.picker-list {
  display: grid;
  gap: 10px;
}

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

.archive-family {
  grid-column: 1 / -1;
  padding: 8px;
  border: 1px solid rgba(24, 245, 255, 0.22);
  border-radius: var(--card-radius);
  background:
    linear-gradient(90deg, rgba(24,245,255,.06), transparent 34%),
    rgba(7, 14, 27, 0.62);
}

.archive-family-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--muted);
}

.archive-family-head strong {
  color: var(--text);
  font-size: 13px;
  text-transform: uppercase;
}

.archive-family-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-evo-strip {
  display: grid;
  grid-template-columns: repeat(var(--archive-cols, 3), minmax(0, 1fr));
  gap: 8px;
}

.evo-number {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 3;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--rarity), transparent 35%);
  border-radius: 50%;
  color: #06111e;
  background: var(--rarity);
  font-size: 10px;
  font-weight: 1000;
  box-shadow: 0 0 12px color-mix(in srgb, var(--rarity), transparent 52%);
}

.archive-dex-number {
  position: absolute;
  left: 8px;
  top: 40px;
  z-index: 4;
  padding: 3px 5px;
  border: 1px solid rgba(237,247,255,.16);
  border-radius: 5px;
  color: var(--cyan);
  background: rgba(3,9,19,.78);
  font-size: 9px;
  font-weight: 1000;
}

.archive-evo-strip .archive-card {
  padding: 7px;
}

.archive-evo-strip .entity-name {
  font-size: 12px;
}

.archive-evo-strip .card-meta {
  font-size: 10px;
}

.entity-card,
.archive-card,
.slot-card,
.raid-card {
  position: relative;
  padding: 10px;
}

.entity-card.is-locked {
  border-color: rgba(255,209,102,.5);
  box-shadow: 0 16px 42px rgba(0,0,0,.28), inset 0 0 22px rgba(255,209,102,.08);
}

.select-check {
  position: absolute;
  top: 42px;
  right: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border: 1px solid rgba(24,245,255,.34);
  border-radius: 999px;
  background: rgba(3, 9, 19, .82);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
}

.icon-card-button {
  position: absolute;
  right: 7px;
  top: 7px;
  z-index: 7;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(3, 9, 19, .74);
  font-size: 0;
  font-weight: 1000;
}

.icon-card-button.active {
  border-color: rgba(255,209,102,.62);
  color: var(--gold);
  background: rgba(12, 10, 18, .86);
  box-shadow: 0 0 12px rgba(255,209,102,.28);
}

.star-icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
}

.entity-art-wrap {
  position: relative;
}

.sync-corner {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 8;
  min-width: 50px;
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid rgba(24,245,255,.55);
  border-radius: 999px;
  color: #03111c;
  background: linear-gradient(135deg, var(--cyan), #b68cff);
  box-shadow: 0 0 18px rgba(24,245,255,.35), 0 8px 18px rgba(0,0,0,.42);
  font-size: 10px;
  font-weight: 1000;
}

.sync-corner.used,
.sync-corner:disabled {
  color: var(--muted);
  background: rgba(6, 12, 24, .82);
  border-color: rgba(255,255,255,.12);
  box-shadow: none;
}

.select-check input {
  accent-color: var(--cyan);
}

.entity-art {
  width: 100%;
  aspect-ratio: 1.05;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background:
    radial-gradient(circle at center, color-mix(in srgb, var(--type), transparent 72%), transparent 58%),
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0));
}

.locked-signal-art {
  width: 100%;
  aspect-ratio: 1.05;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(4, 9, 18, 0.96);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.46);
}

.locked-signal-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) brightness(.9);
}

.locked-signal-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--type), transparent 72%), transparent 58%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.entity-card .entity-art,
.archive-card .entity-art,
.slot-card .entity-art {
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--type), transparent 68%), transparent 52%),
    conic-gradient(from 90deg, transparent, color-mix(in srgb, var(--rarity), transparent 82%), transparent 45%),
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0));
}

.entity-card .entity-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(circle at 50% 45%, transparent 0 45%, rgba(6,10,18,.72) 76%),
    linear-gradient(180deg, transparent 0 58%, rgba(6,10,18,.65));
  pointer-events: none;
}

.creature-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
  filter: saturate(1.08) contrast(1.05) drop-shadow(0 0 12px color-mix(in srgb, var(--type), transparent 58%));
  transform-origin: center;
  animation: creatureFloat 3.4s ease-in-out infinite;
}

.entity-card .creature-img {
  object-fit: cover;
  transform: scale(1.08);
}

.creature-aura {
  position: absolute;
  inset: 10%;
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--type), transparent 65%), transparent 66%);
  filter: blur(10px);
  animation: auraPulse 2.6s ease-in-out infinite;
}

.form-2 .creature-img {
  transform: scale(1.07);
  filter: saturate(1.18) contrast(1.08) drop-shadow(0 0 16px var(--type));
}

.form-3 .creature-img {
  animation-duration: 1.8s;
  transform: scale(1.13);
  filter: saturate(1.28) contrast(1.12) drop-shadow(0 0 22px var(--type));
}

.entity-name {
  margin-top: 8px;
  font-weight: 900;
  font-size: 14px;
  line-height: 1.1;
}

.copy-line {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.entity-meta,
.card-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.entity-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.entity-stats span {
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 6px;
  background: rgba(2, 9, 20, 0.36);
  text-align: center;
}

.entity-stats small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.entity-stats strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fragment-panel {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(24, 245, 255, 0.12);
  border-radius: 6px;
  background: rgba(7, 14, 27, 0.52);
}

.fragment-panel > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.fragment-panel > div:first-child span {
  color: var(--muted);
  font-size: 10px;
}

.fragment-panel small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.level-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.level-chip {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 10px;
  white-space: nowrap;
}

.bond-panel {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 209, 102, 0.14);
  border-radius: 6px;
  background: rgba(24, 18, 7, 0.32);
}

.bond-panel > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.bond-panel span {
  color: var(--muted);
  font-size: 10px;
}

.sync-timer-line {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.fragment-bar {
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.fragment-bar span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  box-shadow: 0 0 10px rgba(24, 245, 255, 0.45);
}

.bond-bar span {
  background: linear-gradient(90deg, var(--gold), var(--cyan));
}

.entity-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.luck-grid,
.shop-grid,
.more-grid,
.hub-grid {
  display: grid;
  gap: 10px;
}

.hub-card {
  width: 100%;
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  color: var(--text);
  background: linear-gradient(180deg, rgba(18, 28, 50, 0.92), rgba(10, 15, 28, 0.9));
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  text-align: left;
}

.hub-card.priority {
  border-color: rgba(24,245,255,.38);
}

.hub-card strong,
.hub-card h2 {
  display: block;
  margin: 5px 0 3px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
}

.hub-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.luck-view {
  display: none;
}

.luck-view.active {
  display: block;
  animation: panelIn 170ms ease-out;
}

.luck-host {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(24,245,255,.24);
  border-radius: var(--card-radius);
  background:
    radial-gradient(circle at 20% 30%, rgba(24,245,255,.16), transparent 45%),
    rgba(8,17,32,.84);
}

.luck-host img {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 28px rgba(24,245,255,.16);
}

.luck-host h1 {
  margin: 2px 0 0;
  font-size: 28px;
}

.luck-host p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.luck-menu {
  display: grid;
  gap: 10px;
}

.machine-button {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 104px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  color: var(--text);
  background: linear-gradient(180deg, rgba(18,28,50,.9), rgba(8,14,26,.95));
  text-align: left;
}

.machine-button.locked {
  border-color: rgba(255, 209, 102, .32);
  background: linear-gradient(180deg, rgba(34, 26, 9, .76), rgba(10, 15, 28, .92));
}

.machine-button.locked strong::after {
  content: " LOCKED";
  margin-left: 6px;
  color: var(--gold);
  font-size: 10px;
}

.settings-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.settings-row .mini-button.active {
  border-color: rgba(24, 245, 255, 0.72);
  color: #06111e;
  background: linear-gradient(135deg, var(--cyan), #aef8ff);
  box-shadow: 0 0 18px rgba(24, 245, 255, 0.2);
}

.dome-card {
  border-color: rgba(255, 77, 125, 0.3);
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 77, 125, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(18, 28, 50, 0.92), rgba(10, 15, 28, 0.92));
}

.dome-meter strong {
  color: #ff79aa;
}

.dome-arena {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.dome-arena > div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.dome-arena > div.turn-now {
  border-color: rgba(255, 209, 102, .48);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,209,102,.12), transparent 54%),
    rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 18px rgba(255,209,102,.08), 0 0 14px rgba(255,209,102,.12);
}

.dome-arena span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 1000;
  text-transform: uppercase;
}

.dome-arena strong {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}

.dome-fighter {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 6px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.dome-fighter .entity-art {
  width: 48px;
  aspect-ratio: 1;
}

.dome-fighter b {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dome-fighter em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 1000;
  text-transform: uppercase;
}

.dome-fighter.active {
  outline: 1px solid rgba(24, 245, 255, 0.62);
  box-shadow: 0 0 16px rgba(24, 245, 255, 0.22);
}

.dome-fighter.attacker {
  outline: 1px solid rgba(255, 209, 102, 0.82);
  background:
    linear-gradient(90deg, rgba(255,209,102,.18), rgba(255,255,255,.04));
  box-shadow: 0 0 18px rgba(255,209,102,.26);
}

.dome-fighter.attacker em {
  color: var(--gold);
}

.dome-fighter.out {
  opacity: 0.86;
  border: 1px solid rgba(255, 77, 125, .48);
  background:
    linear-gradient(90deg, rgba(255,77,125,.28), rgba(255,77,125,.08));
  box-shadow: inset 0 0 18px rgba(255,77,125,.12);
}

.dome-fighter.out .entity-art {
  filter: grayscale(.35) sepia(.45) hue-rotate(300deg) saturate(1.7) brightness(.74);
}

.dome-fighter.out b,
.dome-fighter.out em {
  color: #ff8ca8;
}

.dome-fighter.hit::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(135deg, transparent 43%, rgba(255, 77, 125, 0.96) 47%, #fff 50%, rgba(255, 77, 125, 0.96) 53%, transparent 58%);
  animation: slashHit 520ms ease-out;
}

.dome-fighter.miss::after {
  content: "MISS";
  position: absolute;
  right: 8px;
  top: 8px;
  color: #06111e;
  background: var(--cyan);
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 10px;
  font-weight: 1000;
  transform: rotate(-12deg);
  animation: missStamp 520ms ease-out;
}

.dome-fighter.empty {
  display: block;
}

.dome-log {
  min-height: 98px;
  max-height: 160px;
  margin-top: 10px;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  border: 1px solid rgba(255, 77, 125, 0.18);
  border-radius: 8px;
  background: rgba(3, 7, 14, 0.48);
}

.dome-log-line {
  padding: 7px 8px;
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  line-height: 1.25;
  animation: panelIn 160ms ease-out;
}

.dome-log-line.rarity-rare,
.dome-log-line.rarity-epic,
.dome-log-line.rarity-legendary,
.dome-log-line.rarity-glitched {
  border-left-color: currentColor;
}

.dome-log-line.rarity-rare { color: var(--blue); }
.dome-log-line.rarity-epic { color: var(--purple); }
.dome-log-line.rarity-legendary { color: var(--gold); }
.dome-log-line.rarity-glitched { color: var(--cyan); }

.machine-button img {
  width: 82px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.machine-button strong,
.machine-button small {
  display: block;
}

.machine-button strong {
  color: var(--cyan);
  font-size: 20px;
}

.machine-button small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.back-button {
  margin-bottom: 10px;
}

.luck-card,
.shop-card,
.more-card,
.changelog-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: linear-gradient(180deg, rgba(18,28,50,.86), rgba(8,14,26,.92));
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

.cipher-strip {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.cipher-strip img {
  width: 68px;
  aspect-ratio: 1;
  border: 1px solid rgba(24,245,255,.22);
  border-radius: 8px;
  object-fit: cover;
}

.cipher-strip strong {
  display: block;
  font-size: 18px;
}

.cipher-strip p,
.shop-hero p,
.commander-hero p,
.shop-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.crash-graph {
  position: relative;
  height: 150px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(24,245,255,.16);
  border-radius: 8px;
  background: #07101e;
}

.crash-graph canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.crash-multiplier {
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--cyan);
  font-size: 28px;
  font-weight: 1000;
  text-shadow: 0 0 14px rgba(24,245,255,.5);
}

.crash-history {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(35, 199, 255, .18);
  border-radius: 8px;
  background: rgba(2, 8, 18, .46);
}

.crash-history > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.crash-history > strong {
  color: var(--muted);
  font-size: 12px;
}

.crash-history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.crash-history-row {
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px;
  background: rgba(255,255,255,.045);
  text-align: center;
}

.crash-history-row strong,
.crash-history-row small {
  display: block;
  line-height: 1.05;
}

.crash-history-row strong {
  font-size: 11px;
}

.crash-history-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.crash-history-row.win {
  border-color: rgba(69, 255, 159, .42);
  color: var(--ok);
  box-shadow: inset 0 0 12px rgba(69,255,159,.13);
}

.crash-history-row.loss {
  border-color: rgba(255, 77, 125, .42);
  color: var(--danger);
  box-shadow: inset 0 0 12px rgba(255,77,125,.13);
}

.wager-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 64px;
  gap: 8px;
  margin-top: 10px;
}

.wager-row input {
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  color: var(--text);
  background: rgba(4, 10, 20, .8);
  font-weight: 900;
}

.collider-meter {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 9px;
  border-radius: 8px;
  background: rgba(0,0,0,.22);
  color: var(--muted);
  font-size: 12px;
}

.collider-meter strong {
  color: var(--cyan);
}

.collider-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 9px;
  border: 1px solid rgba(24,245,255,.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 21% 50%, rgba(24,245,255,.13), transparent 46%),
    linear-gradient(180deg, rgba(10,22,42,.9), rgba(2,7,16,.82));
}

.preview-reward {
  min-width: 0;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}

.preview-reward > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 9px;
  font-weight: 1000;
  text-transform: uppercase;
}

.preview-reward .entity-art,
.preview-reward .reward-art-img {
  width: 74px;
  aspect-ratio: 1;
  border-radius: 8px;
  grid-row: span 2;
}

.preview-reward strong,
.preview-reward small {
  display: block;
}

.preview-reward small {
  color: var(--muted);
  font-size: 11px;
}

.collider-list {
  max-height: min(240px, 32dvh);
  margin: 10px 0;
  display: grid;
  gap: 8px;
  overflow: auto;
}

.collider-row {
  display: grid;
  grid-template-columns: 22px 54px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--rarity), transparent 62%);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}

.collider-row .entity-art {
  width: 54px;
  aspect-ratio: 1;
}

.collider-row span {
  min-width: 0;
}

.collider-row strong,
.collider-row small {
  display: block;
}

.collider-row small {
  color: var(--muted);
  font-size: 11px;
}

.shop-hero,
.commander-hero {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(24,245,255,.22);
  border-radius: var(--card-radius);
  background: rgba(8, 17, 32, .78);
}

.commander-hero {
  border-color: rgba(255, 209, 102, 0.3);
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 209, 102, 0.14), transparent 46%),
    rgba(8, 17, 32, .82);
}

.shop-hero img,
.commander-hero img {
  width: 102px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.shop-hero h1,
.commander-hero h1 {
  margin: 2px 0 0;
}

.shop-card {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.shop-section {
  display: grid;
  gap: 8px;
}

.shop-section h2 {
  margin: 4px 0 0;
  color: var(--cyan);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.shop-card img {
  width: 66px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.shop-card strong,
.shop-card span {
  display: block;
}

.shop-card span {
  margin-top: 5px;
  color: var(--gold);
  font-weight: 1000;
}

.more-card {
  width: 100%;
  color: var(--text);
  text-align: left;
}

.more-card strong,
.more-card span {
  display: block;
}

.more-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.changelog-card {
  margin-top: 10px;
}

.change-row {
  padding: 9px 0;
  border-top: 1px solid rgba(255,255,255,.07);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--rarity), transparent 35%);
  border-radius: 999px;
  color: var(--rarity);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.slot-card.empty {
  border-style: dashed;
}

.slot-progress {
  height: 8px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.slot-progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  box-shadow: 0 0 12px rgba(24, 245, 255, 0.4);
}

.raid-card {
  display: grid;
  gap: 10px;
}

.raid-cost {
  color: var(--gold);
  font-weight: 900;
}

.status-pill {
  color: var(--ok);
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.status-pill.busy,
.blocked-reason {
  color: var(--gold);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding: 6px 7px calc(6px + var(--safe-bottom));
  background: rgba(6, 10, 18, 0.95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.tab-button {
  min-width: 0;
  min-height: 44px;
  padding: 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--card-radius);
  background: rgba(16, 24, 42, 0.76);
  color: var(--muted);
  cursor: pointer;
}

.tab-button span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 850;
}

.tab-button.active {
  color: #03131d;
  background: linear-gradient(135deg, var(--cyan), #9c6bff);
  box-shadow: 0 0 18px rgba(24, 245, 255, 0.24);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: end center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.dev-panel-card {
  width: min(420px, 100%);
}

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

.dev-grid .mini-button {
  min-height: 44px;
}

.reward-reveal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rarity, var(--cyan)), transparent 70%), transparent 42%),
    rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(10px);
}

.reward-reveal.hidden {
  display: none;
}

.collider-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(10px);
}

.collider-modal.hidden {
  display: none;
}

.collider-modal-card {
  width: min(100%, 430px);
  padding: 14px;
  border: 1px solid rgba(24,245,255,.36);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 32%, rgba(24,245,255,.16), transparent 48%),
    rgba(8, 13, 25, .98);
  text-align: center;
  box-shadow: 0 22px 70px rgba(0,0,0,.62), 0 0 36px rgba(24,245,255,.2);
}

.collider-modal-card.win {
  border-color: rgba(24,245,255,.82);
  box-shadow: 0 22px 70px rgba(0,0,0,.62), 0 0 46px rgba(24,245,255,.42);
}

.collider-modal-card.lose {
  border-color: rgba(185,91,255,.78);
  box-shadow: 0 22px 70px rgba(0,0,0,.62), 0 0 46px rgba(185,91,255,.38);
}

.collider-modal-card h2 {
  margin: 6px 0 0;
  font-size: clamp(22px, 6vw, 34px);
  line-height: 1;
}

.collider-wheel-stage {
  display: grid;
  place-items: center;
  margin: 14px auto 10px;
}

.collider-modal-wheel {
  position: relative;
  width: min(78vw, 300px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(7,16,30,1) 0 38%, transparent 39%),
    radial-gradient(circle at 72% 50%, rgba(24,245,255,.28), transparent 39%),
    radial-gradient(circle at 28% 50%, rgba(185,91,255,.25), transparent 42%),
    linear-gradient(90deg, rgba(185,91,255,.72) 0 50%, rgba(24,245,255,.78) 50% 100%);
  box-shadow:
    inset 0 0 22px rgba(255,255,255,.14),
    inset 0 0 42px rgba(24,245,255,.12),
    0 0 38px rgba(24,245,255,.22),
    0 0 46px rgba(185,91,255,.16);
}

.collider-modal-wheel::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid rgba(237,247,255,.16);
  border-radius: 50%;
}

.wheel-half {
  position: absolute;
  z-index: 1;
  color: #edf7ff;
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: .04em;
}

.wheel-win {
  right: 28px;
  color: #d8fbff;
  text-shadow: 0 0 10px rgba(24,245,255,.9), 0 0 18px rgba(24,245,255,.45);
}

.wheel-lose {
  left: 24px;
  color: #f2e8ff;
  text-shadow: 0 0 10px rgba(185,91,255,.92), 0 0 18px rgba(185,91,255,.42);
}

.collider-center-reward {
  position: relative;
  z-index: 2;
  width: 42%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid rgba(237,247,255,.18);
  border-radius: 50%;
  background: #07101e;
  box-shadow: inset 0 0 18px rgba(24,245,255,.14), 0 0 18px rgba(0,0,0,.45);
  overflow: hidden;
}

.collider-center-reward .entity-art,
.collider-center-reward .reward-art-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.collider-modal-needle {
  position: absolute;
  z-index: 4;
  inset: -8px;
  margin: auto;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  transform-origin: 50% 50%;
  transform: rotate(0deg);
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(24,245,255,.82));
}

.collider-modal-needle::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%) rotate(180deg);
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 22px solid #18f5ff;
}

.collider-modal-needle::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #e8fdff;
  box-shadow: 0 0 10px rgba(24,245,255,.85), 0 0 18px rgba(185,91,255,.38);
}

.collider-modal-needle.spin-win {
  animation: colliderNeedleWin 3.25s cubic-bezier(.08,.78,.08,1) forwards;
}

.collider-modal-needle.spin-lose {
  animation: colliderNeedleLose 3.25s cubic-bezier(.08,.78,.08,1) forwards;
}

.collider-modal-card p {
  margin: 8px auto 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.reward-reveal-card {
  width: min(100%, 430px);
  max-height: min(88dvh, 720px);
  overflow: hidden auto;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--rarity), transparent 28%);
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity), transparent 88%), transparent 34%),
    rgba(8, 13, 25, 0.98);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 22px 70px rgba(0, 0, 0, 0.58),
    0 0 34px color-mix(in srgb, var(--rarity), transparent 58%);
  text-align: center;
  animation: rewardPop 320ms cubic-bezier(.2,.95,.2,1);
}

.reward-reveal-kicker {
  color: var(--rarity);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.reward-reveal-art {
  width: min(78vw, 320px);
  aspect-ratio: 1;
  margin: 10px auto 8px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--rarity), transparent 68%), transparent 58%);
  overflow: hidden;
}

.reward-reveal-art .entity-art {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: transparent;
}

.reward-reveal-art .creature-img {
  animation-duration: 2.2s;
}

.reward-reveal-card h2 {
  margin: 6px 0 0;
  font-size: clamp(24px, 7vw, 38px);
  line-height: 1;
}

.reward-reveal-card p {
  margin: 8px auto 0;
  max-width: 32ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.reward-reveal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.reward-reveal-stats span {
  padding: 8px 6px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,0.035);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.reward-reveal-stats strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 14px;
  text-transform: none;
}

.reward-continue {
  width: 100%;
  margin-top: 12px;
}

.reward-burst-icon {
  width: 110px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #06111e;
  background: var(--rarity);
  box-shadow: 0 0 38px color-mix(in srgb, var(--rarity), transparent 35%);
  font-size: 34px;
  font-weight: 1000;
}

.reward-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(100%, 500px);
  max-height: min(76dvh, 640px);
  overflow: hidden;
  padding: 12px;
}

.picker-list {
  max-height: calc(76dvh - 82px);
  margin-top: 10px;
  overflow: auto;
}

.crew-modal-card {
  width: min(92vw, 420px);
}

.crew-modal-body {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.crew-host {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(24,245,255,.18);
  border-radius: var(--card-radius);
  background: rgba(255,255,255,.035);
}

.crew-host img {
  width: 88px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.crew-host p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.brass-host {
  border-color: rgba(255,209,102,.22);
}

.crew-actions {
  display: grid;
  gap: 8px;
}

.crew-action {
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(24,245,255,.24);
  border-radius: var(--card-radius);
  color: var(--text);
  background: rgba(8,17,32,.78);
  text-align: left;
}

.crew-action strong,
.crew-action span {
  display: block;
}

.crew-action span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.crew-daily-list {
  grid-template-columns: 1fr;
}

.daily-door-large {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(200,92,255,.28);
  border-radius: var(--card-radius);
  background:
    radial-gradient(circle at 50% 0%, rgba(200,92,255,.16), transparent 54%),
    rgba(8,17,32,.72);
}

.daily-door-large img {
  width: 54px;
  height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(24,245,255,.35));
}

.picker-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: rgba(255, 255, 255, 0.035);
}

.picker-row .entity-art {
  width: 58px;
  aspect-ratio: 1;
}

.toast-zone {
  position: fixed;
  left: 50%;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 50;
  width: min(92vw, 480px);
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px;
  border: 1px solid rgba(24, 245, 255, 0.34);
  border-radius: var(--card-radius);
  background: rgba(10, 15, 28, 0.96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  animation: toastIn 220ms ease-out;
}

.silhouette {
  filter: grayscale(1) brightness(0.42) contrast(1.18);
  opacity: 0.58;
}

.locked {
  color: var(--muted);
}

@media (max-height: 680px) {
  .tutorial-card {
    grid-template-columns: 1fr;
    width: min(calc(100% - 28px), 420px);
    margin-bottom: 10px;
    padding: 8px;
  }

  .tutorial-card p {
    font-size: 11px;
    line-height: 1.25;
  }

  .tutorial-actions {
    justify-content: stretch;
    gap: 5px;
  }

  .tutorial-actions .mini-button {
    flex: 1;
    min-height: 34px;
    padding: 0 8px;
  }

  .scan-stage {
    min-height: 0;
    padding-top: 8px;
  }

  .signal-orb {
    width: min(32vw, 132px);
  }

  .scan-button {
    min-height: 48px;
    font-size: 13px;
  }

  .roll-track-wrap {
    height: 78px;
  }

  .roll-pointer {
    height: 74px;
  }

  .scan-mode-card p {
    display: none;
  }

  .scan-mode-card {
    min-height: 96px;
  }

  .daily-card {
    padding: 5px 7px;
  }

  .daily-list {
    grid-template-columns: 1fr;
  }

  .crew-dock {
    left: 6px;
    right: 6px;
    gap: 6px;
  }

  .crew-button {
    width: 44px;
    min-height: 48px;
  }

  .crew-button img {
    width: 30px;
    height: 30px;
  }

}

@media (max-width: 420px) {
  .crew-dock {
    gap: 4px;
  }

  .crew-button {
    width: 42px;
    min-height: 50px;
  }

  .crew-button img {
    width: 38px;
    height: 36px;
  }
}

@media (min-width: 620px) {
  .shell {
    max-width: 640px;
  }

  #tab-scan.active {
    grid-template-columns: minmax(0, 520px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    justify-content: center;
  }

  #tab-scan.active > .scan-stage,
  #tab-scan.active > .roll-panel,
  #tab-scan.active > .camera-card {
    grid-column: 1;
  }

  .crew-dock {
    position: absolute;
  }

  .crew-button {
    width: 64px;
    min-height: 76px;
  }

  .crew-button img {
    width: 64px;
    height: 60px;
  }
}

@media (max-height: 760px) {
  .topbar {
    padding-top: max(7px, env(safe-area-inset-top));
    padding-bottom: 6px;
  }

  .brand small {
    display: none;
  }

  .viewport {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  #tab-scan.active {
    gap: 6px;
  }

  .signal-orb {
    width: min(22dvh, 36vw, 132px);
  }

  .timer-line {
    margin-top: 4px;
    font-size: 12px;
  }

  .scan-modes {
    margin-top: 4px;
  }

  .quick-actions {
    margin-top: 6px;
  }

  .roll-panel {
    margin-top: 0;
  }

  .tabs {
    padding-top: 5px;
    padding-bottom: calc(5px + var(--safe-bottom));
  }

  .tab-button {
    min-height: 38px;
  }

  .luck-host {
    grid-template-columns: 74px minmax(0, 1fr);
    padding: 8px;
  }

  .luck-host img {
    width: 74px;
  }

  .luck-host h1 {
    font-size: 22px;
  }

  .luck-host p {
    font-size: 11px;
  }

  .machine-button {
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 78px;
    padding: 8px;
  }

  .machine-button img {
    width: 58px;
  }

  .machine-button strong {
    font-size: 17px;
  }

  .machine-button small {
    font-size: 11px;
  }

  .dome-log {
    max-height: 110px;
  }
}

@media (max-width: 360px) {
  .scan-modes {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 430px) {
  .entity-grid,
  .archive-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

@keyframes pulseRing {
  0% { transform: scale(0.72); opacity: 0; }
  35% { opacity: 0.95; }
  100% { transform: scale(1.12); opacity: 0; }
}

@keyframes coreBeat {
  0%, 100% { transform: scale(0.86); opacity: 0.65; }
  50% { transform: scale(1.08); opacity: 1; }
}

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

@keyframes glitchFlicker {
  0%, 100% { filter: hue-rotate(0deg) saturate(1.2); transform: translateX(0); }
  45% { filter: hue-rotate(80deg) saturate(1.9); transform: translateX(1px); }
  55% { filter: hue-rotate(-60deg) saturate(1.6); transform: translateX(-1px); }
}

@keyframes creatureFloat {
  0%, 100% { transform: translateY(0) scale(1.03); }
  50% { transform: translateY(-5px) scale(1.07); }
}

@keyframes revealFloat {
  0%, 100% { transform: translateY(0) scale(1.02); }
  50% { transform: translateY(-7px) scale(1.06); }
}

@keyframes eyePulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

@keyframes limbDrift {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(5deg); }
}

@keyframes sparkOrbit {
  0%, 100% { transform: rotate(0deg) scale(1); opacity: 0.42; }
  50% { transform: rotate(8deg) scale(1.05); opacity: 0.9; }
}

@keyframes auraPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 0.8; transform: scale(1.08); }
}

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

body .signal-orb {
  width: min(16dvh, 28vw, 104px);
}

body .signal-orb.captured {
  width: min(19dvh, 34vw, 132px);
}

@keyframes slashHit {
  0% { opacity: 0; transform: translate(-40%, 40%); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translate(40%, -40%); }
}

@keyframes missStamp {
  0% { opacity: 0; transform: scale(1.4) rotate(-12deg); }
  35% { opacity: 1; transform: scale(1) rotate(-12deg); }
  100% { opacity: 0.7; transform: scale(1) rotate(-12deg); }
}

@keyframes wheelSpin {
  from { transform: rotate(0); }
  to { transform: rotate(1260deg); }
}

@keyframes colliderNeedleWin {
  from { transform: rotate(0deg); }
  to { transform: rotate(1530deg); }
}

@keyframes colliderNeedleLose {
  from { transform: rotate(0deg); }
  to { transform: rotate(1710deg); }
}

@keyframes rewardPop {
  from { opacity: 0; transform: translateY(12px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes scanSurge {
  0%, 100% { box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28), 0 0 0 rgba(24, 245, 255, 0); }
  50% { box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28), 0 0 32px rgba(24, 245, 255, 0.22); }
}

@keyframes hitPulse {
  0% { transform: scale(1); filter: brightness(1); }
  42% { transform: scale(1.015); filter: brightness(1.32); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes legendaryBurst {
  0% { transform: scale(1); filter: brightness(1) saturate(1); }
  35% { transform: scale(1.02); filter: brightness(1.65) saturate(1.35); }
  100% { transform: scale(1); filter: brightness(1.05) saturate(1.05); }
}
