*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: #fff;
  font-family: "Oswald", "Arial Narrow", Arial, sans-serif;
}

.tracker-shell {
  width: 100%;
  max-width: 902px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 40, 80, 0.14);
}

.track-order-header {
  margin: 0;
  padding: 0.72rem 1rem 0.68rem;
  text-align: center;
  background: #4a95c9;
  border-bottom: 2px solid #1a4d6e;
}

.track-order-title {
  margin: 0;
  font-family: "Oswald", "Arial Narrow", Arial, sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.025em;
  color: #e8f6fc;
}

.tracker-shell > .app-header {
  padding: 0.85rem 1.1rem 0;
  margin-bottom: 0.65rem;
  background: #fff;
}

.tracker-shell > .tracker-panel {
  border-radius: 0;
  border-top: none;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  margin-bottom: 0.83rem;
}

.dominos-logo {
  width: 46px;
  height: auto;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.app-title {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 2.00rem;
  font-weight: 700;
  line-height: 0.95;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #e31837;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.app-title-line {
  display: block;
}

.tracker-panel {
  position: relative;
  padding: 1.38rem 1.1rem 1.1rem;
  border-radius: 7px;
  border: 1px solid rgba(0, 35, 70, 0.45);
  background: linear-gradient(180deg, #2a7ec4 0%, #1a5f94 55%, #0d4a73 100%);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.14),
    inset 0 2px 6px rgba(255, 255, 255, 0.18),
    inset 0 -4px 12px rgba(0, 25, 55, 0.3),
    inset 0 0 24px rgba(0, 40, 80, 0.25);
}

.tracker-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.tracker {
  --bar-w: 100%;
  --bar-h: 60px;
  --bar-radius: 39px;
  --slant: 11px;
  --strip-h: 4px;
  --label-size: 12px;
  --num-size: 42px;
}

.bar-stack {
  flex: 1;
  min-width: 0;
}

.labels-row,
.strips-row {
  display: flex;
  align-items: flex-end;
  padding: 0 5px;
}

.strips-row {
  margin-bottom: 5px;
}

.label-slot,
.strip-slot {
  position: relative;
  flex: 1 1 0;
  width: auto;
  margin-left: calc(var(--slant) * -1);
  display: flex;
  justify-content: center;
  min-width: 0;
}

.label-slot:first-child,
.strip-slot:first-child {
  margin-left: 0;
}

.labels-row .stage-name {
  display: block;
  width: 100%;
  margin: 0 0 4px;
  font-size: var(--label-size);
  font-weight: 500;
  line-height: 1.1;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  text-align: center;
}

.mini-strip {
  display: block;
  width: 68%;
  max-width: 6rem;
  height: var(--strip-h);
  transform: skewX(-28deg);
  background: #f3f7ff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(150, 160, 175, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.35);
  transition: background 0.3s, box-shadow 0.3s;
}

.mini-strip.is-green {
  background: linear-gradient(
    to bottom,
    #d7ff92 0%,
    #8df02f 38%,
    #48b50e 72%,
    #1d6f04 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 0 5px rgba(100, 255, 40, 0.65);
}

.main-bar-wrap {
  width: 100%;
}

.bar-stack .main-bar {
  width: 100%;
  flex: none;
}

.main-bar {
  position: relative;
  min-width: 0;
  height: var(--bar-h);
  border-radius: var(--bar-radius);
  overflow: hidden;
  padding: 0;
  background: transparent;
  border-top: 4px solid rgba(235, 248, 255, 0.95);
  border-left: 4px solid rgba(185, 215, 230, 0.85);
  border-right: 4px solid rgba(115, 145, 160, 0.9);
  border-bottom: 5px solid rgba(42, 65, 78, 0.82);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.75),
    inset 0 6px 9px rgba(0, 0, 0, 0.28),
    inset 0 -6px 9px rgba(0, 0, 0, 0.28),
    inset 0 -1px 0 rgba(140, 210, 240, 0.35),
    0 2px 0 rgba(255, 255, 255, 0.35),
    0 4px 10px rgba(0, 0, 0, 0.4);
}

.main-bar.has-red-glow {
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.75),
    inset 0 6px 9px rgba(0, 0, 0, 0.28),
    inset 0 -6px 9px rgba(0, 0, 0, 0.28),
    inset 0 -1px 0 rgba(140, 210, 240, 0.35),
    0 2px 0 rgba(255, 255, 255, 0.35),
    0 4px 10px rgba(0, 0, 0, 0.4),
    0 0 14px rgba(255, 90, 60, 0.25);
}

.main-bar::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 6px;
  right: 6px;
  height: 10px;
  z-index: 2;
  pointer-events: none;
  border-radius: calc(var(--bar-radius) - 5px) calc(var(--bar-radius) - 5px) 0 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0.1) 55%,
    transparent 100%
  );
}

