:root { --bg:#EAE8E4; --text:#2B2B2B; --mid:#555; --dim:#818181; --line:#D6D3CC; }
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
body { font-family:'M PLUS Rounded 1c',sans-serif; font-weight:500; background:var(--bg); color:var(--text); line-height:1.9; -webkit-font-smoothing:antialiased; }
img { max-width:100%; display:block; }
a { color:var(--text); }
h1,h2,h3 { font-weight:800; }

.demo-note { background:#FFF3D6; border-bottom:1px solid #E8D9A8; color:#6B5E3E; font-size:0.75rem; font-weight:700; text-align:center; padding:6px 12px; }
.head { position:sticky; top:0; z-index:100; background:#fff; display:flex; align-items:center; gap:6px; padding:8px 12px; border-bottom:1px solid var(--line); min-height:52px; }
.head .logo { display:flex; align-items:center; gap:8px; font-weight:800; font-size:0.95rem; text-decoration:none; white-space:nowrap; }
.head .logo img { width:30px; height:30px; border-radius:50%; }
.head .logo span { font-weight:700; font-size:0.8em; color:var(--mid); }
.head .who { margin-left:auto; font-size:0.72rem; color:var(--dim); font-weight:700; text-align:right; line-height:1.5; }

.page-title { text-align:center; padding:30px 20px 4px; }
.page-title h1 { font-size:1.35rem; }
.page-title h1::after { content:""; display:block; width:44px; height:3px; background:var(--text); border-radius:2px; margin:10px auto 0; }
.page-title p { font-size:0.82rem; color:var(--mid); margin-top:10px; }
.wrap { max-width:760px; margin:0 auto; padding:10px 18px 60px; }
section { margin-top:34px; }
.sec-h { margin-bottom:14px; border-bottom:1px solid var(--line); padding-bottom:6px; display:flex; align-items:baseline; gap:8px; }
.sec-h h2 { font-size:0.82rem; letter-spacing:0.08em; }
.sec-h .opt { font-size:0.68rem; color:var(--dim); font-weight:700; margin-left:auto; }
.box { background:#fff; border-radius:6px; padding:20px 18px; }

.f { margin-bottom:18px; }
.f:last-child { margin-bottom:0; }
.f label { display:block; font-size:0.8rem; font-weight:800; }
.f .hint { display:block; font-size:0.72rem; color:var(--dim); font-weight:500; margin:2px 0 6px; }
.f input[type=text], .f select, .f textarea {
  width:100%; font-family:inherit; font-size:0.86rem; font-weight:500; color:var(--text); line-height:1.8;
  background:#fff; border:1px solid var(--line); border-radius:4px; padding:8px 10px;
}
.f textarea { resize:vertical; min-height:88px; }
.f input:focus, .f select:focus, .f textarea:focus { outline:none; border-color:var(--text); }
.f .count { font-size:0.68rem; color:var(--dim); text-align:right; margin-top:2px; }

.yr { border:1px solid var(--line); border-radius:4px; margin-bottom:10px; overflow:hidden; }
.yr .yh { display:flex; align-items:center; gap:8px; background:#F6F5F2; border-bottom:1px solid var(--line); padding:6px 10px; }
.yr .yh input { width:6.5em; font-family:inherit; font-weight:800; font-size:0.82rem; background:#fff; border:1px solid var(--line); border-radius:3px; padding:3px 6px; }
.yr .yh .del { margin-left:auto; background:none; border:none; font-family:inherit; font-size:0.72rem; font-weight:700; color:var(--dim); cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
.yr textarea { width:100%; border:none; border-radius:0; font-family:inherit; font-size:0.84rem; line-height:1.9; padding:8px 10px; min-height:80px; resize:vertical; }
.yr textarea:focus { outline:none; background:#FCFBF9; }
.add { background:#fff; border:1px dashed var(--line); border-radius:4px; width:100%; padding:9px; font-family:inherit; font-size:0.78rem; font-weight:700; color:var(--mid); cursor:pointer; }
.add:hover { border-color:var(--text); color:var(--text); }

.photo-row { display:grid; grid-template-columns:88px 1fr; gap:14px; align-items:center; }
.photo-row .ph { width:88px; height:88px; border-radius:50%; background:#F1EFEB; border:1px solid var(--line); display:flex; align-items:center; justify-content:center; font-size:0.68rem; color:var(--dim); font-weight:700; overflow:hidden; }
.photo-row .ph img { width:100%; height:100%; object-fit:cover; }

.bar { position:sticky; bottom:0; background:rgba(234,232,228,0.96); border-top:1px solid var(--line); padding:12px 18px calc(12px + env(safe-area-inset-bottom)); margin:34px -18px -60px; text-align:center; }
.btn { display:inline-block; background:#1c1c1c; color:#fff; text-decoration:none; font-family:inherit; font-weight:700; font-size:0.88rem; padding:13px 34px; border-radius:999px; border:none; cursor:pointer; }
.btn.line2 { background:#fff; color:#1c1c1c; border:1.5px solid #1c1c1c; }
.bar .saved { font-size:0.72rem; color:var(--dim); margin-top:8px; }

/* --- 右側（下側）のプレビュー：本番のカードと同じ見た目 --- */
.pv-wrap { margin-top:34px; }
.pv-lead { font-size:0.72rem; color:var(--dim); font-weight:700; text-align:center; margin-bottom:8px; }
.prof { background:#fff; border-radius:6px; padding:20px; }
.prof .top { display:grid; grid-template-columns:96px 1fr; gap:14px; align-items:center; }
.prof .top img { width:96px; height:96px; object-fit:cover; border-radius:50%; }
.prof .top.nophoto { grid-template-columns:1fr; }
.prof h3 { font-size:1rem; }
.prof .title { font-size:0.78rem; color:var(--dim); font-weight:700; }
.prof ul { list-style:none; margin-top:10px; }
.prof ul li { font-size:0.82rem; color:var(--mid); padding-left:1em; text-indent:-1em; }
.prof details { margin-top:10px; }
.prof summary { font-size:0.8rem; font-weight:700; cursor:pointer; color:var(--text); }
.prof details li { font-size:0.78rem; }
.prof details li.sh { font-size:0.7rem; font-weight:800; letter-spacing:0.08em; color:var(--text); padding-left:0; text-indent:0; margin:12px 0 6px; padding-bottom:4px; border-bottom:1px solid var(--line); }
.prof details li.sh:first-child { margin-top:4px; }
.prof .quote { margin-top:10px; font-size:0.85rem; font-weight:700; text-align:center; }

.footer { background:#fff; border-top:1px solid var(--line); text-align:center; padding:24px 18px; margin-top:44px; font-size:0.78rem; color:var(--mid); }
.footer .copy { font-size:0.72rem; color:var(--dim); margin-top:8px; }

/* --- 名前をえらぶ画面 --- */
.pick { list-style:none; background:#fff; border-radius:6px; overflow:hidden; }
.pick li { border-bottom:1px solid var(--line); }
.pick li:last-child { border-bottom:none; }
.pick a { display:grid; grid-template-columns:1fr auto; align-items:center; gap:10px; padding:12px 14px; text-decoration:none; }
.pick a:active { background:#F6F5F2; }
.pick b { font-size:0.9rem; font-weight:800; }
.pick .sub { display:block; font-size:0.7rem; color:var(--dim); font-weight:500; }
.pick .go { font-size:0.72rem; font-weight:700; color:var(--mid); white-space:nowrap; }
.pick .go::after { content:" ›"; font-weight:800; }
#q { width:100%; font-family:inherit; font-size:0.9rem; background:#fff; border:1px solid var(--line); border-radius:4px; padding:10px 12px; }
#q:focus { outline:none; border-color:var(--text); }


/* ============ 戦歴アプリ ============ */
.f input[type=date] {
  width:100%; font-family:inherit; font-size:0.86rem; font-weight:500; color:var(--text); line-height:1.8;
  background:#fff; border:1px solid var(--line); border-radius:4px; padding:8px 10px;
}
.f input[type=date]:focus { outline:none; border-color:var(--text); }

.who-bar { margin-left:auto; font-size:0.72rem; color:var(--dim); font-weight:700; text-align:right; line-height:1.5; }
.who-bar b { color:var(--text); font-size:1.15em; }

/* 通算成績。ここが見たくて記録する、という順番にしたい */
.tally { background:#fff; border:1px solid var(--line); border-radius:6px; padding:16px 14px; }
.tally .lead { font-size:0.72rem; color:var(--dim); font-weight:700; letter-spacing:0.06em; }
.tally .big { display:flex; align-items:baseline; gap:4px; margin:2px 0 12px; }
.tally .big b { font-size:2.4rem; line-height:1; font-weight:800; }
.tally .big span { font-size:0.8rem; color:var(--mid); font-weight:700; }
.medals { display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid var(--line); }
.medals div { text-align:center; padding:10px 2px 0; }
.medals b { display:block; font-size:1.25rem; font-weight:800; line-height:1.4; }
.medals span { font-size:0.68rem; color:var(--dim); font-weight:700; }

/* 記録した1件。日付は固定幅にして左端をそろえる */
.recs { list-style:none; background:#fff; border-radius:6px; overflow:hidden; }
.recs li { display:grid; grid-template-columns:4.6em 1fr auto; gap:10px; align-items:baseline; padding:11px 14px; border-bottom:1px solid var(--line); }
.recs li:last-child { border-bottom:none; }
.recs .dt { font-size:0.7rem; color:var(--dim); font-weight:700; font-variant-numeric:tabular-nums; }
.recs .nm { font-size:0.84rem; font-weight:700; }
.recs .sub { display:block; font-size:0.7rem; color:var(--dim); font-weight:500; }
.recs .rk { font-size:0.76rem; font-weight:800; white-space:nowrap; }
.recs .rk.m1 { color:#A8842C; }
.recs .rk.m2 { color:#6E7B85; }
.recs .rk.m3 { color:#9A6B4A; }
.recs .x { font-family:inherit; font-size:0.72rem; font-weight:700; color:#B04A3A; background:none; border:1px solid #E0C6C0; border-radius:3px; padding:3px 9px; cursor:pointer; }
.yr-h { font-size:0.72rem; font-weight:800; letter-spacing:0.08em; color:var(--mid); margin:22px 0 8px; }
.yr-h:first-child { margin-top:0; }

/* 大会をえらぶ */
.hits { list-style:none; background:#fff; border-radius:6px; overflow:hidden; margin-top:12px; }
.hits li { border-bottom:1px solid var(--line); }
.hits li:last-child { border-bottom:none; }
.hits button { display:grid; grid-template-columns:4.6em 1fr; gap:10px; align-items:baseline; width:100%; text-align:left; background:none; border:none; font-family:inherit; padding:12px 14px; cursor:pointer; }
.hits button:active { background:#F6F5F2; }
.hits .dt { font-size:0.7rem; color:var(--dim); font-weight:700; font-variant-numeric:tabular-nums; }
.hits .nm { font-size:0.84rem; font-weight:700; color:var(--text); }
.hits .sub { display:block; font-size:0.7rem; color:var(--dim); font-weight:500; }

/* 順位えらび。よく使う4つを大きく、それ以外はプルダウン */
.ranks { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.ranks button { background:#fff; border:1px solid var(--line); border-radius:4px; font-family:inherit; font-size:0.86rem; font-weight:700; color:var(--text); padding:13px 8px; cursor:pointer; }
.ranks button.on { background:#1c1c1c; border-color:#1c1c1c; color:#fff; }

.empty { background:#fff; border:1px dashed var(--line); border-radius:6px; text-align:center; padding:28px 18px; }
.empty p { font-size:0.82rem; color:var(--mid); }
.empty .btn { margin-top:14px; }
.mini { font-size:0.72rem; color:var(--dim); font-weight:700; background:none; border:none; font-family:inherit; text-decoration:underline; text-underline-offset:2px; cursor:pointer; padding:0; }
.step { font-size:0.7rem; color:var(--dim); font-weight:700; letter-spacing:0.08em; }
