* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #03050f;
  color: #f8fbff;
  font-family: Inter, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button {
  min-height: 44px;
  border: 1px solid rgba(0, 240, 255, 0.52);
  border-radius: 8px;
  background: rgba(0, 240, 255, 0.08);
  color: #f8fbff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

.app,
#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hud {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.metric {
  min-width: 78px;
  padding: 9px 11px;
  border: 1px solid rgba(157, 0, 255, 0.38);
  border-radius: 8px;
  background: rgba(4, 7, 18, 0.62);
  box-shadow: 0 0 24px rgba(157, 0, 255, 0.12), inset 0 0 18px rgba(0, 240, 255, 0.04);
  backdrop-filter: blur(10px);
}

.metric-right {
  border-color: rgba(0, 240, 255, 0.36);
}

.metric span,
.stats span {
  display: block;
  font-size: 24px;
  font-weight: 800;
}

.metric small,
.stats small,
.task small,
.brand span,
.result,
.task-status {
  color: #a8c4d2;
}

.sheet {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 8px;
  background: rgba(4, 7, 18, 0.84);
  box-shadow: 0 0 38px rgba(0, 240, 255, 0.08), inset 0 0 28px rgba(157, 0, 255, 0.05);
  backdrop-filter: blur(14px);
}

.sheet.hidden,
.captcha.hidden {
  display: none;
}

.brand,
.taskbar,
.tabs,
.stats {
  display: flex;
  align-items: center;
}

.brand,
.taskbar {
  justify-content: space-between;
  gap: 12px;
}

.brand div {
  display: grid;
  gap: 2px;
}

.view {
  display: none;
  gap: 12px;
}

.view.active {
  display: grid;
}

.stats {
  gap: 10px;
}

.stats div {
  flex: 1;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(157, 0, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.primary {
  border-color: rgba(0, 240, 255, 0.72);
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.18), rgba(157, 0, 255, 0.16));
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.12);
}

.ghost {
  min-height: 36px;
  padding: 0 12px;
}

.result {
  min-height: 20px;
  margin: 0;
  line-height: 1.35;
}

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

.tab {
  min-height: 38px;
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.03);
}

.tab.active {
  border-color: rgba(0, 240, 255, 0.62);
}

.tasks {
  display: grid;
  gap: 8px;
  max-height: min(34vh, 280px);
  overflow: auto;
}

.task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.task strong {
  display: block;
  margin-bottom: 2px;
}

.task-actions {
  display: grid;
  gap: 6px;
  min-width: 104px;
}

.captcha {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 7, 18, 0.78);
  backdrop-filter: blur(8px);
}

.captcha > div {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 0, 85, 0.5);
  border-radius: 8px;
  background: #090d1d;
}

@media (max-height: 680px) {
  .sheet {
    gap: 9px;
    padding: 12px;
  }

  .stats {
    display: none;
  }
}
