/* =======================================================
 * Stamp Rally – スタイルシート
 * モバイルファーストの設計
 * ======================================================= */

/* -------------------------------------------------------
 * CSS変数
 * ----------------------------------------------------- */
:root {
    --sr-primary: #e63946;
    --sr-primary-dk: #c12a35;
    --sr-accent: #457b9d;
    --sr-green: #2dc653;
    --sr-bg: #f8f8f8;
    --sr-surface: #ffffff;
    --sr-text: #1a1a2e;
    --sr-muted: #777;
    --sr-border: #e0e0e0;
    --sr-radius: 12px;
    --sr-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
    --sr-transition: 0.25s ease;
}

/* -------------------------------------------------------
 * ラッパー
 * ----------------------------------------------------- */
.sr-wrap {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
    color: var(--sr-text);
    max-width: 800px;
    margin: 0 auto;
    padding: 0 0 40px;
}

/* -------------------------------------------------------
 * ヘッダー進捗
 * ----------------------------------------------------- */
.sr-header {
    background: linear-gradient(135deg, var(--sr-primary) 0%, #a8393f 100%);
    color: #fff;
    padding: 20px;
    border-radius: 0 0 var(--sr-radius) var(--sr-radius);
    margin-bottom: 12px;
}

/* -------------------------------------------------------
 * プログレスバー
 * ----------------------------------------------------- */
.sr-progress-wrap,
.sr-progress-widget {
    width: 100%;
}

.sr-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.sr-progress-rate {
    font-size: 24px;
    font-weight: 700;
}

.sr-progress-bar-bg {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 99px;
    height: 14px;
    overflow: hidden;
}

.sr-header .sr-progress-bar-bg {
    background: rgba(255, 255, 255, 0.3);
}

.sr-progress-widget .sr-progress-bar-bg {
    background: var(--sr-border);
}

.sr-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    border-radius: 99px;
    width: 0%;
    transition: width 0.7s ease;
}

.sr-progress-widget .sr-progress-bar-fill {
    background: linear-gradient(90deg, var(--sr-primary) 0%, #ff6b72 100%);
}

.sr-progress-count {
    margin: 6px 0 0;
    font-size: 12px;
    opacity: 0.85;
}

.sr-progress-widget {
    background: var(--sr-surface);
    padding: 20px;
    border-radius: var(--sr-radius);
    box-shadow: var(--sr-shadow);
}

.sr-progress-widget .sr-progress-label {
    color: var(--sr-text);
}

.sr-progress-widget .sr-progress-count {
    color: var(--sr-muted);
}

.sr-complete-msg {
    color: var(--sr-primary);
    font-weight: 700;
    margin-top: 10px;
}

/* -------------------------------------------------------
 * プログレスウィジェット内 スタンプ場所一覧
 * ----------------------------------------------------- */
.sr-progress-location-list {
    margin-top: 24px;
    border-top: 2px solid var(--sr-border);
    padding-top: 20px;
}

.sr-progress-list-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--sr-text);
    margin: 0 0 14px;
}

.sr-progress-loc-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: background var(--sr-transition);
}

.sr-progress-loc--got {
    background: #f0fff4;
}

.sr-progress-loc--pending {
    background: #f8f8f8;
}

.sr-progress-loc-icon {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sr-progress-loc-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sr-progress-loc-emoji {
    font-size: 22px;
}

.sr-progress-loc--pending .sr-progress-loc-icon {
    filter: grayscale(1);
    opacity: 0.55;
}

.sr-progress-loc-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    border: 2px solid #fff;
}

.sr-progress-check {
    background: var(--sr-green);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    position: absolute;
    bottom: -2px;
    right: -2px;
    border: 2px solid #fff;
}

.sr-progress-pending {
    background: #bbb;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    position: absolute;
    bottom: -2px;
    right: -2px;
    border: 2px solid #fff;
}

.sr-progress-loc-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.sr-progress-loc-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--sr-text);
}

.sr-progress-loc-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    white-space: nowrap;
}

.sr-badge--got {
    background: #d4f5e2;
    color: #1a7a40;
}

.sr-badge--pending {
    background: #ebebeb;
    color: #888;
}

/* -------------------------------------------------------
 * マップ
 * ----------------------------------------------------- */
