:root {
  --bg: #8e0707;
  --bg-deep: #5f0202;
  --paper: #fffaf2;
  --paper-deep: #f6ead8;
  --ink: #3e2018;
  --muted: #8f6657;
  --line: rgba(123, 38, 18, 0.12);
  --red: #ef554d;
  --red-deep: #d8312b;
  --gold: #ffe2a0;
  --gold-deep: #ffbf52;
  --blue: #4f93ee;
  --blue-deep: #2d67d7;
  --panel: rgba(103, 10, 10, 0.5);
  --shadow: 0 24px 60px rgba(74, 7, 7, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Noto Sans SC", sans-serif;
  color: #fff7ef;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 218, 140, 0.16), transparent 24%),
    radial-gradient(circle at 100% 10%, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(180deg, #b70f0f 0%, #8d0707 38%, #6e0404 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.poster-page {
  width: min(1220px, calc(100vw - 24px));
  margin: 12px auto 28px;
}

.poster-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.poster-controls {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 14px;
}

.poster-topbar,
.poster-toolbar,
.poster-guidance {
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.poster-eyebrow,
.guidance-label,
.section-kicker {
  margin: 0;
  color: var(--gold);
  font: 700 13px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.16em;
}

.poster-topbar {
  display: grid;
  gap: 16px;
}

.topbar-copy h1 {
  margin: 6px 0 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.08;
}

.poster-subcopy {
  margin: 8px 0 0;
  color: rgba(255, 247, 239, 0.74);
  font-size: 13px;
  line-height: 1.7;
}

.primary-btn {
  min-height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: 16px;
  color: #6b1906;
  font-weight: 800;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  box-shadow: 0 14px 30px rgba(255, 191, 82, 0.3);
}

.primary-btn:disabled {
  opacity: 0.72;
}

.poster-toolbar,
.poster-guidance {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 12px;
  color: rgba(255, 247, 239, 0.72);
}

.field input {
  min-height: 44px;
  width: 100%;
  padding: 0 14px;
  color: #fff7ef;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.field input::placeholder {
  color: rgba(255, 247, 239, 0.42);
}

.guidance-list {
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 247, 239, 0.72);
  font-size: 13px;
  line-height: 1.7;
}

.poster-stage {
  min-width: 0;
  display: flex;
  justify-content: center;
}

.poster-card {
  width: min(820px, 100%);
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  padding: 28px 24px 22px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% -4%, rgba(255, 236, 182, 0.24), transparent 28%),
    linear-gradient(180deg, #cb1c18 0%, #b80e0e 24%, #a50606 44%, #920505 100%);
  box-shadow: 0 34px 80px rgba(66, 2, 2, 0.28);
}

.poster-spark {
  position: absolute;
  top: 18px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  opacity: 0.3;
  filter: blur(2px);
}

.spark-left {
  left: -20px;
  background: radial-gradient(circle, rgba(255, 233, 176, 0.88) 0 4%, transparent 4%),
    radial-gradient(circle, rgba(255, 233, 176, 0.58) 0 1%, transparent 1%);
  background-size: 44px 44px, 16px 16px;
}

.spark-right {
  right: -10px;
  background: radial-gradient(circle, rgba(255, 233, 176, 0.84) 0 4%, transparent 4%),
    radial-gradient(circle, rgba(255, 233, 176, 0.54) 0 1%, transparent 1%);
  background-size: 52px 52px, 18px 18px;
}

.poster-hero {
  position: relative;
  min-height: 152px;
  display: block;
}

.hero-lantern {
  position: relative;
  position: absolute;
  left: 0;
  top: 16px;
  display: grid;
  place-items: center;
  width: 72px;
  height: 92px;
  border-radius: 40px 40px 28px 28px;
  color: #fff9ee;
  font-size: 32px;
  font-weight: 900;
  background:
    linear-gradient(180deg, #ff7960 0%, #e63e2f 60%, #c81d1a 100%);
  border: 4px solid rgba(255, 226, 160, 0.5);
  box-shadow: inset 0 -10px 18px rgba(120, 10, 10, 0.2);
}

.hero-lantern::before,
.hero-lantern::after {
  content: "";
  position: absolute;
  left: 33px;
  width: 6px;
  background: linear-gradient(180deg, #ffd98e, #f0a620);
}

.hero-lantern::before {
  top: 10px;
  height: 18px;
}

.hero-lantern::after {
  bottom: -14px;
  height: 24px;
  border-radius: 999px;
}

.hero-copy {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(100%, 640px);
  transform: translateX(-50%);
  padding: 0 12px;
  text-align: center;
}

.headline-stack {
  display: grid;
  gap: 2px;
  justify-items: center;
}

.poster-headline-line {
  display: block;
  white-space: nowrap;
}

.poster-hero h2 {
  margin: 8px 0 6px;
  color: #fff3c4;
  text-shadow: 0 4px 0 rgba(128, 10, 10, 0.2);
  font-size: clamp(2.45rem, 5.2vw, 4.1rem);
  line-height: 1;
  letter-spacing: 0.02em;
}

.card-subline {
  margin: 0;
  color: rgba(255, 243, 196, 0.8);
  font-size: 14px;
  line-height: 1.7;
}

.hero-year {
  position: absolute;
  top: 10px;
  right: 4px;
  color: rgba(255, 226, 160, 0.92);
  font: 700 22px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.08em;
  transform: rotate(-8deg);
}

.hero-ribbon {
  justify-self: center;
  min-width: 250px;
  padding: 10px 26px;
  border-radius: 999px;
  color: #6f1a10;
  background: linear-gradient(180deg, #fff8ea 0%, #f5dfba 100%);
  box-shadow: 0 12px 28px rgba(121, 15, 15, 0.22);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.note-label {
  display: block;
  font-size: 12px;
  color: rgba(255, 241, 217, 0.78);
}

.results-panel {
  padding: 18px 18px 20px;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  box-shadow: inset 0 0 0 1px rgba(169, 81, 48, 0.1);
}

.section-head {
  display: block;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(123, 38, 18, 0.08);
}

.section-head h3 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: clamp(1.12rem, 3vw, 1.55rem);
}

.poster-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.draw-card {
  display: grid;
  gap: 12px;
  padding: 14px 2px 14px 0;
  border-bottom: 1px dashed rgba(123, 38, 18, 0.1);
}

.draw-card:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.draw-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}

.draw-title strong {
  display: inline-block;
  color: #342018;
  font-size: 18px;
  line-height: 1.3;
}

.draw-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #8b150e;
  background: linear-gradient(180deg, #ffe4a8 0%, #ffc768 100%);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.draw-title span,
.draw-heading .draw-issue {
  color: var(--muted);
  font-size: 12px;
}

.draw-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.ball-groups {
  display: grid;
  gap: 8px;
  margin-left: 0;
}

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

.draw-card.lottery-kl8 .ball-row {
  flex-wrap: wrap;
  gap: 6px;
  width: 314px;
  max-width: 314px;
}

.share-ball {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.12);
}

.share-ball.red {
  background: linear-gradient(180deg, #ff7765 0%, var(--red-deep) 100%);
}

.share-ball.blue {
  background: linear-gradient(180deg, #79b0ff 0%, var(--blue-deep) 100%);
}

.draw-card.lottery-kl8 .share-ball {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.draw-card.lottery-kl8 .share-ball.blue {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.draw-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  color: #6c473d;
  background: rgba(255, 236, 210, 0.72);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;
}

.poster-note {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(119, 9, 9, 0.34);
  border: 1px solid rgba(255, 226, 160, 0.14);
}

.poster-note p {
  margin: 8px 0 0;
  color: rgba(255, 247, 239, 0.82);
  font-size: 13px;
  line-height: 1.7;
}

.poster-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 240, 216, 0.82);
  font-size: 12px;
  letter-spacing: 0.04em;
}

@media (max-width: 980px) {
  .poster-shell {
    grid-template-columns: 1fr;
  }

  .poster-controls {
    position: static;
  }
}

@media (max-width: 640px) {
  .poster-page {
    width: calc(100vw - 12px);
  }

  .poster-topbar,
  .poster-toolbar,
  .poster-guidance {
    border-radius: 20px;
  }

  .poster-card {
    padding: 20px 14px 16px;
    border-radius: 26px;
  }

  .poster-hero {
    min-height: 132px;
    padding-top: 8px;
  }

  .hero-copy {
    left: 50%;
    width: calc(100% - 32px);
    padding: 0 16px;
  }

  .hero-lantern {
    position: absolute;
    top: 22px;
    left: 0;
    width: 54px;
    height: 72px;
    font-size: 24px;
    border-width: 3px;
  }

  .hero-lantern::before,
  .hero-lantern::after {
    left: 24px;
  }

  .hero-lantern::before {
    top: -10px;
    height: 12px;
  }

  .hero-lantern::after {
    bottom: -10px;
    height: 16px;
  }

  .hero-year {
    position: absolute;
    top: 8px;
    right: 4px;
    font-size: 16px;
  }

  .poster-hero h2 {
    font-size: clamp(1.95rem, 10.2vw, 3.05rem);
    line-height: 0.98;
  }

  .poster-headline-line {
    white-space: nowrap;
  }

  .card-subline {
    font-size: 12px;
    line-height: 1.55;
  }

  .hero-ribbon {
    min-width: 0;
    width: min(88%, 280px);
    padding: 9px 18px;
  }

  .poster-summary {
    grid-template-columns: 1fr;
  }

  .poster-foot {
    flex-direction: column;
    align-items: start;
  }

  .ball-groups,
  .draw-note {
    margin-left: 0;
  }

  .share-ball {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .draw-card.lottery-kl8 .share-ball {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .draw-card.lottery-kl8 .share-ball.blue {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  .draw-card.lottery-kl8 .ball-row {
    width: 294px;
    max-width: 100%;
  }

  .primary-btn {
    width: 100%;
  }
}
