/* 素数占い：あたたかいアイボリー × テラコッタ × 金茶の、落ち着いた雑誌風デザイン */
:root {
  --bg: #f6f0e6;          /* 背景：アイボリー */
  --bg-band: #efe5d6;     /* 帯：少し濃いベージュ */
  --card: #ffffff;
  --line: #d9c7a8;        /* 細い金茶の線 */
  --line-soft: #ece2d1;
  --text: #4a3b32;        /* こげ茶の文字 */
  --muted: #8a7a6c;
  --accent: #a65a46;      /* テラコッタ */
  --gold: #a88a5c;        /* 金茶 */
  --gold-soft: #d8c39b;
  --good: #8fb8a4;        /* くすみミント（素数） */
  --pink: #e9c9c0;
  --blue: #c6d7e3;
  --star-off: #e4d8c6;
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "BIZ UDPMincho", serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
}
a { color: var(--accent); }
#sky { display: none; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px 56px; }

/* ===== ヘッダーとメニュー ===== */
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; font-size: 14px; }
.nav .logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-family: var(--mincho); font-weight: bold; font-size: 20px; text-decoration: none; letter-spacing: .08em; }
.nav .logo img { width: 30px; height: 30px; }
.nav ul { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; }
.nav ul a { color: var(--muted); text-decoration: none; }
.nav ul a:hover { color: var(--accent); }

.menu { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--bg-band); margin: 0 -16px 20px; }
.menu a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px 8px; color: var(--text); text-decoration: none; font-size: 11px; font-weight: bold; }
.menu a svg { width: 26px; height: 26px; }
.menu a.on, .menu a:hover { background: var(--bg); }

header.hero-head { text-align: center; padding: 18px 0 8px; }
header .sub { color: var(--gold); letter-spacing: .25em; font-size: 11px; }
h1 { font-family: var(--mincho); font-size: clamp(28px, 7vw, 38px); margin: 4px 0 6px; letter-spacing: .12em; color: var(--text); font-weight: 600; }
header p { color: var(--muted); margin: 0; font-size: 14px; }

/* 見出し（短い下線つき） */
h2 { font-family: var(--mincho); font-size: 20px; font-weight: 600; color: var(--accent); margin: 0 0 14px; letter-spacing: .05em; }
h2::after { content: ""; display: block; width: 28px; height: 2px; background: var(--pink); margin-top: 8px; }
.hero h2::after, .center h2::after { margin-left: auto; margin-right: auto; }

