:root {
  --page-bg: #0d1b26;
  --page-bg-soft: #143347;
  --panel-bg: rgba(8, 24, 35, 0.86);
  --panel-border: rgba(173, 220, 255, 0.22);
  --text-main: #f5fbff;
  --text-muted: #b8cedd;
  --brand: #7ae3cf;
  --brand-strong: #36c5af;
  --warning: #ffd08a;
  --danger: #ffb5b5;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  --radius-large: 22px;
  --radius-medium: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(122, 227, 207, 0.18), transparent 32%),
    radial-gradient(circle at bottom left, rgba(79, 138, 255, 0.18), transparent 28%),
    linear-gradient(160deg, var(--page-bg) 0%, var(--page-bg-soft) 100%);
  color: var(--text-main);
}

body {
  min-height: 100vh;
}

.app-shell,
.debug-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.overlay-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 10, 15, 0.62);
  backdrop-filter: blur(10px);
}

.overlay-screen.hidden,
.tracking-badge.hidden,
.hidden-media,
.ar-scene.hidden {
  display: none;
}

.overlay-screen.visible {
  display: flex;
}

.modal-screen {
  z-index: 50;
}

.panel {
  width: min(100%, 560px);
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-large);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.panel-large {
  width: min(100%, 680px);
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

h1,
h2 {
  margin: 0 0 12px;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2rem, 8vw, 3.4rem);
  max-width: 10ch;
}

h2 {
  font-size: clamp(1.4rem, 5vw, 2rem);
}

.panel-text,
.helper-text {
  margin: 0;
  line-height: 1.6;
  color: var(--text-muted);
}

.helper-text {
  margin-top: 12px;
  font-size: 0.95rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.primary-button,
.secondary-button,
.floating-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  transition:
    transform 120ms ease,
    opacity 120ms ease,
    background-color 120ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand) 0%, #b4f7ea 100%);
  color: #06202a;
  font-weight: 700;
}

.secondary-button,
.floating-button {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.primary-button:hover,
.secondary-button:hover,
.floating-button:hover {
  transform: translateY(-1px);
}

.status-layer {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 14px 16px;
}

.status-pill,
.tracking-badge {
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.status-pill {
  background: rgba(5, 17, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tracking-badge {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0) + 60px);
  right: 16px;
  background: rgba(54, 197, 175, 0.92);
  color: #03231f;
}

.action-layer {
  position: fixed;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0) + 16px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.floating-button {
  min-width: 144px;
  backdrop-filter: blur(8px);
}

.ar-scene {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.tips-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--text-muted);
  line-height: 1.7;
}

.debug-page {
  padding: 24px;
}

.debug-header {
  position: relative;
  z-index: 2;
  max-width: 860px;
}

.debug-grid {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 18px;
  padding-bottom: 140px;
}

.debug-target-preview {
  width: 100%;
  border-radius: var(--radius-medium);
  border: 1px solid rgba(255, 255, 255, 0.08);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 640px) {
  .panel,
  .panel-large {
    padding: 20px;
  }

  .button-row {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .floating-button {
    width: 100%;
  }

  .action-layer {
    left: 16px;
  }
}
