* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Auth Page Styles */
.auth-box {
    background: white;
    border-radius: 15px;
    padding: 40px;
    max-width: 400px;
    margin: 100px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.auth-box h1 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #667eea;
}

#auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f0f0f0;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-form input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-form button {
    padding: 12px;
    border: none;
    background: #667eea;
    color: white;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-form button:hover {
    background: #5568d3;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9em;
    min-height: 20px;
    text-align: center;
}

/* Main App Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #667eea;
    font-size: 2em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-weight: 600;
    color: #333;
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 968px) {
    main {
        grid-template-columns: 1fr;
    }
}

.controls-section,
.wheel-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.controls-section h2,
.wheel-section h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.wheel-manager {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.wheel-manager h2 {
    margin-bottom: 15px;
}

.wheel-selector {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wheel-select {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
}

.wheel-select:focus {
    outline: none;
    border-color: #667eea;
}

.add-item-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#new-item-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
}

#new-item-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-spin {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.items-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.item-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.item-text {
    flex: 1;
    word-break: break-word;
}

.linked-indicator {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #667eea;
    color: white;
    border-radius: 4px;
    font-size: 0.85em;
}

.item-actions {
    display: flex;
    gap: 6px;
}

.btn-link {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-link:hover {
    background: #5568d3;
}

.btn-delete {
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #c0392b;
}

.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wheel-container {
    position: relative;
    margin: 30px 0;
}

#wheel-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.wheel-pointer {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3em;
    color: #e74c3c;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn-spin {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    font-size: 1.5em;
    padding: 15px 50px;
    margin-top: 20px;
}

.btn-spin:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

.btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.result-display {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-display.show {
    animation: resultPop 0.5s ease;
}

@keyframes resultPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}