@font-face {
  font-family: "Hannari";
  src: url("fonts/HannariMincho-Regular.otf") format("opentype");
  font-display: swap;
}

/* 運命のコンビガチャの色（紫メイン・少し占いの雰囲気）。
   形・余白・部品は推し履歴書分析（design/oshirireki-style.css）と同じにし、色だけをこの変数に置き換える。
   推し履歴書分析の変数との対応：--violet → --violet、--violet-2 → --violet-2、--violet-deep → --violet-deep、
   --panel・--paper・--ink などは同じ名前で色だけ違う。
   どの文字色と背景色の組み合わせも、コントラスト比 4.5 以上を確かめてある（2026-12-03）：
     クリーム文字／紫ボタン 6.70・本文／紙 15.15・薄い文字／紙 5.73・薄い文字／背景 4.95・紫の文字／背景 6.01・本文／金 9.38
   グラデーション・ぼかし・光の効果は使わない。平たい色・太い輪郭・ずらした影だけ。角は丸めない（姉妹サイト共通の決まり） */
:root {
  color-scheme: light;
  --bg: #efe8f4;        /* 机（淡いラベンダー） */
  --panel: #e2d3f0;     /* 「ガチャを回す」などの枠 */
  --panel-2: #d3bde8;
  --paper: #fdfaff;     /* カード・結果の紙 */
  --paper-2: #ece2f5;
  --line: #b7a3c9;      /* 細い区切り線 */
  --ink: #2b1d3a;       /* 本文 */
  --ink-dim: #6e5d80;   /* 補足の文字 */
  --violet: #6c3fa8;    /* 主役の色（ボタン・札・印） */
  --violet-2: #7d4fbb;  /* ボタンを押す前（hover） */
  --violet-deep: #4a2575;
  --gold: #e9c46a;      /* 星・飾り（文字は --ink を乗せる。クリームを乗せない） */
  --gold-deep: #b8892e; /* 金の輪郭 */
  --cream: #fff6e2;     /* 紫の上に乗せる文字 */
  --shadow: #2b1d3a;    /* ずらした影・太い輪郭 */
  /* 左右のキャラの色（好みに寄せるモードの「左」「右」を見分ける。文字だけに頼らず、位置と見出しでも区別する） */
  --left: #6c3fa8;      /* 左：紫 */
  --right: #8a5a12;     /* 右：濃い金（クリーム文字 5.50・紙の上の文字 5.71・背景の上の文字 4.93。#b8892e は白っぽい文字が読みにくい 2.93 のでやめた） */
  /* 背景の点模様（推し履歴書分析と同じ作り。色だけ紫に） */
  --dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Crect width='24' height='24' fill='%23efe8f4'/%3E%3Crect x='11' y='11' width='3' height='3' fill='%23dccdea'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; border-radius: 0 !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
[hidden] { display: none !important; }
body {
  margin: 0;
  overflow-x: hidden;
  min-height: 100vh;
  padding: 24px 16px 40px;
  font-family: "Hannari", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  color: var(--ink);
  background: url("grain.png"), var(--dots) 0 0 / 24px 24px, var(--bg);
}
a { color: var(--violet-deep); }
.desk { max-width: 640px; margin: 0 auto; }

/* ---------- 題 ---------- */
.top { text-align: center; }
.plaque {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 18px 6px 26px;
  font-size: clamp(20px, 5.6vw, 26px);
  font-weight: normal;
  letter-spacing: .4em;
  color: var(--cream);
  background: var(--violet);
  border: 2px solid var(--shadow);
  outline: 2px solid var(--cream);
  outline-offset: -7px;
  box-shadow: 5px 5px 0 var(--shadow);
}
.lead { margin: 6px 0 22px; font-size: clamp(14px, 3.9vw, 16px); line-height: 1.9; }
.note { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-dim); line-height: 1.7; }

