:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(170deg, #ffedf2, #f5f7ff);
  color: #191919;
}

.app {
  width: min(94vw, 420px);
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.6rem 0;
}

.topbar {
  text-align: center;
}

.topbar h1 {
  margin: 0;
  font-size: 1.9rem;
}

.topbar p {
  margin: 0.3rem 0 0;
  color: #666;
}

.feed-source {
  font-size: 0.85rem;
  color: #4f4f4f;
}

.stats-row {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-weight: 600;
}

.deck-wrap {
  position: relative;
  height: min(520px, 62dvh);
  min-height: 340px;
}

.deck {
  position: relative;
  width: 100%;
  height: 100%;
}

.card {
  position: absolute;
  inset: 0;
  background: white;
  border-radius: 22px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.14);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  touch-action: none;
  user-select: none;
  cursor: grab;
  transition: transform 180ms ease, opacity 180ms ease;
}

.card h2 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.35;
}

.headline-title {
  overflow-wrap: anywhere;
}

.headline-image {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  margin: 0.9rem 0;
  background: #f2f2f2;
}

.card a {
  text-decoration: none;
  color: #0b57d0;
  font-weight: 600;
}

.card .meta {
  color: #777;
  font-size: 0.92rem;
}

.label {
  position: absolute;
  top: 1rem;
  padding: 0.35rem 0.65rem;
  font-weight: 700;
  border: 2px solid currentColor;
  border-radius: 9px;
  opacity: 0;
}

.label.like {
  right: 1rem;
  color: #0ea35d;
}

.label.nope {
  left: 1rem;
  color: #f03f5f;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding-bottom: max(0.3rem, env(safe-area-inset-bottom));
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn-no {
  background: #ff4e73;
  color: #fff;
}

.btn-yes {
  background: #37b26c;
  color: #fff;
}

.btn-export {
  background: #fff;
  color: #222;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

.empty-state {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 20px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
}

.hidden {
  display: none;
}

@media (max-height: 780px) {
  .app {
    gap: 0.7rem;
    padding-bottom: calc(5.2rem + env(safe-area-inset-bottom));
  }

  .topbar h1 {
    font-size: 1.6rem;
  }

  .deck-wrap {
    height: min(470px, 56dvh);
  }

  .headline-image {
    max-height: 160px;
  }

  .actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(6px);
    padding: 0.55rem 0 0.85rem;
    padding-bottom: calc(0.7rem + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 22px rgba(0, 0, 0, 0.08);
  }
}

@media (max-height: 680px) {
  .deck-wrap {
    height: min(420px, 50dvh);
    min-height: 300px;
  }

  .btn {
    padding: 0.62rem 1.05rem;
  }
}
