:root {

  --bg: #f3f4f6;

  --surface: #ffffff;

  --surface-2: #f8fafc;

  --text: #111827;

  --muted: #64748b;

  --line: #e5e7eb;

  --accent: #2563eb;

  --accent-soft: #eff6ff;

  --aim: #7e22ce;

  --aim-soft: #f3e8ff;

  --warn-soft: #fffbeb;

  --danger: #dc2626;

  --danger-soft: #fef2f2;

  --shadow: 0 8px 28px rgba(15, 23, 42, .08);

  --radius: 16px;

}

/* =========================================================

   基本

   ========================================================= */

* {

  box-sizing: border-box;

}

html {

  scroll-behavior: smooth;

  background: var(--bg);

}

body {

  min-height: 100vh;

  margin: 0;

  background: var(--bg);

  color: var(--text);

  font-family:

    -apple-system,

    BlinkMacSystemFont,

    "Segoe UI",

    "Hiragino Kaku Gothic ProN",

    "Yu Gothic",

    Meiryo,

    sans-serif;

  -webkit-text-size-adjust: 100%;

}

button,

input {

  font: inherit;

}

button,

a {

  -webkit-tap-highlight-color: transparent;

}

a {

  color: inherit;

}

img {

  max-width: 100%;

}

.boot {

  padding: 40px 20px;

  text-align: center;

  color: var(--muted);

}

/* =========================================================

   共通ヘッダー

   ========================================================= */

.topbar {

  position: sticky;

  top: 0;

  z-index: 50;

  display: flex;

  align-items: center;

  gap: 10px;

  min-height: 58px;

  padding:

    calc(8px + env(safe-area-inset-top))

    12px

    8px;

  background: rgba(17, 24, 39, .96);

  color: #fff;

  backdrop-filter: blur(12px);

}

.topbar-back {

  flex: 0 0 auto;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  min-width: 42px;

  height: 42px;

  border: 0;

  border-radius: 12px;

  background: rgba(255, 255, 255, .10);

  color: #fff;

  text-decoration: none;

  font-size: 20px;

}

.topbar-title {

  min-width: 0;

  flex: 1;

}

.topbar-title strong {

  display: block;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

  font-size: 16px;

}

.topbar-title small {

  display: block;

  margin-top: 2px;

  color: #cbd5e1;

  font-size: 11px;

}

/* =========================================================
   ホーム
   ========================================================= */

.home {
  width: min(100%, 760px);
  margin: 0 auto;
  padding:
    20px
    14px
    calc(40px + env(safe-area-inset-bottom));
}

.home-title {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -.02em;
}

.home-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.machine-search {
  width: 100%;
  height: 48px;
  margin-bottom: 14px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 12px rgba(15, 23, 42, .04);
}

.machine-search:focus {
  border-color: var(--accent);
}

.machine-grid {
  display: grid;
  gap: 10px;
}

/* 機種カード
   左：機種名・導入日
   右：横長メイン画像 */
.machine-card {
  display: flex;
  align-items: stretch;
  gap: 12px;
  min-height: 112px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 3px 14px rgba(15, 23, 42, .04);
}

.machine-card-main {
  min-width: 0;
  flex: 1 1 44%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 2px 6px 4px;
}

.machine-card-name {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.4;
}

.machine-card-date {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.machine-card-thumb {
  flex: 0 0 54%;
  width: 54%;
  height: 92px;
  overflow: hidden;
  border-radius: 11px;
  background: #f1f5f9;
}

.machine-card-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.machine-card-thumb-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #94a3b8;
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 800;
}

/* =========================================================

   機種ページ

   ========================================================= */

.machine-page {

  width: min(100%, 760px);

  margin: 0 auto;

  padding-bottom:

    calc(48px + env(safe-area-inset-bottom));

}

.machine-hero {

  padding: 18px 14px 14px;

}

.machine-hero-card {

  overflow: hidden;

  border: 1px solid var(--line);

  border-radius: 20px;

  background: var(--surface);

  box-shadow: var(--shadow);

}

.machine-hero-image {

  display: block;

  width: 100%;

  height: auto;

  object-fit: contain;

  background: #fff;

}

