* { box-sizing: border-box; }
body { margin: 0; background: #f3f3f3; color: #111; font: 14px/1.5 Arial, "Microsoft YaHei", sans-serif; }
.history-page { width: min(720px, 100%); min-height: 100vh; margin: auto; background: #fff; }
.history-header { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 10px; background: linear-gradient(#075800, #39d82b); color: #fff; }
.history-header h1 { margin: 0; font-size: 16px; font-weight: normal; }
.history-header a { color: #fff; text-decoration: none; font-size: 36px; line-height: 1; }
.history-header .history-home { font-size: 30px; }
.history-navigation { display: flex; justify-content: space-around; padding: 6px 0 3px; border-bottom: 1px solid #ffa900; }
.history-navigation a { display: grid; justify-items: center; gap: 2px; color: #333; font-size: 13px; text-decoration: none; }
.history-navigation a[aria-current] { color: #f60; text-decoration: underline; }
.history-navigation span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #41baff, #5965eb); color: white; font-size: 27px; }
.history-navigation a:last-child span { background: linear-gradient(135deg, #8ee35e, #40c523); }
.history-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid #ff9a00; }
.history-filters > * { min-width: 0; border-right: 1px solid #ff9a00; }
.history-game { display: grid; place-items: center; color: #006a81; }
.history-filters select { width: 100%; min-height: 29px; padding: 2px 6px; border: 0; background: #fff; color: #111; font: inherit; }
.history-tools { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 4px 8px; background: #fafafa; }
.history-tools button { border: 1px solid #ddd; border-radius: 4px; background: #fff; padding: 3px 12px; color: #333; cursor: pointer; white-space: nowrap; }
#history-message { margin: 0; padding: 0 8px; color: #b12222; font-size: 12px; }
.history-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; padding: 6px 4px; border-bottom: 1px solid #61d6f1; }
.history-meta { text-align: center; }
.history-meta time, .history-date-missing { display: block; color: #888; font-size: 12px; }
.history-meta strong { display: block; margin-top: 3px; font-size: 16px; }
.history-balls { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) 14px minmax(0, 1fr); align-items: center; text-align: center; }
.history-ball { display: grid; justify-items: center; gap: 3px; min-width: 0; }
.history-number { display: grid; place-items: center; width: 31px; height: 31px; border: 3px solid; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 45%, #e8e8e8); color: #00394e; font: bold 18px/1 Arial, sans-serif; }
.history-red { border-color: #ff414b; box-shadow: inset 0 0 0 1px #ffb6ba; }
.history-blue { border-color: #27bdf0; box-shadow: inset 0 0 0 1px #adebff; }
.history-green { border-color: #64d334; box-shadow: inset 0 0 0 1px #bceba5; }
.history-empty { border-color: #999; box-shadow: inset 0 0 0 1px #ddd; color: #777; }
.history-label { color: #12547a; font-size: 12px; white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
@media (max-width: 400px) {
  .history-row { grid-template-columns: 75px minmax(0, 1fr); padding: 6px 2px; }
  .history-number { width: 27px; height: 27px; font-size: 16px; border-width: 2px; }
  .history-label { font-size: 10px; }
  .history-meta time, .history-date-missing { font-size: 10px; }
  .history-balls { grid-template-columns: repeat(6, minmax(0, 1fr)) 10px minmax(0, 1fr); }
}
