/* XXロトシミュレーター — 暗号資産シミュレーターと同じ明るいモノクロ。ダークモード禁止。 */
:root {
  color-scheme: only light;
  --bg: #f7f7f7;
  --ink: #535353;
  --red: #c4453a;
  --gap: 8px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  color-scheme: only light;
  font-family: "Noto Sans CJK JP", "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
button, input, textarea, select {
  color-scheme: light;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 0;
}
button {
  min-height: 42px;
  padding: 0 10px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 2px;
}
button.active, button.is-active {
  background: var(--ink);
  color: var(--bg);
}

.app {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 6px 8px calc(88px + env(safe-area-inset-bottom));
  background: var(--bg);
  overflow-x: hidden;
}

#disclaimer {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 0 8px;
  padding: 6px 8px;
  border: 2px solid var(--red);
  background: var(--bg);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}
#disclaimer .brk { display: block; height: 0; }

header { margin: 0 0 8px; }
/* SIMULATORS へ戻る（暗号資産投資ラボ・FXエージェントと同じ見た目） */
.back { display: inline-block; font-size: 12px; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--ink); padding: 0 0 1px; letter-spacing: .04em; margin: 2px 0 6px; }
.back:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; }
h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.subhead, .tagline {
  margin: 2px 0 0;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.tagline { font-weight: 700; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0 8px;
}
.section-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.section-head small {
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.game-switch {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
.game {
  min-height: 44px;
  padding: 4px 2px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}
.game b {
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}
.game.active { background: var(--ink); color: var(--bg); }
.game.active b { color: var(--bg); }

.panel {
  border: 2px solid var(--ink);
  background: var(--bg);
  padding: 12px 10px;
  margin-top: 10px;
  min-width: 0;
}
.panel-title { font-size: 13px; font-weight: 800; }
.sub { color: var(--ink); font-size: 12px; line-height: 1.5; margin: 4px 0 0; overflow-wrap: anywhere; }

.gameinfo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.gameinfo strong { font-size: 16px; font-weight: 800; }
.gameinfo small { font-size: 11px; font-weight: 700; white-space: nowrap; }

.model-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.model {
  min-height: 56px;
  padding: 8px;
  text-align: left;
  min-width: 0;
}
.model strong { display: block; font-size: 13px; font-weight: 800; }
.model span { display: block; font-size: 11px; margin-top: 2px; line-height: 1.35; overflow-wrap: anywhere; }
.model.active { background: var(--ink); color: var(--bg); }

.result {
  margin-top: 12px;
  padding: 10px 8px 12px;
  border: 2px solid var(--ink);
  background: var(--bg);
}
.result-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.result-top b, .result-top span { font-size: 11px; font-weight: 800; overflow-wrap: anywhere; }

.balls {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 12px;
  flex-wrap: wrap;
}
.ball, .draw-ball {
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--ink);
  border: 2px solid var(--ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ball {
  width: clamp(44px, 12vw, 56px);
  height: clamp(44px, 12vw, 56px);
  font-size: 18px;
}
.draw-balls { display: flex; gap: 5px; flex-wrap: wrap; }
.draw-ball { width: 30px; height: 30px; font-size: 12px; }
.draw-card.recent-draw { margin-top: 8px; }

.result-reason {
  font-size: 12px;
  border-top: 2px solid var(--ink);
  padding-top: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.result-reason b { font-weight: 800; }

.statgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}
.stat {
  border: 2px solid var(--ink);
  background: var(--bg);
  padding: 8px 6px;
  min-width: 0;
}
.stat small { display: block; font-size: 10px; font-weight: 700; }
.stat strong {
  display: block;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
#lastDate { font-size: 13px; }

.freq-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
  margin: 7px 0;
  font-size: 12px;
}
.freq-row b { font-weight: 800; font-variant-numeric: tabular-nums; }
.track {
  height: 8px;
  background: var(--bg);
  overflow: hidden;
  border: 2px solid var(--ink);
}
.track i { height: 100%; display: block; background: var(--ink); }
.freq-row em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.freq-sub { margin: 12px 0 5px; font-size: 12px; font-weight: 700; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.table td, .table th {
  padding: 8px 6px;
  border-bottom: 2px solid var(--ink);
  text-align: right;
}
.table th:first-child, .table td:first-child { text-align: left; }
.table th { font-weight: 800; font-size: 11px; }
.table .best { font-weight: 800; }

.notice {
  font-size: 12px;
  line-height: 1.55;
  background: var(--bg);
  border: 2px solid var(--red);
  color: var(--red);
  padding: 8px 10px;
  margin-top: 12px;
  overflow-wrap: anywhere;
}

.hero {
  border: 2px solid var(--ink);
  background: var(--bg);
  padding: 14px 12px;
  margin-top: 8px;
}
.eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border: 2px solid var(--ink);
}
.hero-title {
  font-size: 18px;
  line-height: 1.4;
  margin: 12px 0 6px;
  font-weight: 800;
}
.hero p { margin: 0; font-size: 13px; line-height: 1.55; }

.screen { display: none; }
.screen.active { display: block; }

.bottom-nav {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 2px solid var(--ink);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  max-width: 440px;
  margin: auto;
}
.navbtn {
  border: 2px solid transparent;
  background: var(--bg);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  min-height: 48px;
  padding: 4px 2px;
  min-width: 0;
}
.navbtn .ico { display: block; font-size: 16px; line-height: 1.2; margin-bottom: 1px; }
.navbtn.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

footer {
  text-align: center;
  font-size: 11px;
  padding: 20px 0 8px;
}
footer p { margin: 0; }
footer .data-src { margin: 0 auto 8px; max-width: 46em; font-size: 10px; line-height: 1.6; opacity: .8; overflow-wrap: anywhere; }

.thinking-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(247, 247, 247, 0.86);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.thinking-overlay.show { opacity: 1; visibility: visible; }
.thinking-card {
  width: min(100%, 320px);
  padding: 22px 16px 16px;
  text-align: center;
  border: 2px solid var(--ink);
  background: var(--bg);
}
.think-title { font-size: 18px; font-weight: 800; }
.think-sub { font-size: 13px; margin-top: 6px; line-height: 1.5; }
.think-progress {
  height: 8px;
  background: var(--bg);
  overflow: hidden;
  margin: 18px 0 10px;
  border: 2px solid var(--ink);
}
.think-progress i {
  height: 100%;
  width: 38%;
  display: block;
  background: var(--ink);
  animation: thinking 1.05s ease-in-out infinite alternate;
}
.think-foot { font-size: 11px; font-weight: 700; }

@keyframes thinking {
  from { transform: translateX(-15%); width: 25%; }
  to { transform: translateX(180%); width: 38%; }
}
@media (prefers-reduced-motion: reduce) {
  .think-progress i { animation: none; }
  .thinking-overlay { transition: none; }
}

.error-box {
  margin: 40px 0;
  padding: 18px 14px;
  border: 2px solid var(--red);
  background: var(--bg);
  color: var(--ink);
}
.error-box h2 { margin: 0 0 8px; font-size: 16px; }
.error-detail { font-size: 12px; }

@media (min-width: 800px) {
  .app, .bottom-nav { max-width: 980px; }
  #disclaimer { font-size: 14px; padding: 8px 12px; }
  #disclaimer .brk { display: none; }
  h1 { font-size: 22px; }
  .app { padding: 16px 20px calc(84px + env(safe-area-inset-bottom)); }
  .game b { font-size: 13px; }
  .model strong { font-size: 14px; }
  .ball { width: 56px; height: 56px; font-size: 20px; }
  .hero-title { font-size: 22px; }
  #strategy .panel:first-of-type, #home .panel:first-of-type {
    /* keep stacked; numbers stay readable */
  }
}

@media (prefers-color-scheme: dark) {
  html, body, .app, button, #disclaimer, .panel, .result, .stat, .thinking-card, .hero, .bottom-nav, .notice, .ball, .draw-ball, .track, .thinking-overlay {
    background: #f7f7f7;
    color: #535353;
    color-scheme: only light;
  }
  #disclaimer, .notice { color: #c4453a; }
  button.active, button.is-active, .game.active, .game.active b, .model.active, .navbtn.active {
    background: #535353;
    color: #f7f7f7;
  }
  .track i, .think-progress i { background: #535353; }
}

.freq-bar-w-0{width:0%}
.freq-bar-w-1{width:1%}
.freq-bar-w-2{width:2%}
.freq-bar-w-3{width:3%}
.freq-bar-w-4{width:4%}
.freq-bar-w-5{width:5%}
.freq-bar-w-6{width:6%}
.freq-bar-w-7{width:7%}
.freq-bar-w-8{width:8%}
.freq-bar-w-9{width:9%}
.freq-bar-w-10{width:10%}
.freq-bar-w-11{width:11%}
.freq-bar-w-12{width:12%}
.freq-bar-w-13{width:13%}
.freq-bar-w-14{width:14%}
.freq-bar-w-15{width:15%}
.freq-bar-w-16{width:16%}
.freq-bar-w-17{width:17%}
.freq-bar-w-18{width:18%}
.freq-bar-w-19{width:19%}
.freq-bar-w-20{width:20%}
.freq-bar-w-21{width:21%}
.freq-bar-w-22{width:22%}
.freq-bar-w-23{width:23%}
.freq-bar-w-24{width:24%}
.freq-bar-w-25{width:25%}
.freq-bar-w-26{width:26%}
.freq-bar-w-27{width:27%}
.freq-bar-w-28{width:28%}
.freq-bar-w-29{width:29%}
.freq-bar-w-30{width:30%}
.freq-bar-w-31{width:31%}
.freq-bar-w-32{width:32%}
.freq-bar-w-33{width:33%}
.freq-bar-w-34{width:34%}
.freq-bar-w-35{width:35%}
.freq-bar-w-36{width:36%}
.freq-bar-w-37{width:37%}
.freq-bar-w-38{width:38%}
.freq-bar-w-39{width:39%}
.freq-bar-w-40{width:40%}
.freq-bar-w-41{width:41%}
.freq-bar-w-42{width:42%}
.freq-bar-w-43{width:43%}
.freq-bar-w-44{width:44%}
.freq-bar-w-45{width:45%}
.freq-bar-w-46{width:46%}
.freq-bar-w-47{width:47%}
.freq-bar-w-48{width:48%}
.freq-bar-w-49{width:49%}
.freq-bar-w-50{width:50%}
.freq-bar-w-51{width:51%}
.freq-bar-w-52{width:52%}
.freq-bar-w-53{width:53%}
.freq-bar-w-54{width:54%}
.freq-bar-w-55{width:55%}
.freq-bar-w-56{width:56%}
.freq-bar-w-57{width:57%}
.freq-bar-w-58{width:58%}
.freq-bar-w-59{width:59%}
.freq-bar-w-60{width:60%}
.freq-bar-w-61{width:61%}
.freq-bar-w-62{width:62%}
.freq-bar-w-63{width:63%}
.freq-bar-w-64{width:64%}
.freq-bar-w-65{width:65%}
.freq-bar-w-66{width:66%}
.freq-bar-w-67{width:67%}
.freq-bar-w-68{width:68%}
.freq-bar-w-69{width:69%}
.freq-bar-w-70{width:70%}
.freq-bar-w-71{width:71%}
.freq-bar-w-72{width:72%}
.freq-bar-w-73{width:73%}
.freq-bar-w-74{width:74%}
.freq-bar-w-75{width:75%}
.freq-bar-w-76{width:76%}
.freq-bar-w-77{width:77%}
.freq-bar-w-78{width:78%}
.freq-bar-w-79{width:79%}
.freq-bar-w-80{width:80%}
.freq-bar-w-81{width:81%}
.freq-bar-w-82{width:82%}
.freq-bar-w-83{width:83%}
.freq-bar-w-84{width:84%}
.freq-bar-w-85{width:85%}
.freq-bar-w-86{width:86%}
.freq-bar-w-87{width:87%}
.freq-bar-w-88{width:88%}
.freq-bar-w-89{width:89%}
.freq-bar-w-90{width:90%}
.freq-bar-w-91{width:91%}
.freq-bar-w-92{width:92%}
.freq-bar-w-93{width:93%}
.freq-bar-w-94{width:94%}
.freq-bar-w-95{width:95%}
.freq-bar-w-96{width:96%}
.freq-bar-w-97{width:97%}
.freq-bar-w-98{width:98%}
.freq-bar-w-99{width:99%}
.freq-bar-w-100{width:100%}

@media (max-height: 900px) {
  #disclaimer { padding: 5px 6px; font-size: 12px; margin-bottom: 4px; }
  h1 { font-size: 17px; }
  .subhead, .tagline { font-size: 10px; }
  .section-head { margin: 8px 0 6px; }
  .section-head h2 { font-size: 15px; }
  .model { min-height: 48px; padding: 5px 6px; }
  .model strong { font-size: 12px; }
  .model span { font-size: 10px; }
  .model-list { gap: 4px; margin-top: 8px; }
  .panel { padding: 10px 8px; margin-top: 8px; }
  .balls { margin: 10px 0 8px; }
  .ball { width: 42px; height: 42px; font-size: 16px; }
  .result { margin-top: 8px; padding: 8px 6px 10px; }
  .statgrid { margin-top: 8px; }
}