/* ===== タブ ===== */
.tabs { display: flex; gap: 0; margin-bottom: 0; border-bottom: 1px solid var(--line); }
.tab { flex: 1; padding: 11px 4px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: bold; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== カード（角を折ったような飾りつき） ===== */
.card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  padding: 22px 20px; margin-bottom: 18px;
  box-shadow: 5px 5px 0 var(--line-soft);
}
.card::before {
  content: ""; position: absolute; top: -1px; left: -1px; width: 18px; height: 18px;
  background: linear-gradient(135deg, var(--bg) 50%, var(--gold-soft) 50%);
}
form.card { border-top: 0; }
form.card::before { display: none; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: bold; }
input { width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fffdf9; color: var(--text); font: inherit; font-size: 16px; }
input:focus { outline: 2px solid var(--gold-soft); outline-offset: 1px; border-color: var(--gold); }
.row { display: grid; gap: 14px; }
@media (min-width: 560px) { .row.two { grid-template-columns: 1fr 1fr; } }
.btn { display: block; margin-top: 18px; width: 100%; padding: 14px; border: 0; border-radius: 999px; cursor: pointer;
       font: inherit; font-weight: bold; font-size: 17px; color: #fff; text-align: center; text-decoration: none;
       background: var(--gold); box-shadow: 0 3px 0 #8a7049; }
.btn.small { font-size: 15px; padding: 10px; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a7049; }
.hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.error { color: var(--accent); font-size: 14px; margin-top: 8px; min-height: 1em; }
.m0 { margin: 0; }
.mt { margin-top: 14px; }

#result { display: none; }
#result.show { display: block; animation: rise .5s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ===== 結果 ===== */
.hero, #shared { text-align: center; }
.label { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; font-size: 12px; font-weight: bold; color: #fff; background: var(--accent); border-radius: 999px; padding: 2px 12px; }
.illust { width: 120px; height: 120px; margin: 6px auto 0; display: block; }
.bignum { font-family: var(--mincho); font-size: clamp(38px, 11vw, 56px); font-weight: 600; color: var(--accent);
          font-variant-numeric: tabular-nums; letter-spacing: .04em; line-height: 1.25; word-break: break-all; }
.bignum .unit { font-size: .5em; margin-left: 4px; }
.type { font-family: var(--mincho); font-size: 22px; font-weight: 600; margin: 4px 0 2px; }
.equation { font-family: "Consolas", "Menlo", monospace; color: var(--muted); font-size: 13px; word-break: break-all; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.chips.center { justify-content: center; }
.chip { padding: 2px 12px; border-radius: 999px; font-size: 12px; font-weight: bold; background: var(--bg-band); color: var(--text); }
ul.traits { margin: 10px 0 0; padding-left: 1.2em; }
ul.traits li { margin-bottom: 6px; }
ul.traits li::marker { color: var(--gold); }

/* 今日の運勢：順位バッジ風 */
.rank { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0 6px; }
.rank b { font-family: var(--mincho); font-size: 40px; font-weight: 600; color: var(--accent); line-height: 1; }
.rank .seal { display: grid; place-items: center; width: 54px; height: 54px; border: 2px solid var(--gold); color: var(--gold); font-family: var(--mincho); font-weight: bold; font-size: 13px; line-height: 1.2; text-align: center; transform: rotate(-6deg); }
.rank-sub { text-align: center; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.scores { display: grid; gap: 4px; margin: 14px 0; }
.score { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dotted var(--line); padding: 6px 0; font-size: 15px; }
.stars { color: var(--gold); letter-spacing: 2px; }
.stars .off { color: var(--star-off); }
.lucky, .pair { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin-top: 12px; }
.pair { grid-template-columns: 1fr 1fr; margin-top: 14px; }
.lucky div, .pair div { background: var(--bg); border-radius: 8px; padding: 10px 4px; }
.lucky b, .pair b { display: block; font-size: 17px; color: var(--text); word-break: break-all; }
.lucky span, .pair span { font-size: 11px; color: var(--muted); }
.line { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 12px 0 4px; }
.dot { flex: 0 0 auto; min-width: 34px; padding: 4px 6px; text-align: center; border-radius: 6px; font-size: 11px;
       font-variant-numeric: tabular-nums; color: var(--muted); background: var(--bg); }
.dot.p { color: #fff; background: var(--good); font-weight: bold; }
.dot.me { outline: 2px solid var(--accent); color: var(--accent); font-weight: bold; }
.dot.p.me { color: #fff; }
.bond { border-color: var(--accent); background: #fff7f3; }
.next a { display: block; text-align: center; text-decoration: none; color: var(--text); font-weight: bold; }
.next a::after { content: " ›"; color: var(--gold); }
.next b { color: var(--accent); }
.next a + a { margin-top: 10px; padding-top: 10px; border-top: 1px dotted var(--line); }
#shared { border-color: var(--accent); }

/* ===== 共有ボタン ===== */
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
@media (min-width: 560px) { .share-grid { grid-template-columns: repeat(4, 1fr); } .share-grid.two { grid-template-columns: 1fr 1fr; } }
.sns { display: block; width: 100%; padding: 11px 6px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: bold;
       text-align: center; text-decoration: none; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--text); }
.sns:hover { background: var(--bg); }
.sns-x { background: #222; border-color: #222; color: #fff; }
.sns-line { background: #06c755; border-color: #06c755; color: #fff; }
.sns-threads { background: #222; border-color: #222; color: #fff; }
.sns-fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.sns-img { background: var(--accent); border-color: var(--accent); color: #fff; }
.sns-more { margin-bottom: 4px; }

/* ===== 広告枠 ===== */
.ad-slot { margin: 0 0 18px; min-height: 0; text-align: center; }
.ad-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.ad-dummy { border: 1px dashed var(--line); padding: 36px 8px; color: var(--muted); font-size: 12px; background: #fff; }

/* ===== 読み物ページ ===== */
.article h1 { font-size: clamp(24px, 6vw, 32px); text-align: center; margin-top: 14px; }
.article h3 { font-family: var(--mincho); font-size: 17px; margin: 22px 0 6px; color: var(--text); }
.article p, .article li { font-size: 15px; }
.article table { width: 100%; border-collapse: collapse; font-size: 14px; }
.article th, .article td { border-bottom: 1px solid var(--line-soft); padding: 9px 6px; text-align: left; vertical-align: top; }
.article th { color: var(--gold); white-space: nowrap; font-weight: bold; }
.article table.list td:first-child { white-space: nowrap; }
.article td .chips { margin: 4px 0 0; }
.article td .chip { font-size: 11px; padding: 1px 8px; }
.toc { padding-left: 1.4em; margin: 0; }
.toc li::marker { color: var(--gold); }

/* 1〜100 の表（コラム） */
.grid10 { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin-top: 10px; }
.grid10 .dot { min-width: 0; padding: 4px 0; }

footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 10px; }
footer a { color: var(--muted); }
details { color: var(--muted); font-size: 13px; }
details summary { cursor: pointer; color: var(--text); }

/* ===== 生年月日（年・月・日のプルダウン。js/birthpicker.js）===== */
.bdate { display: grid; grid-template-columns: 2.3fr 1fr 1fr; gap: 6px; max-width: 440px; }
.bdate select {
  width: 100%; min-width: 0; font: inherit; font-size: 16px; padding: 12px 22px 12px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: #fffdf9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a7a6c' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center / 10px 6px;
  color: var(--text); -webkit-appearance: none; appearance: none; cursor: pointer;
}
.bdate select:focus { outline: 2px solid var(--gold-soft); outline-offset: 1px; border-color: var(--gold); }
