:root {
  --bg: #07101d;
  --panel: rgba(10, 18, 32, 0.96);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(76, 201, 255, 0.22);
  --text: #edf4ff;
  --muted: #95abc8;
  --blue: #46c5ff;
  --blue-2: #7fdfff;
  --yellow: #ffbf47;
  --danger: #ff728d;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #11254b 0%, #060f1d 50%, #030814 100%);
  color: var(--text);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.device-wrap {
  width: min(430px, calc((100vh - 36px) * 0.49));
  min-width: 360px;
  position: relative;
  filter: drop-shadow(0 25px 60px rgba(0, 0, 0, 0.5));
}

.device {
  position: relative;
  background: linear-gradient(180deg, #0d1221, #030713);
  border-radius: 44px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), var(--shadow);
  overflow: hidden;
}

.device::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 44px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.side-btn {
  position: absolute;
  width: 4px;
  background: #202944;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.side-btn-one {
  top: 148px;
  right: -3px;
  height: 62px;
}

.side-btn-two {
  top: 226px;
  right: -3px;
  height: 62px;
}

.side-btn-three {
  top: 160px;
  left: -3px;
  height: 96px;
}

.screen {
  position: relative;
  height: min(880px, calc(100vh - 36px));
  min-height: 0;
  overflow: hidden;
  border-radius: 34px;
  background:
    radial-gradient(circle at top left, rgba(76, 201, 255, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 191, 71, 0.12), transparent 20%),
    linear-gradient(180deg, #091329 0%, #06101f 45%, #040a14 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 168px;
  height: 30px;
  background: #030814;
  border-radius: 0 0 20px 20px;
  z-index: 6;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-top: none;
}

.statusbar {
  position: absolute;
  top: 14px;
  left: 18px;
  right: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #c9d4eb;
  font-size: 12px;
}

.app-header {
  position: absolute;
  top: 42px;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.brand-lockup-logo {
  width: min(226px, 56vw);
  max-height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.28));
}

.header-pill,
.action-chip,
.platform-chip,
.btn,
.result-chip,
.result-item,
.sheet-close,
.stat-card,
.dock-btn,
.auth-tab {
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.header-pill {
  min-width: 74px;
  text-align: center;
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.page-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 188px 18px 100px;
  scrollbar-width: none;
}

.page-scroll::-webkit-scrollbar,
.platform-row::-webkit-scrollbar,
.guest-actions::-webkit-scrollbar,
.sheet-large::-webkit-scrollbar {
  display: none;
}

.guest-actions {
  display: flex;
  gap: 10px;
  overflow: auto;
  margin: 12px 0 18px;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.action-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 18px;
  padding: 12px 14px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 700;
}

.action-chip-primary {
  background: rgba(76, 201, 255, 0.12);
  border-color: var(--line-strong);
}

.action-chip-danger {
  background: rgba(255, 114, 141, 0.12);
  border-color: rgba(255, 114, 141, 0.2);
  color: #ffdbe3;
}

.banner {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 114, 141, 0.1);
  border: 1px solid rgba(255, 114, 141, 0.18);
}

.banner strong {
  font-size: 15px;
}

.banner span {
  font-size: 13px;
  line-height: 1.55;
  color: #ffd6df;
}

.panel {
  border-radius: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  padding: 16px;
  margin-bottom: 14px;
}

.panel-head,
.result-head,
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  margin-bottom: 14px;
}

.panel-head h2,
.result-head h3,
.sheet-head h3 {
  margin: 0;
}

