/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    overflow: hidden;
    position: relative;
    
    /* 固定背景圖片 */
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    /* 備用背景色（圖片載入失敗時顯示） */
    background-color: #667eea;
}

/* 背景遮罩層（增強毛玻璃效果） */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* ========== 毛玻璃卡片 ========== */
.glass-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 32px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3), 
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    padding: 40px 30px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4), 
        inset 0 0 25px rgba(255, 255, 255, 0.3);
}

/* ========== 標題與文字 ========== */
.title {
    font-size: 1.8rem;
    color: #ffffff;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    margin-bottom: 25px;
    letter-spacing: 1px;
}

/* ========== 圖片容器 ========== */
.image-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease;
    outline: none;
}

.image-container:active {
    transform: scale(0.95);
}

.image-container:focus-visible {
    border-radius: 24px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.6);
}

.image-container img {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 24px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    pointer-events: none;
}

/* ========== 振動動畫 ========== */
@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10% { transform: translateX(-10px) rotate(-3deg); }
    20% { transform: translateX(10px) rotate(3deg); }
    30% { transform: translateX(-8px) rotate(-2deg); }
    40% { transform: translateX(8px) rotate(2deg); }
    50% { transform: translateX(-6px) rotate(-1deg); }
    60% { transform: translateX(6px) rotate(1deg); }
    70% { transform: translateX(-4px) rotate(-0.5deg); }
    80% { transform: translateX(4px) rotate(0.5deg); }
    90% { transform: translateX(-2px) rotate(0deg); }
}

/* ========== 旋轉動畫 ========== */
@keyframes spin {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.image-container.shaking img {
    animation: shake 0.6s ease-in-out;
}

.image-container.spinning img {
    animation: spin 0.8s ease-in-out;
}

/* ========== 狀態提示 ========== */
.status-indicator {
    margin-top: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    min-height: 24px;
    transition: all 0.3s;
    font-weight: 500;
}

.hint {
    margin-top: 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
}

/* ========== 響應式設計 ========== */
@media (max-width: 480px) {
    .glass-card { 
        padding: 25px 15px; 
    }
    .image-container img { 
        width: 160px; 
        height: 160px; 
    }
    .title { 
        font-size: 1.4rem; 
    }
}

@media (max-width: 320px) {
    .image-container img { 
        width: 130px; 
        height: 130px; 
    }
    .glass-card { 
        padding: 20px 10px; 
    }
}