:root {
  --bg: #f4f8ff;
  --bg-card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe4f0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --gold: #93c5fd;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --cta-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

html {
  background: var(--bg);
}

body {
  min-height: 100dvh;
  font-family: Manrope, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 50% -80px, #dbeafe 0%, transparent 68%),
    radial-gradient(520px 280px at 110% 88%, #bfdbfe 0%, transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.view {
  width: 100%;
  min-height: 100dvh;
  max-width: 100%;
}

html[data-view="instruction"] #view-main,
html[data-view="main"] #view-instruction,
.view[hidden] {
  display: none !important;
}

html[data-view="instruction"] #view-instruction {
  display: flex !important;
  flex-direction: column;
}

html[data-view="main"] #view-main {
  display: flex;
}

html[data-view="main"],
html[data-view="main"] body {
  background: #fff;
}

.view-main {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: calc(24px + var(--safe-top)) 24px calc(28px + var(--safe-bottom));
}

.hero {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  max-width: 390px;
  margin: 0 auto;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 18px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #1e4b8e;
  font-size: 13px;
  font-weight: 700;
}

.hero-icon {
  width: 52px;
  height: 52px;
  margin: 0 0 16px;
  filter: drop-shadow(0 8px 12px rgba(30, 75, 142, 0.18));
}

.hero-title {
  margin: 0;
  font-family: Manrope, system-ui, sans-serif;
  font-size: clamp(28px, 7vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #1a365d;
}

.hero-subtitle {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  color: #5b6b82;
}

.hero-hint {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: #8b97a8;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 28px;
}

.hero-note {
  margin: 28px 0 0;
  font-size: 13px;
  color: #9aa6b5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  border: 1.5px solid transparent;
  border-radius: 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn::before {
  content: "";
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: url("assets/telegram.svg") center / 22px 22px no-repeat;
  mask: url("assets/telegram.svg") center / 22px 22px no-repeat;
}

.btn-primary {
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.28);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #1d4ed8;
}

.btn-secondary {
  background: #ffffff;
  color: #1a365d;
  border-color: #8bb4f0;
  box-shadow: 0 6px 16px rgba(30, 75, 142, 0.08);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: #f5f9ff;
  border-color: #3b82f6;
}

@media (prefers-reduced-motion: reduce) {
  .hint-arrow {
    animation: none;
  }
}

.view-instruction {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-top)) 20px calc(28px + var(--safe-bottom));
}

.hint-arrow {
  position: fixed;
  top: 8px;
  right: 10px;
  z-index: 90;
  width: 36px;
  height: 54px;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.2));
  animation: hint-point 1.1s ease-in-out infinite;
}

@keyframes hint-point {
  0%, 100% {
    transform: translateY(6px);
  }
  50% {
    transform: translateY(-4px);
  }
}

.instruction-card {
  width: 100%;
  max-width: 390px;
  padding: 28px 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  text-align: center;
  overflow: visible;
}

.instruction-title {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(28px, 8vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.instruction-lead {
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.instruction-steps {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  text-align: left;
  counter-reset: step;
}

.instruction-steps li {
  position: relative;
  padding: 8px 0 8px 36px;
}

.instruction-steps li::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  left: 0;
  top: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.menu-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  vertical-align: middle;
}

.instruction-art {
  margin: 16px auto 0;
  max-width: 300px;
  overflow: visible;
  display: flex;
  justify-content: center;
}

.instruction-art img {
  margin: 0 auto;
  width: 100%;
  height: auto;
}

@media (max-width: 320px) {
  .view-main,
  .view-instruction {
    padding-left: 16px;
    padding-right: 16px;
  }

  .instruction-card {
    padding: 22px 14px 18px;
    border-radius: 22px;
  }

  .hero {
    padding: 0;
  }

  .instruction-art {
    max-width: 260px;
  }

  .instruction-title {
    font-size: 28px;
  }
}

@media (min-width: 430px) {
  .view-main {
    padding-top: calc(32px + var(--safe-top));
  }
}
