/* ジャンボガチャ — モバイルファースト（基本はスマホ、min-width で広げる） */
:root{
  --red:#e0002a;--red-d:#b80022;--red-soft:#fff0f2;
  --purple:#3a1670;--purple-d:#2a0f52;--purple-soft:#f4effc;
  --gold:#f5b800;--gold-l:#ffd84a;--gold-soft:#fff7d6;
  --blue:#1769d1;--blue-soft:#eaf2fd;
  --ink:#1d1428;--ink-2:#463c55;--muted:#7a7088;--line:#ece6f2;--bg:#f7f5fa;--card:#fff;
  --ok:#0a8a5a;--ok-soft:#e9f8f1;--wait:#b26b00;--done:#5d5670;--done-soft:#f2f0f5;
  --r:16px;--shadow:0 1px 2px rgb(29 20 40/.06),0 6px 18px rgb(29 20 40/.08);
  --font:"Hiragino Maru Gothic ProN","Hiragino Sans","BIZ UDPGothic","Noto Sans JP",system-ui,sans-serif;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-padding-top:150px}
body{margin:0;font-family:var(--font);color:var(--ink);background:var(--bg);line-height:1.8;font-feature-settings:"palt";-webkit-tap-highlight-color:transparent}
body.locked{overflow:hidden}
a{color:var(--red-d);text-underline-offset:3px}
:focus-visible{outline:3px solid var(--gold);outline-offset:2px;border-radius:6px}
.ic{width:22px;height:22px;flex:none}

