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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #4a5568;
    padding: 15px;
    margin: 0;
    min-height: 100vh;
    height: 100vh;
    overflow-x: hidden;
}

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

h1 {
    text-align: center;
    margin-bottom: 15px;
    color: white;
    font-size: 28px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

/* Quick Input Section */
.quick-input-section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.top-info {
    text-align: center;
    margin-bottom: 20px;
}

.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

.collaborative-info {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.collaborative-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Clear Button */
#clearPedestals {
    display: block;
    margin: 0 auto 25px auto;
    margin-bottom: 10px !important;
    padding: 8px 16px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#clearPedestals:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.input-mode-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mode-panel {
    margin-bottom: 15px;
}

/* Click Mode */
.color-palette {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.color-btn {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    font-weight: bold;
    font-size: 18px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.color-btn.active {
    border-color: white;
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Type Mode */
#quickInput {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

#quickInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#parseInput {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#parseInput:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* Pedestals Grid */
.pedestals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.pedestal {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.pedestal.complete {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(34, 139, 34, 0.1) 100%);
}

.pedestal-number {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pedestal-colors {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-slots-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.color-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
    min-height: 35px;
    flex: 1;
}

.color-slot.filled {
    background: white;
    border-color: #667eea;
}

.color-slot-display {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.color-slot-text {
    font-weight: 600;
    font-size: 12px;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #333;
    display: inline-block;
}

.pedestal-color-selectors {
    display: flex;
    flex-direction: column;
        gap: 8px;
        margin-top: 8px;
    }
    
    .slot-selectors {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .slot-label {
        font-size: 11px;
        font-weight: 600;
        color: #666;
        min-width: 40px;
        text-align: right;
    }
    
    .slot-colors {
        display: flex;
    gap: 4px;
    flex: 1;
}

.pedestal-color-btn {
    flex: 1;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    font-size: 10px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.pedestal-color-btn.active {
    border-color: grey;
    border-width: 2px;
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Solution Section */
.solution-section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-height: 130px;
}

#solutions {
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Reference Section */
.reference-section {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.toggle-btn {
    width: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-1px);
}

.cubes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.cube {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    background: #f8f9fa;
}

.cube-number {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cube .color-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px 0;
    font-weight: 600;
}

.cube .color-pair span {
    flex: 0 0 45px;
    text-align: right;
    font-size: 12px;
}

.cube .color-pair span:last-child {
    text-align: left;
}

.cube .color-pair .color-box {
    flex: 0 0 25px;
    margin: 0 5px;
}

.cube .color-pair span:nth-child(3) {
    flex: 0 0 15px;
    text-align: center;
    margin: 0 5px;
}

/* Clear Button */
#clearPedestals {
    display: block;
    margin: 15px auto 0;
    padding: 10px 20px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#clearPedestals:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 24px;
    }

    .pedestals-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pedestal {
        padding: 15px;
        min-height: 160px;
        font-size: 14px;
    }

    .pedestal-color-selectors {
        gap: 6px;
        margin-top: 10px;
    }

    .pedestal-color-btn {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .cubes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cube {
        padding: 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .pedestals-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .pedestal {
        padding: 12px;
        min-height: 150px;
        font-size: 13px;
    }

    .pedestal-color-selectors {
        gap: 5px;
        margin-top: 8px;
    }

    .cubes-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cube {
        padding: 8px;
        font-size: 11px;
    }

    .pedestal-color-btn {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }
}