@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;800&display=swap");

:root {
  --bg-main: #04040f;
  --bg-main-2: #070018;
  --text-main: #dfe8ff;
  --text-dim: #59619f;
  --future-border: #2c2f79;
  --future-fill: #121437;
  --completed: #34ff6a;
  --current: #ffea00;
  --finish: #00f6ff;
  --danger: #ff2d9f;
  --goal-accent: #00f6ff;
  --goal-accent-rgb: 0, 246, 255;
  --column-width: 280px;
  --step-height: 92px;
  --step-gap: 10px;
  --hero-size: 28px;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Orbitron", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 75% 95%, rgba(110, 0, 255, 0.22), transparent 36%),
    radial-gradient(circle at 10% 12%, rgba(0, 221, 255, 0.14), transparent 26%),
    linear-gradient(180deg, var(--bg-main) 0%, #030313 65%, var(--bg-main-2) 100%);
  min-height: 100vh;
}

.app-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.top-bar {
  background: linear-gradient(180deg, rgba(7, 8, 24, 0.94), rgba(4, 4, 16, 0.9));
  border-bottom: 1px solid rgba(0, 246, 255, 0.2);
  padding: 24px 34px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.title-wrap h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4.8vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  background: linear-gradient(90deg, #00f6ff 0%, #a700ff 35%, #00f6ff 74%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow:
    0 0 10px rgba(0, 246, 255, 0.75),
    0 0 24px rgba(0, 246, 255, 0.42);
}

.subtitle {
  margin: 8px 0 0;
  color: #3f4a86;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.controls-wrap {
  justify-self: end;
}

.hud-wrap {
  grid-column: 1 / -1;
}

.overall-progress {
  display: grid;
  gap: 8px;
  max-width: 380px;
}

.progress-track {
  height: 8px;
  background: rgba(25, 28, 68, 0.86);
  border: 1px solid rgba(46, 57, 123, 0.7);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00f6ff 0%, #ffea00 55%, #00f6ff 100%);
  box-shadow:
    0 0 10px rgba(0, 246, 255, 0.75),
    0 0 18px rgba(255, 234, 0, 0.35);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hud-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.66rem;
  color: #505ca3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.streak-badge {
  border: 1px solid rgba(255, 234, 0, 0.48);
  border-radius: 999px;
  padding: 2px 8px;
  color: #f7e35c;
  text-shadow: 0 0 8px rgba(255, 234, 0, 0.5);
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.72rem;
  font-family: inherit;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: rgba(4, 9, 30, 0.94);
  border: 1px solid rgba(0, 246, 255, 0.8);
  color: #00f6ff;
  box-shadow:
    inset 0 0 12px rgba(0, 246, 255, 0.1),
    0 0 14px rgba(0, 246, 255, 0.28);
}

.btn-primary:hover {
  box-shadow:
    inset 0 0 12px rgba(0, 246, 255, 0.18),
    0 0 18px rgba(0, 246, 255, 0.45);
}

.btn-ghost {
  background: rgba(16, 18, 47, 0.86);
  color: #d2dfff;
  border: 1px solid rgba(83, 98, 196, 0.56);
}

.btn-ghost:hover {
  background: rgba(23, 27, 66, 0.95);
}

.goal-board {
  flex: 1;
  display: flex;
  gap: 40px;
  align-items: flex-end;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 42px 34px 32px;
  scrollbar-width: thin;
}

.goal-board::-webkit-scrollbar {
  height: 10px;
}

.goal-board::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(64, 78, 161, 0.45);
}

.goal-column {
  width: var(--goal-width, var(--column-width));
  min-width: var(--goal-width, var(--column-width));
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goal-head {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.goal-head-top {
  width: 100%;
  display: grid;
  justify-items: center;
}

.goal-title {
  margin: 0;
  text-align: center;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.09em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--goal-accent);
  text-shadow:
    0 0 10px rgba(var(--goal-accent-rgb), 0.68),
    0 0 24px rgba(var(--goal-accent-rgb), 0.38);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-mini {
  width: 100%;
  text-align: center;
  color: #4f5c9f;
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-top: 1px solid rgba(58, 67, 128, 0.44);
  padding-top: 8px;
}

.goal-controls {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  gap: 6px;
}

.mini-btn {
  border: 1px solid rgba(76, 94, 176, 0.72);
  background: rgba(12, 15, 39, 0.88);
  color: #b8c7fa;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 0 8px rgba(53, 63, 131, 0.35);
}

.mini-btn:hover:not(:disabled) {
  border-color: rgba(var(--goal-accent-rgb), 0.72);
  color: #e8ffff;
  box-shadow:
    0 0 8px rgba(var(--goal-accent-rgb), 0.34),
    inset 0 0 8px rgba(53, 63, 131, 0.48);
}

.mini-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.steps-viewport {
  position: relative;
  flex: 1;
  min-height: 560px;
  max-height: min(72vh, 920px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.steps-track {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--step-gap);
}

.step {
  height: var(--step-height);
  min-height: var(--step-height);
  border-radius: var(--radius);
  border: 2px solid var(--future-border);
  background: linear-gradient(180deg, rgba(20, 23, 58, 0.88), rgba(15, 18, 49, 0.86));
  color: var(--text-main);
  text-align: left;
  padding: 0 54px 0 20px;
  display: grid;
  align-content: center;
  gap: 2px;
  cursor: pointer;
  transition:
    box-shadow 220ms ease,
    border-color 220ms ease,
    transform 180ms ease,
    background 220ms ease;
}

.step:hover {
  transform: translateY(-1px);
  border-color: rgba(122, 139, 255, 0.85);
}

.step-topline {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 14px;
}

.step-number {
  width: 26px;
  text-align: left;
  font-size: 1.6rem;
  font-weight: 500;
  color: #4f59a2;
  border: 0;
}

.step-title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.06em;
  color: #5963a7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-desc {
  display: none;
}

.step-future {
  background: linear-gradient(180deg, rgba(17, 20, 53, 0.88), rgba(14, 16, 43, 0.88));
  border-color: var(--future-border);
  box-shadow: inset 0 0 12px rgba(41, 45, 98, 0.32);
}

.step-current {
  border-color: var(--current);
  background: linear-gradient(180deg, rgba(20, 20, 21, 0.94), rgba(15, 15, 17, 0.95));
  box-shadow:
    0 0 14px rgba(255, 234, 0, 0.45),
    inset 0 0 8px rgba(255, 234, 0, 0.1);
}

.step-current .step-number,
.step-current .step-title {
  color: var(--current);
  text-shadow: 0 0 8px rgba(255, 234, 0, 0.48);
}

.step-completed {
  border-color: var(--completed);
  background: linear-gradient(180deg, rgba(9, 36, 24, 0.88), rgba(8, 27, 19, 0.9));
  box-shadow:
    0 0 12px rgba(52, 255, 106, 0.38),
    inset 0 0 8px rgba(52, 255, 106, 0.18);
}

.step-completed .step-number,
.step-completed .step-title {
  color: var(--completed);
}

.step-finish {
  border-color: var(--finish);
}

.step-finish .step-title,
.step-finish .step-number {
  color: #6b72b4;
}

.step-finish.step-current,
.step-finish.step-completed {
  border-color: var(--finish);
  background: linear-gradient(180deg, rgba(13, 31, 46, 0.9), rgba(11, 22, 39, 0.9));
  box-shadow:
    0 0 14px rgba(0, 246, 255, 0.38),
    inset 0 0 10px rgba(0, 246, 255, 0.16);
}

.step-pulse {
  animation: pulseStep 430ms ease-out;
}

@keyframes pulseStep {
  0% {
    transform: scale(0.98);
    filter: brightness(0.9);
  }
  45% {
    transform: scale(1.01);
    filter: brightness(1.12);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.hero-marker {
  position: absolute;
  right: 18px;
  top: 0;
  width: var(--hero-size);
  height: var(--hero-size);
  border-radius: 999px;
  background: radial-gradient(circle at 40% 35%, #fffbe2, #ffe90a 62%, #f9bd1a 100%);
  border: 1px solid rgba(255, 240, 142, 0.96);
  box-shadow:
    0 0 14px rgba(255, 234, 0, 0.82),
    0 0 30px rgba(255, 210, 46, 0.52);
  transition: top 420ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
  pointer-events: none;
}

.hero-burst {
  animation: heroBurst 430ms ease;
}

@keyframes heroBurst {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.goal-footer {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-top: 4px;
}

.complete-btn {
  width: 100%;
  border-radius: 10px;
  padding: 11px 10px;
  border: 2px solid #34ff6a;
  color: #34ff6a;
  background: rgba(8, 18, 11, 0.5);
  box-shadow: inset 0 0 10px rgba(52, 255, 106, 0.12);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.94rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.complete-btn:hover:not(:disabled) {
  box-shadow:
    0 0 12px rgba(52, 255, 106, 0.35),
    inset 0 0 10px rgba(52, 255, 106, 0.2);
}

.complete-btn:disabled {
  border-color: rgba(0, 246, 255, 0.52);
  color: rgba(133, 245, 255, 0.84);
  background: rgba(14, 42, 50, 0.6);
  cursor: not-allowed;
}

.undo-btn {
  width: 56px;
  min-width: 56px;
  border-radius: 10px;
  padding: 11px 0;
  border: 2px solid #ff2d9f;
  color: #ff2d9f;
  background: rgba(30, 6, 25, 0.55);
  cursor: pointer;
  font-family: inherit;
  font-size: 1.2rem;
  line-height: 1;
  text-transform: lowercase;
}

.undo-btn:hover:not(:disabled) {
  box-shadow:
    0 0 10px rgba(255, 45, 159, 0.32),
    inset 0 0 8px rgba(255, 45, 159, 0.16);
}

.undo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.empty-state {
  min-height: 280px;
  width: min(560px, 90vw);
  margin: auto;
  border: 1px dashed rgba(67, 80, 168, 0.64);
  border-radius: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  color: #6470b2;
  box-shadow: inset 0 0 30px rgba(32, 44, 128, 0.26);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 16, 0.82);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 16px;
}

.hidden {
  display: none;
}

.modal-card {
  width: min(440px, 96vw);
  background: linear-gradient(180deg, rgba(15, 18, 47, 0.96), rgba(11, 12, 31, 0.95));
  border: 1px solid rgba(69, 86, 177, 0.76);
  border-radius: 14px;
  padding: 16px;
  box-shadow:
    0 0 24px rgba(61, 79, 173, 0.28),
    inset 0 0 14px rgba(23, 29, 73, 0.62);
}

.modal-card-wide {
  width: min(860px, 96vw);
}

.modal-card h2 {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #b7c8ff;
}

.modal-meta {
  margin: 8px 0 0;
  color: #6a79be;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-form {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.modal-form label {
  font-size: 0.74rem;
  color: #a8b8ef;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.modal-form input,
.modal-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(84, 101, 194, 0.7);
  background: rgba(10, 12, 33, 0.95);
  color: #e7f0ff;
  padding: 10px 11px;
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.modal-form input[type="color"] {
  padding: 2px;
  height: 42px;
}

.modal-form input:focus,
.modal-form textarea:focus {
  outline: 1px solid rgba(0, 246, 255, 0.78);
  box-shadow: 0 0 8px rgba(0, 246, 255, 0.34);
}

.modal-actions {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.goal-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.goal-card-grid > div {
  display: grid;
  gap: 8px;
}

.goal-card-steps-head {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
  color: #adc0ff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.goal-card-steps-head span {
  color: #6b7abf;
  font-size: 0.68rem;
}

.goal-card-steps {
  border: 1px solid rgba(76, 95, 188, 0.7);
  border-radius: 12px;
  background: rgba(9, 11, 30, 0.82);
  padding: 10px;
  max-height: min(58vh, 520px);
  overflow: auto;
  display: grid;
  gap: 10px;
}

.goal-step-row {
  border: 1px solid rgba(71, 87, 168, 0.68);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 6px;
  background: rgba(15, 17, 45, 0.72);
}

.goal-step-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.goal-step-tag {
  font-size: 0.66rem;
  color: #93a7eb;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.goal-step-chip {
  border-radius: 999px;
  border: 1px solid rgba(95, 115, 210, 0.74);
  padding: 2px 8px;
  font-size: 0.62rem;
  color: #d7e3ff;
  background: rgba(27, 32, 71, 0.86);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.step-tooltip {
  position: fixed;
  z-index: 70;
  max-width: min(320px, 80vw);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 246, 255, 0.78);
  background: rgba(6, 11, 30, 0.96);
  color: #e6f6ff;
  font-size: 0.72rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
  box-shadow:
    0 0 14px rgba(0, 246, 255, 0.35),
    inset 0 0 10px rgba(29, 74, 112, 0.35);
  pointer-events: none;
  white-space: pre-wrap;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.confetti-piece {
  position: fixed;
  width: 8px;
  height: 14px;
  opacity: 0;
  animation: confettiFall 1100ms ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--rot));
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .top-bar {
    grid-template-columns: 1fr;
    padding: 18px 18px 12px;
  }

  .controls-wrap {
    justify-self: start;
  }

  .goal-board {
    gap: 20px;
    padding: 24px 16px 22px;
  }

  .goal-column {
    width: min(var(--goal-width, 240px), 86vw);
    min-width: min(var(--goal-width, 240px), 86vw);
  }

  .steps-viewport {
    min-height: 460px;
  }

  .goal-title {
    font-size: 1.5rem;
  }

  .step {
    height: 78px;
    min-height: 78px;
    padding-right: 48px;
  }

  .step-title {
    font-size: 1.5rem;
  }

  .step-number {
    font-size: 1.3rem;
  }

  .hero-marker {
    width: 24px;
    height: 24px;
    right: 14px;
  }

  .goal-card-steps-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .goal-card-grid {
    grid-template-columns: 1fr;
  }
}
