/* --- Crystal Stamp Voting System --- */
.vote-item-v2 {
    margin-bottom: 16px;
}

.vote-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.crystal-stamps {
    display: flex;
    gap: 8px;
    gap: 12px;
    justify-content: center;
    margin: 10px 0;
}

.stamp-btn {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    background: #f7fafc;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: visible;
    /* エフェクトがはみ出るように */
}

.stamp-btn::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.stamp-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.stamp-emoji {
    display: none;
    /* 絵文字は非表示 */
}

.stamp-value {
    position: absolute;
    bottom: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #4a5568;
    z-index: 2;
    background: rgba(255, 255, 255, 0.8);
    padding: 0 6px;
    border-radius: 10px;
    backdrop-filter: blur(2px);
}

/* Diamond (Perfect) */
.stamp-diamond {
    background: linear-gradient(135deg, #e6f7ff 0%, #bae7ff 100%);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.stamp-diamond::before {
    background-image: url('assets/ui/crystal_diamond.png');
}

.stamp-diamond:hover,
.stamp-diamond.selected {
    border-color: #1890FF;
    background: linear-gradient(135deg, #bae7ff 0%, #91d5ff 100%);
    box-shadow: 0 0 20px rgba(24, 144, 255, 0.6);
}

/* Gold (Good) */
.stamp-gold {
    background: linear-gradient(135deg, #fffbe6 0%, #fff1b8 100%);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.stamp-gold::before {
    background-image: url('assets/ui/crystal_gold.png');
}

.stamp-gold:hover,
.stamp-gold.selected {
    border-color: #FAAD14;
    background: linear-gradient(135deg, #fff1b8 0%, #ffe58f 100%);
    box-shadow: 0 0 20px rgba(250, 173, 20, 0.6);
}

/* Silver (Fair) */
.stamp-silver {
    background: linear-gradient(135deg, #f5f5f5 0%, #d9d9d9 100%);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.stamp-silver::before {
    background-image: url('assets/ui/crystal_silver.png');
    filter: grayscale(100%) brightness(1.1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.stamp-silver:hover,
.stamp-silver.selected {
    border-color: #8C8C8C;
    background: linear-gradient(135deg, #d9d9d9 0%, #bfbfbf 100%);
    box-shadow: 0 0 20px rgba(140, 140, 140, 0.6);
}

/* Bronze (Poor) */
.stamp-bronze {
    background: linear-gradient(135deg, #fff7e6 0%, #ffd591 100%);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.stamp-bronze::before {
    background-image: url('assets/ui/crystal_bronze.png');
    /* セピア調 + 色相調整でブロンズ色を作成 */
    filter: sepia(100%) hue-rotate(-40deg) saturate(1.5) brightness(0.9) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.stamp-bronze:hover,
.stamp-bronze.selected {
    border-color: #D48806;
    background: linear-gradient(135deg, #FFD591 0%, #FFA940 100%);
    box-shadow: 0 0 20px rgba(212, 136, 6, 0.6);
}

/* Selected state */
.stamp-btn.selected {
    transform: scale(1.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.stamp-btn.selected::before {
    transform: translateX(-50%) scale(1.2);
    animation: bounce 0.5s ease;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

@keyframes bounce {

    0%,
    100% {
        transform: translateX(-50%) scale(1.2);
    }

    50% {
        transform: translateX(-50%) scale(1.3);
    }
}

.stamp-btn.selected .stamp-value {
    color: #1a202c;
    font-weight: 900;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Flash animation */
@keyframes stamp-flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
        transform: scale(1.15);
    }
}

.stamp-flash {
    animation: stamp-flash 0.3s ease;
}

.stamp-flash::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: flash-pulse 0.3s ease;
}

@keyframes flash-pulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* Close button */
.close-btn-mini {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #718096;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.close-btn-mini:hover {
    background: #e53e3e;
    color: white;
    transform: scale(1.1);
}

/* --- Image Zoom Overlay --- */
.tori-score-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tori-score-zoom-overlay.active {
    opacity: 1;
}

.tori-score-zoom-image {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tori-score-zoom-overlay.active .tori-score-zoom-image {
    transform: scale(1);
}

.zoom-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.zoom-close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* --- Zoom Floating Action Button --- */
.tori-score-zoom-fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #2e7d32;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(100px);
    opacity: 0;
}

.tori-score-zoom-fab.active {
    transform: translateY(0);
    opacity: 1;
}

.tori-score-zoom-fab:hover {
    transform: scale(1.1) translateY(-2px);
    background: #388e3c;
}

.tori-score-zoom-fab:active {
    transform: scale(0.9);
}

.tori-score-zoom-fab .fab-label {
    position: absolute;
    right: 65px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.tori-score-zoom-fab:hover .fab-label {
    opacity: 1;
}