/* =============================================
   デジタルMAP：スタンプラリー
   ============================================= */

:root {
    --sr-accent: #f08300;     /* ボタン・強調色（管理画面の「デザイン」で変更可） */
    --sr-on-accent: #3b2a25;  /* 強調色の上の文字色（自動で決まる） */
    --sr-text: #3b2a25;
}

/* ---- スポット詳細：カード ---- */
.sr-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 4px 0 18px;
    padding: 14px;
    border-radius: 14px;
    background: #f1f1f1;
    color: var(--sr-text);
}

.sr-card-img {
    flex: 0 0 38%;
    width: 38%;
    max-width: 150px;
    height: auto;
    border-radius: 8px;
}

.sr-card-title {
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 700;
}

.sr-card-meta {
    font-size: 12px;
    line-height: 1.6;
    color: #555;
}

/* ---- スポット詳細：スタンプを押すボタン（パネル下部に固定） ---- */
.sr-press-wrap {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 20px 16px 16px;
    background: linear-gradient(to top, #fff 65%, rgba(255, 255, 255, 0));
    pointer-events: none;
}

.sr-press {
    pointer-events: auto;
    display: block;
    width: 100%;
    padding: 15px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--sr-accent);
    color: var(--sr-on-accent, #3b2a25);
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(240, 131, 0, .4);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
}

.sr-press:active { transform: scale(.98); }
.sr-press.is-busy { opacity: .75; }
.sr-press.is-disabled,
.sr-press.is-done {
    background: #bdbdbd;
    color: #fff;
    box-shadow: none;
    cursor: default;
}
.sr-press.is-done { background: #5b9a5b; }

/* ---- モーダル共通 ---- */
.sr-overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;       /* イベント告知(100000)より手前 */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, .55);
    animation: sr-fade .2s ease-out;
}

.sr-overlay-top {
    z-index: 100002;
    align-items: center;
    padding: 16px;
}

@keyframes sr-fade { from { opacity: 0; } to { opacity: 1; } }

.sr-sheet {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 560px;
    height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 20px 20px 0 0;
    background: #fff;
    animation: sr-up .25s ease-out;
}

@media (min-width: 640px) {
    .sr-overlay { align-items: center; }
    .sr-sheet { height: auto; max-height: 90vh; border-radius: 20px; }
}

