body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: radial-gradient(circle at 20% 10%, #1b2340 0%, #10131a 48%, #0b0e14 100%);
  color: #f5f7ff;
  min-height: 100vh;
}

body.debt-mode {
  background: #180f12;
  color: #ffe9ea;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.container h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 46px);
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #8fb3ff, #d6e4ff 35%, #8ff0d7 70%, #8fb3ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 26px rgba(70, 120, 255, 0.35);
}

.subtitle {
  margin: -8px 0 0;
  color: #dbe6ff;
  font-weight: 600;
  letter-spacing: 0.03em;
}

body.debt-mode .subtitle {
  color: #ffd5dc;
}

.disclaimer {
  position: sticky;
  top: 8px;
  z-index: 11;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(63, 47, 110, 0.88), rgba(44, 39, 78, 0.88));
  border: 1px solid #8d7dd2;
  font-size: 14px;
  box-shadow: 0 8px 20px rgba(20, 14, 39, 0.35);
}

.disclaimer p {
  margin: 0;
}

.disclaimer-note {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.9;
}

body.debt-mode .disclaimer {
  background: #3a1f2b;
  border-color: #99506b;
}

.card {
  background: linear-gradient(155deg, rgba(34, 43, 65, 0.92), rgba(22, 28, 44, 0.92));
  border: 1px solid #3d4b6b;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
}

body.debt-mode .card {
  background: #26151a;
  border-color: #7f2e3c;
}

.chart {
  min-height: 180px;
  background: linear-gradient(180deg, rgba(9, 13, 22, 0.95), rgba(6, 9, 15, 0.95));
  border-radius: 8px;
  padding: 12px;
  white-space: pre;
  overflow-x: auto;
  border: 1px solid #2f405f;
  box-shadow: inset 0 0 0 1px rgba(143, 179, 255, 0.06);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.chart.pulse-up {
  animation: chartPulseUp 0.42s ease;
}

.chart.pulse-down {
  animation: chartPulseDown 0.42s ease;
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  position: relative;
  overflow: hidden;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f9bff, #2d7ef7);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(45, 126, 247, 0.34);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(45, 126, 247, 0.42);
}

button.pressing {
  transform: translateY(0) scale(0.98);
}

button .ripple {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  background: rgba(255, 255, 255, 0.55);
  animation: rippleExpand 0.55s ease-out forwards;
}

button.secondary {
  background: linear-gradient(135deg, #77819a, #5c6478);
  box-shadow: 0 6px 16px rgba(40, 46, 59, 0.32);
}

button.secondary:hover {
  box-shadow: 0 8px 18px rgba(40, 46, 59, 0.4);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.banner {
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
}

.banner.hidden {
  display: none;
}

.banner.warn {
  background: linear-gradient(135deg, rgba(95, 24, 24, 0.95), rgba(68, 18, 18, 0.95));
  border: 1px solid #a44545;
  box-shadow: 0 8px 18px rgba(115, 24, 24, 0.3);
}

.banner.info {
  background: linear-gradient(135deg, rgba(28, 57, 88, 0.95), rgba(22, 45, 71, 0.95));
  border: 1px solid #4d86cc;
  box-shadow: 0 8px 18px rgba(23, 59, 102, 0.28);
}

.tutorial {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 24px;
  z-index: 999;
}

.tutorial.hidden {
  display: none;
}

.tutorial-card {
  width: min(680px, 92vw);
  background: rgba(20, 28, 42, 0.95);
  border: 1px solid #3f74b3;
  border-radius: 12px;
  padding: 14px 16px;
}

.tutorial-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.tutorial-card p {
  margin: 0;
}

.tutorial-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.debt-fixed {
  position: sticky;
  top: 8px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: #5f111f;
  border: 1px solid #cc3d56;
  font-weight: 700;
}

.debt-fixed.hidden {
  display: none;
}

.debt-value-line {
  font-size: 20px;
  font-weight: 700;
  color: #ff6f86;
}

.debt-progress-wrap.hidden {
  display: none;
}

.debt-progress-wrap progress {
  width: 100%;
  height: 16px;
}

@keyframes chartPulseUp {
  0% {
    box-shadow: 0 0 0 rgba(69, 190, 255, 0);
    border-color: #2f405f;
    transform: translateY(0);
  }
  40% {
    box-shadow: 0 0 22px rgba(69, 190, 255, 0.42);
    border-color: #62b5ff;
    transform: translateY(-1px);
  }
  100% {
    box-shadow: inset 0 0 0 1px rgba(143, 179, 255, 0.06);
    border-color: #2f405f;
    transform: translateY(0);
  }
}

@keyframes chartPulseDown {
  0% {
    box-shadow: 0 0 0 rgba(255, 107, 126, 0);
    border-color: #2f405f;
    transform: translateY(0);
  }
  40% {
    box-shadow: 0 0 22px rgba(255, 107, 126, 0.38);
    border-color: #ff7588;
    transform: translateY(1px);
  }
  100% {
    box-shadow: inset 0 0 0 1px rgba(143, 179, 255, 0.06);
    border-color: #2f405f;
    transform: translateY(0);
  }
}

@keyframes rippleExpand {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(16);
    opacity: 0;
  }
}
