* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.title {
    text-align: center;
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    margin: 0;
    line-height: 1;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.rules {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.guess-input {
    flex: 1;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    letter-spacing: 2px;
}

.guess-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.submit-btn {
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: bold;
}

.attempts {
    color: #667eea;
}

.attempts-warning {
    color: #e74c3c !important;
}

.attempts-danger {
    color: #c0392b !important;
    font-weight: bold !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.history {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateX(5px);
}

.guess-number {
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.result {
    font-weight: bold;
    color: #e74c3c;
}

.new-game-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.new-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.success {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2c3e50;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    animation: bounce 0.5s ease-in-out;
}

.game-over {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    animation: shake 0.5s ease-in-out;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.error {
    color: #e74c3c;
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
}

.hint {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    color: #2c3e50;
}

.title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    align-items: center;
    /* 垂直置中 */
    gap: 12px;
    margin-bottom: 10px;
    /* 取代原本 .title 的下邊距 */
    background: #fff;
}

.title-row .title {
    margin: 0;
    /* 避免多餘空隙 */
}

.title-logo {
    height: 98px;
    /* 調整圖示高度 */
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    /* 可選：圓角 */
    background: transparent;
}

.logo-big {
    height: 142px;
}

/* 只放大第二張 */

@media (max-width: 400px) {
    .title-logo {
        height: 78px;
    }
}