/* CODM 主題配色 - 黑紅色 */
:root {
    --codm-primary: #ef4444;
    --codm-secondary: #dc2626;
    --codm-accent: #f87171;
    --codm-dark: #1a0a0a;
    --codm-darker: #0f0505;
}

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

body {
    font-family: 'Microsoft JhengHei', 'Inter', -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--codm-darker) 0%, var(--codm-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(239, 68, 68, 0.1);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    margin-bottom: 30px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.back-btn:hover {
    background: var(--codm-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(--codm-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(--codm-primary) 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(--codm-primary);
    font-weight: 600;
}

/* 商品網格 */
.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(220, 38, 38, 0.15) 0%, rgba(239, 68, 68, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--codm-primary), var(--codm-accent));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.item-card:hover::before {
    transform: scaleX(1);
}

.item-card:hover {
    transform: translateY(-8px);
    border-color: var(--codm-primary);
    box-shadow: 0 15px 40px rgba(239, 68, 68, 0.4);
}

.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(--codm-primary);
}

.item-badge {
    background: var(--codm-secondary);
    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(--codm-secondary) 0%, var(--codm-primary) 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;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.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(239, 68, 68, 0.6);
}

.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(--codm-dark) 0%, #1a0a0a 100%);
    border: 2px solid var(--codm-primary);
    border-radius: 20px;
    padding: 35px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(239, 68, 68, 0.5);
}

.modal-content h2 {
    color: var(--codm-primary);
    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(--codm-primary);
    font-size: 1.3em;
}

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

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

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

.server-select:focus,
.uid-input:focus {
    outline: none;
    border-color: var(--codm-primary);
    box-shadow: 0 0 15px rgba(239, 68, 68, 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(--codm-secondary) 0%, var(--codm-primary) 100%);
    color: white;
}

.btn-confirm:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(239, 68, 68, 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;
    }
    
    /* 商品網格 - 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.85em;
    }
}