.machine-hero-body {

  padding: 16px;

}

.machine-name {

  margin: 0;

  font-size: 23px;

  line-height: 1.35;

  letter-spacing: -.02em;

}

.machine-meta {

  display: flex;

  flex-wrap: wrap;

  gap: 7px;

  margin-top: 11px;

}

.badge {

  display: inline-flex;

  align-items: center;

  min-height: 28px;

  padding: 4px 9px;

  border-radius: 999px;

  background: var(--accent-soft);

  color: #1d4ed8;

  font-size: 12px;

  font-weight: 800;

}

.badge.dark {

  background: #111827;

  color: #fff;

}

/* =========================================================

   上部ナビ

   ========================================================= */

.section-nav-wrap {

  position: sticky;

  top: calc(58px + env(safe-area-inset-top));

  z-index: 40;

  padding: 8px 0;

  background:

    linear-gradient(

      to bottom,

      rgba(243, 244, 246, .98) 75%,

      rgba(243, 244, 246, 0)

    );

}

.section-nav {

  display: flex;

  gap: 7px;

  overflow-x: auto;

  padding: 0 14px 8px;

  scrollbar-width: none;

  -webkit-overflow-scrolling: touch;

}

.section-nav::-webkit-scrollbar {

  display: none;

}

.nav-chip {

  flex: 0 0 auto;

  min-height: 38px;

  padding: 8px 12px;

  border: 1px solid var(--line);

  border-radius: 999px;

  background: var(--surface);

  color: #334155;

  text-decoration: none;

  font-size: 13px;

  font-weight: 700;

  white-space: nowrap;

}

/* =========================================================

   セクション

   ========================================================= */

.machine-content {

  display: grid;

  gap: 12px;

  padding: 0 12px;

}

.content-section {

  scroll-margin-top: 112px;

  overflow: hidden;

  border: 1px solid var(--line);

  border-radius: var(--radius);

  background: var(--surface);

  box-shadow: 0 3px 16px rgba(15, 23, 42, .045);

}

.section-heading {

  margin: 0;

  padding: 15px 16px 13px;

  border-bottom: 1px solid var(--line);

  font-size: 19px;

  line-height: 1.4;

}

.section-body {

  display: grid;

  gap: 14px;

  padding: 15px;

}

.block-title {

  margin: 3px 0 -3px;

  font-size: 15px;

  line-height: 1.5;

}

.text-block {

  margin: 0;

  font-size: 14px;

  line-height: 1.78;

}

.text-block + .text-block {

  margin-top: -5px;

}

.list-block {

  display: grid;

  gap: 7px;

  margin: 0;

  padding-left: 1.35em;

  font-size: 14px;

  line-height: 1.68;

}

.list-block li::marker {

  color: #64748b;

}

/* =========================================================

   強調BOX

   青 = 確認順・情報

   紫 = ゲーム数なしの狙い目

   黄 = 注意

   赤 = 危険・最終判断

   やめどきは色なし

   ========================================================= */

.callout {

  padding: 12px 13px;

  border-radius: 13px;

  background: var(--surface-2);

  font-size: 13px;

  line-height: 1.7;

}

.callout-title {

  margin-bottom: 4px;

  font-weight: 900;

}

/* 青：確認順・情報 */

.callout.info {

  background: var(--accent-soft);

  color: #1e3a8a;

}

/* 紫：ゲーム数のない狙い目 */

.callout.aim {

  background: var(--aim-soft);

  color: var(--text);

}

/* 黄：注意 */

.callout.warn {

  background: var(--warn-soft);

  color: #78350f;

}

/* 赤：危険・最終判断 */

.callout.danger {

  background: var(--danger-soft);

  color: #991b1b;

}

/* =========================================================

   表

   ゲーム数・周期・コレ数の狙い目は基本ここで表示

   strong:true = 赤太字

   ========================================================= */

.table-wrap {

  width: 100%;

  overflow-x: hidden;

  border: 1px solid var(--line);

  border-radius: 13px;

  background: #fff;

}

.data-table {

  width: 100%;

  min-width: 0;

  border-collapse: collapse;

  table-layout: fixed;

  background: #fff;

  font-size: 13px;

}

