:root {
  color-scheme: light;
  --page-bg: #10131d;
  --dark: #171923;
  --red: #f04b5f;
  --blue: #2e75ff;
  --gold: #ffd166;
  --ink: #202331;
  --muted: #73798c;
  --panel: #fff;
  --line: rgba(32, 35, 49, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(110deg, rgba(240, 75, 95, 0.18), rgba(46, 117, 255, 0.18)),
    #0b0e16;
}

body {
  display: flex;
  justify-content: center;
  color: var(--muted);
}

button {
  border: 0;
  font: inherit;
}

.phone-shell {
  position: relative;
  width: min(100vw, 430px);
  min-height: 100vh;
  padding-bottom: 76px;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(240, 75, 95, 0.28), transparent 42%, rgba(46, 117, 255, 0.28)),
    linear-gradient(180deg, #171923, #111522 34rem),
    var(--page-bg);
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.28);
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  color: #fff;
  background: linear-gradient(180deg, rgba(17, 21, 34, 0.9), rgba(17, 21, 34, 0.24));
  backdrop-filter: blur(14px);
}

.top-title {
  position: absolute;
  left: 50%;
  display: inline-flex;
  max-width: min(260px, calc(100% - 112px));
  overflow: hidden;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  white-space: nowrap;
}

.top-title-icon {
  width: 24px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 3px;
}

.top-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  position: relative;
  z-index: 1;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.icon-button span {
  font-size: 24px;
  line-height: 1;
}

.hero {
  min-height: 286px;
  margin: 0 12px;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(90deg, rgba(240, 75, 95, 0.88), transparent 48%, rgba(46, 117, 255, 0.9)),
    linear-gradient(145deg, #242838, #111522);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.hero + .hero {
  margin-top: 12px;
}

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.22), transparent 30%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 32px);
  opacity: 0.7;
}

.hero-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 24px;
}

.hero-bolt {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
}

.hero-image-slot {
  display: grid;
  width: min(124px, 100%);
  aspect-ratio: 1;
  height: auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.16);
}

.hero-image-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image-slot span {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-side.red .hero-image-slot {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(240, 75, 95, 0.38));
}

.hero-side.blue .hero-image-slot {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(46, 117, 255, 0.38));
}

.hero-bolt {
  flex: 0 0 auto;
  margin-top: 45px;
  width: 46px;
  height: 46px;
  color: var(--dark);
  font-size: 15px;
  background: var(--gold);
  border: 4px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.hero-copy {
  position: relative;
  display: flex;
  min-height: 286px;
  flex-direction: column;
  justify-content: start;
  padding: 14px 16px;
  color: #fff;
}

.topic-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-bottom: 4px;
}

.hero-copy p {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.topic-row p {
  margin: 0;
  font-size: 16px;
  line-height: 20px;
  white-space: nowrap;
}

.topic-slot {
  display: -webkit-box;
  min-height: 20px;
  overflow: hidden;
  padding: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 20px;
  overflow-wrap: anywhere;
  background: transparent;
  border: 0;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hero-copy h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
}

.hero-side {
  display: grid;
  min-width: 0;
  gap: 7px;
  justify-items: center;
  color: #fff;
  text-align: center;
  padding-top: 6px;
}

.hero-vote-button {
  height: 34px;
  margin-top: 0;
  background: rgba(17, 21, 34, 0.9);
}

.panel,
.circle-link-panel {
  margin: 12px;
  border-radius: 8px;
}

.vote-button,
.primary-action {
  display: inline-flex;
  width: 100%;
  height: 38px;
  margin-top: 10px;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  background: var(--dark);
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}

.vote-button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.panel,
.circle-link-panel {
  padding: 14px;
  background: var(--panel);
}

.circle-link-panel {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 8px 14px;
  background: var(--panel);
  border: 0;
}

.circle-link-panel::before {
  display: none;
}

.circle-link-button {
  color: inherit;
  text-decoration: none;
}

.circle-link-button {
  position: relative;
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  background: transparent;
  border-bottom: 0;
  border-radius: 0;
  box-shadow: none;
}

.bottom-bar {
  position: fixed;
  right: 50%;
  bottom: 0;
  z-index: 24;
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 10px;
  width: min(100vw, 430px);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  transform: translateX(50%);
  backdrop-filter: blur(14px);
}

.bottom-bar button {
  width: auto;
  height: 42px;
  margin: 0;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 900;
}

.outline-action {
  color: var(--dark);
  background: #eef1f8;
}

.toast {
  position: fixed;
  right: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 30;
  width: max-content;
  max-width: min(300px, calc(100vw - 40px));
  padding: 10px 14px;
  color: #fff;
  background: rgba(18, 9, 29, 0.88);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  transform: translateX(50%);
}

.rules-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 14, 22, 0.62);
}

.rules-modal {
  width: min(340px, 100%);
  max-height: min(76vh, 620px);
  overflow-y: auto;
  padding: 18px;
  color: var(--ink);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.rules-modal h2 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 900;
}

.rules-modal ol {
  margin: 0;
  padding-left: 20px;
}

.rules-modal li {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.rules-modal strong {
  color: inherit;
  font-weight: 850;
}

.state-panel {
  margin-top: 18px;
}

.skeleton,
.skeleton-card {
  position: relative;
  overflow: hidden;
}

.skeleton::after,
.skeleton-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  animation: shimmer 1.2s linear infinite;
}

.skeleton-card {
  height: 220px;
}

.skeleton-card.short {
  height: 120px;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 340px) {
  .hero-stage {
    grid-template-columns: 1fr;
  }

  .hero-bolt {
    justify-self: center;
  }
}
