:root {
  --red: #cc2c2c;
  --border: #e5e5e5;
  font-family: "Lantinghei SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #333;
  background: #edfcf6;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, select { font: inherit; }
button, select:not(:disabled) { cursor: pointer; }
button:focus-visible, select:focus-visible {
  outline: 2px solid #8c1f1f;
  outline-offset: 2px;
}

.page {
  max-width: 800px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
}

.page-head {
  display: grid;
  place-items: center;
  height: 45px;
  color: #fff;
  background: var(--red);
}

.page-head h1 { margin: 0; font-size: 18px; font-weight: 600; }
.kjt-history-tools > a[aria-disabled="true"] { color: #666; background: #fafafa; }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.controls label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.controls select, #retry {
  min-height: 34px;
  padding: 3px 7px;
  border: 1px solid #ccc;
  border-radius: 2px;
  background: #fff;
  color: inherit;
}

.status, .notice, .load-error { margin: 0; padding: 8px 10px; }
.notice { color: #555; }
.load-error { color: #8c1f1f; }
.load-error p { margin: 0 0 6px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 14px;
  padding: 8px 10px 0;
  color: #555;
}

.zodiac-heading {
  margin: 0;
  padding: 4px 10px;
  background: #eee;
  color: #444;
  font-size: 14px;
}

.ball-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 5px 10px 6px;
  list-style: none;
}

.ball-cell { display: grid; justify-items: center; gap: 1px; }
.ball {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ball-art, #eee) center / contain no-repeat;
  color: #222;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ball-red { --ball-art: url('/static/2/images/ball-red.png'); }
.ball-blue { --ball-art: url('/static/2/images/ball-blue.png'); }
.ball-green { --ball-art: url('/static/2/images/ball-green.png'); }
.ball-element { color: #555; font-size: 13px; line-height: 1.25; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
