/* シャリシャリのカード(試し 2026-11-20)= 紙の札・クレヨンの枠・小皿の数
   字体は同じフォルダの fonts\ の写し(Yomogi)を読む(ゲームの v2\fonts は読まない = ティザーの trial\cards\ にも fonts\ を置く) */
@font-face { font-family: "Yomogi"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/yomogi-base.woff2") format("woff2");
  unicode-range: U+0000-33FF, U+FE30-FE4F, U+FF00-FFEF; }
@font-face { font-family: "Yomogi"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/yomogi-kanji.woff2") format("woff2");
  unicode-range: U+3400-9FFF, U+F900-FAFF; }

:root {
  --ink: #4a3422;
  --ink2: #7b6248;
  --paper: #fffaf0;
  --cloth: #f2e4ca;
  /* 持ち主の色: 自分 = みかん色(暖かい)・相手 = すみれ色(寒い)。色が見分けにくい人のため、枠の形(実線 / 点線)と旗の向き(右 / 左)でも分ける */
  --me: #e07b14;
  --me-paper: #ffe4bd;
  --cpu: #6b52c8;
  --cpu-paper: #e2dbfa;
  --hk: #3f8f3a; /* 引き立ての印(+1・六角・スイッチ)= 持ち主の色とぶつからない緑 */
  --go: #4d9a3b;
  --hand: "Yomogi", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .3 0 0 0 0 .18 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100svh; background: var(--cloth) var(--noise); color: var(--ink); font-family: var(--hand); }
button { font: inherit; color: inherit; }

/* ---- 札 ---- */
.cd {
  --frame: #9a7a58;
  position: relative; display: block; flex: none;
  width: var(--w, 180px); aspect-ratio: 3 / 4;
  container-type: inline-size;
  border-radius: 9% / 6.75%;
  background: var(--paper) var(--noise);
  transition: background-color .2s;
  box-shadow: 0 1px 0 rgba(74, 52, 34, .10), 0 4px 10px rgba(74, 52, 34, .20);
  color: var(--ink); font-family: var(--hand); line-height: 1;
  user-select: none; -webkit-user-select: none;
}
.cd[data-owner="me"] { --frame: var(--me); background-color: var(--me-paper); }
.cd[data-owner="cpu"] { --frame: var(--cpu); background-color: var(--cpu-paper); }
.cd-frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.cd-line { fill: none; stroke: var(--frame); stroke-width: 2.3; stroke-linejoin: round; stroke-linecap: round; transition: stroke .2s; }
.cd[data-owner] .cd-line { stroke-width: 4.6; }
.cd[data-owner="cpu"] .cd-line { stroke-dasharray: 7 5.5; }