.data-table caption {

  padding: 10px 11px;

  border-bottom: 1px solid var(--line);

  background: #f8fafc;

  text-align: left;

  font-weight: 900;

}

.data-table th,

.data-table td {

  padding: 10px 7px;

  border-right: 1px solid var(--line);

  border-bottom: 1px solid var(--line);

  text-align: center;

  vertical-align: middle;

  line-height: 1.45;

  white-space: normal;

  overflow-wrap: anywhere;

  word-break: break-word;

}

.data-table th:last-child,

.data-table td:last-child {

  border-right: 0;

}

.data-table tr:last-child td {

  border-bottom: 0;

}

.data-table th {

  background: #f8fafc;

  font-weight: 800;

}

.data-table .strong {

  color: var(--danger);

  font-weight: 900;

}

/* =========================================================

   データカウンター表

   ========================================================= */

/*

  横スクロールさせず、

  5列を表の横幅内に収める

*/

.data-table:has(.counter-bb),

.data-table:has(.counter-rb),

.data-table:has(.counter-highlight) {

  width: 100%;

  min-width: 0;

  table-layout: fixed;

}

/* 時間 */

.data-table:has(.counter-bb) th:nth-child(1),

.data-table:has(.counter-rb) th:nth-child(1),

.data-table:has(.counter-highlight) th:nth-child(1) {

  width: 18%;

}

/* 種別 */

.data-table:has(.counter-bb) th:nth-child(2),

.data-table:has(.counter-rb) th:nth-child(2),

.data-table:has(.counter-highlight) th:nth-child(2) {

  width: 16%;

}

/* スタート */

.data-table:has(.counter-bb) th:nth-child(3),

.data-table:has(.counter-rb) th:nth-child(3),

.data-table:has(.counter-highlight) th:nth-child(3) {

  width: 20%;

}

/* 出玉 */

.data-table:has(.counter-bb) th:nth-child(4),

.data-table:has(.counter-rb) th:nth-child(4),

.data-table:has(.counter-highlight) th:nth-child(4) {

  width: 16%;

}

/* 備考・解説 */

.data-table:has(.counter-bb) th:nth-child(5),

.data-table:has(.counter-rb) th:nth-child(5),

.data-table:has(.counter-highlight) th:nth-child(5) {

  width: 30%;

}

/* BB = 赤 */

.counter-bb {

  background: #fef2f2;

  color: #b91c1c;

  font-weight: 900;

}

/* RB = 青 */

.counter-rb {

  background: #eff6ff;

  color: #1d4ed8;

  font-weight: 900;

}

/* 重要箇所 */

.counter-highlight {

  background: #fff7ed;

  color: #9a3412;

  font-weight: 800;

}

/* =========================================================

   タブ

   ========================================================= */

.tabs {

  overflow: hidden;

  border: 1px solid var(--line);

  border-radius: 14px;

}

.tab-list {

  display: flex;

  gap: 5px;

  overflow-x: auto;

  padding: 6px;

  background: #f1f5f9;

  scrollbar-width: none;

  -webkit-overflow-scrolling: touch;

}

.tab-list::-webkit-scrollbar {

  display: none;

}

.tab-button {

  flex: 0 0 auto;

  min-height: 40px;

  padding: 8px 12px;

  border: 0;

  border-radius: 10px;

  background: transparent;

  color: #475569;

  font-size: 13px;

  font-weight: 800;

  cursor: pointer;

  white-space: nowrap;

}

.tab-button.is-active {

  background: #111827;

  color: #fff;

  box-shadow: 0 2px 8px rgba(15, 23, 42, .12);

}

.tab-panel {

  display: none;

  gap: 13px;

  padding: 14px;

}

.tab-panel.is-active {

  display: grid;

}

/* =========================================================

   折りたたみ

   ========================================================= */

.details-block {

  overflow: hidden;

  border: 1px solid var(--line);

  border-radius: 13px;

  background: #fafafa;

}

/* ページ内リンクで飛んだ時に

   固定ヘッダーの下に隠れにくくする */

.details-block[id] {

  scroll-margin-top: 112px;

}

