:root {
  --bg: #08111f;
  --bg-soft: #101b30;
  --panel: rgba(16, 27, 48, 0.8);
  --panel-strong: rgba(19, 32, 56, 0.96);
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --text-faint: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --accent: #facc15;
  --accent-soft: rgba(250, 204, 21, 0.16);
  --success: #22c55e;
  --shadow: 0 24px 60px rgba(2, 8, 23, 0.45);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(250, 204, 21, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 26%),
    linear-gradient(180deg, #08111f 0%, #0b1324 45%, #070d18 100%);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

body {
  padding: 32px 20px 40px;
}

.page-shell {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  gap: 28px;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.18), transparent 70%);
  pointer-events: none;
}

.hero-panel,
.message-panel {
  padding: 28px;
}

.hero-head,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(30px, 5vw, 52px);
  max-width: 820px;
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.hero-copy,
.section-copy {
  margin: 14px 0 0;
  color: var(--text-soft);
  max-width: 740px;
  line-height: 1.7;
}

.live-pill,
.status-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.live-pill {
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.12);
  color: #dcfce7;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.18);
  animation: pulse 1.4s infinite ease-in-out;
}

.result-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.lottery-card {
  position: relative;
  padding: 22px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(17, 24, 39, 0.94));
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.lottery-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -120px auto;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.18), transparent 68%);
  pointer-events: none;
}

.lottery-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.lottery-region {
  font-size: 24px;
  font-weight: 700;
}

.lottery-issue {
  color: var(--text-faint);
  font-size: 14px;
}

.ball-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ball,
.ball-special {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 20px;
  color: #0f172a;
}

.ball {
  background: linear-gradient(180deg, #fde68a 0%, #facc15 100%);
  box-shadow: inset 0 -6px 12px rgba(255, 255, 255, 0.22);
}

.ball-special {
  background: linear-gradient(180deg, #bbf7d0 0%, #22c55e 100%);
  box-shadow: inset 0 -6px 12px rgba(255, 255, 255, 0.24);
}

.plus-sign {
  align-self: center;
  font-size: 24px;
  color: var(--text-faint);
}

.lottery-updated {
  margin-top: 16px;
  color: var(--text-faint);
  font-size: 14px;
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.message-count {
  color: var(--text-soft);
  font-size: 14px;
}

.status-connecting {
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.24);
}

.status-live {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.24);
}

.status-reconnecting {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.empty-state {
  margin-top: 22px;
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.48);
  color: var(--text-faint);
}

.empty-state.is-hidden {
  display: none;
}

.card-container {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 2px 8px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.card-container::-webkit-scrollbar {
  width: 12px;
}

.card-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.54);
  border-radius: 999px;
}

.card-container::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.72), rgba(34, 197, 94, 0.5));
  border-radius: 999px;
}

.message-card {
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.88));
  box-shadow: 0 18px 34px rgba(2, 8, 23, 0.34);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.message-card:hover {
  transform: translateY(-4px);
  border-color: rgba(250, 204, 21, 0.42);
}

.message-card.is-new {
  animation: cardEnter 0.35s ease;
}

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

.sequence-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #fde68a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.message-time {
  color: var(--text-faint);
  font-size: 13px;
}

.message-content {
  margin: 18px 0 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 118px;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

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

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

@media (max-width: 900px) {
  body {
    padding: 20px 14px 28px;
  }

  .hero-panel,
  .message-panel {
    padding: 22px;
  }

  .hero-head,
  .section-head {
    flex-direction: column;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .feed-meta {
    justify-content: flex-start;
  }

  .message-card {
    width: 100%;
    max-width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 560px) {
  .ball,
  .ball-special {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }

  .lottery-region {
    font-size: 20px;
  }

  .card-container {
    gap: 14px;
  }

  .message-card {
    width: 100%;
    max-width: 100%;
    flex-basis: auto;
  }
}
