:root {
  --bg: #eef1f8;
  --bg-accent: #dce8ff;
  --surface: #ffffff;
  --text: #191f28;
  --text-secondary: #6b7684;
  --text-tertiary: #8b95a1;
  --primary: #3182f6;
  --primary-press: #1b64da;
  --border: rgba(0, 0, 0, 0.06);
  --shadow: 0 8px 32px rgba(2, 32, 71, 0.08);
  --shadow-sm: 0 2px 12px rgba(2, 32, 71, 0.06);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Pretendard Variable', Pretendard, system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--bg-accent), transparent 55%),
    var(--bg);
}

.page-main {
  flex: 1;
  width: 100%;
}

a {
  color: inherit;
}

.shell {
  width: 100%;
  max-width: min(720px, 94vw);
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.shell--wide {
  max-width: min(960px, 96vw);
  padding: 32px 24px 56px;
}

.shell--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  max-width: min(440px, 94vw);
  padding: 32px 20px;
}

@media (min-width: 900px) {
  .shell--wide {
    max-width: 1040px;
    padding: 40px 40px 64px;
  }

  .shell--wide .topbar h1 {
    font-size: 1.5rem;
  }

  .shell--wide .empty {
    padding: 64px 32px;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-bottom: 20px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: cover;
  display: block;
  border-radius: 9px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.card--hero .brand-logo--hero {
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

.card {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card--hero {
  text-align: center;
  padding: 40px 28px 36px;
}

.card h1 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.lead {
  margin: 0 0 28px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(49, 130, 246, 0.35);
}

.btn--primary:hover {
  background: var(--primary-press);
}

.btn--discord::before {
  content: '';
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C1.566 7.76.458 11.087.035 14.47a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.54-3.893-.904-7.21-3.075-10.073a.061.061 0 0 0-.031-.03zM8.02 12.38c-1.183 0-2.157-.966-2.157-2.157 0-1.193.962-2.158 2.157-2.158 1.204 0 2.167.965 2.157 2.158 0 1.191-.962 2.157-2.157 2.157zm7.975 0c-1.183 0-2.157-.966-2.157-2.157 0-1.193.962-2.158 2.157-2.158 1.204 0 2.168.965 2.157 2.158 0 1.191-.962 2.157-2.157 2.157z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.link-quiet {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.link-quiet:hover {
  text-decoration: underline;
}

/* Library */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.btn--ghost {
  flex-shrink: 0;
  width: auto;
  padding: 10px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn--ghost:hover {
  background: #f9fafb;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.item:last-child {
  border-bottom: none;
}

.item__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #f0f4ff, #e8eeff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.item__body {
  flex: 1;
  min-width: 0;
}

.item strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item small {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.item__row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.btn--download {
  flex-shrink: 0;
  width: auto;
  padding: 10px 16px;
  font-size: 0.8125rem;
  background: var(--text);
  color: #fff;
  border-radius: 10px;
  box-shadow: none;
}

.btn--download:hover {
  background: #333d4b;
}

.empty {
  padding: 48px 24px;
  text-align: center;
}

.empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #f2f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0.7;
}

.empty p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.footer-hint {
  margin-top: 20px;
  padding: 14px 16px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-tertiary);
  text-align: center;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
}

.turnstile-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
  min-height: 68px;
}

.site-footer {
  flex-shrink: 0;
  padding: 20px 16px 28px;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
}

@media (prefers-color-scheme: dark) {
  .brand-logo,
  .brand-logo--hero {
    background: #0a0a0a;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  }

  :root {
    --bg: #0d1117;
    --bg-accent: #1a2744;
    --surface: #161b22;
    --text: #f0f3f6;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.25);
  }

  .btn--ghost:hover {
    background: #1c2128;
  }

  .item__icon {
    background: linear-gradient(145deg, #1e293b, #1a2332);
  }

  .empty__icon {
    background: #21262d;
  }

  .footer-hint {
    background: rgba(22, 27, 34, 0.8);
  }
}
