/* Genshin Impact Theme - Purple & Gold */
:root {
    --genshin-primary: #9333ea;
    --genshin-secondary: #fbbf24;
    --genshin-accent: #a855f7;
    --genshin-dark: #1a0f2e;
    --genshin-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(--genshin-darker) 0%, var(--genshin-dark) 100%);
    min-height: 100vh;
    padding: 20px;
    color: white;
}

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

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

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

/* Game Header */
.game-header {
    position: relative;
    margin-bottom: 40px;
    border-radius: 20px;
    overflow: hidden;
}

.game-banner {
    position: relative;
    height: 280px;
    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(--genshin-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(--genshin-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(--genshin-secondary);
    font-weight: 600;
}

/* User Info Box */
.user-info-box {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2) 0%, rgba(168, 85, 247, 0.1) 100%);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.user-info-box h2 {
    color: var(--genshin-secondary);
    margin-bottom: 25px;
    font-size: 1.5em;
    text-align: center;
}

/* 並排佈局 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 0;
}

.input-field,
.select-field {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 1em;
    transition: all 0.3s ease;
}

.input-field:focus,
.select-field:focus {
    outline: none;
    border-color: var(--genshin-secondary);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

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

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

/* Items Box */
.items-box {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15) 0%, rgba(168, 85, 247, 0.08) 100%);
    border: 2px solid rgba(251, 191, 36, 0.2);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 60px;
    backdrop-filter: blur(10px);
}

.items-box h2 {
    color: var(--genshin-secondary);
    margin-bottom: 30px;
    font-size: 1.5em;
    text-align: center;
}

/* Items Grid - 3 columns */
.items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Item Card */
.item-card {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.25) 0%, rgba(168, 85, 247, 0.15) 100%);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

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

.item-card:hover {
    transform: translateY(-5px);
    border-color: var(--genshin-secondary);
    box-shadow: 0 15px 40px rgba(251, 191, 36, 0.4);
}

.item-card.selected {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.4) 0%, rgba(168, 85, 247, 0.3) 100%);
    border-color: var(--genshin-secondary);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
}

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

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

.item-badge {
    background: var(--genshin-primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
}

.item-price {
    font-size: 1.8em;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
}

/* Buy Button */
.buy-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--genshin-primary) 0%, var(--genshin-accent) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
    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(147, 51, 234, 0.5);
}

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

.buy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.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(--genshin-dark) 0%, #1a0f2e 100%);
    border: 2px solid var(--genshin-secondary);
    border-radius: 20px;
    padding: 35px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(251, 191, 36, 0.5);
}

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

.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(--genshin-primary) 0%, var(--genshin-accent) 100%);
    color: white;
}

.btn-confirm:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(147, 51, 234, 0.6);
}

.btn-confirm: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;
}

/* Responsive */
@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;
    }
    
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@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;
    }
    
    .user-info-box,
    .items-box {
        padding: 20px;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .item-amount {
        font-size: 1.2em;
    }
    
    .item-price {
        font-size: 1.5em;
    }
}
