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

:root {
  --bg: #f5f6f8;
  --ink: #20242a;
  --muted: #7a828e;
  --line: #dde2ea;
  --panel: #ffffff;
  --accent: #e95f8b;
  --accent-dark: #d84373;
  --ok: #2b9b70;
  --bad: #ca4451;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Nunito", "Trebuchet MS", "Noto Sans SC", sans-serif;
  background: var(--bg);
}

a {
  color: inherit;
}

.page {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(28px, 8vh, 72px) 0;
}

.home {
  display: grid;
  gap: 24px;
}

.site-head {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar {
  width: 86px;
  height: 86px;
  border: 4px solid #fff;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(30, 38, 52, 0.16);
  object-fit: cover;
}

.kicker {
  margin: 0 0 2px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 4.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
}

.intro {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.8;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(30, 38, 52, 0.08);
}

input {
  min-height: 50px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  color: var(--ink);
  background: #f6f7f9;
  font: inherit;
  outline: none;
}

input:focus {
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(233, 95, 139, 0.35);
}

button,
.primary-link,
.ghost-link {
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  padding: 0 22px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

button:hover,
.primary-link:hover {
  background: var(--accent-dark);
}

.recent {
  display: grid;
  gap: 12px;
}

.result-card {
  display: grid;
  grid-template-columns: 138px 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(30, 38, 52, 0.08);
}

.cover {
  width: 138px;
  min-width: 138px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #eef1f5;
  background-position: center;
  background-size: cover;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(30, 38, 52, 0.12);
}

.cover.is-empty {
  background:
    linear-gradient(135deg, rgba(233, 95, 139, 0.16), rgba(43, 155, 112, 0.12)),
    #eef1f5;
  opacity: 1;
}

.cover.is-empty::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    radial-gradient(circle at 28% 34%, rgba(255, 255, 255, 0.75) 0 10%, transparent 11%),
    radial-gradient(circle at 68% 64%, rgba(255, 255, 255, 0.55) 0 14%, transparent 15%);
}

.result-main {
  min-width: 0;
  min-height: 78px;
}

.result-card h2 {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 2rem);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 2.2rem;
}

.result-meta,
.result-text {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.result-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-text {
  margin-top: 2px;
  font-weight: 800;
  min-height: 1.35rem;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.section-title span {
  color: var(--ink);
  font-weight: 800;
}

.recent-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  min-height: 54px;
}

.recent-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.recent-row:last-child {
  border-bottom: 0;
}

.recent-row:hover {
  background: #fafbfc;
}

.map-id {
  color: var(--muted);
  font-weight: 800;
}

.map-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  background: #f1f3f6;
  font-size: 0.78rem;
  font-weight: 800;
}

.map-status small {
  color: inherit;
  font-size: 0.72rem;
  opacity: 0.72;
}

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

.status-failed .map-status {
  color: var(--bad);
}

.empty,
.fallback-download {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.status-view {
  padding-top: 8vh;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #e9edf3;
}

.fallback-download {
  overflow-wrap: anywhere;
}

.fallback-download a {
  color: var(--accent-dark);
  font-weight: 800;
}

.hidden {
  display: none;
}

@media (max-width: 620px) {
  .site-head {
    gap: 14px;
  }

  .avatar {
    width: 72px;
    height: 72px;
    border-radius: 20px;
  }

  .search-box,
  .recent-row {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  button,
  .primary-link,
  .ghost-link {
    width: 100%;
  }

  .result-card {
    align-items: stretch;
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .cover {
    width: 100%;
  }

  .result-card h2,
  .result-meta {
    white-space: normal;
  }
}