.details-block summary {

  min-height: 44px;

  padding: 12px 14px;

  cursor: pointer;

  font-size: 13px;

  font-weight: 800;

}

.details-inner {

  display: grid;

  gap: 12px;

  padding: 0 14px 14px;

}

/* =========================================================

   HELPリンク

   ========================================================= */

.inline-help {

  display: inline;

  padding: 0;

  border: 0;

  background: none;

  color: inherit;

  font: inherit;

  text-align: inherit;

  cursor: pointer;

}

.inline-help-label {

  border-bottom: 1px dotted #64748b;

}

.help-dot {

  display: inline-grid;

  place-items: center;

  width: 18px;

  height: 18px;

  margin-left: 3px;

  border-radius: 50%;

  background: #111827;

  color: #fff;

  font-size: 11px;

  font-weight: 900;

  vertical-align: .08em;

}

.inline-link {

  color: #1d4ed8;

  font-weight: 700;

  text-decoration: none;

  border-bottom: 1px dotted #60a5fa;

}

/* =========================================================

   HELPシート

   ========================================================= */

.help-sheet {

  position: fixed;

  inset: 0;

  z-index: 1000;

  display: none;

}

.help-sheet.is-open {

  display: block;

}

.help-backdrop {

  position: absolute;

  inset: 0;

  width: 100%;

  border: 0;

  background: rgba(15, 23, 42, .58);

}

.help-card {

  position: absolute;

  right: 0;

  bottom: 0;

  left: 0;

  width: min(100%, 760px);

  max-height: 86dvh;

  margin: 0 auto;

  overflow-y: auto;

  padding:

    8px

    16px

    calc(18px + env(safe-area-inset-bottom));

  border-radius: 22px 22px 0 0;

  background: #fff;

  box-shadow: 0 -16px 44px rgba(15, 23, 42, .22);

  animation: sheet-in .18s ease-out;

}

@keyframes sheet-in {

  from {

    transform: translateY(20px);

    opacity: .5;

  }

}

.help-grab {

  width: 42px;

  height: 5px;

  margin: 0 auto 7px;

  border-radius: 99px;

  background: #cbd5e1;

}

.help-header {

  display: flex;

  align-items: center;

  gap: 10px;

}

.help-header h2 {

  flex: 1;

  margin: 0;

  font-size: 18px;

}

.help-close {

  display: grid;

  place-items: center;

  width: 42px;

  height: 42px;

  border: 0;

  border-radius: 50%;

  background: #f1f5f9;

  color: #334155;

  font-size: 24px;

  cursor: pointer;

}

.help-context {

  margin-top: 4px;

  color: var(--muted);

  font-size: 12px;

  line-height: 1.6;

}

.help-image {

  display: block;

  width: 100%;

  height: auto;

  max-height: 48dvh;

  margin-top: 14px;

  object-fit: contain;

  border-radius: 14px;

  background: #f1f5f9;

}

.help-body {

  padding: 14px 2px 2px;

  font-size: 14px;

  line-height: 1.75;

}

body.help-open {

  overflow: hidden;

}

/* =========================================================

   スマホ

   ========================================================= */

@media (max-width: 480px) {

  .machine-hero {

    padding:

      12px

      10px

      10px;

  }

  .machine-content {

    padding: 0 8px;

  }

  .section-body {

    padding: 12px;

  }

  .section-heading {

    padding:

      13px

      14px

      12px;

    font-size: 18px;

  }

  .tab-panel {

    padding: 11px;

  }

  .data-table {

    font-size: 11px;

  }

  .data-table th,

  .data-table td {

    padding: 8px 4px;

  }

  .callout {

    padding: 11px 12px;

  }

}

/* =========================================================

   デスクトップ

   ========================================================= */

@media (min-width: 720px) {

  .home {

    padding-top: 34px;

  }

  .machine-grid {

    grid-template-columns:

      repeat(

        2,

        minmax(0, 1fr)

      );

  }

  .machine-content {

    gap: 16px;

    padding: 0 16px;

  }

  .machine-hero {

    padding:

      22px

      16px

      16px;

  }

  .section-body {

    padding: 18px;

  }

  .content-section {

    border-radius: 18px;

  }

}
