:root {
  --bg-deep: #070d0a;
  --bg-card: rgba(14, 24, 19, 0.92);
  --border-glass: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #9ca3af;
  --line-green: #06c755;
  --line-green-dark: #00b900;
  --line-green-lip: #048f3d;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  overscroll-behavior: none;
  user-select: none;
}

.app-root {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #0d2116 0%, #070d0a 68%);
}

.ambient-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 199, 85, 0.24) 0%, rgba(6, 199, 85, 0) 70%);
  filter: blur(56px);
  pointer-events: none;
  z-index: 0;
}

/* ===== Centered Main Layout ===== */
.launcher-view {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(var(--safe-top) + 20px)
    calc(var(--safe-right) + 20px)
    calc(var(--safe-bottom) + 20px)
    calc(var(--safe-left) + 20px);
}

.center-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* LINE-Green Hero CTA */
.btn-hero {
  min-width: 260px;
  height: 58px;
  padding: 0 30px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #10d862 0%, var(--line-green) 55%, var(--line-green-dark) 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    0 5px 0 var(--line-green-lip),
    0 16px 34px rgba(6, 199, 85, 0.36);
  cursor: pointer;
  transition: transform 0.13s ease, box-shadow 0.13s ease;
}

.btn-hero__icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-hero__arrow {
  opacity: 0.92;
  transition: transform 0.16s ease;
}

.btn-hero:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    0 2px 0 var(--line-green-lip),
    0 8px 18px rgba(6, 199, 85, 0.25);
}

.btn-hero:active .btn-hero__arrow {
  transform: translateX(3px);
}

/* Secondary Install Button (matching LINE green tone) */
.btn-install {
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(6, 199, 85, 0.38);
  background: rgba(6, 199, 85, 0.1);
  color: #86efac;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.btn-install:active {
  transform: scale(0.96);
  opacity: 0.78;
}

/* Subtle Notification Toggle Button (appears when Firebase is configured) */
.btn-notify {
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #d1d5db;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.btn-notify.is-enabled {
  border-color: rgba(6, 199, 85, 0.35);
  color: #86efac;
}

.btn-notify:active {
  transform: scale(0.96);
  opacity: 0.78;
}

/* ===== In-App Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(3, 8, 5, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 360px;
  border-radius: 26px;
  background: var(--bg-card);
  border: 1px solid rgba(6, 199, 85, 0.2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.2s ease;
}

.modal-backdrop.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.modal-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
}

.modal-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(7, 13, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.step-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 12px;
  background: rgba(6, 199, 85, 0.14);
  color: var(--line-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.step-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #d1d5db;
}

.step-text strong {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
}

.step-text b {
  color: #86efac;
  font-weight: 600;
}

.modal-footer {
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.btn-pill {
  width: fit-content;
  min-width: 148px;
  height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1px solid rgba(6, 199, 85, 0.35);
  background: rgba(6, 199, 85, 0.14);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.btn-pill:active {
  transform: scale(0.96);
  opacity: 0.85;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 24px);
  transform: translateX(-50%) translateY(16px);
  z-index: 80;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(14, 24, 19, 0.96);
  border: 1px solid rgba(6, 199, 85, 0.3);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

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

.hidden {
  display: none !important;
}
