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

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --text-color: #2d3436;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --chrome-light: #e8e8e8;
    --chrome-mid: #b8b8b8;
    --chrome-dark: #707070;
    --chrome-shadow: #404040;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(180deg, #1a0a2e 0%, #2d1b4e 50%, #1a0a2e 100%);
    min-height: 100vh;
    color: var(--text-color);
    overflow-x: hidden;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 32px;
}

.header {
    text-align: center;
    padding: 20px 0 16px;
}

.header h1 {
    font-size: 32px;
    color: #ffd700;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.8),
        0 2px 0 #b8860b,
        0 4px 0 #8b6914,
        0 6px 10px rgba(0, 0, 0, 0.5);
    font-weight: 900;
    letter-spacing: 4px;
}

.wheels-section {
    margin: 20px 0;
}

.slot-machine {
    background: linear-gradient(180deg, 
        #f0f0f0 0%, 
        #d0d0d0 5%, 
        #a0a0a0 10%, 
        #c0c0c0 15%,
        #e8e8e8 20%,
        #d8d8d8 50%,
        #b0b0b0 80%,
        #909090 90%,
        #707070 100%
    );
    border-radius: 20px;
    padding: 20px 16px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.8),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    border: 3px solid var(--chrome-mid);
    position: relative;
}

.slot-machine::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 10px;
    right: 10px;
    height: 30%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
    border-radius: 15px 15px 50% 50%;
    pointer-events: none;
}

.wheel-wrapper {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 
        inset 0 4px 10px rgba(0, 0, 0, 0.8),
        0 2px 0 rgba(255, 255, 255, 0.1);
}

.wheel-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.wheel-label {
    font-size: 14px;
    font-weight: 800;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.6),
        0 1px 0 #8b6914;
}

.wheel-container {
    position: relative;
    width: 140px;
    height: 135px;
    background: linear-gradient(90deg, 
        #d0d0d0 0%, 
        #f5f5f5 10%, 
        #ffffff 50%, 
        #f5f5f5 90%, 
        #d0d0d0 100%
    );
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.15),
        inset 5px 0 10px rgba(0, 0, 0, 0.1),
        inset -5px 0 10px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--chrome-mid);
}

.wheel-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 25px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}

.wheel-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.15) 0%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}

.wheel-strip {
    position: absolute;
    width: 100%;
    transition: transform 2s cubic-bezier(0.15, 0.85, 0.35, 1.05);
}

.wheel-item {
    width: 100%;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    text-shadow: 
        1px 1px 0 #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    background: linear-gradient(180deg, 
        rgba(255, 100, 100, 0.9) 0%, 
        rgba(255, 150, 50, 0.9) 100%
    );
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.wheel-item::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 10%;
    right: 10%;
    height: 30%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
    border-radius: 50%;
}

.wheel-divider {
    width: 12px;
    background: linear-gradient(90deg,
        #606060 0%,
        #909090 20%,
        #c0c0c0 50%,
        #909090 80%,
        #606060 100%
    );
    border-radius: 4px;
    box-shadow: 
        inset 0 0 5px rgba(0, 0, 0, 0.5),
        0 0 3px rgba(0, 0, 0, 0.3);
    margin: 0 -2px;
    flex-shrink: 0;
}

.wheel-pointer {
    display: none;
}

.wheel-center-pointer {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 20;
    pointer-events: none;
}

.wheel-center-pointer::before,
.wheel-center-pointer::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
}

.wheel-center-pointer::before {
    left: 2px;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 14px solid #ffd700;
    filter: drop-shadow(2px 0 3px rgba(0, 0, 0, 0.4));
}

.wheel-center-pointer::after {
    right: 2px;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 14px solid #ffd700;
    filter: drop-shadow(-2px 0 3px rgba(0, 0, 0, 0.4));
}

.wheel-arrow {
    display: none;
}

.spin-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(180deg, 
        #ff4444 0%, 
        #cc0000 50%, 
        #aa0000 100%
    );
    color: white;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 
        0 6px 0 #660000,
        0 8px 15px rgba(0, 0, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.1s;
    min-width: 100px;
    border: 2px solid #880000;
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 0 #660000,
        0 10px 20px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.spin-btn:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 
        0 2px 0 #660000,
        0 4px 10px rgba(0, 0, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.spin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translateY(4px);
    box-shadow: 
        0 2px 0 #660000,
        0 4px 10px rgba(0, 0, 0, 0.4);
}

@keyframes winner-highlight {
    0%, 100% {
        background: linear-gradient(180deg, 
            rgba(255, 215, 0, 0.3) 0%, 
            rgba(255, 215, 0, 0.1) 100%
        );
    }
    50% {
        background: linear-gradient(180deg, 
            rgba(255, 215, 0, 0.6) 0%, 
            rgba(255, 215, 0, 0.3) 100%
        );
    }
}

.wheel-item.highlight {
    animation: winner-highlight 0.5s ease-in-out 3;
}

.result-display {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 12px;
    text-align: center;
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.5),
        0 2px 0 rgba(255, 255, 255, 0.1);
    border: 2px solid #404040;
}

.result-text {
    font-size: 20px;
    font-weight: 800;
    color: #ffd700;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.6),
        0 2px 0 #8b6914;
}

.controls-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: var(--shadow);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.stats strong {
    color: var(--primary-color);
    font-size: 18px;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 48px;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.categories-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: var(--shadow);
}

.categories-section h2 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-card {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
}

.category-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.category-actions {
    display: flex;
    gap: 8px;
}

.category-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.brands-list {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.brand-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border-radius: 20px;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.brand-tag .delete-brand {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.add-brand-btn {
    padding: 6px 12px;
    border: 1px dashed #ccc;
    border-radius: 20px;
    background: transparent;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-brand-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.history-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: var(--shadow);
    display: none;
}

.history-section.visible {
    display: block;
}

.history-section h2 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    border-radius: 10px;
    font-size: 14px;
}

.history-time {
    color: #888;
    font-size: 12px;
}

.history-result {
    font-weight: 600;
    color: var(--primary-color);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal.visible {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    font-size: 18px;
    margin-bottom: 16px;
    text-align: center;
}

.modal-content input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-hint {
    font-size: 12px;
    color: #888;
    text-align: center;
    margin-bottom: 12px;
}

.modal-subtitle {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-bottom: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(180deg, #ffd700 0%, #ffaa00 100%);
    color: #333;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 200;
    white-space: nowrap;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
    border: 2px solid #cc8800;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.empty-hint {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
}

@media (max-width: 360px) {
    .container {
        padding: 12px;
    }
    
    .wheel-container {
        width: 120px;
        height: 120px;
    }
    
    .wheel-item {
        height: 40px;
        font-size: 14px;
    }
    
    .header h1 {
        font-size: 26px;
    }
    
    .wheel-divider {
        width: 10px;
    }
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.auth-title {
    font-size: 28px;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-color);
}

.auth-subtitle {
    font-size: 14px;
    text-align: center;
    color: #888;
    margin-bottom: 24px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: #f0f0f0;
    color: #666;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-submit {
    margin-top: 8px;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    padding: 0 16px;
    color: #888;
    font-size: 14px;
}

.auth-guest {
    width: 100%;
}

.auth-guest-hint {
    font-size: 12px;
    color: #888;
    text-align: center;
    margin-top: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.user-info span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.btn-logout {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}
