:root { color-scheme: dark; }

/* App shell adopting minimal, cinematic full-screen */
html, body { height: 100%; }
body.app {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 800px at 70% -10%, rgba(255, 198, 58, 0.06), transparent 60%),
              linear-gradient(160deg, #10141F 0%, #12101E 100%);
  color: #EFEFEF;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

/* Typography: display for titles / data */
.display {
  font-family: 'Bebas Neue', Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.display-lg { font-size: clamp(48px, 12vw, 112px); line-height: .95; font-weight: 700; }
.display-md { font-size: clamp(28px, 8vw, 64px);  line-height: .98; font-weight: 700; }
.display-num { font-size: clamp(64px, 18vw, 160px); line-height: .9; font-weight: 800; }

/* Single-screen layout */
.screen {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

.section-center {
  display: grid;
  place-items: center;
  padding: 24px 0;
}

/* Action button in Saffron */
.btn-primary {
  --btn-bg: #FFC63A;
  --btn-text: #12101E;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 0 12px 28px rgba(255, 198, 58, .15);
  cursor: pointer;
}
.btn-primary:hover {
  background: #FFD25C;
  box-shadow: 0 16px 32px rgba(255, 198, 58, .25);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(1px) scale(.99); }
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: #EFEFEF;
  border: 2px solid rgba(239, 239, 239, .25);
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: transform .15s ease, border-color .2s ease, background .2s ease;
  cursor: pointer;
}
.btn-secondary:hover { 
  border-color: rgba(239, 239, 239, .5); 
  background: rgba(239, 239, 239, .05);
  transform: translateY(-2px);
}
.btn-secondary:active { transform: translateY(1px) scale(.99); }
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Secondary link style */
.link { 
  color: #EFEFEF; 
  opacity: .7; 
  text-decoration: none;
  transition: opacity .2s ease, transform .15s ease;
  display: inline-block;
}
.link:hover { 
  opacity: 1;
  transform: translateY(-1px);
}

/* Minimal underline input */
.input-underline {
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(239,239,239,.25);
  color: #EFEFEF;
  padding: 12px 4px;
  width: 100%;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  font-size: 16px;
}
.input-underline::placeholder { color: rgba(239,239,239,.35); }
.input-underline:focus {
  border-bottom-color: #FFC63A;
  box-shadow: 0 6px 0 -4px #FFC63A;
}
.input-underline:hover:not(:focus) {
  border-bottom-color: rgba(239,239,239,.4);
}

/* Slider: immersive horizontal control */
.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #493e7a 0%, #2b2740 100%);
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: #FFC63A; border: 3px solid #12101E;
  box-shadow: 0 8px 20px rgba(255, 198, 58, .3);
}
.slider::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%;
  background: #FFC63A; border: 3px solid #12101E;
  box-shadow: 0 8px 20px rgba(255, 198, 58, .3);
}

/* Result feedback colors */
.success { color: #50E3C2; }
.error { color: #FF6B6B; }

/* Semicircle container positioning */
.semicircle-container { position: relative; margin: 0 auto; }
#semicircle-svg { 
  cursor: pointer; 
  touch-action: none;
  transition: filter .2s ease;
}
#semicircle-svg:hover {
  filter: brightness(1.1);
}

/* Big center number animation */
.value-pop { transform: scale(1); transition: transform .12s ease; }
.value-pop.bump { transform: scale(1.08); }

/* Particles for results */
.particle { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #FFC63A; pointer-events: none; filter: blur(.2px); }

/* Results overlay */
.result-overlay {
  position: fixed;
  inset: 0;
  display: none; /* shown by JS */
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 50;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Utility */
* { -webkit-tap-highlight-color: transparent; }
@keyframes pulse { 
  0%, 100% { opacity: 1; transform: scale(1); } 
  50% { opacity: .4; transform: scale(0.95); } 
}
.animate-pulse { animation: pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
