:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #342421;
  background: #f4efe6;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  background: radial-gradient(circle at 50% 0%, rgba(153, 57, 51, .1), transparent 34rem), #f4efe6;
}

button { font: inherit; touch-action: manipulation; }

.page-shell {
  width: min(760px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 20px 64px;
}

.hero { max-width: 680px; margin: 0 auto 24px; text-align: center; }
h1 { margin: 0; font-family: Georgia, "Microsoft YaHei", serif; font-size: clamp(34px, 7vw, 52px); }

.primary-button {
  margin-top: 24px;
  min-width: 190px;
  min-height: 52px;
  padding: 0 24px;
  color: #fff;
  background: #8c3334;
  border: 0;
  border-radius: 13px;
  box-shadow: 0 9px 24px rgba(140, 51, 52, .2);
  cursor: pointer;
  font-weight: 800;
}

.primary-button:hover { filter: brightness(1.06); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; filter: grayscale(.25); opacity: .72; }
.status { min-height: 22px; margin: 14px 0 0; color: #765d54; font-size: 14px; }
.status.error { color: #a32729; font-weight: 700; }

.results {
  overflow: hidden;
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 5px;
}
.draw-card {
  padding: 4px;
  background: #f8f8f8;
  border-bottom: 1px solid #d6d6d6;
}
.draw-card:last-child { border-bottom: 0; }

.draw-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 24px;
  padding: 0 3px 3px;
  color: #666;
}

.draw-heading div { display: flex; align-items: baseline; gap: 3px; }
.issue { font-size: 14px; }
.date { color: #777; font-size: 12px; }
.baseline { margin: 0 0 0 auto; color: #d20d16; font-size: 12px; font-weight: 800; white-space: nowrap; }
.balls { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }

.ball-item {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  min-width: 0;
  padding: 5px 3px 0;
  color: #fff;
  background: var(--ball-color, #777);
  border: 1px solid #ddd;
  border-radius: 3px 3px 0 0;
}

.ball-item.color-red { --ball-color: #e51414; }
.ball-item.color-blue { --ball-color: #176fe3; }
.ball-item.color-green { --ball-color: #129324; }
.ball-item.special { box-shadow: inset 0 0 0 2px #ffd43b; }
.ball-item strong { color: #fff; font-family: Arial, sans-serif; font-size: 20px; line-height: 1.15; text-align: center; text-shadow: 0 1px 1px rgba(0, 0, 0, .2); }
.zodiac {
  display: block;
  margin: 5px -3px 0;
  padding: 2px 0;
  color: #222;
  background: #fff;
  font-size: 12px;
  text-align: center;
}
.ball-item em {
  display: block;
  margin: 0 -3px;
  padding: 2px 0 3px;
  color: var(--ball-color, #333);
  background: #fff;
  border-top: 1px solid #e7e7e7;
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .page-shell { padding: 24px 5px 40px; }
}

@media (max-width: 430px) {
  .hero { margin-bottom: 18px; }
  .draw-heading { gap: 2px; }
  .issue { font-size: 12px; }
  .date, .baseline { font-size: 10px; }
  .balls { gap: 2px; }
  .ball-item strong { font-size: 17px; }
  .ball-item em { font-size: 11px; }
}
