* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; background: #f4f5f7; color: #222; }
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }
.title { font-size: 1.45rem; line-height: 1.4; text-align: center; margin: 12px 0 8px; }
.subtitle { text-align: center; color: #555; margin: 0 0 20px; }
.already { background: #fff3cd; border: 1px solid #e6cf7a; border-radius: 10px; padding: 10px 14px; text-align: center; font-size: .92rem; }
.foot-link { text-align: center; margin-top: 18px; font-size: .92rem; }
.survey .q { border: 1px solid #ddd; border-radius: 12px; background: #fff; padding: 14px 16px 16px; margin: 0 0 14px; }
.survey legend { font-weight: 700; padding: 0 4px; }
.opt { display: block; padding: 10px 8px; border-radius: 8px; font-size: 1.05rem; }
.opt:active { background: #eef3ff; }
.opt input { transform: scale(1.25); margin-right: 8px; }
select, input[type="text"], input[type="email"], textarea { width: 100%; font-size: 1.05rem; padding: 10px; border: 1px solid #bbb; border-radius: 8px; }
.note { color: #666; font-size: .85rem; }
.submit { display: block; width: 100%; padding: 16px; font-size: 1.15rem; font-weight: 700; color: #fff; background: #1f5fd0; border: 0; border-radius: 12px; cursor: pointer; }
.submit:active { opacity: .85; }
.errors { background: #fdecec; border: 1px solid #f0b4b4; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; color: #a00; }
.errors p { margin: 4px 0; }
.result { background: #fff; border-radius: 16px; padding: 28px 20px; text-align: center; border: 1px solid #ddd; }
.result.win { border: 3px solid #f0a500; }
.win-mark { font-size: 2rem; font-weight: 800; }
.win-prize { font-size: 1.5rem; font-weight: 800; margin: 10px 0 4px; }
.win-note { color: #555; }
.win-warn { background: #fdecea; border: 1px solid #e57373; color: #b71c1c; font-weight: bold; text-align: center; padding: 10px 12px; border-radius: 8px; margin: 12px 0; }
.code-box { background: #fff8e1; border: 2px dashed #f0a500; border-radius: 12px; padding: 14px; margin-top: 14px; }
.code-label { font-size: .85rem; color: #777; }
.code { font-size: 2rem; font-weight: 800; letter-spacing: .18em; }
.code.gift { font-size: 1.35rem; letter-spacing: .05em; word-break: break-all; }
.copy-btn { margin-top: 10px; }
.redeemed { color: #c00; font-weight: 700; }
.lose-mark { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }
.redeem-open { display: block; width: 100%; margin-top: 16px; padding: 13px; font-size: 1rem; font-weight: 700; color: #1f5fd0; background: #eef3ff; border: 2px solid #1f5fd0; border-radius: 12px; cursor: pointer; }
.redeem-box { margin-top: 16px; background: #f7f7f7; border: 1px solid #ccc; border-radius: 12px; padding: 16px; }
.redeem-title { font-weight: 700; margin: 0 0 8px; }
.redeem-btn { background: #d35400; }
.pin-input { width: 100%; font-size: 1.3rem; padding: 10px; text-align: center; letter-spacing: .3em; border: 1px solid #bbb; border-radius: 8px; }
/* 引換スライダー（最後までスライドしないと確定しない）＋引換済み表示 */
.slide-confirm { position: relative; margin: 12px 0 4px; background: #e8e8e8; border-radius: 999px; height: 56px; overflow: hidden; }
.slide-confirm input[type="range"] { -webkit-appearance: none; appearance: none; position: relative; z-index: 2; width: 100%; height: 56px; margin: 0; background: transparent; cursor: pointer; }
.slide-confirm input[type="range"]::-webkit-slider-runnable-track { height: 56px; background: transparent; }
.slide-confirm input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 56px; height: 56px; border-radius: 50%; background: #d35400; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35); }
.slide-confirm input[type="range"]::-moz-range-track { height: 56px; background: transparent; }
.slide-confirm input[type="range"]::-moz-range-thumb { width: 50px; height: 50px; border-radius: 50%; background: #d35400; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35); }
.slide-label { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #888; pointer-events: none; }
.redeemed-box { margin-top: 16px; background: #fdf0ec; border: 2px solid #d35400; border-radius: 12px; padding: 16px; text-align: center; }
.redeemed-title { font-size: 1.5rem; font-weight: 700; color: #d35400; }
.redeemed-time { font-size: 2.2rem; font-weight: 700; line-height: 1.2; }
.contact-box { background: #fafafa; border: 1px solid #ddd; border-radius: 12px; padding: 12px 16px; margin: 20px 0 8px; font-size: .9rem; color: #444; }
.contact-box p { margin: 4px 0; }
.contact-box .contact-org { font-weight: 700; color: #222; }
.contact-box .contact-note { color: #888; font-size: .8rem; }
.staff-note { background: #fff8e1; border: 2px solid #f0a500; border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-weight: 700; text-align: center; color: #7a5200; }
/* ギフト券テンプレート（使い方・ご注意ブロック） */
.gift-howto { background: #fafafa; border: 1px solid #ddd; border-radius: 12px; padding: 12px 16px; margin: 14px 0 4px; text-align: left; font-size: .9rem; color: #444; }
.gift-howto p { margin: 6px 0; }
.gift-howto ul { margin: 4px 0 6px; padding-left: 1.2em; }
.gift-howto li { margin: 3px 0; }
.test-banner { background: #6c3483; color: #fff; text-align: center; padding: 8px 10px; font-size: .9rem; font-weight: 700; }
.test-banner a { color: #ffe; }
/* v4: prize image + gift activation pics */
.prize-img { display: block; max-width: 100%; height: auto; border-radius: 12px; margin: 12px auto 4px; }
.prize-img.small { max-width: 220px; }
.prize-thumb { max-width: 110px; height: auto; border-radius: 6px; }
.pic-set { display: flex; justify-content: center; gap: 14px; margin: 14px 0 6px; flex-wrap: wrap; }
.pic-set .pic-item { font-size: 3rem; line-height: 1.1; background: #fff8e1; border: 2px dashed #f0a500; border-radius: 14px; padding: 10px 14px 6px; text-align: center; }
.pic-set .pic-name { display: block; font-size: .85rem; color: #555; }
.pic-set.small .pic-item { font-size: 1.9rem; padding: 6px 10px 4px; }
.pending-box { border: 2px solid #f0a500; background: #fffdf4; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.pic-inline { display: inline-block; background: #fff8e1; border: 1px solid #e6cf7a; border-radius: 8px; padding: 2px 8px; font-size: 1.05rem; }
.pic-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.pic-choice { display: inline-block; border: 1px solid #bbb; border-radius: 10px; padding: 8px 6px; width: 76px; text-align: center; font-size: .85rem; cursor: pointer; background: #fff; }
.pic-choice .pic-emoji { font-size: 1.7rem; }
.test-badge { background: #6c3483; color: #fff; border-radius: 6px; padding: 1px 7px; font-size: .78rem; font-weight: 700; }
/* admin */
.admin-wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; }
.nav a { white-space: nowrap; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { border: 1px solid #ddd; padding: 6px 8px; font-size: .9rem; text-align: left; vertical-align: top; }
th { background: #f0f0f0; white-space: nowrap; }
.card { background: #fff; border: 1px solid #ddd; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 16px; background: #eef3ff; border-left: 6px solid #1f5fd0; border-radius: 0 8px 8px 0; padding: 12px 14px; }
.card h3 { margin: 32px 0 12px; background: #f4f5f7; border-left: 5px solid #9aa3ad; border-radius: 0 8px 8px 0; padding: 10px 12px; }
.card > h3:first-child, .card > h2 + h3 { margin-top: 4px; }
/* ボタン：種類によらず高さ・余白を統一し、押し間違いを防ぐ */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 168px; padding: 10px 20px; background: #1f5fd0; color: #fff; border: 0; border-radius: 8px; text-decoration: none; cursor: pointer; font-size: .95rem; line-height: 1.25; white-space: nowrap; }
.btn.small { min-width: 0; min-height: 38px; padding: 6px 14px; font-size: .88rem; }
.btn.sub { background: #666; }
.btn.danger { background: #c00; }
.btn:active { opacity: .85; }
/* ブランドバー（仮ロゴ：文字組みのみ）とフッター */
.brand-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 2px 10px; border-bottom: 2px solid #1a56db; margin-bottom: 14px; }
.brand-mark { font-weight: 800; font-size: 1.3rem; letter-spacing: .02em; color: #14337f; }
.brand-latin { font-size: .95rem; letter-spacing: .18em; margin-left: 8px; color: #1a56db; }
.brand-sub { color: #666; font-size: .8rem; white-space: nowrap; }
.site-footer { text-align: center; background: #14337f; color: #fff; font-size: .78rem; padding: 12px 16px; margin: 32px -16px 0; }
/* 横並びのボタン群（等間隔・上にも余白を確保） */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
/* 表の操作列のボタン群：横並び・コンパクトにして行の高さを抑える */
.btn-stack { display: flex; flex-direction: row; gap: 6px; align-items: center; }
.btn-pair { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.btn-row form { margin: 0; display: flex; }
.btn-pair form { margin: 0; }
.btn-pair.stack { flex-direction: column; align-items: stretch; flex-wrap: nowrap; min-width: 152px; }
.btn-pair.stack form { display: block; }
.btn-pair.stack .btn { width: 100%; }
.ship-ops .btn { width: 168px; }
.btn-stack form { display: flex; margin: 0; }
.btn-stack .btn { width: auto; padding: 5px 12px; font-size: .82rem; white-space: nowrap; }
table .btn { min-width: 0; }
.btn-top-gap { margin-top: 8px; }
/* 保管用CSVのダウンロードボタン用：義務が解除されるまで点滅し続ける */
@keyframes csvBlink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.csv-blink { animation: csvBlink 1s ease-in-out infinite; }
input[type="number"], input[type="password"], input[type="datetime-local"], .admin-wrap input[type="text"] { padding: 8px; border: 1px solid #bbb; border-radius: 6px; max-width: 100%; }
.stat { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat .box { background: #fff; border: 1px solid #ddd; border-radius: 12px; padding: 12px 18px; min-width: 110px; }
.stat .num { font-size: 1.6rem; font-weight: 800; }
.tree-dist { margin: 10px 0 14px; }
.tree-head { font-size: 1.02rem; margin-bottom: 2px; }
.tree-row { margin-left: 14px; color: #333; line-height: 1.8; }
.entries-table td, .entries-table th { padding: 6px 8px; font-size: .9rem; }
.field-err { border: 2px solid #b3261e !important; background: #fdf3f2 !important; }
.subhead { margin: 14px 0 2px; font-size: 1rem; border-left: 4px solid #14337f; padding-left: 8px; }
#toastMsg { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 9999; max-width: 92vw; padding: 11px 20px; border-radius: 999px; color: #fff; font-size: .95rem; font-weight: 700; box-shadow: 0 6px 24px rgba(0,0,0,.28); cursor: pointer; animation: toastIn .25s ease-out; text-align: center; }
#toastMsg.toast-ok { background: #2e7d32; }
#toastMsg.toast-err { background: #b3261e; border-radius: 14px; }
#toastMsg.toast-hide { opacity: 0; transform: translateX(-50%) translateY(-10px); transition: opacity .4s, transform .4s; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.ship-table td, .ship-table th { padding: 6px 8px; font-size: .9rem; vertical-align: top; }
.ship-table td.c-prize, .ship-table td.c-addr { max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ship-table td.c-mail { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ship-table td.c-date, .ship-table td.c-state { white-space: nowrap; }
.pending-box.hl { border-color: #2e7d32; background: #eef7ee; box-shadow: 0 0 0 2px rgba(46,125,50,.35); }
.entries-table .nowrap { white-space: nowrap; }
.entries-table td.ans { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* フォームの整列：ラベル上・入力下のセルをグリッドで揃える（PCは複数列、スマホは1列） */
.grid, .form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; margin: 12px 0; }
.grid label, .form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; }
.grid input, .grid select, .form-grid input, .form-grid select { width: 100% !important; }
.grid input.inline-num, .form-grid input.inline-num { width: 120px !important; }
.num-unit { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.form-grid .span-all { grid-column: 1 / -1; }
/* ラベル文の行数が違っても入力欄の段がずれないよう、欄を下端で揃える（賞品追加フォーム等） */
.form-grid.align-fields > label > input, .form-grid.align-fields > label > select, .form-grid.align-fields > label > textarea { margin-top: auto; }
/* 画像ドロップゾーン（賞品追加フォーム） */
.req { display: inline-block; color: #c62828; border: 1px solid #c62828; border-radius: 3px; font-size: .68rem; font-weight: 700; padding: 0 4px; margin-left: 6px; vertical-align: 2px; background: #fff; }
.draw-inner { position: relative; }
/* カプセルトイ演出 */
.cap-machine { width: 264px; margin: 0 auto; }
.cap-machine.winflash { animation: wflash .45s 4 alternate; }
.cap-dome { position: relative; width: 264px; height: 190px; border: 4px solid var(--theme-dark); border-radius: 132px 132px 16px 16px; background: linear-gradient(180deg, #ffffff 0%, #e8eef2 70%, #d7e0e6 100%); overflow: hidden; box-shadow: inset -18px -10px 30px rgba(0,0,0,.06); }
.cap-dome::after { content: ''; position: absolute; left: 26px; top: 14px; width: 54px; height: 110px; border-radius: 40px; background: rgba(255,255,255,.5); transform: rotate(14deg); pointer-events: none; }
.cap { position: absolute; width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(0,0,0,.10); box-shadow: inset -3px -4px 6px rgba(0,0,0,.12); }
.cap-dome.stirring .cap { animation: capJump .45s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes capJump { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(var(--jx, 0px), -24px) rotate(var(--jr, 20deg)); } }
.cap-machine.shaking { animation: capShake .12s linear infinite; }
@keyframes capShake { 0% { transform: translate(0, 0); } 25% { transform: translate(1px, -1px); } 50% { transform: translate(-1px, 1px); } 75% { transform: translate(1px, 1px); } 100% { transform: translate(0, 0); } }
.cap-base { width: 264px; margin: 6px auto 0; background: var(--theme); border-radius: 12px; padding: 10px 0 12px; box-shadow: inset 0 -6px 0 rgba(0,0,0,.15); }
.cap-knob { width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 50%; background: #ffffff; border: 4px solid var(--theme-dark); position: relative; }
.cap-knob::after { content: ''; position: absolute; left: 50%; top: 6px; width: 6px; height: 30px; margin-left: -3px; border-radius: 3px; background: var(--theme-dark); }
.shaking .cap-knob { animation: knobTurn 2.3s ease-in-out; }
@keyframes knobTurn { 0% { transform: rotate(0deg); } 30% { transform: rotate(300deg); } 60% { transform: rotate(660deg); } 100% { transform: rotate(1080deg); } }
.cap-tray { width: 150px; height: 58px; margin: 0 auto; background: rgba(0,0,0,.28); border-radius: 10px; position: relative; box-shadow: inset 0 3px 8px rgba(0,0,0,.4); }
.cap-drop { position: absolute; left: 50%; top: 6px; width: 46px; height: 46px; margin-left: -23px; opacity: 0; }
.cap-drop.dropped { animation: capDropIn .55s cubic-bezier(.3, 1.6, .6, 1) forwards; }
@keyframes capDropIn { 0% { opacity: 0; transform: translateY(-64px) scale(.7); } 60% { opacity: 1; transform: translateY(2px) scale(1.05); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.cap-drop.settled { animation: none; opacity: 1; transition: transform .45s ease; }
.cap-drop.open { transform: scale(1.9); }
.cap-drop .cd-top, .cap-drop .cd-bot { position: absolute; left: 0; width: 46px; height: 23px; }
.cap-drop .cd-top { top: 0; border-radius: 23px 23px 0 0; background: var(--theme); transform-origin: 4px 100%; transition: transform .5s ease; z-index: 2; }
.cap-drop .cd-bot { bottom: 0; border-radius: 0 0 23px 23px; background: #ffffff; border-top: 2px solid rgba(0,0,0,.08); }
.cap-drop.open .cd-top { transform: rotate(-105deg); }
.cap-drop .cd-star { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.3); font-size: 20px; color: #ffb300; opacity: 0; transition: opacity .4s ease .15s, transform .4s ease .15s; z-index: 1; }
.cap-drop.open.win .cd-star { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 13px; opacity: .95; animation-name: confettiFall; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes confettiFall { to { transform: translateY(105vh) rotate(720deg); opacity: .7; } }
.keihyo-box { border: 1px solid #e3c878; background: #fffaf0; border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.keihyo-warn { margin: 0; padding-left: 18px; color: #a33; }
.prev-box { border: 1px solid #dfe3e8; background: #f7f8fa; border-radius: 8px; padding: 10px 12px; }
.prev-box .prev-cap { display: block; font-size: .8rem; font-weight: 700; color: #555; margin-bottom: 4px; }
.prev-box .prev-body { margin: 0; white-space: pre-wrap; font-size: .92rem; }
.dropzone { border: 2px dashed #b9bec7; border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fcfcfc; }
.dropzone.drag { border-color: #1f5fd0; background: #eef3ff; }
.fieldset { margin: 22px 0; border: 1.5px solid #d5d8dc; border-radius: 10px; padding: 6px 18px 18px; }
.fieldset legend { font-weight: 700; font-size: 1.02rem; padding: 0 6px; }
.fieldset .form-grid { margin-bottom: 4px; }
/* チェックボックスの横並び（等間隔で整列） */
.checks { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 14px 0; }
.checks label { display: inline-flex; align-items: center; gap: 6px; font-size: .95rem; }
/* ラジオ選択肢のブロック（枠で区切って読みやすく） */
.radio-block { display: block; padding: 12px 14px; border: 1px solid #e3e3e3; border-radius: 10px; margin: 0 0 10px; background: #fcfcfc; }
.radio-block .desc { display: block; color: #666; font-size: .85rem; margin: 6px 0 0 1.7em; line-height: 1.5; }
/* ラジオ選択肢のカード横並び（丸と文字の対応を枠で明示。form-grid内でも崩れないよう row 固定） */
.radio-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-cards label { display: flex; flex-direction: row; align-items: center; gap: 9px; padding: 11px 14px; border: 1.5px solid #c9ccd1; border-radius: 10px; background: #fff; cursor: pointer; font-size: .95rem; flex: 1 1 230px; margin: 0; }
.radio-cards label:has(input:checked) { border-color: #1f5fd0; background: #eef3ff; font-weight: 600; }
.radio-cards input[type="radio"], .radio-cards input[type="checkbox"] { width: 20px !important; height: 20px; flex: none; margin: 0; }
/* 公開状態バッジ（色枠＋太字で状態を明示） */
.status-badge { display: inline-block; padding: 5px 14px; border: 2px solid; border-radius: 8px; font-weight: 700; font-size: 1rem; margin: 2px 0 8px; }
tr.editing-row td { background: #fff6e0; }
.editing-badge { display: inline-block; background: #f59e0b; color: #fff; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.status-badge.draft { color: #b00020; border-color: #d32f2f; background: #fdecec; }
.status-badge.live { color: #1f5fd0; border-color: #1f5fd0; background: #eef3ff; }
.status-badge.scheduled { color: #1b7a43; border-color: #2e9e5b; background: #e9f7ee; }
.status-badge.suspended { color: #b25e00; border-color: #e08a00; background: #fff4e0; }
/* ボタンの直後の説明文は同じ行に置かず、下に回す */
form .btn + span, p .btn + span { display: block; margin-top: 8px; }
/* 開閉トグル（details）は押せる見た目にする */
details > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 14px; background: #f0f3f8; border: 1.5px solid #c9ccd1; border-radius: 8px; font-weight: 600; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▶"; font-size: .75rem; color: #1f5fd0; }
details[open ] > summary::before { content: "▼"; }
details > summary::after { content: "開く"; margin-left: auto; font-size: .8rem; font-weight: 400; color: #1f5fd0; text-decoration: underline; }
details[open ] > summary::after { content: "閉じる"; }
/* 編集できない値の表示（入力欄と誤認させない） */
.readonly-value { padding: 12px 14px; border: 1px dashed #b5b8bd; border-radius: 8px; background: #f4f5f7; color: #333; font-size: .95rem; line-height: 1.6; }
/* report charts (inline SVG, no external libraries) */
.chart { display: block; width: 100%; height: auto; }
.chart text { font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: #555; margin: 4px 0 8px; }
.chip { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.donut-flex { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.donut-box { width: 200px; max-width: 62vw; flex: none; }
.donut-legend p { margin: 6px 0; font-size: .95rem; }
.hbar { margin: 7px 0; }
.hbar-head { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; }
.hbar-val { color: #555; white-space: nowrap; }
.hbar-svg { display: block; width: 100%; height: 10px; background: #eef1f5; border-radius: 5px; margin-top: 3px; }
@media (max-width: 640px) {
  .stat .box { flex: 1 1 40%; }
  th, td { font-size: .82rem; padding: 5px 6px; }
  .card { padding: 14px; }
  .grid, .form-grid { grid-template-columns: 1fr; }
  .btn { min-height: 46px; }
  .btn-stack { min-width: 0; }
  .fieldset { padding: 4px 12px 14px; }
  /* 現場利用（スマホ）配慮：入力欄の文字を16px以上にしてiOSの自動ズームを防ぐ */
  .admin-wrap input, .admin-wrap select, .admin-wrap textarea { font-size: 16px; }
  /* タブは指で押しやすい大きさに */
  .tab-nav button { min-height: 46px; padding: 10px 14px; }
  .tab-nav.sub button { min-height: 42px; }
  /* チェック・ラジオはタップ範囲を広げる */
  .checks label { padding: 8px 6px; }
  .checks input[type="checkbox"], .checks input[type="radio"] { width: 20px; height: 20px; }
  .radio-block { padding: 14px; }
  /* 絵合わせの選択肢も大きめに */
  .pic-choice { width: 88px; padding: 12px 6px; }
  h2 { font-size: 1.18rem; }
}
@media print {
  body { background: #fff; }
  .no-print, .nav { display: none !important; }
  .card { border: 0; padding: 0; margin-bottom: 20px; }
  .card h2, .card h3 { background: none; }
  .admin-wrap { max-width: none; }
  .chart, .hbar-svg, .chip { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  /* 同じ項目がページをまたがないように */
  .card, .q-block, .stat .box, .hbar, .donut-flex { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  tr { break-inside: avoid; }
}

/* 抽選スロット演出（タップして抽選） */
.slot-machine{background:#fffdf5;border:2px solid #f0b429;border-radius:16px;padding:18px 12px 10px;text-align:center;margin:16px 0;box-shadow:0 4px 14px rgba(0,0,0,.08)}
.slot-title{font-weight:700;font-size:1.1rem;margin-bottom:10px}
.slot-reels{display:flex;gap:8px;justify-content:center}
.slot-reel{width:76px;height:68px;overflow:hidden;border-radius:10px;background:#fff8e1;border:1px solid #e8d48b}
.slot-strip{display:flex;flex-direction:column;will-change:transform}
.slot-strip span{height:68px;line-height:68px;font-size:42px;display:block;text-align:center}
.slot-hint{color:#888;font-size:.8rem;margin:8px 0 4px}

/* 発送先「あとで登録」（メールリンク） */
.ship-later{margin-top:18px;border-top:1px dashed #ccc;padding-top:12px}
.ship-choice{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0 10px}
.reg-link{word-break:break-all;font-size:.85rem;color:#1565c0}

/* 入力欄の高さを種類によらず揃える（date / number / select で高さがバラつく対策） */
.form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-grid select { min-height: 42px; padding: 8px 10px; }
.form-grid textarea { padding: 8px 10px; }
/* 詳細設定（普段は閉じておく任意項目） */
.advanced { margin-top: 10px; }
.advanced summary { cursor: pointer; color: #555; font-size: .9rem; }

/* 日本語の改行最適化：見出しは行バランス＋文節改行、本文は最終行の孤立（字切れ）を避ける */
h1, h2, .win-mark, .lose-mark { text-wrap: balance; word-break: auto-phrase; }
p, .sub, .win-note, .note, .staff-note { text-wrap: pretty; }
.ph { display: inline-block; max-width: 100%; }
.code-mini { text-align: center; color: #999; font-size: .82rem; letter-spacing: .06em; margin-top: 10px; }

.tab-nav { display:flex; gap:4px; flex-wrap:wrap; margin:14px 0 0; border-bottom:2px solid #333; }
.tab-nav button { border:1px solid #ccc; border-bottom:none; background:#eee; color:#333; border-radius:10px 10px 0 0; padding:9px 18px; font-size:.98rem; font-weight:700; cursor:pointer; min-height:44px; }
.tab-nav button.on { background:#333; color:#fff; border-color:#333; }
.tab-nav.sub { align-items:center; margin:0 0 12px; background:#f7f7f7; border:1px solid #ddd; border-top:none; border-bottom:1px solid #ddd; border-radius:0 0 10px 10px; padding:8px 10px 8px 24px; }
.tab-nav.sub .sub-label { font-size:.8rem; color:#666; margin-right:2px; }
.tab-nav.sub button { border:1px solid #ccc; border-bottom:1px solid #ccc; background:#fff; color:#333; border-radius:999px; padding:6px 13px; font-size:.88rem; font-weight:400; min-height:40px; }
.tab-nav.sub button.on { background:#666; color:#fff; border-color:#666; }
.tab-badge { background:#c00; color:#fff; border-radius:999px; padding:0 7px; font-size:.78rem; margin-left:2px; }
.warn-box { background:#fff8e1; border:1px solid #e0c341; border-radius:8px; padding:10px 14px; font-size:.88rem; color:#5d4a00; }
.warn-box ul { margin:6px 0 0; padding-left:1.2em; }
.warn-box li { margin:3px 0; }

/* ===== 応募画面テーマ（デザインパターン／テーマカラー） ===== */
body[data-pattern="simple"] .title { color: var(--theme-dark); border-bottom: 3px solid var(--theme); padding-bottom: 8px; }
body[data-pattern="middle"] .title { background: var(--theme); color: var(--on-theme); border-radius: 12px; padding: 14px 16px; }
body[data-pattern="flashy"] .title { background: linear-gradient(180deg, var(--theme), var(--theme-dark)); color: var(--on-theme); border-radius: 12px; padding: 14px 16px; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
body[data-pattern] .win-mark { color: var(--theme-dark); }
body[data-pattern] .code-box { border-color: var(--theme); }
body[data-pattern] .submit { background: var(--theme-dark); color: var(--on-theme); }

/* ===== 抽選演出オーバーレイ ===== */
.draw-overlay { position: fixed; inset: 0; z-index: 80; background: #fff; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 30px 12px 40px; box-sizing: border-box; }
body[data-pattern="flashy"] .draw-overlay { background: linear-gradient(180deg, #232833, #14171d); }
.draw-inner { text-align: center; }
.draw-title { font-weight: 900; font-size: 1.15rem; color: var(--theme-dark); margin: 0 0 16px; }
body[data-pattern="flashy"] .draw-title { color: #ffd94d; }
.draw-status { text-align: center; min-height: 1.5em; font-weight: 700; color: var(--theme-dark); margin-top: 12px; }
body[data-pattern="flashy"] .draw-status { color: #ffd94d; }
.machine { text-align: center; display: inline-block; }
.reels { display: flex; gap: 8px; justify-content: center; }
.reel { width: 76px; height: 96px; border-radius: 10px; background: #fff; overflow: hidden; position: relative; font-size: 2.6rem; }
.strip { display: flex; flex-direction: column; will-change: transform; }
.cell { height: 96px; flex: none; display: flex; align-items: center; justify-content: center; line-height: 1; }
.glyph { display: inline-block; }
.g1 { transform: translateY(-5px); }
.g2 { transform: translate(-5px, -3px); }
.reel::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,0) 32%, rgba(0,0,0,0) 68%, rgba(0,0,0,.22)); }
.start-btn { border: none; cursor: pointer; font-weight: 900; letter-spacing: .12em; white-space: nowrap; }
.start-btn[disabled] { filter: grayscale(.75); opacity: .55; cursor: default; }
[data-pattern="simple"] .machine { background: #fff; border: 2px solid #ddd; border-radius: 14px; padding: 16px 14px; }
[data-pattern="simple"] .reel { border: 2px solid #e2e2e2; }
[data-pattern="simple"] .lamps { display: none; }
[data-pattern="simple"] .start-btn { background: var(--theme); color: var(--on-theme); border-radius: 10px; padding: 12px 44px; font-size: 1.05rem; }
[data-pattern="middle"] .machine { background: #fff; border: 3px solid var(--theme); border-radius: 18px; padding: 16px 14px; box-shadow: 0 8px 20px rgba(0,0,0,.10); }
[data-pattern="middle"] .reel { border: 2px solid var(--theme-band); box-shadow: inset 0 0 0 2px #fff, inset 0 -10px 16px rgba(0,0,0,.05); }
[data-pattern="middle"] .lamps { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }
[data-pattern="middle"] .lamps i { width: 11px; height: 11px; border-radius: 50%; background: var(--theme-band); box-shadow: 0 0 6px var(--theme-band); }
[data-pattern="middle"] .lamps i:nth-child(odd) { background: var(--theme); box-shadow: 0 0 8px var(--theme); }
[data-pattern="middle"] .start-btn { background: linear-gradient(180deg, var(--theme), var(--theme-dark)); color: var(--on-theme); border-radius: 999px; padding: 14px 52px; font-size: 1.15rem; box-shadow: 0 5px 0 var(--theme-dark); }
[data-pattern="flashy"] .machine { background: linear-gradient(180deg, #3a3f4a, #20242e); border: 3px solid #ffd94d; border-radius: 20px; padding: 16px 14px; box-shadow: 0 12px 28px rgba(0,0,0,.35); }
[data-pattern="flashy"] .reel { border: 3px solid #ffd94d; box-shadow: inset 0 -12px 18px rgba(0,0,0,.12); }
[data-pattern="flashy"] .lamps { display: flex; gap: 9px; justify-content: center; margin-bottom: 10px; }
[data-pattern="flashy"] .lamps i { width: 12px; height: 12px; border-radius: 50%; background: #ffd94d; animation: lampGlow .7s infinite alternate; }
[data-pattern="flashy"] .lamps i:nth-child(even) { animation-delay: .35s; background: #ffef9e; }
[data-pattern="flashy"] .start-btn { background: linear-gradient(180deg, #ffe259, #ffa751); color: #7a2d00; border-radius: 999px; padding: 16px 36px; font-size: 1.18rem; box-shadow: 0 6px 0 #c46a1b, 0 10px 22px rgba(0,0,0,.35); }
.reel.spinning .strip { filter: blur(1.5px); }
.reel.stopped { animation: pop .25s; }
.machine.reach { animation: mpulse 1s ease-in-out infinite alternate; }
.machine.reach .lamps i { animation: blinkOp 1.1s ease-in-out infinite alternate; background: #ff5a3c; }
.machine.reach .lamps i:nth-child(even) { animation-delay: .55s; background: #ffd94d; }
.machine.winflash { animation: wflash .45s 4 alternate; }
.strip.looping { animation: drumloop .45s linear infinite; }
.wheel-box { position: relative; width: 236px; height: 236px; margin: 0 auto; }
.wheel { position: absolute; inset: 0; width: 236px; height: 236px; transition: transform 4.2s cubic-bezier(.1,.7,.08,1); }
.wheel.spinning { filter: blur(1.3px); }
.pointer { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 18px solid var(--theme-dark); z-index: 3; }
.pointer.tick { animation: tick .11s infinite alternate; }
.hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 3px solid var(--theme-dark); display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--theme-dark); z-index: 2; }
.wheel-box.atari .wheel { filter: drop-shadow(0 0 12px rgba(255,180,0,.95)); }
@keyframes lampGlow { from { box-shadow: 0 0 2px #ffd94d; opacity: .55; } to { box-shadow: 0 0 12px #ffd94d; opacity: 1; } }
@keyframes blinkOp { from { opacity: 1; } to { opacity: .2; } }
@keyframes pop { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes mpulse { from { transform: scale(1); } to { transform: scale(1.025); } }
@keyframes wflash { from { filter: brightness(1); } to { filter: brightness(1.3); } }
@keyframes tick { from { transform: translateX(-50%) rotate(-13deg); } to { transform: translateX(-50%) rotate(11deg); } }
@keyframes drumloop { from { transform: translateY(0); } to { transform: translateY(-576px); } }

/* 日別当選上限に到達した日の応募画面の案内 */
.cap-ended-note { background: var(--theme-soft, #fdecea); border: 1px solid var(--theme, #d32f2f); color: #333; border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; line-height: 1.7; }

/* 抽選演出の固定注記（編集不可・全パターン共通） */
.draw-fixed-note { font-size: 13px; color: #555; text-align: center; line-height: 1.7; margin: 12px 0 0; }
.draw-overlay .draw-fixed-note { color: #555; }

.save-bar { position:fixed; left:0; right:0; bottom:0; z-index:60; background:rgba(255,255,255,.97); border-top:1px solid #ddd; box-shadow:0 -2px 10px rgba(0,0,0,.08); padding:10px 14px calc(10px + env(safe-area-inset-bottom)); display:flex; justify-content:center; }
.save-bar .btn { width:100%; max-width:520px; }
body.has-savebar { padding-bottom:92px; }

/* 方式Cの照合コード（当選画面） */
.verify-code { text-align: center; font-size: 2.3rem; font-weight: 800; letter-spacing: .35em; text-indent: .35em; background: #fff7e0; border: 2px solid #f0b429; border-radius: 12px; padding: 12px 8px; margin: 12px auto; max-width: 320px; color: #333; }
/* 管理画面：確定待ちの導線バナー */
.notice-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff3cd; border: 1px solid #e6c34a; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: .92rem; }

/* 賞品テーブル（コンパクト化・アイコン・ファイル選択・固定列） */
.prizes th, .prizes td { padding: 8px; }
.prizes input[name="name"] { width: 100%; min-width: 130px; }
.prizes .prize-more { margin-top: 6px; }
.prizes .prize-more summary { cursor: pointer; font-size: .82rem; color: #555; }
.prizes .prize-more input, .prizes .prize-more select, .prizes .prize-more textarea { max-width: 100%; }
.prizes .dist-cell { text-align: center; width: 76px; }
.dist-ico { width: 24px; height: 24px; color: #444; }
.prizes .dist-cell span { display: block; font-size: .78rem; margin-top: 2px; }
.dist-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: .85rem; color: #444; margin: 6px 0 10px; }
.dist-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dist-legend .dist-ico { width: 20px; height: 20px; }
.prizes .stock-cell .mini { display: block; font-size: .75rem; color: #777; }
.prizes .stock-left { font-size: .85rem; margin-top: 4px; }
.prizes .actual-prob { margin-top: 6px; font-size: .85rem; border-top: 1px dashed #ddd; padding-top: 5px; }
.prizes .filepick { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.prizes .filebtn { cursor: pointer; font-size: .82rem; padding: 5px 10px; }
.prizes .fname { font-size: .8rem; color: #666; word-break: break-all; }
.prizes .prize-thumb { max-width: 64px; }
.prizes th:first-child, .prizes td:first-child { position: sticky; left: 0; background: #fff; box-shadow: 5px 0 8px -4px rgba(0,0,0,.18); z-index: 1; }
.prizes th:last-child, .prizes td:last-child { position: sticky; right: 0; background: #fff; box-shadow: -5px 0 8px -4px rgba(0,0,0,.18); z-index: 1; }
.prizes th:first-child, .prizes th:last-child { background: #f0f0f0; }
@media (max-width: 760px) {
  .prizes th, .prizes td { padding: 6px; }
  .prizes .btn-stack .btn { min-height: 40px; }
}
.field-msg { display: block; color: #b3261e; font-size: .8rem; font-weight: 600; margin-top: 4px; }

.field-flash { animation: fieldFlash 1.3s ease-in-out 2; }
@keyframes fieldFlash { 0%,100% { box-shadow: 0 0 0 0 rgba(179,38,30,0); } 50% { box-shadow: 0 0 0 5px rgba(179,38,30,.38); } }
