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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: white;
    color: var(--text-primary);
    padding: 1.5rem 2.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.logo-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Main Container */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 1.5rem auto;
    padding: 0 1rem 1.5rem;
    flex: 1;
}

/* Spinner Layout */
.spinner-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Wheel Section */
.wheel-section {
    position: sticky;
    top: 2rem;
}

.wheel-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 0 auto 1rem;
    max-width: 100%;
    overflow: visible;
}

#wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid var(--danger-color);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    z-index: 10;
}

.spin-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: 4px solid white;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 20;
}

.spin-button:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

.spin-button:active:not(:disabled) {
    transform: translate(-50%, -50%) scale(0.95);
}

.spin-button:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.result {
    text-align: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Controls Section */
.controls-section {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.options-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-container span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.options-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.reset-button {
    padding: 0.4rem 0.85rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.reset-button:hover {
    background: #db2777;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.reset-button:active {
    transform: translateY(0);
}

.add-option {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

#optionInput {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#optionInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#addBtn {
    padding: 0.5rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#addBtn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

#addBtn:active {
    transform: translateY(0);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.options-list::-webkit-scrollbar {
    width: 6px;
}

.options-list::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 3px;
}

.options-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.options-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    background: var(--bg-color);
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.option-item:hover {
    border-color: var(--primary-color);
    transform: translateX(3px);
}

.option-item.won {
    background: #f0fdf4;
    border-color: var(--success-color);
}

.option-item.won .option-text {
    color: var(--success-color);
    font-weight: 600;
}

.option-item.won .won-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--success-color);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.option-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-word;
}

.option-item .delete-btn {
    padding: 0.35rem 0.75rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-item .delete-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* SEO Content */
.seo-content {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 2.5rem;
    margin-top: 2rem;
}

.seo-container {
    max-width: 1200px;
    margin: 0 auto;
    color: var(--text-primary);
}

.seo-container h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.seo-container h3 {
    font-size: 1.35rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.seo-container p {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.seo-container ul,
.seo-container ol {
    margin: 1rem 0 1rem 2rem;
    line-height: 1.8;
}

.seo-container li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.seo-container strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Header Navigation */
.header-nav {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.header-nav a {
    padding: 0.5rem 1.25rem;
    background: var(--bg-color);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.header-nav a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.header-nav a.active {
    background: var(--primary-color);
    color: white;
}

/* Team Picker Styles */
.team-picker-section {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    align-items: start;
}

.controls-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 2rem;
}

.control-group {
    margin-bottom: 0.75rem;
}

.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.control-group input[type="number"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.control-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.add-member {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

#memberInput {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#memberInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#addMemberBtn {
    padding: 0.5rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#addMemberBtn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.members-list-container h3 {
    font-size: 1rem;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-bottom: 0.75rem;
}

.members-list::-webkit-scrollbar {
    width: 6px;
}

.members-list::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 3px;
}

.members-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.65rem;
    background: var(--bg-color);
    border-radius: 5px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.member-item:hover {
    border-color: var(--primary-color);
    transform: translateX(3px);
}

.member-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.5rem;
    font-style: italic;
    font-size: 0.9rem;
}

.delete-btn {
    padding: 0.35rem 0.75rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Picker Wheel Button */
.generate-spinner-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.picker-wheel-wrapper {
    position: relative;
    display: inline-block;
}

.picker-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: var(--danger-color);
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.picker-wheel-btn {
    position: relative;
    width: 180px;
    height: 180px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.picker-wheel-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.picker-wheel-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.picker-wheel-btn.spinning {
    animation: wheelSpin 0.5s ease-in-out;
}

@keyframes wheelSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

#pickerWheelCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.picker-center-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 3px solid white;
    z-index: 5;
}

.picker-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    text-align: center;
    line-height: 1.2;
}

.teams-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.team-card {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    overflow: hidden;
    transition: opacity 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.team-header {
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.team-size {
    font-size: 0.8rem;
    opacity: 0.9;
}

.team-members {
    padding: 1rem;
    list-style: none;
}

.team-members li {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.4rem;
    background: var(--bg-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.team-members li:last-child {
    margin-bottom: 0;
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .header p {
        font-size: 0.875rem;
    }

    .container {
        margin: 1rem auto;
    }

    /* Spinner Layout Mobile */
    .spinner-layout {
        grid-template-columns: 1fr;
    }

    .wheel-section {
        position: static;
    }

    .wheel-container {
        width: 300px;
        height: 300px;
        margin-bottom: 1rem;
    }

    .spin-button {
        width: 60px;
        height: 60px;
        font-size: 0.85rem;
    }

    .wheel-pointer {
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-top: 24px solid var(--danger-color);
    }

    .result {
        font-size: 1rem;
        padding: 0.85rem;
    }

    .options-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .options-header h2 {
        font-size: 1.1rem;
    }

    .add-option {
        flex-direction: column;
    }

    #addBtn {
        width: 100%;
    }

    .option-item {
        padding: 0.6rem 0.75rem;
    }

    .option-text {
        font-size: 0.85rem;
    }

    /* Team Picker Mobile */
    .team-picker-section {
        grid-template-columns: 1fr;
    }

    .controls-card {
        position: static;
    }

    .teams-display {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .wheel-container {
        width: 260px;
        height: 260px;
    }

    .spin-button {
        width: 55px;
        height: 55px;
        font-size: 0.8rem;
    }

    .controls-section {
        padding: 1rem;
    }
}
