:root {
  --blue: #0017c1;
  --blue-dark: #000b78;
  --blue-light: #e8f1fe;
  --ink: #1a1a1a;
  --muted: #4d4d4d;
  --line: #949494;
  --line-light: #d9d9d9;
  --bg: #f5f5f5;
  --white: #fff;
  --focus: #ffd43b;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: "Noto Sans JP", "Noto Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}
button,
input {
  font: inherit;
}
button,
a,
label,
summary {
  touch-action: manipulation;
}
a {
  color: var(--blue);
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 2px;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: 8px;
  z-index: 1000;
  background: var(--ink);
  color: white;
  padding: 10px 16px;
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: none;
}
.content-width {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line-light);
}
.header-inner {
  width: min(1240px, calc(100% - 48px));
  height: 80px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 40px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
  font-weight: 700;
  font-size: 14px;
}
.brand strong,
.brand small {
  display: block;
}
.brand strong {
  font-size: 18px;
  line-height: 1.35;
}
.brand small {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.beta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 9px;
  border: 1px solid var(--blue);
  border-radius: 3px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.site-header nav {
  display: flex;
  align-items: stretch;
  height: 100%;
  margin-left: auto;
}
.site-header nav a {
  display: flex;
  align-items: center;
  padding: 0 18px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 4px solid transparent;
}
.site-header nav a:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.login-button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--blue);
  background: white;
  color: var(--blue);
  font-weight: 700;
  border-radius: 4px;
}
.login-button:hover {
  background: var(--blue-light);
}
.login-button:disabled,
.save-button:disabled {
  border-color: var(--line);
  background: #eee;
  color: #666;
  cursor: not-allowed;
  opacity: 1;
}
.login-button:disabled:hover,
.save-button:disabled:hover {
  background: #eee;
}
.intro {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--line-light);
  background: linear-gradient(
    90deg,
    #fff 0,
    #fff 64%,
    var(--blue-light) 64%,
    var(--blue-light) 100%
  );
}
.intro .content-width {
  position: relative;
}
.intro .content-width:after {
  content: "01 — 43";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(54px, 8vw, 104px);
  font-weight: 700;
  letter-spacing: -0.06em;
  color: var(--blue);
  opacity: 0.12;
}
.service-label,
.section-kicker {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}
.intro h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.35;
  letter-spacing: 0.01em;
}
.intro-text {
  max-width: 700px;
  margin: 20px 0 28px;
  font-size: 18px;
}
.primary-button,
.generate-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--blue);
  border-radius: 4px;
  background: var(--blue);
  color: white;
  padding: 0 28px;
  font-weight: 700;
  text-decoration: none;
}
.primary-button:hover,
.generate-button:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}
.notice-inline {
  max-width: 830px;
  margin: 32px 0 0;
  padding: 16px 20px;
  border-left: 6px solid #f9c23c;
  background: #fff9e5;
  font-size: 14px;
}
.notice-inline strong {
  display: inline-block;
  margin-right: 6px;
}
.summary,
.generator-section,
.guide-section {
  padding: 72px 0;
}
.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.section-title-row h2,
.generator-section h2,
.guide-section h2 {
  margin: 0;
  font-size: 36px;
  line-height: 1.4;
}
.verified-label {
  display: inline-block;
  border: 1px solid #006e54;
  background: #e7f7f2;
  color: #005a46;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 3px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  border: 1px solid var(--line);
}
.summary-grid > div {
  min-height: 132px;
  padding: 22px;
  border-right: 1px solid var(--line-light);
}
.summary-grid > div:last-child {
  border-right: 0;
}
.summary-grid dt {
  font-size: 14px;
  color: var(--muted);
}
.summary-grid dd {
  margin: 12px 0 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--blue);
}
.summary-grid dd small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.summary-grid i {
  font-style: normal;
}
.latest-draw {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 36px;
  align-items: center;
  padding: 28px;
  margin-top: 20px;
  background: var(--bg);
  border-left: 6px solid var(--blue);
}
.latest-draw h3 {
  font-size: 16px;
  margin: 0 0 14px;
}
.latest-balls {
  display: flex;
  gap: 10px;
}
.latest-balls b,
.ball {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: white;
  border: 2px solid var(--blue);
  color: var(--blue);
  font-weight: 700;
}
.latest-draw > p {
  margin: 0;
}
.latest-draw > p strong {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--muted);
  color: white;
}
.latest-draw > a {
  font-weight: 700;
}
.generator-section {
  background: var(--bg);
}
.section-description {
  max-width: 740px;
  margin: 8px 0 30px;
  color: var(--muted);
}
.generator-shell {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  border: 1px solid var(--line);
  background: white;
}
.controls-panel,
.results-panel {
  padding: 36px;
}
.controls-panel {
  border-right: 1px solid var(--line);
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 34px;
}
legend {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}
legend span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  background: var(--blue);
  color: white;
  border-radius: 50%;
  font-size: 14px;
}
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mode {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 92px;
  padding: 16px;
  border: 2px solid var(--line-light);
  border-radius: 4px;
  cursor: pointer;
}
.mode:hover {
  border-color: var(--blue);
}
.mode.active {
  border-color: var(--blue);
  background: var(--blue-light);
}
.mode input {
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  accent-color: var(--blue);
}
.mode strong,
.mode small {
  display: block;
}
.mode small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.stepper {
  display: flex;
  width: max-content;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.stepper button {
  width: 52px;
  height: 48px;
  border: 0;
  background: white;
  color: var(--blue);
  font-size: 24px;
  font-weight: 700;
}
.stepper button:hover {
  background: var(--blue-light);
}
.stepper output {
  width: 42px;
  text-align: right;
  font-size: 20px;
  font-weight: 700;
}
.stepper > span {
  padding-right: 14px;
}
.field-help {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}
.advanced + .field-help {
  margin: 0 4px 18px;
}
.input-error {
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 2px solid #e7001d;
  background: #fff2f2;
  color: #1a1a1a;
  font-size: 14px;
}
.input-error strong {
  color: #b40019;
}
.input-error ul {
  margin: 6px 0 0;
  padding-left: 1.4em;
}
[aria-invalid="true"] {
  border: 2px solid #e7001d !important;
}
details {
  margin: 0 0 24px;
  border-top: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
}
summary {
  padding: 18px 4px;
  color: var(--blue);
  font-weight: 700;
}
.advanced {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 4px 20px;
}
.advanced label {
  font-weight: 600;
}
.advanced label span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.advanced input {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 12px;
}
.generate-button {
  width: 100%;
}
.results-panel {
  background: #f7f9ff;
}
.results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-light);
}
.results-head p {
  margin: 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}
