/* Shape Early Brand Design System */
:root {
  --color-terracotta: #C85A32;
  --color-terracotta-dark: #9F4120;
  --color-terracotta-soft: #F4E8E1;
  --color-bg: #FAF7F5;
  --color-surface: #FFFFFF;
  --color-text-primary: #1C1815;
  --color-text-secondary: #6B635D;
  --color-text-muted: #9E948C;
  --color-border: #EADBCE;
  --radius-pill: 9999px;
  --radius-card: 22px;
  --shadow-clay: 0 10px 30px rgba(200, 90, 50, 0.08);
  --shadow-dial: 0 20px 48px rgba(0, 0, 0, 0.12);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Dynamic Cardinal Themes */
  --theme-bg: #FAF7F5;
  --theme-accent: #C85A32;
  --theme-accent-soft: #F4E8E1;
  --theme-card-bg: #FFFFFF;
  --theme-text-header: #FFFFFF;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  transition: background-color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--theme-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
  transition: background-color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  padding: 24px 20px;
  animation: fadeIn 0.3s ease-out;
  position: relative;
  z-index: 2;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cardinal Themes for Screen & App */
.theme-n {
  --theme-bg: #C85A32;
  --theme-accent: #C85A32;
  --theme-accent-soft: #F4E8E1;
  --theme-text-header: #FFFFFF;
}

.theme-e {
  --theme-bg: #C67D28;
  --theme-accent: #C67D28;
  --theme-accent-soft: #FBF0DE;
  --theme-text-header: #FFFFFF;
}

.theme-s {
  --theme-bg: #3E6353;
  --theme-accent: #3E6353;
  --theme-accent-soft: #E3EDE7;
  --theme-text-header: #FFFFFF;
}

.theme-w {
  --theme-bg: #2E4E59;
  --theme-accent: #2E4E59;
  --theme-accent-soft: #E0EBF0;
  --theme-text-header: #FFFFFF;
}

/* Typography & Headings */
.brand-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--color-terracotta);
  background: var(--color-terracotta-soft);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

.hero-title {
  font-size: 38px;
  font-weight: 850;
  line-height: 1.1;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 16px;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

.stepper {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-terracotta);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.section-header h2 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
}

.section-header .hint {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 14px;
}

.counter-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  background: var(--color-border);
  color: var(--color-text-secondary);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-pill {
  padding: 16px 28px;
  border-radius: var(--radius-pill);
  width: 100%;
}

.btn-primary {
  background: var(--color-terracotta);
  color: #FFFFFF;
}

.btn-primary:active {
  background: var(--color-terracotta-dark);
  transform: scale(0.985);
}

.btn-primary:disabled {
  background: #D8CEC7;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #FFFFFF;
  color: var(--theme-accent);
  border: 1.5px solid transparent;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

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

.btn-ghost-light {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 600;
  padding: 10px;
  border: none;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 14px;
  padding: 10px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-pill);
}

/* Mini Compass Preview (Hook) */
.mini-compass-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
}

.compass-ring-preview {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 8px solid var(--color-terracotta-soft);
  box-shadow: var(--shadow-clay);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  position: relative;
}

.needle-indicator {
  position: absolute;
  top: -12px;
  width: 24px;
  height: 24px;
  background: var(--color-terracotta);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.preview-card-cardinal {
  font-size: 18px;
  font-weight: 900;
  color: var(--color-terracotta);
}

.preview-card-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 6px 0;
}

.preview-card-action {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.micro-reassurance {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 14px;
}

/* Categories Grid */
.categories-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 80px;
  overflow-y: auto;
}

.topic-tile {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.topic-tile.selected {
  border-color: var(--color-terracotta);
  background: var(--color-terracotta-soft);
}

.topic-info h4 {
  font-size: 16px;
  font-weight: 750;
  margin-bottom: 4px;
}

.topic-info p {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.topic-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all 0.2s ease;
}

.topic-tile.selected .topic-check {
  background: var(--color-terracotta);
  border-color: var(--color-terracotta);
  color: #FFFFFF;
}

.sticky-footer {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--color-bg) 80%, rgba(250, 247, 245, 0));
  padding-top: 16px;
  margin-top: auto;
}