.main-bar-inner {
  display: flex;
  height: 100%;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.step {
  position: relative;
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: 100%;
  margin-left: calc(var(--slant) * -1);
  clip-path: polygon(var(--slant) 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
}

.step-1 {
  margin-left: 0;
  z-index: 5;
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
}

.step-2 {
  z-index: 4;
}

.step-3 {
  z-index: 3;
}

.step-4 {
  z-index: 2;
}

.step-5 {
  z-index: 1;
  clip-path: polygon(var(--slant) 0, 100% 0, 100% 100%, 0 100%);
}

.step.is-blue {
  background:
    linear-gradient(
      to right,
      rgba(6, 22, 42, 0.42) 0%,
      rgba(8, 28, 48, 0.18) 7%,
      transparent 16%
    ),
    radial-gradient(
      ellipse 75% 55% at 28% 0%,
      rgba(255, 255, 255, 0.42) 0%,
      rgba(217, 247, 255, 0.22) 40%,
      rgba(120, 185, 220, 0) 70%
    ),
    linear-gradient(
      to bottom,
      #ffffff 0%,
      #d9f7ff 4%,
      #b5ddf2 14%,
      #8ec5e8 28%,
      #6aaddc 42%,
      #5b9bd5 58%,
      #4a86b4 72%,
      #3a6f99 86%,
      #1b365d 96%,
      #0f2438 100%
    );
  box-shadow:
    inset 4px 0 8px -2px rgba(6, 20, 38, 0.38),
    inset 0 2px 4px rgba(255, 255, 255, 0.55),
    inset 0 -5px 10px rgba(11, 32, 52, 0.26);
}

.step.is-red {
  background:
    linear-gradient(
      to right,
      rgba(45, 10, 2, 0.38) 0%,
      rgba(55, 14, 4, 0.16) 7%,
      transparent 16%
    ),
    radial-gradient(
      ellipse 75% 55% at 28% 0%,
      rgba(255, 255, 240, 0.38) 0%,
      rgba(255, 220, 160, 0.18) 40%,
      rgba(255, 140, 60, 0) 70%
    ),
    linear-gradient(
      to bottom,
      #fff8e8 0%,
      #ffe4a8 5%,
      #ffb84a 16%,
      #f08028 38%,
      #e04a18 58%,
      #c42e10 78%,
      #8a1a0a 94%,
      #5a0e06 100%
    );
  box-shadow:
    inset 4px 0 8px -2px rgba(35, 8, 2, 0.34),
    inset 0 2px 4px rgba(255, 255, 255, 0.5),
    inset 0 -5px 10px rgba(60, 12, 4, 0.24),
    0 0 16px rgba(255, 70, 45, 0.5),
    0 0 28px rgba(255, 45, 25, 0.28);
}

.step:not(.step-1)::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 0;
  width: 29px;
  height: 100%;
  transform: skewX(-17deg);
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(
    to right,
    rgba(8, 24, 42, 0.62) 0%,
    rgba(12, 32, 52, 0.45) 28%,
    rgba(18, 42, 62, 0.12) 48%,
    rgba(190, 228, 248, 0.32) 58%,
    rgba(240, 252, 255, 0.5) 66%,
    rgba(210, 232, 248, 0.08) 82%,
    transparent 100%
  );
}

.step:not(.step-1)::after {
  content: "";
  position: absolute;
  left: -1px;
  top: 3px;
  width: 1px;
  height: calc(100% - 8px);
  transform: skewX(-17deg);
  pointer-events: none;
  z-index: 5;
  background: rgba(220, 242, 255, 0.55);
  box-shadow: 1px 0 2px rgba(255, 255, 255, 0.35);
}

.step-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Roboto Condensed", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--num-size);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.05em;
  transform: scale(0.88, 0.68);
  z-index: 6;
  pointer-events: none;
}

.step.is-blue .step-num {
  color: rgba(118, 162, 198, 0.82);
  text-shadow:
    -1px -1px 0 rgba(22, 52, 78, 0.42),
    -2px -2px 2px rgba(12, 35, 55, 0.14),
    1px 1px 0 rgba(220, 242, 255, 0.68),
    2px 2px 1px rgba(240, 252, 255, 0.28);
}

.step.is-red .step-num {
  color: rgba(210, 130, 75, 0.85);
  text-shadow:
    -1px -1px 0 rgba(95, 35, 12, 0.38),
    -2px -2px 2px rgba(70, 22, 6, 0.12),
    1px 1px 0 rgba(255, 235, 200, 0.65),
    2px 2px 1px rgba(255, 248, 230, 0.24);
}

.status-block {
  margin-top: 11px;
  min-height: 2.6rem;
}

.status-line {
  margin: 0;
  min-height: 1.15em;
  font-size: 0.87rem;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.status-detail {
  margin: 2px 0 0;
  min-height: 1.15em;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
}

.status-detail.is-empty {
  visibility: hidden;
}

.controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 15px;
}

.controls button {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 3px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #ff4a5e, #c81028);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.controls button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.controls .btn-next {
  background: linear-gradient(180deg, #5aafd4, #1a5f94);
}

.controls .btn-reset {
  background: linear-gradient(180deg, #8a8a8a, #4a4a4a);
}

.hidden {
  display: none !important;
}

@media (max-width: 700px) {
  .tracker {
    --bar-h: 42px;
    --bar-radius: 21px;
    --slant: 10px;
    --strip-h: 3px;
    --label-size: 10px;
    --num-size: 1.1rem;
  }
}

.admin-bar {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.admin-bar label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  color: #333;
}

.admin-bar input {
  width: 100%;
  max-width: 320px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.89rem;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.admin-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.admin-bar button {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 3px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #5aafd4, #1a5f94);
}

.admin-hint {
  margin: 0.5rem 0 0;
  font-size: 0.61rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-error {
  margin: 0.35rem 0 0;
  font-size: 0.65rem;
  color: #c81028;
  min-height: 1em;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.admin-modal.hidden {
  display: none;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 25, 55, 0.45);
}

.admin-modal-box {
  position: relative;
  width: 100%;
  max-width: 22rem;
  padding: 1.25rem 1.35rem 1.1rem;
  border-radius: 8px;
  background: #fff;
  border: 2px solid #1a4d6e;
  box-shadow: 0 12px 32px rgba(0, 40, 80, 0.28);
  text-align: center;
}

.admin-modal-message {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  color: #0d4a73;
}

.admin-modal-ok {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 22px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 3px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #5aafd4, #1a5f94);
}