/* ===== header ===== */
header.site{position:sticky;top:0;z-index:20;background:#fff;box-shadow:0 2px 10px rgb(29 20 40/.08)}
header.site .bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 10px 6px 14px;max-width:1120px;margin:auto}
.logo{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--purple-d);font-weight:900;font-size:1.22rem;letter-spacing:-.03em;line-height:1;white-space:nowrap;flex:none}
.logo .mark{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--red);color:#fff;font-size:.95rem;box-shadow:inset 0 -2px 0 rgb(0 0 0/.15)}
.logo img{display:block;height:34px;width:auto}
.logotext{background:linear-gradient(180deg,var(--purple) 0 60%,var(--red-d));-webkit-background-clip:text;background-clip:text;color:transparent;filter:drop-shadow(0 1px 0 rgb(0 0 0/.08))}
.tools{display:flex;gap:2px}
.tools button{display:flex;flex-direction:column;align-items:center;gap:1px;background:none;border:0;padding:4px 6px;color:var(--ink-2);font:inherit;font-size:.56rem;font-weight:700;cursor:pointer;border-radius:10px;min-width:44px;white-space:nowrap;letter-spacing:-.04em}
.tools button:active{background:var(--done-soft)}
.mainnav{display:flex;background:var(--red);overflow-x:auto;scrollbar-width:none}
.mainnav::-webkit-scrollbar,.subnav::-webkit-scrollbar{display:none}
.mainnav a{flex:1 0 auto;min-width:62px;display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 6px 7px;color:#fff;text-decoration:none;font-size:.72rem;font-weight:800;position:relative}
.mainnav a .ic{width:22px;height:22px}
.mainnav a[aria-current]{background:var(--red-d)}
.mainnav a[aria-current]::after{content:"";position:absolute;left:18%;right:18%;bottom:0;height:4px;border-radius:4px 4px 0 0;background:var(--gold-l)}
.subnav{display:flex;background:var(--purple);overflow-x:auto;scrollbar-width:none}
.subnav a{flex:1 0 auto;padding:7px 12px;color:#fff;text-decoration:none;font-size:.8rem;font-weight:800;text-align:center;white-space:nowrap;position:relative}
.subnav a+a::before{content:"";position:absolute;left:0;top:30%;bottom:30%;width:1px;background:rgb(255 255 255/.4)}
.subnav a[aria-current]{color:var(--gold-l)}

/* ===== sheet (menu / fav / history) ===== */
.panel-sheet{position:fixed;inset:0;z-index:50;background:rgb(20 10 35/.45);display:flex;align-items:flex-end}
.panel-sheet[hidden]{display:none}
.sheet{background:#fff;width:100%;max-height:82vh;overflow:auto;border-radius:20px 20px 0 0;padding:6px 18px 28px;animation:up .2s ease-out}
@keyframes up{from{transform:translateY(30px);opacity:.4}to{transform:none;opacity:1}}
.sheet-head{display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:#fff;padding:10px 0;border-bottom:1px solid var(--line)}
.sheet-head h2{margin:0;font-size:1.05rem;border:0;padding:0}
.sheet-head h2::after{display:none}
.sheet-close{background:none;border:0;padding:8px;color:var(--ink-2);cursor:pointer}
.sheet h3{font-size:.8rem;color:var(--muted);margin:16px 0 4px}
.sheet ul{list-style:none;margin:0;padding:0}
.sheet li a{display:block;padding:11px 4px;border-bottom:1px solid var(--line);color:var(--ink);text-decoration:none;font-weight:700}
.sheet .empty{color:var(--muted);font-size:.9rem;margin:18px 0}

/* ===== hero (top page) ===== */
/* 背景はAI生成の招き猫イラスト（スマホは正方形、PCは横長）。左側に暗いグラデーションを重ねて文字を読みやすくする */
.hero{position:relative;overflow:hidden;color:#fff;background:#160a30;min-height:min(100vw,560px);display:flex;align-items:flex-start}
.hero-bg img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:70% 100%}
.hero::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(90deg,rgb(14 6 38/.82) 0%,rgb(14 6 38/.55) 42%,rgb(14 6 38/0) 68%),
             linear-gradient(0deg,rgb(14 6 38/.55) 0%,rgb(14 6 38/0) 35%)}
.hero-in{position:relative;z-index:1;width:100%;max-width:1120px;margin:0 auto;padding:16px 16px 22px}
.hero-tag{display:inline-block;margin:0 0 8px;padding:3px 14px;border-radius:999px;background:rgb(255 255 255/.92);color:var(--ink);font-size:.78rem;font-weight:900}
.hero-h1{margin:0;font-size:clamp(1.5rem,.8rem + 4.6vw,3.4rem);line-height:1.3;font-weight:900;letter-spacing:-.01em;text-shadow:0 2px 0 rgb(0 0 0/.4),0 0 18px rgb(0 0 0/.45)}
.hero-h1 .nw{white-space:nowrap}
.hero-h1 .hl{color:var(--gold-l);text-shadow:0 2px 0 #7a3b00,0 0 16px rgb(255 190 0/.4)}
.hero-h1 .to{font-size:.72em;margin:0 .05em}
.hero-h1 .u{position:relative;white-space:nowrap}
.hero-h1 .u::after{content:"";position:absolute;left:-4%;right:-6%;bottom:-.16em;height:.3em;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'%3E%3Cpath d='M4 16 C60 6 140 4 296 10 C200 12 120 16 40 22' fill='none' stroke='%23e0002a' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center/100% 100%}
.hero-sub{margin:14px 0 0;font-size:.74rem;line-height:1.65;font-weight:700;max-width:52%;text-shadow:0 1px 3px rgb(0 0 0/.8)}

/* ===== layout ===== */
main{max-width:1120px;margin:auto;padding:12px 14px 48px}
.crumbs{font-size:.74rem;color:var(--muted);margin:2px 0;white-space:nowrap;overflow-x:auto}
.crumbs a{color:var(--muted)}
.h1row{display:flex;flex-direction:column;gap:6px;margin:.3em 0 .6em}
h1{font-size:clamp(1.38rem,1.05rem + 1.6vw,2rem);line-height:1.4;font-weight:900;margin:0}
.fav-toggle{align-self:flex-start;display:inline-flex;align-items:center;gap:4px;background:#fff;color:var(--ink-2);border:1px solid var(--line);border-radius:999px;padding:4px 12px 4px 8px;font:inherit;font-size:.78rem;font-weight:700;cursor:pointer}
.fav-toggle .ic{width:16px;height:16px}
.fav-toggle.on{color:#a86f00;border-color:var(--gold);background:var(--gold-soft)}
.fav-toggle.on .ic{fill:var(--gold)}
h2{font-size:1.15rem;line-height:1.5;font-weight:900;margin:2.2em 0 .7em;padding-bottom:.35em;border-bottom:2px solid var(--line);position:relative}
h2::after{content:"";position:absolute;left:0;bottom:-2px;width:56px;height:2px;background:var(--red)}
h3{font-size:1rem;margin:1.6em 0 .5em}
p,ul,ol{margin:.6em 0}
ul,ol{padding-left:1.3em}
.lead{font-size:1rem;color:var(--ink-2)}
.small{font-size:.84rem;color:var(--muted)}

/* ===== section titles & cards (top) ===== */
.sec{margin:22px 0 8px}
.sec-title{display:flex;align-items:center;gap:8px;margin:0 0 12px;font-size:1.06rem;border-bottom:2px solid var(--line)}
.sec-title::after{width:100%;background:linear-gradient(90deg,var(--red),var(--purple) 70%,transparent)}
.sec-title .ic{width:28px;height:28px;color:var(--red)}
.pcards{display:grid;gap:10px}
.pcard{display:grid;grid-template-columns:52px 1fr auto;align-items:center;gap:10px;background:var(--card);border-radius:var(--r);padding:12px 12px 12px 10px;text-decoration:none;color:inherit;box-shadow:var(--shadow);border:1px solid var(--line);transition:transform .12s}
.pcard:active{transform:scale(.985)}
.pc-ic{display:grid;place-items:center;width:52px;height:52px}
.pc-ic .ic{width:40px;height:40px}
.pc-txt{display:flex;flex-direction:column;min-width:0}
.pc-title{font-weight:900;font-size:1.06rem;line-height:1.35}
.pc-desc{font-size:.74rem;color:var(--ink-2);line-height:1.5;margin-top:2px}
.pc-btn{display:inline-flex;align-items:center;gap:2px;background:linear-gradient(180deg,#ff2448,var(--red-d));color:#fff;font-size:.74rem;font-weight:800;padding:8px 8px 8px 12px;border-radius:10px;white-space:nowrap;box-shadow:0 2px 0 #8a0019}
.pc-btn .ic{width:14px;height:14px;stroke-width:3}
.c-gold .pc-ic,.c-gold .pc-title{color:#d99a00}
.c-red .pc-ic,.c-red .pc-title{color:var(--red)}
.c-purple .pc-ic,.c-purple .pc-title{color:#5a2aa8}
.c-blue .pc-ic,.c-blue .pc-title{color:var(--blue)}
.c-gold .pc-title{color:#9a6a00}

/* ===== top text box ===== */
.textbox{background:var(--card);border:1px solid var(--line);border-top:5px solid var(--red);border-radius:var(--r);box-shadow:var(--shadow);padding:6px 16px 18px;margin:28px 0 8px;line-height:1.9}
.textbox h2{margin-top:1.4em;font-size:1.12rem}
.textbox h2:first-child{margin-top:.8em}
.textbox h3{font-size:.98rem;margin:1.5em 0 .4em;padding-left:10px;border-left:4px solid var(--gold)}
.textbox p{font-size:.92rem;color:var(--ink-2)}
.textbox strong{background:linear-gradient(transparent 62%,var(--gold-soft) 62%)}
.steps{list-style:none;counter-reset:st;padding:0;margin:12px 0}
.steps li{counter-increment:st;position:relative;padding:10px 0 10px 44px;border-bottom:1px dashed var(--line);font-size:.92rem;color:var(--ink-2)}
.steps li::before{content:counter(st);position:absolute;left:0;top:10px;width:30px;height:30px;border-radius:50%;background:var(--red);color:#fff;font-weight:900;display:grid;place-items:center;font-size:.9rem}
.steps li strong{display:block;color:var(--ink);background:none}
@media (min-width:640px){.textbox{padding:10px 32px 26px}}

/* ===== generic panels / forms ===== */
.note,.panel{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:16px;margin:20px 0;box-shadow:var(--shadow)}
.panel label{display:inline-flex;align-items:center;gap:8px;margin:0 14px 12px 0;font-weight:800;font-size:.9rem}
#sim label{display:flex;flex-direction:column;align-items:stretch;gap:4px;margin-right:0}
input,select,button{font:inherit;font-size:1rem;padding:9px 12px;border:1px solid #d6cde2;border-radius:12px;background:#fff;color:var(--ink);max-width:100%}
input{width:10em}
input:focus,select:focus{border-color:var(--red);outline:none;box-shadow:0 0 0 3px rgb(224 0 42/.15)}
button{background:var(--red);border-color:var(--red);color:#fff;font-weight:800;cursor:pointer}
.quick{display:flex;flex-wrap:wrap;gap:8px}
.quick button{background:var(--red-soft);color:var(--red-d);border-color:#ffc7d1;padding:6px 14px;border-radius:999px;font-size:.9rem}
.result{background:var(--gold-soft);border-left:5px solid var(--gold);border-radius:12px;padding:12px 14px;font-weight:800;line-height:1.7}

/* ===== status badge ===== */
.status{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;border-radius:14px;padding:10px 14px;margin:12px 0;font-size:.88rem;border:1px solid}
.status b{font-size:.72rem;padding:2px 10px;border-radius:999px;color:#fff;white-space:nowrap}
.status.on{background:var(--ok-soft);border-color:#b4ead3}.status.on b{background:var(--ok)}
.status.wait{background:var(--gold-soft);border-color:#ffe28a}.status.wait b{background:var(--wait)}
.status.done{background:var(--done-soft);border-color:var(--line)}.status.done b{background:var(--done)}

/* ===== tables ===== */
.tbl{overflow-x:auto;border:1px solid var(--line);border-radius:var(--r);background:var(--card);box-shadow:var(--shadow);margin:14px 0;-webkit-overflow-scrolling:touch}
table{border-collapse:collapse;width:100%;font-size:.88rem}
th,td{padding:9px 11px;text-align:left;vertical-align:top;border-bottom:1px solid var(--line)}
tbody tr:last-child>*{border-bottom:0}
thead th{background:var(--purple);color:#fff;font-size:.76rem;font-weight:800;white-space:nowrap}
tbody th{background:#faf8fc;font-weight:800;white-space:nowrap}
td.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.formula{background:var(--purple-d);color:#efe8fb;padding:12px 14px;border-radius:12px;font-size:.82rem;overflow-x:auto;font-family:ui-monospace,Menlo,monospace}

/* ===== generators ===== */
.gen .go{width:100%;padding:12px;border-radius:999px;border:0;font-size:1.05rem;background:linear-gradient(180deg,#ff2448,var(--red-d));box-shadow:0 3px 0 #8a0019}
.gen .go:active{transform:translateY(2px);box-shadow:0 1px 0 #8a0019}
.picks{list-style:none;counter-reset:n;padding:0;margin:14px 0 0}
.picks li{counter-increment:n;display:flex;flex-wrap:wrap;align-items:center;gap:5px;padding:8px 0;border-top:1px dashed var(--line)}
.picks li::before{content:counter(n) "口目";width:3.2em;font-size:.74rem;color:var(--muted)}
.ball{display:grid;place-items:center;width:2.2em;height:2.2em;border-radius:50%;font-weight:900;font-variant-numeric:tabular-nums;color:var(--ink);background:radial-gradient(circle at 30% 30%,#fff8d8,var(--gold) 72%);box-shadow:inset 0 -2px 4px rgb(0 0 0/.15),0 1px 2px rgb(0 0 0/.12);animation:pop .25s ease-out both}
@keyframes pop{from{transform:scale(.6);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.ball,.sheet{animation:none}.pcard{transition:none}}

/* ===== sources & footer ===== */
.sources{margin-top:2.6em;font-size:.8rem;color:var(--muted);background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:2px 16px 10px}
.sources h2{font-size:.92rem;margin-top:1em}
.sources a{word-break:break-all}
footer.site{background:var(--purple-d);color:#c9bedb;font-size:.78rem;line-height:1.8}
footer.site .inner{max-width:1120px;margin:auto;padding:24px 16px 32px}
footer.site a{color:#fff}
.flinks{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:12px}

/* ===== tablet / PC ===== */
@media (min-width:640px){
  .hero{min-height:380px;align-items:center}
  .hero-in{margin:auto}
  .hero-h1 br.sp{display:none}
  .hero-sub{max-width:60%;font-size:.9rem}
  .hero-bg img{object-position:right center}
  .hero-in{padding:34px 24px 40px}
  .hero-sub{font-size:.95rem}
  .pcards{grid-template-columns:repeat(2,1fr)}
  .h1row{flex-direction:row;align-items:center;justify-content:space-between}
  .fav-toggle{align-self:center;flex:none}
  main{padding:16px 24px 56px}
}
@media (min-width:960px){
  .hero{min-height:520px}
  .hero-bg img{object-position:right 22%}
  .hero-h1,.hero-sub{max-width:56%}
  header.site .bar{padding:10px 24px}
  .logo img{height:48px}
  .tools button{flex-direction:row;gap:6px;font-size:.85rem;padding:8px 12px}
  .mainnav,.subnav{justify-content:center}
  .mainnav a{flex:0 1 auto;flex-direction:row;gap:8px;padding:12px 22px;font-size:1rem}
  .subnav a{flex:0 1 auto;padding:10px 28px;font-size:.95rem}
  .hero-in{padding:52px 32px 60px}
  .pcards{grid-template-columns:repeat(4,1fr);gap:14px}
  .pcard{grid-template-columns:1fr;justify-items:center;text-align:center;padding:20px 14px 16px;gap:8px}
  .pcard:hover{transform:translateY(-3px)}
  .pc-ic{width:64px;height:64px}.pc-ic .ic{width:54px;height:54px}
  .pc-title{font-size:1.3rem}
  .pc-desc{font-size:.85rem}
  .pc-btn{width:100%;justify-content:center;font-size:.9rem;padding:10px}
  .sheet{max-width:440px;margin-left:auto;height:100vh;max-height:none;border-radius:0}
  .panel-sheet{align-items:stretch}
}
