:root {
  color-scheme: dark;
  --bg: #121212;
  --card: #1e1e1e;
  --text: #f5f5f5;
  --muted: #9ea0a6;
  --border: #2c2c2c;
  --shadow: rgba(0, 0, 0, 0.5);
  --like: #38c172;
  --skip: #444;
  --open: #2d679e;
  --hint: #6a6a6a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-height: 100vh;
}

.app-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 1.25rem;
}

.header-intro h1 {
  margin: 0;
  font-size: 2.35rem;
}

.header-intro p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.header-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--muted);
}

.header-stats strong {
  color: #fff;
  font-weight: 600;
}

.card-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.feed-card {
  width: min(700px, 100%);
  background: #1a1b1f;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 36px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.feed-card.loading {
  text-align: center;
  color: var(--muted);
  animation: pulse 1.5s infinite ease;
}

.repo-name {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.repo-name a {
  color: inherit;
  text-decoration: none;
}

.repo-name a:hover {
  color: #58a6ff;
}

.description {
  font-size: 16px;
  color: #b0b0b0;
  line-height: 1.6;
  margin: 0;
}

.key-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: #a0a0a0;
}

.key-signals strong {
  color: #58a6ff;
  font-weight: 600;
}

.hint {
  font-size: 12px;
  color: var(--hint);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  width: fit-content;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  color: var(--muted);
}

.tag.blocked {
  border-color: rgba(248, 81, 73, 0.4);
  color: #f38b82;
}

.repo-card .repo-name {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 6px;
}

.repo-card .description {
  font-size: 18px;
  margin-bottom: 16px;
}

.hot-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  background: #38c172;
  color: #0c2815;
  padding: 10px 14px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(56, 193, 114, 0.35);
}

.hot-badge-value {
  font-size: 20px;
  font-weight: 700;
}

.hot-badge span {
  display: block;
  font-size: 12px;
  color: rgba(18, 18, 18, 0.75);
}

.repo-card .key-signals {
  display: flex;
  gap: 20px;
  font-size: 15px;
  color: #a0a0a0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
}

.tag-badge {
  background-color: #2d679e;
  color: #e0e0e0;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 14px;
}

.metadata-footer {
  font-size: 11px;
  text-align: center;
  color: #5c5d63;
  margin-top: 32px;
}

.business-fit {
  font-size: 13px;
  color: #8ab4ff;
  background: rgba(88, 166, 255, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  width: fit-content;
}

.value-pitch {
  font-size: 15px;
  font-weight: 600;
  background: rgba(255, 215, 0, 0.12);
  border-radius: 12px;
  padding: 0.4rem 0.85rem;
  margin-bottom: 0.6rem;
  color: #ffd966;
  width: 100%;
}

.actions-primary,
.actions-secondary {
  display: flex;
}

.actions-primary {
  gap: 16px;
  margin-bottom: 12px;
}

.actions-secondary {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.btn {
  position: relative;
  padding: 14px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  border: none;
  transition: transform 0.15s ease, filter 0.2s;
  font-size: 16px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-like {
  background: var(--like);
  color: #0c2815;
  flex: 1;
  font-size: 18px;
}

.btn-like:hover {
  filter: brightness(0.95);
}

.btn-skip {
  background: var(--skip);
  color: #fff;
  flex: 1;
  font-size: 18px;
}

.btn-open {
  background: var(--open);
  color: #fff;
  padding: 10px 20px;
  font-weight: 600;
  flex: initial;
}

.btn-block {
  background: none;
  border: none;
  color: #999;
  font-size: 15px;
  cursor: pointer;
  padding: 10px 20px;
  text-decoration: none;
}

.btn-block:hover {
  color: #c0c0c0;
  text-decoration: underline;
}

.btn[data-shortcut]:hover::after {
  content: attr(data-shortcut);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.metadata {
  text-align: right;
  font-size: 11px;
  color: #4a4a4a;
  margin-top: 8px;
}

.control-panel {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-hint {
  color: var(--hint);
  font-size: 0.95rem;
  text-align: center;
}

.feedback-toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.feedback-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

.card-liked {
  animation: liked-pop 0.4s ease;
}

@keyframes liked-pop {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.02);
    box-shadow: 0 16px 40px rgba(56, 193, 114, 0.4);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 680px) {
  body,
  html {
    overflow: hidden;
    background: #000;
    height: 100%;
  }
  .app-shell {
    padding: 0;
    max-width: 540px;
    width: 100%;
    min-height: 100vh;
    gap: 0;
  }
  .app-header {
    width: 100%;
    padding: 1rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 90%);
    border-bottom: none;
  }
  .card-container {
    flex: 1;
    width: 100%;
    padding: 0 1rem 5rem;
    display: flex;
  }
  .feed-card {
    width: 100%;
    margin: 0 auto;
    flex: 1;
    padding: 1.25rem;
    border-radius: 16px;
    min-height: calc(100vh - 220px);
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    background: #111217;
  }
  .feed-card .hot-badge {
    position: static;
    margin-bottom: 0.75rem;
    align-self: flex-start;
  }
  .value-pitch {
    font-size: 16px;
    margin-bottom: 0.75rem;
  }
  .business-fit {
    font-size: 14px;
    width: 100%;
  }
  .description {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tag-list {
    flex-wrap: wrap;
  }
  .control-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 540px;
    padding: 0.75rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.88);
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  .control-hint {
    display: none;
  }
  .actions-primary {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
  }
  .actions-secondary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    gap: 1rem;
  }
  .btn {
    border-radius: 10px;
    font-size: 1rem;
    padding: 0.95rem 0;
  }
  .btn-open {
    flex: 1;
  }
  .btn-block {
    border: none;
    font-size: 0.85rem;
    padding: 0;
    text-decoration: underline;
  }
}
