/* Navigation Styles */
.main-nav {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5em;
    font-weight: 700;
    text-decoration: none;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 32px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 600;
    font-size: 1em;
    transition: color 0.2s;
    padding: 8px 16px;
    border-radius: 8px;
}

.nav-links a:hover {
    color: #667eea;
    background: #f7fafc;
}

.nav-links a.active {
    color: #667eea;
    background: #f0f4ff;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .nav-links {
        gap: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .mode-btn:last-child {
        margin-right: 8px;
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: 100vh;
    color: #2d3748;
}

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

header {
    text-align: center;
    margin-bottom: 50px;
}

h1 {
    font-size: 4em;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;  /* ADD THIS LINE */
}

.subtitle {
    color: #718096;
    font-size: 1.1em;
}

.mode-toggle {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 50px;
    background: #fff;
    padding: 6px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.mode-btn {
    padding: 12px 32px;
    background: transparent;
    border: none;
    color: #718096;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s;
}

.mode-btn:hover {
    color: #4a5568;
}

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

.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: stretch;  /* Change this from 'start' to 'stretch' */
}

.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 750px;
    justify-content: flex-start; 
    gap: 20px;
    background: #fff;
    padding: 24px 32px 32px 32px;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    height: 100%;
} 


.wheel-container {
    position: relative;
    width: 550px;
    height: 550px;
    margin-top: 50px;
    flex-shrink: 0;
}

.wheel-pointer {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));  /* STRONGER shadow */
    z-index: 10;
    -webkit-backface-visibility: hidden;  /* ADD - smoother edges */
    backface-visibility: hidden;  /* ADD - smoother edges */
    will-change: transform;  /* ADD - crisper rendering */
}

canvas {
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 5;
    border: 4px solid #fff;
}

.spin-btn {
    padding: 16px 56px;
    font-size: 1.1em;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin-top: 16px;
    margin-bottom: 0;
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.control-panel {
    background: #fff;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.control-panel h2 {
    font-size: 1.5em;
    margin-bottom: 24px;
    font-weight: 700;
    color: #2d3748;
}

.section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 0.9em;
    font-weight: 600;
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    background: #f7fafc;
    border-radius: 12px;
    color: #2d3748;
    font-size: 1em;
    transition: all 0.2s;
    font-family: inherit;
}

.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

.color-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 56px;
    height: 50px;
    border: 2px solid #e2e8f0;
    background: #f7fafc;
    border-radius: 12px;
    cursor: pointer;
    padding: 4px;
}

.color-input-wrapper input[type="number"] {
    width: 80px;
}

.btn-group {
    display: flex;
    gap: 8px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95em;
}

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

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-clear {
    background: #f7fafc;
    color: #718096;
    border: 2px solid #e2e8f0;
}

.btn-clear:hover {
    background: #edf2f7;
    color: #4a5568;
}

.entries-section {
    margin-top: 0px;
}

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

.entries-header h3 {
    font-size: 1.1em;
    font-weight: 700;
    color: #2d3748;
}

.entry-count {
    color: #a0aec0;
    font-size: 0.9em;
    font-weight: 500;
}

.entries-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.entry-item {
    background: #f7fafc;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.entry-item:hover {
    background: #edf2f7;
}

.entry-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.entry-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.entry-text {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
}

.entry-weight {
    background: #edf2f7;
    color: #667eea;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
}

.entry-item button {
    background: transparent;
    border: none;
    color: #cbd5e0;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
}

.entry-item button:hover {
    color: #e53e3e;
    background: #fff5f5;
}

.history-list {
    max-height: 100px;
    overflow-y: auto;
}

.history-item {
    background: #f7fafc;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.history-winner {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 4px;
}

.history-time {
    font-size: 0.85em;
    color: #718096;
}

.share-input {
    width: 100%;
    background: #edf2f7 !important;
    cursor: pointer;
    margin-bottom: 8px;
}

.winner-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: 1000;
    backdrop-filter: blur(8px);
}

.winner-modal.show {
    display: flex;
}

.winner-content {
    background: #fff;
    padding: 60px 80px;
    border-radius: 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-width: 500px;
    animation: modalPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.winner-content h2 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #718096;
    font-weight: 600;
}

.winner-content .winner-name {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.winner-content button {
    padding: 14px 40px;
    font-size: 1em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

@media (max-width: 1024px) {
    .main-content { grid-template-columns: 1fr; }
    .wheel-container { width: 400px; height: 400px; }
    canvas { width: 400px !important; height: 400px !important; }
    .wheel-section {
        min-height: auto;
    }
}

@media (max-width: 600px) {
    /* Fix tab bar overflow - make it scrollable */
    .mode-toggle {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start;
        padding: 6px 8px;
        gap: 11px;
    }
    .mode-toggle::-webkit-scrollbar {
        display: none;
    }
    .mode-btn {
        padding: 8px 12px;
        font-size: 0.85em;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .mode-btn:last-child {
        margin-right: 8px;
    }

    .home-header {
        display: none;
    }

    /* Fix white space */
    .wheel-section { 
        padding: 20px 16px; 
        min-height: auto;
        gap: 16px;
    }
    .wheel-container { 
        width: 300px; 
        height: 300px; 
        margin-top: 20px;
    }
    
    canvas { width: 300px !important; height: 300px !important; }
    
    .spin-btn {
        margin-top: 8px;
        padding: 14px 40px;
    }
    
    h1 { font-size: 2em; }
    .winner-content { padding: 40px; margin: 20px; }
    .winner-content .winner-name { font-size: 2em; }
    header { margin-bottom: 30px; }
    .container { padding: 20px 16px; }
}

/* Yes/No Mode Specific */
.maybe-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 10px;
    margin-bottom: 16px;
}

.maybe-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: #4a5568;
}

.maybe-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Team Builder Styles */
.teams-display {
    background: #fff;
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.teams-header {
    text-align: center;
    margin-bottom: 24px;
}

.teams-header h2 {
    font-size: 1.8em;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.teams-header p {
    color: #718096;
}

.teams-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    flex: 1;
    overflow-y: auto;
}

.team-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 20px;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
}

.team-card h3 {
    font-size: 1.2em;
    margin-bottom: 12px;
    color: #2d3748;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    font-weight: 700;
}

.team-member {
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 6px;
    color: #4a5568;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.team-count-input {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    background: #f7fafc;
    border-radius: 12px;
}

.team-count-input label {
    font-weight: 600;
    color: #4a5568;
    flex: 1;
}

.team-count-input input {
    width: 80px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    color: #2d3748;
}

.generate-teams-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.generate-teams-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.no-teams-message {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
    grid-column: 1 / -1;
}

.confetti-canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 9999 !important;
    background: transparent !important;
}

.confetti-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-weight: 600;
    color: #4a5568;
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    border-radius: 28px;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

/* Checked state */
.switch input:checked + .slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}
