/* MLBB 主題配色 - 紫金色 */
:root {
    --mlbb-primary: #5a3fb5;
    --mlbb-secondary: #d4af37;
    --mlbb-accent: #7c4dff;
    --mlbb-dark: #1a0f2e;
    --mlbb-darker: #0f0822;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', 'Inter', -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--mlbb-darker) 0%, var(--mlbb-dark) 100%);
    min-height: 100vh;
    padding: 20px;
    color: white;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 返回按鈕 */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1em;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-btn:hover {
    background: var(--mlbb-primary);
    transform: translateX(-5px);
}

/* 遊戲標題區 */
.game-header {
    position: relative;
    margin-bottom: 50px;
    border-radius: 20px;
    overflow: hidden;
}

.game-banner {
    position: relative;
    height: 300px;
    width: 100%;
}

.game-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, var(--mlbb-darker) 100%);
}

.game-title {
    position: absolute;
    bottom: 30px;
    left: 40px;
    z-index: 10;
}

.game-title h1 {
    font-size: 3em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--mlbb-secondary) 0%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.game-subtitle {
    font-size: 1.3em;
    color: var(--mlbb-secondary);
    font-weight: 600;
}

/* 區域選擇器 */
.region-selector {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.region-btn {
    padding: 16px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border: 2px solid rgba(212, 175, 55, 0.3);
    background: rgba(90, 63, 181, 0.2);
    color: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.region-btn:hover {
    border-color: var(--mlbb-secondary);
    background: rgba(90, 63, 181, 0.4);
    transform: translateY(-2px);
}

.region-btn.active {
    background: linear-gradient(135deg, var(--mlbb-primary) 0%, var(--mlbb-accent) 100%);
    border-color: var(--mlbb-secondary);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

.region-btn.active:hover {
    transform: translateY(-2px);
}

/* 分類選擇器 */
.category-selector {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 12px 28px;
    font-size: 1em;
    font-weight: 600;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: rgba(26, 15, 46, 0.5);
    color: #ccc;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    color: white;
    border-color: rgba(212, 175, 55, 0.6);
    background: rgba(26, 15, 46, 0.7);
}

.category-btn.active {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--mlbb-secondary);
    color: var(--mlbb-secondary);
}

/* 商品網格 */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

/* 商品卡片 */
.item-card {
    background: linear-gradient(135deg, rgba(90, 63, 181, 0.2) 0%, rgba(124, 77, 255, 0.1) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.item-card:hover {
    transform: translateY(-8px);
    border-color: var(--mlbb-secondary);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.3);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.item-amount {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--mlbb-secondary);
}

.item-badge {
    background: var(--mlbb-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.item-price {
    font-size: 2.2em;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
}

.item-price span {
    font-size: 0.5em;
    color: #888;
    font-weight: 400;
}

/* 購買按鈕 */
.buy-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--mlbb-primary) 0%, var(--mlbb-accent) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.buy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.buy-btn:hover::before {
    left: 100%;
}

.buy-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(124, 77, 255, 0.5);
}

.buy-btn:active {
    transform: scale(0.98);
}

/* Footer */
footer {
    text-align: center;
    color: #888;
    padding: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
}

/* ========== 確認彈窗 ========== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, var(--mlbb-dark) 0%, #1a0f2e 100%);
    border: 2px solid var(--mlbb-secondary);
    border-radius: 20px;
    padding: 35px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.5);
}

.modal-content h2 {
    color: var(--mlbb-secondary);
    margin-bottom: 25px;
    font-size: 1.8em;
    text-align: center;
}

.confirm-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.confirm-item .label {
    color: #888;
    font-size: 0.95em;
}

.confirm-item .value {
    color: white;
    font-weight: 600;
}

.confirm-item .value.highlight {
    color: var(--mlbb-secondary);
    font-size: 1.3em;
}

.form-group {
    margin-top: 25px;
}

.form-group label {
    display: block;
    color: #ccc;
    margin-bottom: 10px;
    font-weight: 600;
}

.uid-input {
    width: 100%;
    padding: 14px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    color: white;
    font-size: 1em;
    transition: all 0.3s ease;
}

.uid-input:focus {
    outline: none;
    border-color: var(--mlbb-secondary);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.uid-input::placeholder {
    color: #666;
}

.hint {
    display: block;
    color: #888;
    font-size: 0.85em;
    margin-top: 8px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-cancel,
.btn-confirm {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-confirm {
    background: linear-gradient(135deg, var(--mlbb-primary) 0%, var(--mlbb-accent) 100%);
    color: white;
}

.btn-confirm:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(124, 77, 255, 0.6);
}

.btn-confirm:active {
    transform: scale(0.98);
}

/* ========== 手機版 ========== */

@media (max-width: 768px) {
    .game-title h1 {
        font-size: 2em;
    }
    
    .game-subtitle {
        font-size: 1.1em;
    }
    
    .game-title {
        left: 20px;
        bottom: 20px;
    }
    
    .game-banner {
        height: 220px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px; /* 縮小邊距 */
    }
    
    .back-btn {
        font-size: 1em;
        padding: 10px 20px;
    }
    
    .game-title h1 {
        font-size: 1.6em;
    }
    
    .game-subtitle {
        font-size: 1em;
    }
    
    .game-banner {
        height: 180px;
    }
    
    /* 區域按鈕手機版 */
    .region-selector {
        gap: 8px;
        padding: 0 5px;
    }
    
    .region-btn {
        padding: 10px 20px;
        font-size: 0.9em;
        flex: 1;
        min-width: 120px;
    }
    
    /* 分類按鈕手機版 */
    .category-selector {
        gap: 6px;
        padding: 0 5px;
    }
    
    .category-btn {
        padding: 8px 12px;
        font-size: 0.85em;
        flex: 1;
        min-width: 90px;
    }
    
    /* 商品網格 - 2欄布局 */
    .items-grid {
        grid-template-columns: repeat(2, 1fr); /* 左右各一個 */
        gap: 10px;
        padding: 0 5px;
    }
    
    /* 商品卡片縮小 */
    .item-card {
        padding: 15px;
    }
    
    .item-amount {
        font-size: 1.2em;
    }
    
    .item-badge {
        font-size: 0.75em;
        padding: 4px 8px;
    }
    
    .item-price {
        font-size: 1.4em;
    }
    
    .buy-btn {
        padding: 12px;
        font-size: 0.9em;
    }
}