:root {
  --bg: #f7f4ec;
  --surface: #fffef9;
  --ink: #2f2a24;
  --muted: #6d655b;
  --line: #dccfb9;
  --accent: #12616f;
  --accent-soft: #d7eef2;
  --ok: #2f7d42;
  --warn: #8d5a17;
  --missing: #9c2f2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgb(247 244 236 / 35%), rgb(247 244 236 / 35%)),
    url("assets/Tsuki.jpg") 0 0 / 320px auto repeat,
    var(--bg);
}

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

.dogetti {
  position: fixed;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 3px 8px rgb(0 0 0 / 20%);
  animation-name: dogetti-burst;
  animation-timing-function: cubic-bezier(0.21, 0.82, 0.28, 1);
  animation-fill-mode: forwards;
}

@keyframes dogetti-burst {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0.7) rotate(var(--rot));
    opacity: 0;
  }
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: grid;
  gap: 14px;
}

.hero h1 {
  margin: 0;
  letter-spacing: 0.02em;
}

.hero p {
  margin: 6px 0 0;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 5px 20px rgb(31 21 6 / 5%);
}

.nav-row,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.action-row {
  margin-top: 10px;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
}

button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint,
#summary,
#url-size,
#message {
  margin: 8px 0 0;
  color: var(--muted);
}

#message {
  min-height: 1.2em;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 6px;
  text-align: left;
  white-space: nowrap;
}

th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  font-weight: 600;
}

.status.done {
  color: var(--ok);
}

.status.partial {
  color: var(--warn);
}

.status.missing {
  color: var(--missing);
}

@media (max-width: 720px) {
  .nav-row,
  .action-row {
    flex-wrap: wrap;
  }

  .nav-row h2 {
    width: 100%;
  }

  th,
  td {
    font-size: 0.92rem;
  }
}