#sr-map {
    width: 100%;
    height: 380px;
    border-radius: var(--sr-radius);
    overflow: hidden;
    box-shadow: var(--sr-shadow);
}

/* -------------------------------------------------------
 * GPS状態
 * ----------------------------------------------------- */
.sr-gps-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin: 10px 0;
    border-radius: 99px;
    font-size: 13px;
    background: var(--sr-surface);
    box-shadow: var(--sr-shadow);
}

.sr-gps-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    flex-shrink: 0;
}

.sr-gps-status--ok .sr-gps-dot {
    background: var(--sr-green);
    animation: sr-pulse 1.5s infinite;
}

.sr-gps-status--error .sr-gps-dot {
    background: var(--sr-primary);
}

.sr-gps-status--waiting .sr-gps-dot {
    background: #f4a261;
    animation: sr-pulse 1s infinite;
}

@keyframes sr-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.6;
    }
}

/* -------------------------------------------------------
 * スタンプカード
 * ----------------------------------------------------- */
.sr-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 12px;
    padding-left: 10px;
    border-left: 4px solid var(--sr-primary);
}

.sr-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

.sr-card {
    background: var(--sr-surface);
    border-radius: var(--sr-radius);
    box-shadow: var(--sr-shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--sr-transition), box-shadow var(--sr-transition);
    position: relative;
}

.sr-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
}

.sr-card-icon {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--sr-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sr-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sr-card-placeholder {
    font-size: 32px;
    filter: grayscale(1);
    opacity: 0.4;
}

.sr-card--got .sr-card-placeholder {
    filter: none;
    opacity: 1;
}

.sr-card-stamp {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 900;
    color: var(--sr-primary);
    border: 3px solid var(--sr-primary);
    border-radius: 50%;
    margin: 8px;
    background: rgba(255, 255, 255, 0.85);
    transform: rotate(-15deg);
    letter-spacing: 1px;
}

.sr-card-title {
    font-size: 11px;
    font-weight: 600;
    padding: 6px 6px 8px;
    text-align: center;
    color: var(--sr-text);
}

.sr-card--got {
    border: 2px solid var(--sr-green);
}

.sr-card--pending {
    border: 2px solid var(--sr-border);
}

.sr-card--pending .sr-card-icon {
    filter: grayscale(0.6);
}

/* -------------------------------------------------------
 * マップマーカー
 * ----------------------------------------------------- */
.sr-map-marker {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 3px solid var(--sr-primary);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sr-map-marker span {
    transform: rotate(45deg);
    font-size: 18px;
    line-height: 1;
}

.sr-map-marker--got {
    border-color: var(--sr-green);
    background: #e6fff0;
}

.sr-user-marker {
    width: 36px;
    height: 36px;
    background: var(--sr-accent);
    border: 3px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    font-size: 18px;
}

/* -------------------------------------------------------
 * ポップアップ
 * ----------------------------------------------------- */
.leaflet-popup-content .sr-popup h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.leaflet-popup-content .sr-popup p {
    margin: 0 0 10px;
    color: var(--sr-muted);
    font-size: 13px;
}

.sr-popup-got {
    color: var(--sr-green);
    font-weight: 700;
    font-size: 14px;
}

.sr-popup-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
}

/* -------------------------------------------------------
 * ボタン
 * ----------------------------------------------------- */
.sr-btn {
    display: inline-block;
    background: var(--sr-primary);
    color: #fff !important;
    border: none;
    border-radius: 99px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--sr-transition), transform var(--sr-transition);
    letter-spacing: 0.5px;
}

.sr-btn:hover {
    background: var(--sr-primary-dk);
    transform: translateY(-1px);
}

.sr-btn-primary {
    background: var(--sr-primary);
    font-size: 16px;
    padding: 14px 36px;
}

/* -------------------------------------------------------
 * モーダル
 * ----------------------------------------------------- */
.sr-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

.sr-modal--open {
    display: flex;
}

