/* サイト全体の色は管理画面から変更できます。初期値を変える場合はここを編集してください。 */
:root {
  --page-bg: #ffffff; /* 背景色 */
  --button-color: #202020; /* ボタン色 */
  --button-text: #ffffff;
  --text: #222222;
  --muted: #707070;
  --line: #e8e8e8;
  --soft: #f6f6f6;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { background: var(--page-bg); }
body { margin: 0; color: var(--text); background: var(--page-bg); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; line-height: 1.55; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.container { width: min(100% - 28px, 900px); margin: 0 auto; padding: 28px 0 56px; }
.narrow { max-width: 680px; }
.center { text-align: center; }
.site-title { font-size: clamp(1.8rem, 7vw, 2.6rem); line-height: 1.25; letter-spacing: .01em; margin: 12px 0 20px; }
.lead { font-size: 1.05rem; margin: 0 0 10px; }
.muted { color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: rgba(255,255,255,.82); }
.btn { border: 0; background: var(--button-color); color: var(--button-text); border-radius: 999px; padding: 13px 22px; min-height: 48px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; gap: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { color: var(--text); background: #ededed; }
.btn.danger { background: #9b2222; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 24px; }
.small { font-size: .88rem; }
.footer { text-align: center; margin-top: 36px; font-size: .82rem; color: var(--muted); }
.hidden { display: none !important; }
.error { color: #a00000; }
.success { color: #166534; }
.field { display: grid; gap: 6px; margin: 12px 0; }
.field label { font-weight: 700; }
.field input[type=text], .field input[type=password], .field input[type=color] { width: 100%; border: 1px solid #cfcfcf; border-radius: 10px; padding: 11px 12px; background: white; }
.field input[type=color] { height: 48px; padding: 4px; }
/* 4択の顔カード */
.progress { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; margin: 8px 0 12px; }
.progress-track { height: 5px; background: #ededed; border-radius: 9px; overflow: hidden; margin-bottom: 22px; }
.progress-bar { height: 100%; width: 0; background: var(--button-color); transition: width .15s; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice { padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--text); min-width: 0; text-align: center; }
.choice:active { transform: scale(.99); }
.choice img, .face-placeholder { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 9px; background: #f0f0f0; }
.face-placeholder { display: grid; place-items: center; color: #888; font-size: 2rem; }
.choice-name { display: block; font-size: .95rem; font-weight: 700; line-height: 1.35; margin-top: 9px; overflow-wrap: anywhere; }
/* ランキングリスト */
.rank-list { list-style: none; padding: 0; margin: 12px 0; }
.rank-item { display: grid; grid-template-columns: 42px 64px 1fr; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rank-number { font-weight: 800; text-align: center; }
.rank-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #f0f0f0; }
.rank-name { font-weight: 700; overflow-wrap: anywhere; }
.top9-image { display: block; width: min(100%, 620px); height: auto; margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; touch-action: manipulation; -webkit-touch-callout: default; user-select: auto; }
/* 管理画面 */
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.admin-nav button { border: 1px solid var(--line); border-radius: 999px; background: white; padding: 9px 14px; }
.admin-nav button.active { background: var(--button-color); color: var(--button-text); }
.character-row { display: grid; grid-template-columns: 70px minmax(0,1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.character-row img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; background: #f0f0f0; }
.character-row .row-fields { min-width: 0; }
.character-row input[type=text] { width: 100%; border: 1px solid #ccc; border-radius: 8px; padding: 9px; }
.character-row .row-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.character-row .btn { min-height: 38px; padding: 7px 13px; font-size: .9rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 10px 8px; white-space: nowrap; }
th { background: var(--soft); }
@media (min-width: 650px) { .choice-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } .choice { padding: 12px; } }
@media (max-width: 420px) { .container { width: min(100% - 20px, 900px); padding-top: 20px; } .panel { padding: 15px; } .choice-grid { gap: 8px; } .choice { padding: 7px; } .choice-name { font-size: .88rem; } .rank-item { grid-template-columns: 34px 56px 1fr; gap: 9px; } .rank-thumb { width: 56px; height: 56px; } }