.result-head span,
.empty-text,
.stats-update {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.mini-pill {
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.platform-row {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding-bottom: 6px;
  margin-bottom: 6px;
  scrollbar-width: none;
  cursor: grab;
}

.platform-row.dragging {
  cursor: grabbing;
  user-select: none;
}

.platform-chip {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

.platform-chip.active {
  background: rgba(76, 201, 255, 0.12);
  border-color: var(--line-strong);
}

label {
  display: block;
  margin: 10px 0 7px;
  color: #d8e4fb;
  font-size: 12px;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
  padding: 14px 15px;
}

textarea {
  resize: none;
  min-height: 108px;
}

input::placeholder,
textarea::placeholder {
  color: #7588a9;
}

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

.form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: center;
  margin-top: 18px;
}

.grow {
  flex: 1;
}

.count-wrap {
  width: 112px;
}

.btn {
  border: none;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 800;
  padding: 14px 18px;
  min-height: 54px;
}

.btn-primary {
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  color: #062235;
}

.btn-warning {
  background: linear-gradient(90deg, var(--yellow), #ffd572);
  color: #442800;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-block {
  width: 100%;
}

.results-panel {
  display: grid;
  gap: 12px;
}

.result-box {
  border-radius: 22px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-chip {
  border: 1px solid rgba(76, 201, 255, 0.16);
  background: rgba(76, 201, 255, 0.08);
  color: #e6fbff;
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12px;
}

.result-stack {
  display: grid;
  gap: 10px;
}

.result-item {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 14px;
  line-height: 1.6;
  font-size: 13px;
  cursor: pointer;
}

.dashboard-dock {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 10px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(6, 12, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

.dock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 12px 10px;
  cursor: pointer;
  font-weight: 700;
}

.dock-btn-primary {
  background: rgba(255, 191, 71, 0.12);
  border-color: rgba(255, 191, 71, 0.2);
}

.dock-btn-menu {
  min-width: 88px;
}

.dock-icon {
  font-size: 16px;
  line-height: 1;
}

.overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.38);
  transition: 0.18s ease;
  z-index: 8;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  background: linear-gradient(180deg, #122149, #09132c);
  border: 1px solid var(--line);
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  transform: translateY(110%);
  transition: 0.22s ease;
  padding: 14px 16px 20px;
  box-shadow: 0 -25px 60px rgba(0, 0, 0, 0.36);
}

.sheet.show {
  transform: translateY(0);
}

.sheet-large {
  max-height: 74%;
  overflow: auto;
  scrollbar-width: none;
}

.sheet-handle {
  width: 56px;
  height: 6px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.sheet-close {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.auth-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 18px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
}

.auth-tab.active {
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  color: #062235;
  border-color: transparent;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-submit {
  margin-top: 16px;
}

.sheet-card,
.vip-card,
.vip-box,
.vip-price,
.stat-card {
  border-radius: 22px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.sheet-row:last-child {
  border-bottom: none;
}

.sheet-row span,
.tiny-label,
.vip-price span {
  color: var(--muted);
}

.tiny-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.vip-card strong,
.vip-box strong,
.vip-price strong {
  display: block;
}

.current-plan {
  margin-bottom: 12px;
}

.vip-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.vip-box-active {
  border-color: rgba(255, 191, 71, 0.2);
  background: rgba(255, 191, 71, 0.08);
}

.vip-price {
  margin-bottom: 12px;
}

.menu-actions {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.stats-update {
  margin: 6px 0 12px;
}

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

.stat-card h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.stat-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(76, 201, 255, 0.08);
  border: 1px solid rgba(76, 201, 255, 0.14);
  color: #dff7ff;
  font-size: 12px;
}

.loading-screen {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 8, 20, 0.9);
  backdrop-filter: blur(8px);
}

.loading-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px 22px;
  border-radius: 28px;
  background: rgba(10, 18, 32, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.loading-card img {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  object-fit: cover;
}

.loading-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.loading-card span {
  color: var(--muted);
  font-size: 13px;
}

.loading-dots {
  display: flex;
  gap: 8px;
}

.loading-dots i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(76, 201, 255, 0.24);
  animation: pulse 0.9s infinite ease-in-out;
}

.loading-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  50% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(7, 13, 25, 0.96);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  transition: 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.action-chip:active,
.platform-chip:active,
.btn:active,
.result-chip:active,
.result-item:active,
.sheet-close:active,
.auth-tab:active,
.stat-card:active,
.dock-btn:active {
  transform: scale(0.98);
}

@media (max-width: 520px) {
  body {
    padding: 0;
  }

  .device-wrap {
    width: 100%;
    min-width: 0;
    filter: none;
  }

  .device {
    border-radius: 0;
    padding: 0;
  }

  .device::before,
  .side-btn,
  .notch {
    display: none;
  }

  .screen {
    height: 100vh;
    border-radius: 0;
  }

  .app-header {
    top: 12px;
  }

  .brand-lockup-logo {
    width: min(180px, 52vw);
    max-height: 92px;
  }

  .page-scroll {
    padding-top: 154px;
    padding-bottom: 104px;
  }

  .vip-compare,
  .form-row,
  .form-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-dock {
    left: 12px;
    right: 12px;
    bottom: 12px;
    grid-template-columns: 1fr 1.15fr auto;
  }

  .count-wrap {
    width: 100%;
  }
}