@keyframes sr-up {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.sr-close {
    position: sticky;
    top: 12px;
    z-index: 2;
    display: block;
    width: 38px;
    height: 38px;
    margin: 12px 12px -50px auto;
    border: 0;
    border-radius: 50%;
    background: rgba(50, 50, 50, .8);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.sr-sheet-body { padding: 0 20px 28px; color: var(--sr-text); }

.sr-banner {
    display: block;
    width: calc(100% + 40px);
    max-width: none;
    height: auto;
    margin: 0 -20px 16px;
}

.sr-sheet-body > .sr-heading:first-child { padding-top: 56px; }

.sr-heading {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.5;
}

.sr-period {
    display: inline-block;
    margin-bottom: 14px;
    padding: 8px 14px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 13px;
}

.sr-desc {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-line;
}

.sr-warn {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff3e0;
    color: #8a4b00;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
}

/* ---- パネル（アンケート・注意・規約） ---- */
.sr-panel {
    margin: 0 0 18px;
    padding: 20px 18px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 2px 14px rgba(0, 0, 0, .12);
}

.sr-panel-title {
    margin: 0 0 16px;
    font-size: 16px;
}

.sr-field { margin-bottom: 20px; }

.sr-label {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

.sr-req {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 6px;
    border: 1px solid #e02020;
    border-radius: 4px;
    color: #e02020;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.sr-select {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 12px 10px;
    border: 0;
    border-radius: 6px;
    background: #e8e8e8;
    font-size: 15px;
}

.sr-choices { display: flex; flex-direction: column; gap: 6px; }

.sr-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}

.sr-choice input { flex-shrink: 0; width: 20px; height: 20px; }

.sr-env {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
    font-size: 14px;
    font-weight: 700;
}

.sr-note {
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 8px;
    background: #f1f1f1;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.sr-note-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
}

.sr-terms {
    max-height: 220px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.sr-agree {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 22px 0 18px;
    font-size: 15px;
    cursor: pointer;
}

.sr-agree input { width: 22px; height: 22px; }

.sr-error {
    margin-bottom: 12px;
    color: #d11;
    font-size: 13px;
    text-align: center;
}

/* ---- ボタン ---- */
.sr-btn {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.sr-btn-primary { background: var(--sr-accent); color: var(--sr-on-accent, #3b2a25); }

.sr-btn-start {
    max-width: 300px;
    margin: 0 auto;
    background: var(--sr-accent);
    color: var(--sr-on-accent, #3b2a25);
    text-align: center;
}

.sr-btn:disabled {
    background: #e2e2e2;
    color: #7a7a7a;
    cursor: not-allowed;
    text-align: center;
}

/* ---- ダイアログ ---- */
.sr-dialog {
    box-sizing: border-box;
    width: 100%;
    max-width: 360px;
    padding: 26px 22px 22px;
    border-radius: 18px;
    background: #fff;
    text-align: center;
    animation: sr-up .2s ease-out;
}

.sr-dialog-title { margin: 0 0 10px; font-size: 17px; color: var(--sr-text); }

.sr-dialog-text {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.7;
    color: #444;
    text-align: left;
}

.sr-got { margin: 6px 0 22px; }

.sr-got-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: var(--sr-accent);
    color: #fff;
    font-size: 40px;
    font-weight: 700;
    animation: sr-pop .45s cubic-bezier(.2, 1.6, .4, 1);
}

@keyframes sr-pop { from { transform: scale(.3); } to { transform: scale(1); } }

.sr-got-count { font-size: 20px; font-weight: 700; color: var(--sr-text); }

/* ---- スタンプラリートップ ---- */
.sr-progress { margin: 0 0 18px; text-align: center; }
.sr-progress-num { font-size: 32px; font-weight: 700; color: var(--sr-accent); }

.sr-list-title { margin-top: 26px; }

.sr-spot-list { margin: 0; padding: 0; list-style: none; }

.sr-spot {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 4px;
    border: 0;
    border-bottom: 1px solid #eee;
    background: none;
    text-align: left;
    cursor: pointer;
}

.sr-spot-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 2px solid #ccc;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.sr-spot.is-done .sr-spot-mark { border-color: #5b9a5b; background: #5b9a5b; }
.sr-spot-name { font-size: 14px; font-weight: 700; color: var(--sr-text); }

/* メニュー */
.category-menu .menu-stamp a { text-decoration: none; }

/* =============================================
   抽選・クーポン
   ============================================= */

/* ボタン（副）・余白 */
.sr-btn-secondary {
    background: #fff;
    color: #555;
    border: 1px solid #cfcfcf;
}
.sr-btn-secondary:hover { background: #f6f6f6; }

.sr-btn-gap { margin-top: 12px; }
.sr-note-gap { margin-top: 12px; }

/* ダイアログ内でボタンが複数並ぶとき（縦積み） */
.sr-dialog .sr-btn + .sr-btn { margin-top: 10px; }

/* 抽選中のスピナー */
.sr-spinner {
    width: 48px;
    height: 48px;
    margin: 6px auto 22px;
    border: 5px solid #f3d9b5;
    border-top-color: var(--sr-accent);
    border-radius: 50%;
    animation: sr-spin .8s linear infinite;
}
@keyframes sr-spin { to { transform: rotate(360deg); } }

/* スタッフ用パスコード入力 */
.sr-pin { margin: 0 0 18px; }
.sr-pin-input {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: #fafafa;
    font-size: 16px;
    text-align: center;
    letter-spacing: .15em;
}

/* 獲得済みクーポンの一覧（ホーム画面） */
.sr-coupon-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 4px;
    border: 0;
    border-bottom: 1px solid #eee;
    background: none;
    text-align: left;
    cursor: pointer;
}
.sr-coupon-row:last-child { border-bottom: 0; }
.sr-coupon-row-name { font-size: 14px; font-weight: 700; color: var(--sr-text); }
.sr-coupon-row-state { flex-shrink: 0; font-size: 12px; font-weight: 700; color: #5b9a5b; }
.sr-coupon-row-state.is-used,
.sr-coupon-row-state.is-expired { color: #999; }

/* クーポン画面 */
.sr-coupon {
    box-sizing: border-box;
    width: 100%;
    max-width: 360px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
    text-align: center;
    animation: sr-up .22s ease-out;
}

.sr-coupon-head {
    padding: 20px 18px;
    background: var(--sr-accent);
    color: var(--sr-on-accent, #3b2a25);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
}
.sr-coupon.is-inactive .sr-coupon-head { background: #bdbdbd; color: #fff; }

.sr-coupon-body { padding: 20px 22px 24px; color: var(--sr-text); }

.sr-coupon-label { font-size: 12px; font-weight: 700; color: #777; }
.sr-coupon-usage-label { margin-top: 18px; }

.sr-coupon-code {
    margin: 6px 0 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: .12em;
}
.sr-coupon.is-inactive .sr-coupon-code { color: #aaa; text-decoration: line-through; }

.sr-coupon-expiry { font-size: 13px; line-height: 1.6; }

/* スクリーンショットの使い回し防止用の時計 */
.sr-coupon-clock {
    margin: 12px 0 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f1f1f1;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sr-coupon-usage {
    margin: 6px 0 20px;
    font-size: 13px;
    line-height: 1.8;
    text-align: left;
    white-space: pre-line;
}

.sr-coupon-badge {
    margin: 4px 0 6px;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
}
.sr-coupon-badge.is-used,
.sr-coupon-badge.is-expired { background: #eee; color: #777; }


/* ---- 台紙（スタンプグリッド） ---- */
.sr-sheet.has-bg { background-size: cover; background-position: center; background-attachment: local; }

.sr-spot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.sr-spot-grid .sr-spot {
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 6px 12px;
    border: 1px solid #ececec;
    border-radius: 14px;
    background: rgba(255, 255, 255, .85);
    text-align: center;
}

.sr-spot-grid .sr-spot.is-done { border-color: var(--sr-accent); }

.sr-stamp-slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 96px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}

.sr-stamp-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: grayscale(1);
    opacity: .35;
    transition: filter .3s, opacity .3s;
}

.sr-spot.is-done .sr-stamp-img { filter: none; opacity: 1; }

.sr-spot.is-new .sr-stamp-img { animation: sr-stamp-in .6s .35s cubic-bezier(.2, 1.4, .4, 1) both; }

.sr-spot-grid .sr-spot-mark { flex: 0 0 auto; width: 44px; height: 44px; font-size: 22px; }

.sr-spot-mark-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 22px !important;
    height: 22px !important;
    font-size: 13px !important;
    border-color: #5b9a5b;
    background: #5b9a5b;
}

.sr-spot-grid .sr-spot-name { font-size: 12px; line-height: 1.4; word-break: break-all; }

@keyframes sr-stamp-in {
    0%   { transform: scale(2.6) rotate(-18deg); opacity: 0; }
    55%  { transform: scale(.92) rotate(4deg);   opacity: 1; }
    75%  { transform: scale(1.06) rotate(-2deg); }
    100% { transform: scale(1) rotate(0); }
}

/* ---- スタンプ獲得の演出 ---- */
.sr-got-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    margin: 0 auto 8px;
}

.sr-got-stage::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 3px solid var(--sr-accent);
    border-radius: 50%;
    opacity: 0;
    animation: sr-ring .7s .35s ease-out;
}

.sr-got-stamp {
    width: 124px;
    height: 124px;
    object-fit: contain;
    animation: sr-stamp-in .6s cubic-bezier(.2, 1.4, .4, 1) both;
}

.sr-got-stage .sr-got-icon { margin: 0 auto; }

.sr-got-cover {
    display: block;
    width: 100%;
    max-height: 180px;
    margin: 0 0 12px;
    border-radius: 12px;
    object-fit: cover;
}

@keyframes sr-ring {
    0%   { transform: scale(.6); opacity: .7; }
    100% { transform: scale(1.5); opacity: 0; }
}

.sr-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.sr-confetti-piece {
    position: absolute;
    top: -14px;
    width: 9px;
    height: 14px;
    border-radius: 2px;
    opacity: 0;
    animation-name: sr-fall;
    animation-timing-function: ease-in;
    animation-fill-mode: forwards;
}

@keyframes sr-fall {
    0%   { opacity: 1; transform: translateY(0) rotate(0); }
    100% { opacity: 1; transform: translateY(105vh) rotate(540deg); }
}

@media (prefers-reduced-motion: reduce) {
    .sr-got-stamp, .sr-got-icon, .sr-spot.is-new .sr-stamp-img { animation: none; }
    .sr-got-stage::after { display: none; }
    .sr-confetti { display: none; }
}