:root {
  --bg: #f3f4fa;
  --card-bg: #ffffff;
  --text: #1e2440;
  --subtle: #7a8099;
  --line: #e7eaf4;
  --checklist-chrome-bg: rgba(255, 255, 255, 0.12);
  --checklist-chrome-border: rgba(255, 255, 255, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: #5486b4;
  background-image: url("bg.jpg");
  background-position: center calc(100% + 170px);
  background-repeat: no-repeat;
  background-size: 100% auto;
}

.baloon-image {
  position: fixed;
  left: 0;
  bottom: 50px;
  height: 48px;
  width: auto;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  transition: opacity 180ms linear;
}

.baloon-image.is-visible {
  opacity: 1;
}

.mascot-image {
  position: fixed;
  top: 40px;
  right: 0;
  height: 220px;
  width: auto;
  transform: translateX(120%);
  transition: transform 1000ms ease;
  z-index: 15;
  pointer-events: none;
  user-select: none;
}

.mascot-image.is-visible {
  transform: translateX(0);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 28px 28px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  padding-top: 0px;
  padding-bottom: 0px;
}

.hero h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.5px;
  color: #fff;
}

.hero-about-link {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 22px;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  cursor: pointer;
}

.hero-about-link:hover {
  opacity: 0.85;
}

.hero-about-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
  border-radius: 4px;
}

.hero p {
  margin: 8px 0 0;
  font-size: 18px;
  color: #fff;
}

.checklist-column {
  width: min(500px, 100%);
}

.checklist-note-row {
  width: min(500px, 100%);
  margin: -10px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checklist-randomize {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 16px;
  font-family: inherit;
  color: #fff;
  background: var(--checklist-chrome-bg);
  border: 1px solid var(--checklist-chrome-border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.checklist-randomize:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.checklist-randomize:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.checklist-selected-counter {
  margin: 0;
  color: #fff;
  font-size: 13px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.checklist-layout {
  display: flex;
  align-items: stretch;
  gap: 22px;
}

.score-column {
  min-width: 140px;
  padding-left: 5px;
  position: relative;
  display: none;
  flex-direction: column;
  justify-content: flex-start;
}

.score-label {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: #ffffff;
}

.score-total {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 32px;
  font-weight: 700;
  color: #ffffff;
  position: relative;
  display: inline-block;
  width: 3ch;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.score-total-value {
  display: inline-block;
  width: 100%;
}

.score-total.is-alert {
  width: auto;
  color: white;
  /* color: #d92d20; */
}

.score-flash {
  position: absolute;
  top: 0px;
  left: calc(100% - 1px);
  font-size: 11px;
  line-height: 12px;
  font-weight: 700;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
}

.score-flash.is-visible {
  animation: score-flash 500ms ease-out;
}

@keyframes score-flash {
  0% {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
  }
  20% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(1);
  }
}

.checklist-viewport {
  height: auto;
  min-height: 400px;
  max-height: none;
  overflow-y: auto;
  border-radius: 6px;
  border: 1px solid var(--checklist-chrome-border);
  background: transparent;
  color: var(--text);
  scrollbar-width: thin;
  scrollbar-color: rgba(30, 36, 64, 0.4) transparent;
}

.checklist-viewport::-webkit-scrollbar {
  width: 8px;
}

.checklist-viewport::-webkit-scrollbar-track {
  background: transparent;
}

.checklist-viewport::-webkit-scrollbar-thumb {
  background-color: rgba(30, 36, 64, 0.35);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.checklist-track {
  list-style: none;
  margin: 0;
  padding: 10px 0;
}

.check-item {
  position: relative;
  padding: 14px 18px;
  cursor: pointer;
}

.check-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 10px;
  bottom: 0;
  height: 1px;
  background: var(--checklist-chrome-border);
}

.check-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  color: var(--text);
}

.check-subtitle {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 20px;
}

.check-subtitle-link {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: transparent;
  cursor: pointer;
}

.check-subtitle-link:hover {
  opacity: 0.8;
}

.check-subtitle-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
  border-radius: 4px;
}

.checklist-viewport .check-value {
  color: var(--text);
}

.check-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  align-items: center;
}

.check-progress {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #fff;
  transform: scaleY(0);
  transform-origin: bottom;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms linear;
}

.check-item.is-active .check-progress {
  opacity: 1;
}

.check-progress-label {
  position: absolute;
  left: 6px;
  top: 98%;
  transform: translateY(-50%);
  color: var(--text);
  font-size: 8px;
  line-height: 12px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms linear;
  display: none;
}

.check-item.is-active .check-progress-label {
  opacity: 1;
}

.check-input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0 0 0 5px;
  border: 1px solid var(--checklist-chrome-border);
  border-radius: 6px;
  background: var(--checklist-chrome-bg);
  position: relative;
  cursor: pointer;
  --mark-opacity: 1;
}

.check-input::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 120ms linear;
}

.check-input:checked::after {
  opacity: var(--mark-opacity);
}

.check-text {
  min-width: 0;
}

.check-value {
  display: none;
}

.check-value.is-pop {
  animation: score-pop 320ms ease-out;
}

body.has-open-modal {
  overflow: hidden;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.info-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.info-modal__dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(700px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--checklist-chrome-border);
  border-radius: 10px;
  background: rgba(18, 32, 45, 0.96);
  color: #fff;
  padding: 18px 18px 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.info-modal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.info-modal__title {
  margin: 0 26px 10px 0;
  font-size: 18px;
  line-height: 22px;
}

.info-modal__content {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  white-space: pre-line;
}

@keyframes score-pop {
  0% {
    transform: scale(1);
  }
  63% {
    transform: scale(1.4);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  body {
    background-image: none;
  }

  .page {
    min-height: 100dvh;
    gap: 20px;
    padding: 18px 14px 10px;
  }

  .hero p {
    font-size: 16px;
  }

  .hero-about-link {
    font-size: 14px;
  }

  .checklist-layout {
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
  }

  .checklist-column {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .checklist-viewport {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .checklist-note-row {
    margin: 0;
    flex-shrink: 0;
  }

  .score-column {
    border-left: 0;
    padding-left: 0;
    padding-top: 10px;
    min-width: 0;
  }
}
