:root {
  --shell: #0c0d12;
  --surface: #141722;
  --surface-2: #1d2233;
  --line: rgba(255, 255, 255, 0.12);
  --text: #ecf1ff;
  --muted: #aab6d4;
  --accent: #6f8cff;
  --yes: #2ed09a;
  --no: #ff5a68;
  --topbar-h: 62px;
  --nav-h: 54px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  font-family: 'Sora', 'Avenir Next', 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 500px at 10% -10%, #26366f 0%, transparent 55%),
    radial-gradient(900px 500px at 110% 10%, #69265d 0%, transparent 50%),
    linear-gradient(180deg, #080a10 0%, #0f131e 100%);
  overflow: hidden;
}

.hidden {
  display: none !important;
}

#app {
  max-width: 460px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border-inline: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1rem 0.7rem;
  min-height: var(--topbar-h);
}

.topbar h1 {
  margin: 0;
  font-family: 'Outfit', 'Avenir Next', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chip {
  font-size: 0.69rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dfe7ff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.35rem 0.58rem;
}

#view-root {
  height: calc(100vh - var(--topbar-h) - var(--nav-h));
  padding: 0.45rem 0.7rem 0.4rem;
  overflow: hidden;
}

.view {
  display: none;
  height: 100%;
  overflow-y: auto;
}

.view.active {
  display: block;
  animation: floatIn 220ms ease;
}

h2,
h3 {
  margin: 0.2rem 0 0.65rem;
  font-family: 'Outfit', 'Avenir Next', sans-serif;
  letter-spacing: 0.01em;
}

.helper {
  color: var(--muted);
  font-size: 0.85rem;
}

.card,
.post-item,
.auth-card {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  padding: 0.9rem;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
}

.auth-card {
  margin-top: 1.8rem;
  text-align: center;
}

.auth-card h2 {
  margin-bottom: 0.5rem;
}

.auth-form {
  margin: 0.75rem 0;
  text-align: left;
}

.auth-form .actions {
  margin-top: 0.4rem;
}

.fine-print {
  color: #94a4cf;
  font-size: 0.76rem;
}

label {
  display: block;
  margin-bottom: 0.8rem;
}

label span,
legend {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 0.38rem;
  color: #b5c2e5;
}

textarea,
select,
input[type='email'],
input[type='password'],
input[type='file'] {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0.58rem;
  color: #eff4ff;
  background: rgba(10, 13, 22, 0.6);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.gradient-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.gradient-btn {
  border: 2px solid transparent;
  border-radius: 12px;
  height: 52px;
  cursor: pointer;
}

.gradient-btn.selected {
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(99, 129, 255, 0.5);
}

.actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 0.64rem 0.98rem;
  font-weight: 700;
  font-size: 0.92rem;
  width: 100%;
  color: #fff;
}

.btn.primary {
  background: linear-gradient(120deg, #7b6eff, #4d87ff 50%, #2ec8ff);
}

.btn.secondary {
  color: #d8e2ff;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
}

.btn.success {
  background: linear-gradient(120deg, #1aaa81, #33d3a2);
}

.btn.danger {
  background: linear-gradient(120deg, #ef4b62, #ff7185);
}

.btn.ghost {
  width: auto;
  padding: 0.4rem 0.68rem;
  font-size: 0.72rem;
  color: #f2f5ff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.question-card {
  margin: 0.1rem 0 0.2rem;
  min-height: 0;
  height: 100%;
  border-radius: 22px;
  padding: 1rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 26px 44px rgba(0, 0, 0, 0.45);
  transition: transform 220ms ease, opacity 220ms ease, box-shadow 220ms ease;
  user-select: none;
  touch-action: auto;
}

#feed-card.question-card {
  touch-action: none;
}

.question-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 6%, rgba(0, 0, 0, 0.38) 55%, rgba(0, 0, 0, 0.6) 100%);
}

.question-card .card-top,
.question-card .card-main,
.question-card .card-bottom,
.question-card .vote-stamp {
  position: relative;
  z-index: 1;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.swipe-pill {
  border-radius: 999px;
  padding: 0.26rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.card-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.8rem;
}

.card-main p {
  margin: 0;
  font-family: 'Outfit', 'Avenir Next', sans-serif;
  text-transform: uppercase;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-wrap: balance;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.question-card img {
  width: 100%;
  max-height: 190px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.card-bottom {
  border-radius: 12px;
  padding: 0.58rem 0.66rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
}

.vote-stamp {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.vote-stamp.yes {
  background: rgba(46, 208, 154, 0.85);
}

.vote-stamp.no {
  background: rgba(255, 90, 104, 0.85);
}

.vote-stamp.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.04);
}

.card-empty {
  text-align: center;
  color: #d6e0ff;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  padding: 1.1rem;
  background: rgba(20, 26, 38, 0.5);
}

.feed-end {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  padding: 1rem;
  text-align: center;
}

.feed-end h3 {
  margin: 0 0 0.4rem;
}

#feed.view.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#feed.view.active .question-card {
  flex: 1;
}

#feed.view.active #vote-status {
  margin: 0.2rem 0 0.1rem;
  text-align: center;
}

.stack {
  display: grid;
  gap: 0.66rem;
}

.post-actions .helper {
  margin: 0.4rem 0 0;
}

.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: var(--nav-h);
  background: linear-gradient(180deg, rgba(13, 16, 26, 0.65), rgba(13, 16, 26, 0.95));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.mobile-nav button {
  border: 0;
  color: #93a2cc;
  background: transparent;
  font-size: 0.76rem;
  padding: 0.74rem 0.15rem;
}

.mobile-nav button.active {
  color: #ffffff;
  font-weight: 700;
  border-top: 2px solid #85a0ff;
}

#desktop-splash {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.splash-card {
  max-width: 540px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 2rem;
  text-align: center;
  background: linear-gradient(150deg, #171f36, #222947 55%, #421c4c);
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.5);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 60;
  background: rgba(7, 10, 18, 0.65);
  backdrop-filter: blur(5px);
}

.modal-card {
  width: min(430px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(160deg, #1a2136, #121a2d);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  padding: 1rem;
}

.modal-card h3 {
  margin: 0 0 0.35rem;
}

@media (max-width: 460px) {
  #desktop-splash {
    display: none;
  }

  #app {
    display: flex;
  }
}

@media (min-width: 461px) {
  #app {
    display: none;
  }

  #desktop-splash {
    display: flex;
  }
}

@keyframes floatIn {
  from {
    transform: translateY(12px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}