.cd-art { position: absolute; left: 12%; top: 9%; width: 76%; height: 64%; object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 1.5px 0 rgba(74, 52, 34, .18)); }
/* 地が四角く切れている料理の絵は、丸くぼかして皿だけを見せる(絵そのものには手を入れない) */
.cd-art.soft { top: 11%; height: auto; aspect-ratio: 1; filter: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 78%, transparent 100%); mask-image: radial-gradient(closest-side, #000 78%, transparent 100%); }

/* 味の印(左上)。シャリオ = 6 つの味・シャリー = 味なし */
.cd-taste { position: absolute; left: 4cqw; top: 3.5cqw; width: 19cqw; height: 19cqw; border-radius: 50%;
  background: var(--t, #999); color: #fff; font-size: 11.5cqw; line-height: 19cqw; text-align: center;
  box-shadow: inset 0 0 0 1cqw rgba(255, 255, 255, .28), 0 .6cqw 0 rgba(74, 52, 34, .18); }
.cd-taste.all { background: conic-gradient(#2f86c9 0 60deg, #e2679a 0 120deg, #c49500 0 180deg, #1f8a70 0 240deg, #e2752b 0 300deg, #b5302f 0); }
.cd-taste.none { background: transparent; box-shadow: none; border: 1cqw dashed rgba(74, 52, 34, .55); }

/* 4 辺の数 = 小皿 */
.cd-n { position: absolute; width: 22cqw; height: 22cqw; margin: -11cqw 0 0 -11cqw; border-radius: 50%;
  background: #fffdf7; color: var(--ink);
  box-shadow: 0 0 0 .9cqw rgba(74, 52, 34, .5), 0 1cqw 0 .9cqw rgba(74, 52, 34, .14);
  font-size: 15.5cqw; line-height: 22cqw; text-align: center; transition: background .2s, transform .2s; }
.cd-n0 { left: 50%; top: 8.6%; }
.cd-n1 { left: 88.5%; top: 45%; }
.cd-n2 { left: 50%; top: 91.4%; }
.cd-n3 { left: 11.5%; top: 45%; }
/* 比べて勝った辺・引き立て(+1)・同じ数(シャリー) */
.cd-n.win { background: #ffe27a; transform: scale(1.08); }
.cd-n.up::after, .cd-n.eq::after { position: absolute; left: 62%; top: -38%; padding: 0 .35em; border-radius: 1em;
  background: #fff; color: var(--hk); font-size: 9cqw; line-height: 1.35; white-space: nowrap; box-shadow: 0 0 0 .7cqw var(--hk); }
.cd-n.up::after { content: "+1"; }
.cd-n.eq::after { content: "="; }

.cd-nm { position: absolute; left: 5%; right: 5%; top: 73.5%; font-size: 8.6cqw; line-height: 1.15; text-align: center; white-space: nowrap; overflow: hidden; }

/* 持ち主 = つまようじの旗 */
.cd-pick { position: absolute; right: -3cqw; top: -11cqw; width: 32cqw; height: 32cqw; display: none; pointer-events: none; }
.cd[data-owner] .cd-pick { display: block; }
.cd-pick svg { width: 100%; height: 100%; overflow: visible; }
.pk-stick { stroke: #c79f69; stroke-width: 2.8; stroke-linecap: round; }
.pk-flag { display: none; fill: var(--frame); stroke: rgba(74, 52, 34, .35); stroke-width: .8; stroke-linejoin: round; }
.cd[data-owner="me"] .pk-me, .cd[data-owner="cpu"] .pk-cpu { display: inline; }

/* 小さい札(手札・スマホ)は名前を出さず、絵を大きく */
@container (max-width: 100px) {
  .cd-nm { display: none; }
  .cd-art { top: 13%; height: 74%; }
  .cd-art.soft { top: 13%; height: auto; }
  .cd-n { width: 29cqw; height: 29cqw; margin: -14.5cqw 0 0 -14.5cqw; font-size: 21cqw; line-height: 29cqw; }
  .cd-n0 { top: 11.5%; }
  .cd-n2 { top: 88.5%; }
  .cd-n1 { left: 85%; }
  .cd-n3 { left: 15%; }
  .cd-taste { width: 16cqw; height: 16cqw; font-size: 0; left: 6cqw; top: 6cqw; }
}

/* 味の六角(遊ぶ頁の横の列と、ルールの中の両方で使う)*/
.hx-e { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; opacity: .55; transition: opacity .2s, stroke .2s; }
.hx-v text { fill: #fff; font-family: var(--hand); font-size: 17px; }
.hx-v circle { stroke: rgba(255, 255, 255, .5); stroke-width: 2; transition: transform .2s; transform-box: fill-box; transform-origin: center; }

/* ルール(小窓)。見出しは切り替えの名前と同じ字 */
.howto { width: min(640px, calc(100vw - 24px)); max-height: calc(100svh - 24px); padding: 0; border: 0; border-radius: 20px; overflow: auto;
  background: #fffaf0 var(--noise); color: var(--ink); font-family: var(--hand); box-shadow: 0 0 0 3px rgba(74, 52, 34, .25), 0 18px 40px rgba(74, 52, 34, .35); }
.howto::backdrop { background: rgba(74, 52, 34, .38); }
.hw { padding: 0 20px 22px; }
.hw-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; margin: 0 -20px 4px; padding: 12px 20px 8px; background: #fffaf0; }
.hw-top h2 { margin: 0; font-weight: 400; font-size: 26px; }
.hw-x { width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(74, 52, 34, .08); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; }
.hw section { margin: 0 0 22px; }
.hw h3 { display: inline-block; margin: 0 0 6px; padding: 2px 14px 4px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 400; font-size: 18px; }
.hw p { margin: 0 0 8px; font-size: 16px; line-height: 1.55; }
.hw-fig { display: block; width: 100%; height: auto; margin: 2px 0 0; overflow: visible; }
.hw-row { display: flex; align-items: center; gap: 12px; }
.hw-row .hw-fig { flex: 1; min-width: 0; }
.hw-hex { flex: none; }
.hw-hex .hx { width: 104px; height: 104px; }
.hw-two { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; }
.hw-two p { margin: 0; }
.hw-pal .cd { --w: 84px; }
.hw-pv { padding: 0 6px 1px; border-radius: 999px; background: var(--me); color: #fff; }
.hm-c { fill: #fffdf7; stroke: rgba(74, 52, 34, .5); stroke-width: 1.2; }
.hm-c.hi { fill: #ffe27a; }
.hm-n { fill: var(--ink); font-family: var(--hand); font-size: 12px; text-anchor: middle; }
.hm-t { fill: #fff; font-family: var(--hand); font-size: 9px; text-anchor: middle; }
.hm-p { fill: var(--hk); font-family: var(--hand); font-size: 15px; text-anchor: middle; stroke: #fff; stroke-width: 4px; paint-order: stroke; stroke-linejoin: round; }
.hm-s { fill: var(--ink); font-family: var(--hand); font-size: 13px; text-anchor: middle; }
.hm-a { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 760px) {
  .hw { padding: 0 14px 18px; }
  .hw-top { margin: 0 -14px 4px; padding: 10px 14px 6px; }
  .hw-row { flex-direction: column; align-items: stretch; }
  .hw-hex { align-self: center; }
}
