:root {
  --bg-top: #0b1026;
  --bg-bottom: #232b52;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.10);
  --text: #f4f1e8;
  --muted: rgba(244, 241, 232, 0.6);
  --accent: #ffd06e;
  --accent-ink: #241704;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-top);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(255, 208, 110, 0.4);
  border-radius: 999px;
  padding: 6px 10px;
}

.ghost {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
}

h1 {
  font-size: 32px;
  line-height: 1.1;
  margin: 20px 0 8px;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -16px 18px;
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 14px;
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

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

.card {
  text-align: left;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px;
  color: var(--text);
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 4px 14px;
  backdrop-filter: blur(8px);
}

.card:active { transform: scale(0.99); }

.card-emoji {
  font-size: 28px;
  grid-row: span 3;
  line-height: 1;
  padding-top: 2px;
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
}

.card-short {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 3px 9px;
}

.foot {
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.channel {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* sheet */
.sheet {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 20;
}
.sheet.is-open { display: block; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 16, 0.66);
  backdrop-filter: blur(2px);
}

.sheet-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88vh;
  overflow-y: auto;
  background: #141a33;
  border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(12px);
  animation: rise 0.18s ease-out forwards;
}

@keyframes rise {
  to { transform: translateY(0); }
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.sheet-emoji { font-size: 40px; }

.sheet-card h2 {
  margin: 8px 0 10px;
  font-size: 23px;
  line-height: 1.2;
}

.sheet-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.sheet-body {
  display: grid;
  gap: 12px;
  font-size: 15px;
  line-height: 1.5;
}

.sheet-body p { margin: 0; }

.sheet-body ul {
  margin: 0;
  padding-left: 20px;
}

.primary {
  width: 100%;
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 16px;
  font-weight: 700;
}

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .sheet-card { animation: none; }
}
