/* ====== Base overrides ====== */
body {
  min-height: 100dvh;
  padding-top: calc(80px + env(safe-area-inset-top));
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

/* ====== Layout & Progress ====== */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.progress-wrap {
  width: 100%;
  max-width: 820px;
  margin: 6px auto 14px;
  display: grid;
  gap: 8px;
}
.progress-bar {
  width: 100%;
  height: 10px;
  background-color: rgba(0, 25, 45, 0.65);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(0, 212, 232, 0.2);
}
.progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-400));
  transition: width 0.35s ease;
}
.progress-label {
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--brand-300);
  font-size: 0.95rem;
  text-shadow: 0 0 12px rgba(0, 212, 232, 0.4);
}

/* ====== Buttons ====== */
.btn {
  max-width: 520px;
}
.btn.ghost {
  background: rgba(0, 212, 232, 0.1);
  color: var(--brand-200);
  border-color: rgba(0, 212, 232, 0.35);
}
.btn.ghost:hover {
  background: rgba(0, 212, 232, 0.2);
}

/* ====== Panels ====== */
.panel {
  width: 100%;
  max-width: 820px;
  background: rgba(0, 20, 40, 0.6);
  border: 1px solid rgba(0, 212, 232, 0.3);
  border-radius: 16px;
  padding: 16px;
  margin: 8px auto;
  text-align: start;
}
.panel-title {
  margin: 0 0 12px;
  font-weight: 900;
  color: var(--brand-200);
  font-size: 1.15rem;
}
.panel-subtle {
  color: var(--brand-200);
  opacity: 0.85;
}

/* ====== Cards ====== */
.pkg-card {
  display: grid;
  gap: 8px;
}
.pkg-meta {
  display: grid;
  gap: 6px;
}
.pkg-meta li {
  margin: 0 0 0 1rem;
}

/* ====== Timer chip ====== */
.timer-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 212, 232, 0.15);
  border: 1px solid rgba(0, 212, 232, 0.35);
  font-weight: 900;
  color: var(--brand-200);
}

/* ====== Inline actions ====== */
.actions {
  width: 100%;
  max-width: 820px;
  margin: 12px auto 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  place-items: center;
}

/* ====== Modals ====== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(12, 24, 26, 0.6);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, var(--ink-800), var(--ink-700));
  color: var(--paper);
  width: min(92%, 620px);
  margin: 0;
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 232, 0.18);
  border: 1px solid rgba(0, 212, 232, 0.35);
}
.modal-content.welcome {
  border-color: transparent;
}
.close-btn {
  position: absolute;
  left: 12px;
  top: 10px;
  background: transparent;
  border: none;
  color: var(--brand-300);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 8px;
}
.close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.welcome-title {
  margin: 6px 0 8px;
  font-weight: 900;
  color: var(--brand-200);
  text-shadow: 0 0 18px rgba(0, 212, 232, 0.4);
}
.welcome-text {
  line-height: 1.9;
  font-weight: 700;
  margin: 8px 0 18px;
  color: var(--brand-200);
}
.rules-list {
  text-align: start;
  margin: 0 0 18px 0;
  padding-inline-start: 18px;
  line-height: 1.9;
}

/* ====== Result text ====== */
.result-text {
  font-size: 1.1rem;
  margin: 12px 0 10px;
  color: var(--brand-200);
}

/* ====== States ====== */
.state-danger {
  border: 2px dashed #ff6460;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 100, 96, 0.08);
  color: #ffdede;
  margin-top: 10px;
}

/* ====== Print ====== */
@media print {
  body {
    background: #fff;
    color: #000;
    padding: 0;
  }
  nav,
  .progress-wrap,
  #game-container,
  .close-btn,
  .btn {
    display: none !important;
  }
  .modal {
    position: static;
    background: #fff;
  }
  .modal-content {
    border: none;
    box-shadow: none;
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    color: #000;
  }
}