/* Schedule Cadence */
.rhythm-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.rhythm-card {
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 18px;
  padding: 18px;
  cursor: pointer;
  gap: 14px;
}

.rhythm-card input[type="radio"] {
  accent-color: var(--color-terracotta);
  width: 20px;
  height: 20px;
}

.rhythm-title {
  display: block;
  font-size: 15px;
  font-weight: 750;
}

.rhythm-sub {
  display: block;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 3px;
}

/* COMPASS SCREEN (Dynamic Theme Enabled) */
.compass-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.brand-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.4s ease;
}

.category-tag {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  margin-top: 2px;
  transition: color 0.4s ease;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.compass-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.spin-trigger-wrapper {
  position: relative;
  z-index: 10;
  margin-bottom: -18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-spin-pill {
  background: #FFFFFF;
  border: none;
  color: var(--theme-accent);
  font-size: 13.5px;
  font-weight: 800;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, color 0.5s ease;
}

.btn-spin-pill:active {
  transform: scale(0.95);
}

.top-dial-pointer {
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 12px solid #FFFFFF;
  margin-top: 5px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* The Fixed Dial Face + Rotating Coordinate Ring */
.dial-container {
  width: 324px;
  height: 324px;
  position: relative;
  margin: 18px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Rotating Compass Ring (Only Coordinates & Ring Spin) */
.compass-dial-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #FFFFFF;
  border: 12px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow-dial);
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center center;
}

.compass-dial-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px dashed #D8C7BC;
  pointer-events: none;
}

.cardinal-marker {
  position: absolute;
  font-size: 12px;
  font-weight: 800;
  color: #A09890;
}

.mark-n  { top: 8px; left: 50%; transform: translateX(-50%); color: var(--theme-accent); font-weight: 900; }
.mark-ne { top: 22px; right: 26px; }
.mark-e  { right: 10px; top: 50%; transform: translateY(-50%); }
.mark-se { bottom: 22px; right: 26px; }
.mark-s  { bottom: 8px; left: 50%; transform: translateX(-50%); }
.mark-sw { bottom: 22px; left: 26px; }
.mark-w  { left: 10px; top: 50%; transform: translateY(-50%); }
.mark-nw { top: 22px; left: 26px; }

/* The Dial Center Card (ALWAYS REMAINS 100% HORIZONTALLY UPRIGHT) */
.dial-center-card {
  position: relative;
  z-index: 5;
  width: 226px;
  height: 226px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.dial-center-card.fade-out {
  opacity: 0;
  transform: scale(0.94);
}

.cardinal-badge {
  font-size: 13px;
  font-weight: 900;
  color: var(--theme-accent);
  background: var(--theme-accent-soft);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  transition: color 0.5s ease, background 0.5s ease;
}

.card-title {
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 1.2px;
  color: var(--theme-accent);
  margin-bottom: 4px;
  transition: color 0.5s ease;
}

.card-action {
  font-size: 15px;
  font-weight: 750;
  color: #1C1815;
  margin-bottom: 8px;
  line-height: 1.25;
}

.card-body {
  font-size: 12px;
  color: #59524D;
  line-height: 1.4;
  margin-bottom: 8px;
}

.card-punchline {
  font-size: 11px;
  font-weight: 800;
  color: var(--theme-accent);
  transition: color 0.5s ease;
}

/* Cardinal Selector Buttons */
.cardinal-navigator {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}

.nav-direction {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  color: #FFFFFF;
  transition: all 0.25s ease;
}

.nav-direction.active {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: var(--theme-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.compass-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

/* Modals & A2HS Drawer */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 21, 0.55);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-card);
  padding: 28px 24px;
  text-align: center;
  max-width: 360px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-icon {
  font-size: 38px;
  margin-bottom: 12px;
}

.modal-card h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-card p {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}