.stamprally-wrap {
    max-width: 800px;
    margin: 0 auto;
}

.stamprally-title {
    text-align: center;
    margin-bottom: 0.5em;
}

.stamprally-status {
    text-align: center;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: 6px;
    background: #f0f0f1;
    color: #333;
    font-size: 0.95em;
}

.stamprally-status.is-error {
    background: #fbeaea;
    color: #a00;
}

.stamprally-status.is-near {
    background: #eaf7ea;
    color: #1a6b1a;
    font-weight: bold;
}

.stamprally-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
}

.stamprally-badge {
    padding: 6px 12px;
    border-radius: 20px;
    background: #ddd;
    color: #666;
    font-size: 0.85em;
    border: 2px solid transparent;
}

.stamprally-badge.is-collected {
    background: #ffd700;
    color: #5a4600;
    border-color: #c9a800;
}

.stamprally-badge.is-newly-collected {
    animation: stamprally-badge-pop 0.6s ease-out;
}

@keyframes stamprally-badge-pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.stamprally-map {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* 番号付きピン型マーカー */
.stamprally-marker-wrap {
    background: transparent;
    border: none;
}

.stamprally-marker-pin {
    position: relative;
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: #e0433c;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    margin: 4px 0 0 2px;
}

.stamprally-marker-pin.is-collected {
    background: #ffb400;
}

.stamprally-marker-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
}

.stamprally-marker-check {
    position: absolute;
    top: -6px;
    right: -6px;
    transform: rotate(45deg);
    background: #1a6b1a;
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.stamprally-marker-pin.is-just-collected {
    animation: stamprally-marker-bounce 0.6s ease-out;
}

@keyframes stamprally-marker-bounce {
    0% { transform: rotate(-45deg) translateY(0); }
    30% { transform: rotate(-45deg) translateY(-10px); }
    60% { transform: rotate(-45deg) translateY(0); }
    80% { transform: rotate(-45deg) translateY(-4px); }
    100% { transform: rotate(-45deg) translateY(0); }
}

.stamprally-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.stamprally-modal {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.stamprally-modal-title {
    margin-top: 0;
}

.stamprally-modal-body {
    margin-bottom: 20px;
    line-height: 1.7;
}

.stamprally-modal-confirm {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 1.05em;
}

.stamprally-modal-confirm:disabled {
    opacity: 0.6;
    cursor: default;
}

/* 獲得結果モーダル（通常獲得・全達成） */
.stamprally-modal-overlay.is-result .stamprally-modal-body {
    text-align: center;
}

.stamprally-stamp-seal {
    display: inline-block;
    font-size: 64px;
    color: #ffb400;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    margin-bottom: 12px;
}

.stamprally-modal-overlay.is-result:not(.is-complete) .stamprally-stamp-seal {
    animation: stamprally-seal-stamp 0.5s ease-out;
}

@keyframes stamprally-seal-stamp {
    0% { transform: scale(2.2) rotate(-15deg); opacity: 0; }
    60% { transform: scale(0.9) rotate(-15deg); opacity: 1; }
    100% { transform: scale(1) rotate(-15deg); opacity: 1; }
}

.stamprally-modal-overlay.is-complete .stamprally-modal {
    border: 3px solid #ffd700;
}

.stamprally-modal-overlay.is-complete .stamprally-modal-title {
    color: #c9860a;
}

.stamprally-confetti {
    position: relative;
    height: 60px;
    overflow: hidden;
}

.stamprally-confetti::before,
.stamprally-confetti::after {
    content: '🎉 🎊 ⭐ 🎉 🎊 ⭐ 🎉 🎊';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    font-size: 22px;
    letter-spacing: 12px;
    animation: stamprally-confetti-fall 1.4s ease-in forwards;
}

.stamprally-confetti::after {
    top: -30px;
    animation-delay: 0.2s;
}

@keyframes stamprally-confetti-fall {
    0% { transform: translateY(-20px); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(70px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .stamprally-badge.is-newly-collected,
    .stamprally-marker-pin.is-just-collected,
    .stamprally-modal-overlay.is-result:not(.is-complete) .stamprally-stamp-seal,
    .stamprally-confetti::before,
    .stamprally-confetti::after {
        animation: none;
    }
}
