* {
    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;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #1877f2;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 1.1em;
}

.input-section {
    margin-bottom: 30px;
}

#uidInput {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1em;
    font-family: monospace;
    resize: vertical;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

#uidInput:focus {
    outline: none;
    border-color: #1877f2;
}

button {
    padding: 12px 30px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
}

#checkBtn {
    background: #1877f2;
    color: white;
}

#checkBtn:hover {
    background: #145dbf;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.3);
}

#checkBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

#clearBtn {
    background: #e74c3c;
    color: white;
}

#clearBtn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 3px solid #ddd;
}

.stat-box.live {
    border-color: #2ecc71;
    background: #d5f4e6;
}

.stat-box.die {
    border-color: #e74c3c;
    background: #fadbd8;
}

.stat-box.checking {
    border-color: #f39c12;
    background: #fef5e7;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #333;
}

.results-section {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.results-header h3 {
    color: #333;
    font-size: 1.5em;
}

.export-buttons button {
    padding: 10px 25px;
    font-size: 0.95em;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    margin-left: 8px;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.3);
    transition: all 0.3s;
}

.export-buttons button:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6391 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(52, 152, 219, 0.4);
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.result-column {
    display: flex;
    flex-direction: column;
}

.column-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 10px 10px 0 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.live-title {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
}

.die-title {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
}

#liveResults, #dieResults {
    width: 100%;
    min-height: 450px;
    max-height: 450px;
    padding: 20px;
    border: 3px solid;
    border-radius: 0 0 10px 10px;
    font-size: 1em;
    font-family: 'Courier New', monospace;
    resize: none;
    line-height: 1.6;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#liveResults {
    border-color: #2ecc71;
    background: linear-gradient(to bottom, #f0fff4 0%, #e8f8f0 100%);
    color: #155724;
    border-top: none;
}

#dieResults {
    border-color: #e74c3c;
    background: linear-gradient(to bottom, #fff5f5 0%, #ffe8e8 100%);
    color: #721c24;
    border-top: none;
}

#liveResults::-webkit-scrollbar, #dieResults::-webkit-scrollbar {
    width: 10px;
}

#liveResults::-webkit-scrollbar-track {
    background: #d5f4e6;
    border-radius: 10px;
}

#dieResults::-webkit-scrollbar-track {
    background: #fadbd8;
    border-radius: 10px;
}

#liveResults::-webkit-scrollbar-thumb {
    background: #2ecc71;
    border-radius: 10px;
}

#dieResults::-webkit-scrollbar-thumb {
    background: #e74c3c;
    border-radius: 10px;
}

#liveResults::-webkit-scrollbar-thumb:hover {
    background: #27ae60;
}

#dieResults::-webkit-scrollbar-thumb:hover {
    background: #c0392b;
}

#liveResults:focus, #dieResults:focus {
    outline: none;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

#results {
    max-height: 500px;
    overflow-y: auto;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 5px solid;
    background: #f8f9fa;
    transition: all 0.3s;
}

.result-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.result-item.live {
    border-left-color: #2ecc71;
    background: #d5f4e6;
}

.result-item.die {
    border-left-color: #e74c3c;
    background: #fadbd8;
}

.result-item.checking {
    border-left-color: #f39c12;
    background: #fef5e7;
}

.result-info {
    flex: 1;
}

.result-uid {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
    font-family: monospace;
}

.result-name {
    color: #666;
    font-size: 0.95em;
}

.result-status {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.result-status.live {
    background: #2ecc71;
    color: white;
}

.result-status.die {
    background: #e74c3c;
    color: white;
}

.result-status.checking {
    background: #f39c12;
    color: white;
}

.result-link {
    margin-left: 10px;
}

.result-link a {
    color: #1877f2;
    text-decoration: none;
    font-weight: bold;
}

.result-link a:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    font-size: 0.9em;
}

/* Scrollbar styling */
#results::-webkit-scrollbar {
    width: 8px;
}

#results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#results::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1877f2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 2em;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .export-buttons {
        width: 100%;
    }

    .export-buttons button {
        margin: 5px 5px 0 0;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    #liveResults, #dieResults {
        min-height: 250px;
    }
}