.sr-modal-inner {
    background: #fff;
    border-radius: 20px;
    padding: 36px 28px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    animation: sr-modal-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes sr-modal-in {
    from {
        transform: scale(0.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.sr-stamp-animation {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
}

.sr-stamp-animation svg {
    width: 100%;
    height: 100%;
    transform: scale(0);
    filter: drop-shadow(0 0 8px rgba(230, 57, 70, 0.5));
}

.sr-stamp-anim--playing svg {
    animation: sr-stamp-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
}

@keyframes sr-stamp-pop {
    from {
        transform: scale(0) rotate(-30deg);
        opacity: 0;
    }

    60% {
        transform: scale(1.2) rotate(5deg);
    }

    to {
        transform: scale(1) rotate(-10deg);
        opacity: 1;
    }
}

.sr-modal-inner h3 {
    font-size: 22px;
    color: var(--sr-primary);
    margin: 0 0 8px;
}

.sr-modal-inner p {
    color: var(--sr-muted);
    margin: 0 0 20px;
    line-height: 1.6;
}

/* -------------------------------------------------------
 * コンプリートページ
 * ----------------------------------------------------- */
.sr-complete-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 20px;
}

.sr-complete-header {
    text-align: center;
    padding: 40px 0 30px;
}

.sr-trophy {
    font-size: 72px;
    animation: sr-trophy-bounce 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

@keyframes sr-trophy-bounce {
    from {
        transform: scale(0) rotate(-20deg);
    }

    to {
        transform: scale(1) rotate(0deg);
    }
}

.sr-complete-header h1 {
    font-size: 26px;
    color: var(--sr-primary);
    margin: 16px 0 8px;
}

.sr-complete-header p {
    color: var(--sr-muted);
    font-size: 16px;
}

/* 応募フォーム */
.sr-apply-form-wrap {
    background: var(--sr-surface);
    border-radius: var(--sr-radius);
    box-shadow: var(--sr-shadow);
    padding: 28px;
    margin-top: 24px;
}

.sr-apply-form-wrap h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.sr-apply-form-wrap>p {
    color: var(--sr-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.sr-form-group {
    margin-bottom: 18px;
}

.sr-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.sr-form-group input {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid var(--sr-border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color var(--sr-transition);
}

.sr-form-group input:focus {
    border-color: var(--sr-primary);
}

.required {
    color: var(--sr-primary);
}

.sr-form-error {
    background: #ffe0e0;
    color: var(--sr-primary);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.sr-apply-success,
.sr-incomplete-notice {
    text-align: center;
    padding: 48px 20px;
}

.sr-confetti,
.sr-incomplete-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.sr-apply-success h2 {
    font-size: 24px;
    color: var(--sr-green);
}

.sr-incomplete-notice h2 {
    font-size: 22px;
}

/* -------------------------------------------------------
 * スタンプ一覧
 * ----------------------------------------------------- */
.sr-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sr-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--sr-surface);
    border-radius: var(--sr-radius);
    box-shadow: var(--sr-shadow);
    padding: 14px;
    border-left: 5px solid var(--sr-border);
    transition: transform var(--sr-transition);
}

.sr-list-item:hover {
    transform: translateX(4px);
}

.sr-got {
    border-left-color: var(--sr-green);
}

.sr-not-got {
    border-left-color: var(--sr-border);
}

.sr-list-icon {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--sr-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sr-list-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sr-list-icon-placeholder {
    font-size: 28px;
}

.sr-not-got .sr-list-icon-placeholder {
    filter: grayscale(1);
    opacity: 0.4;
}

.sr-list-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(45, 198, 83, 0.9);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    padding: 2px 0;
}

.sr-list-info h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.sr-list-info p {
    margin: 0;
    color: var(--sr-muted);
    font-size: 13px;
}

/* -------------------------------------------------------
 * ログインリマインダー
 * ----------------------------------------------------- */
.sr-login-notice {
    text-align: center;
    padding: 40px 20px;
    background: var(--sr-surface);
    border-radius: var(--sr-radius);
    box-shadow: var(--sr-shadow);
}

.sr-login-notice p {
    margin-bottom: 16px;
    color: var(--sr-muted);
}

/* -------------------------------------------------------
 * レスポンシブ
 * ----------------------------------------------------- */
@media (min-width: 600px) {
    #sr-map {
        height: 460px;
    }

    .sr-cards {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (max-width: 400px) {
    .sr-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .sr-stamp-animation {
        width: 80px;
        height: 80px;
    }
}