/* ---------- ボタン ---------- */
button { font: inherit; color: inherit; cursor: pointer; }
.primary {
  display: inline-block;
  font-size: clamp(17px, 4.6vw, 20px);
  letter-spacing: .14em;
  color: var(--cream);
  background: var(--violet);
  border: 2px solid var(--shadow);
  outline: 2px solid var(--cream);
  outline-offset: -6px;
  padding: 12px 34px 12px 38px;
  box-shadow: 5px 5px 0 var(--shadow);
}
.primary.small { font-size: 16px; padding: 9px 20px 9px 22px; letter-spacing: .08em; }
.primary:hover { background: var(--violet-2); }
.primary:active { transform: translate(5px, 5px); box-shadow: none; }
.primary:disabled { opacity: .4; cursor: default; transform: none; box-shadow: 5px 5px 0 var(--shadow); }
.sub {
  font-size: 15px;
  padding: 8px 16px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--shadow);
  box-shadow: 3px 3px 0 var(--shadow);
}
.sub:hover { background: var(--paper-2); }
.sub:active { transform: translate(3px, 3px); box-shadow: none; }
.sub:disabled { opacity: .35; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* ---------- 推しを書き足す ---------- */
.pen {
  margin: 0 0 22px;
  padding: 14px 14px 16px;
  background: var(--panel);
  border: 2px solid var(--shadow);
  outline: 1px solid var(--violet);
  outline-offset: -6px;
  box-shadow: 5px 5px 0 var(--shadow);
}
.pen-h { margin: 0 0 6px; font-size: 15px; font-weight: normal; letter-spacing: .3em; color: var(--violet-deep); text-align: center; }
.kind { margin-left: .5em; padding: 0 4px; border: 1px solid var(--ink-dim); font-size: 10.5px; white-space: nowrap; }
.custom { margin: 12px 0 0; }
.custom summary { cursor: pointer; font-size: 13.5px; color: var(--ink-dim); }
.custom form, .req-form { padding: 4px 0 0; }
.custom label, .req-form label { display: block; margin: 8px 0; font-size: 13px; color: var(--ink-dim); }
.custom input:not([type]), .req-form input, .req-form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 2px solid var(--shadow);
}
.custom .check { display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; }
.custom .check input { margin-top: 3px; }
.req-msg { margin: 8px 0 0; font-size: 13px; color: var(--violet-deep); }
.card {
  margin: 0 0 18px;
  padding: 14px 14px 16px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--shadow);
  box-shadow: 5px 5px 0 var(--shadow);
}
.req { margin: 30px 0 0; }
.req details { margin: 0 0 10px; padding: 0 14px; background: var(--panel); border: 2px solid var(--shadow); box-shadow: 3px 3px 0 var(--shadow); }
.req summary { padding: 10px 0; cursor: pointer; font-size: 14px; }
.req-form { padding-bottom: 14px; }
.db-open { display: block; width: 100%; margin: 4px 0 0; }
.credit { margin: 18px 0 0; font-size: 12px; color: var(--ink-dim); line-height: 1.7; }
.db { width: min(560px, 94vw); max-height: 86vh; padding: 0; color: var(--ink); background: var(--bg); border: 2px solid var(--shadow); box-shadow: 6px 6px 0 var(--shadow); }
.db::backdrop { background: #2b1d3acc; }
.db-top { position: sticky; top: 0; padding: 12px 14px 8px; background: var(--panel); border-bottom: 2px solid var(--shadow); }
.db-head { display: flex; align-items: center; justify-content: space-between; }
.db-head h2 { margin: 0; font-size: 16px; font-weight: normal; letter-spacing: .2em; color: var(--violet-deep); }
.db-close { width: 36px; height: 36px; font-size: 20px; color: var(--ink); background: var(--paper); border: 2px solid var(--shadow); }
.db-q { display: block; width: 100%; margin: 10px 0 6px; padding: 8px; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 2px solid var(--shadow); }
.db-count { margin: 0; font-size: 12px; color: var(--ink-dim); }
.db-list { padding: 8px 12px 14px; }
.db-item { margin: 0 0 8px; padding: 8px 10px; color: var(--ink); background: var(--paper); border: 2px solid var(--shadow); }
.db-item .work { margin: 0; font-size: 12px; color: var(--ink-dim); }
.db-item .name { margin: 0; font-size: 16px; font-weight: normal; }
.db-item .name a { color: var(--ink); }
.db-item .tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; font-size: 12px; }
.db-item .tags span { padding: 0 6px; border: 1px solid var(--line); background: #fff; }
.db-item .tags.deep span { color: var(--ink-dim); border-style: dashed; }

footer { margin: 34px 0 0; text-align: center; font-size: 12px; color: var(--ink-dim); line-height: 1.9; }
footer p { margin: 0; }
footer .sep { margin: 0 .6em; }

.chips-x { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 0 0 12px; }
.chips-x b { padding: 2px 10px; font-weight: normal; font-size: 17px; color: var(--cream); background: var(--violet); border: 2px solid var(--shadow); box-shadow: 2px 2px 0 var(--shadow); }
.chips-x i { font-style: normal; color: var(--ink-dim); }
@keyframes stamp { from { opacity: 0; transform: scale(2.6) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes thud { 0% { transform: translate(0, 4px); } 50% { transform: translate(2px, -2px); } 100% { transform: none; } }
.tagin-lab { margin: 8px 0 4px; font-size: 13px; color: var(--ink-dim); }
.tagin { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 46px; padding: 6px; background: var(--paper); border: 2px solid var(--shadow); cursor: text; }
.tagin .tg { display: inline-flex; align-items: center; gap: 2px; padding: 1px 2px 1px 8px; font-size: 14px; color: var(--cream); background: var(--violet); border: 1px solid var(--shadow); }
.tagin .tg.unk { color: var(--ink); background: var(--paper-2); border-style: dashed; }
.tagin .tg button { width: 22px; padding: 0; font-size: 13px; color: inherit; background: none; border: 0; }
#tagin-chips { display: contents; }
.tagin input { flex: 1; min-width: 8em; padding: 4px; font: inherit; font-size: 16px; color: var(--ink); background: transparent; border: 0; outline: none; }
.custom .tagin input { display: block; flex: 1; width: auto; min-width: 8em; margin: 0; padding: 4px; border: 0; background: transparent; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.pen-h { margin: 0 auto 9px; padding: 0; letter-spacing: .14em; }
.kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kinds label { position: relative; cursor: pointer; }
.kinds input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.kinds span {
  display: block; padding: 8px 2px; text-align: center; white-space: nowrap;
  background: var(--paper); border: 2px solid var(--shadow); box-shadow: 2px 2px 0 var(--shadow);
}
.kinds input:checked + span { color: var(--cream); background: var(--violet); box-shadow: none; }
.kinds input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }
.options { display: flex; justify-content: center; gap: clamp(8px, 3vw, 22px); margin: 17px 0; }
.options label { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: clamp(12px, 3.4vw, 15px); }
input[type="checkbox"] { accent-color: var(--violet); }
.options input { margin: 0; }
.draw, .draw-msg { text-align: center; }
.sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#preferences { margin: 0 0 16px; }
#preferences section { padding: 8px; border: 1px solid var(--line); background: var(--paper); }
#preferences h2 { margin: 0 0 5px; font-size: 14px; color: var(--left); }
#preferences section + section h2 { color: var(--right); }
#preferences .sub, #custom-list .sub { padding: 3px 8px; font-size: 12px; white-space: nowrap; }
#preferences .sub { margin-top: 6px; }
.result { overflow: clip; text-align: center; scroll-margin-top: 14px; }
.pen, .result { background-image: url("grain.png"); }
#result-action .draw { margin-top: 14px; }
.duo-grid, .reels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(4px, 1.3vw, 10px);
}
.amp {
  grid-column: 2; grid-row: 1; align-self: start;
  display: grid; place-items: center; min-height: 82px;
  font-size: clamp(19px, 5vw, 30px); color: var(--violet-deep);
}
.duo-grid { row-gap: 0; }
.duo-grid .amp { align-self: stretch; }
.person { grid-column: 1; grid-row: 1; min-width: 0; text-align: left; overflow-wrap: anywhere; }
.person.right { grid-column: 3; }
@supports (grid-template-rows: subgrid) {
  .person { display: grid; grid-row: span 2; grid-template-rows: subgrid; }
}
.reel {
  margin: 0; min-height: 82px; padding: 8px 5px;
  border: 2px solid var(--shadow); box-shadow: 3px 3px 0 var(--shadow);
  background: url("grain.png") var(--paper-2); color: var(--ink);
  outline: 1px solid var(--line); outline-offset: -5px;
}
.person .name {
  display: grid; place-items: center; text-align: center;
  min-height: 82px; margin: 0; padding: 8px 5px;
  font-size: clamp(18px, 4.8vw, 29px); font-weight: normal; line-height: 1.3;
}
.person .name a { min-width: 0; max-width: 100%; color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
.person .work { margin: 9px 0 0; font-size: 12px; color: var(--ink-dim); }
.person .intro { margin: 7px 0; font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 7px 0; }
.tags .tg { padding: 1px 5px; font-size: 12px; overflow-wrap: anywhere; border: 1px solid var(--line); background: var(--paper); }
.like { padding: 4px 9px; margin: 4px 0; font-size: 13px; white-space: nowrap; }
.like[aria-pressed="true"] { color: var(--cream); background: var(--left); opacity: 1; }
.person.right .like[aria-pressed="true"] { background: var(--right); }
.reel {
  --speed: .35s;
  height: 82px; padding: 0; overflow: hidden; font-size: 34px; text-align: center;
}
.reel:last-child { --speed: .49s; grid-column: 3; }
.reel span { display: block; line-height: 78px; animation: roll var(--speed) steps(8) infinite; }
@keyframes roll { to { transform: translateY(-400%); } }
.result.reveal .person { animation: land .19s steps(3) both; }
.result.reveal .person.right { animation-delay: .17s; }
@keyframes land {
  from { visibility: hidden; transform: translateY(-16px); }
  65% { visibility: visible; transform: translateY(4px); }
  to { visibility: visible; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .reel span, .result.reveal .person { animation: none; } }
@media (max-width: 390px) { .options { gap: 8px; } .options label { font-size: 12px; } }
.req > .custom { margin-top: 12px; }
.custom form { padding-bottom: 14px; }
.custom select { display: block; width: 100%; margin-top: 4px; padding: 7px; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 2px solid var(--shadow); }
.tagin:focus-within { outline: 2px solid var(--violet); outline-offset: 2px; }
#custom-list { margin: 0 0 12px; padding: 0; list-style: none; }
#custom-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.db-item { overflow-wrap: anywhere; }