.results-head h3 {
  margin: 2px 0 0;
  font-size: 26px;
}
.results-head button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.results-panel #results {
  padding: 24px 0 12px;
}
.pick {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.pick > span {
  width: 24px;
  color: var(--muted);
  font-size: 14px;
}
.ball {
  width: 42px;
  height: 42px;
  border-width: 1px;
}
.reason-block {
  padding: 16px 18px;
  border-left: 5px solid var(--blue);
  background: white;
}
.applied-conditions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0 0 16px;
  background: var(--line-light);
  border: 1px solid var(--line-light);
}
.applied-conditions div {
  background: white;
  padding: 12px 14px;
}
.applied-conditions dt {
  color: var(--muted);
  font-size: 12px;
}
.applied-conditions dd {
  margin: 3px 0 0;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}
.reason-block strong {
  font-size: 14px;
}
.reason-block p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.save-button {
  width: 100%;
  min-height: 50px;
  margin-top: 24px;
  border: 2px solid var(--blue);
  border-radius: 4px;
  background: white;
  color: var(--blue);
  font-weight: 700;
}
.save-button:hover {
  background: var(--blue-light);
}
.save-note {
  margin: 7px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.guide-grid article {
  padding: 28px 28px 30px;
  border-right: 1px solid var(--line-light);
}
.guide-grid article:last-child {
  border-right: 0;
}
.guide-grid span {
  color: var(--blue);
  font-weight: 700;
}
.guide-grid h3 {
  margin: 8px 0;
  font-size: 19px;
}
.guide-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
footer {
  padding: 44px 0;
  background: #eee;
  border-top: 1px solid var(--line-light);
}
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  font-size: 14px;
}
.footer-inner > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  background: var(--ink);
  color: white;
  padding: 13px 20px;
  border-radius: 3px;
  transform: translateY(90px);
  opacity: 0;
  transition: 0.25s;
}
.toast.show {
  transform: none;
  opacity: 1;
}
.document-main {
  padding: 56px 0 80px;
  background: var(--bg);
}
.document-shell {
  max-width: 900px;
  padding: 48px clamp(24px, 6vw, 64px);
  background: var(--white);
  border-top: 6px solid var(--blue);
}
.document-breadcrumb {
  margin: 0 0 24px;
  font-size: 14px;
}
.document-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line-light);
}
.document-header h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.4;
}
.document-header p {
  margin: 12px 0 0;
  color: var(--muted);
}
.document-content {
  margin-top: 36px;
}
.document-content section + section {
  margin-top: 36px;
}
.document-content h2 {
  margin: 0 0 12px;
  padding-left: 14px;
  border-left: 5px solid var(--blue);
  font-size: 22px;
  line-height: 1.5;
}
.document-content h3 {
  margin: 24px 0 8px;
  font-size: 17px;
}
.document-content p,
.document-content ul,
.document-content ol,
.document-content dl {
  margin-top: 0;
}
.document-content li + li {
  margin-top: 8px;
}
.document-content dt {
  margin-top: 18px;
  font-weight: 700;
}
.document-content dd {
  margin: 4px 0 0;
}
.document-note {
  padding: 18px 20px;
  border-left: 6px solid #f9c23c;
  background: #fff9e5;
}
.contact-card {
  padding: 28px;
  background: var(--blue-light);
  border: 1px solid #b4c7e7;
}
.contact-card a {
  display: inline-block;
  margin-top: 8px;
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.document-updated {
  margin-top: 48px;
  color: var(--muted);
  font-size: 14px;
}
@media (max-width: 820px) {
  html {
    scroll-padding-top: 70px;
  }
  .content-width,
  .header-inner {
    width: min(100% - 32px, 1120px);
  }
  .header-inner {
    height: 68px;
  }
  .brand-mark {
    width: 36px;
    height: 36px;
  }
  .brand strong {
    font-size: 16px;
  }
  .site-header nav {
    display: none;
  }
  .login-button {
    margin-left: auto;
    padding: 0 14px;
  }
  .beta-badge {
    display: none;
  }
  .document-main {
    padding: 32px 0 52px;
  }
  .document-shell {
    padding: 30px 22px 40px;
  }
  .intro {
    padding: 48px 0 40px;
    background: linear-gradient(
      180deg,
      #fff 0,
      #fff 78%,
      var(--blue-light) 78%
    );
  }
  .intro .content-width:after {
    position: static;
    display: block;
    transform: none;
    margin-top: 24px;
    font-size: 48px;
  }
  .intro h1 {
    font-size: 38px;
  }
  .intro-text {
    font-size: 16px;
  }
  .summary,
  .generator-section,
  .guide-section {
    padding: 52px 0;
  }
  .section-title-row h2,
  .generator-section h2,
  .guide-section h2 {
    font-size: 28px;
  }
  .section-title-row {
    align-items: flex-start;
  }
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .summary-grid > div {
    min-height: 116px;
  }
  .summary-grid > div:nth-child(2) {
    border-right: 0;
  }
  .summary-grid > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-light);
  }
  .latest-draw {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 16px;
  }
  .latest-balls {
    gap: 6px;
  }
  .latest-balls b {
    width: 40px;
    height: 40px;
  }
  .generator-shell {
    grid-template-columns: 1fr;
  }
  .controls-panel,
  .results-panel {
    padding: 26px 18px;
  }
  .controls-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .mode-grid,
  .advanced {
    grid-template-columns: 1fr;
  }
  .mode {
    min-height: auto;
  }
  .ball {
    width: 39px;
    height: 39px;
  }
  .pick {
    gap: 5px;
  }
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .guide-grid article {
    border-right: 0;
    border-bottom: 1px solid var(--line-light);
  }
  .guide-grid article:last-child {
    border-bottom: 0;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-links {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .footer-inner > p {
    text-align: left;
  }
}
@media (max-width: 430px) {
  .intro h1 {
    font-size: 33px;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .summary-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line-light) !important;
  }
  .summary-grid > div:last-child {
    border-bottom: 0 !important;
  }
  .verified-label {
    font-size: 12px;
  }
  .latest-balls b,
  .ball {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  .pick > span {
    width: 18px;
  }
  .results-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .results-head button {
    padding: 0;
  }
  .applied-conditions {
    grid-template-columns: 1fr;
  }
}

.cookie-consent {
  position: fixed;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
  left: 20px;
  padding: 18px;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
}
.cookie-consent__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
}
.cookie-consent strong { display: block; margin-bottom: 4px; }
.cookie-consent p { margin: 0; font-size: 14px; line-height: 1.7; }
.cookie-consent__actions { display: flex; flex: 0 0 auto; gap: 10px; }
.cookie-consent button,
.text-button {
  min-height: 44px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--ink);
  cursor: pointer;
}
.cookie-consent .consent-primary { color: #fff; background: var(--ink); }
.text-button { color: var(--blue); border-color: currentColor; }
@media (max-width: 680px) {
  .cookie-consent { right: 12px; bottom: 12px; left: 12px; padding: 16px; }
  .cookie-consent__inner { align-items: stretch; flex-direction: column; gap: 14px; }
  .cookie-consent__actions { display: grid; grid-template-columns: 1fr 1fr; }
}

.share-actions { display: flex; gap: 12px; margin-top: 18px; }
.share-actions button { min-height: 44px; padding: 8px 16px; color: var(--blue); background: #fff; border: 1px solid var(--blue); font-weight: 700; }
.share-actions button:last-child { color: #fff; background: var(--blue); }
.share-status { min-height: 1.75em; margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.insights-section { padding: 72px 0; background: var(--blue-light); }
.insight-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.insight-cards article { padding: 28px; background: #fff; border-top: 5px solid var(--blue); }
.insight-cards h3 { margin: 4px 0 10px; font-size: 22px; }
.insight-cards p { margin: 0 0 16px; }
.insight-label { color: var(--blue); font-size: 14px; font-weight: 700; }
.data-article { max-width: 900px; }
.data-article > section { margin: 48px 0; }
.data-article h2 { margin-bottom: 14px; font-size: 28px; }
.article-notice { padding: 20px 24px; background: #fff8d8; border-left: 6px solid #f2c94c; }
.article-notice p { margin: 4px 0 0; }
.article-cta { margin-top: 56px; padding: 32px; background: var(--blue-light); border: 1px solid #c5d7ff; }
.article-cta h2 { margin-top: 0; }
.article-cta .primary-button { display: inline-block; }
.ratio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 24px 0; }
.ratio-grid div { padding: 20px; text-align: center; border: 1px solid var(--line-light); }
.ratio-grid strong { display: block; color: var(--blue); font-size: 28px; }
.ratio-grid span { font-size: 14px; }
.frequency-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 22px; }
.frequency-grid div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 12px; background: var(--bg); }
.frequency-grid span { font-size: 12px; color: var(--muted); }
.frequency-grid b { color: var(--blue); font-size: 20px; }
.frequency-grid strong { font-size: 14px; }
.data-loading { padding: 24px; background: var(--bg); }
@media (max-width: 760px) {
  .insight-cards { grid-template-columns: 1fr; }
  .frequency-grid { grid-template-columns: repeat(2, 1fr); }
  .ratio-grid { grid-template-columns: 1fr; }
  .share-actions { display: grid; grid-template-columns: 1fr 1fr; }
}
