@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f29;
    --bg-tertiary: #22272e;
    --accent-green: #52c41a;
    --accent-green-hover: #73d13d;
    --accent-red: #ff4d4f;
    --text-primary: #ffffff;
    --text-secondary: #8b949e;
    --border-color: #2d333b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f1419 0%, #1a1f29 100%);
    min-height: 100vh;
    padding: 40px 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

.dirt-background {
    display: none;
}

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

.header {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeIn 0.6s ease-out;
}

.minecraft-logo h1 {
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-green) 0%, #95de64 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.minecraft-logo h2 {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 12px;
}

.search-box {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    animation: slideUp 0.6s ease-out;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 12px;
    margin-bottom: 16px;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
}

.port-wrapper {
    max-width: none;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.3px;
}

input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent-green);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(82, 196, 26, 0.1);
}

input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.minecraft-btn {
    background: var(--accent-green);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-shadow: var(--shadow-sm);
}

.minecraft-btn:hover {
    background: var(--accent-green-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.minecraft-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.minecraft-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.popular-servers {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 13px;
    letter-spacing: 0.5px;
}

.server-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.server-tag {
    background: var(--bg-tertiary);
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.server-tag:hover {
    background: var(--accent-green);
    border-color: var(--accent-green);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.history-box {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    animation: slideUp 0.6s ease-out;
}

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

.history-header h3 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.clear-history-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.clear-history-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.history-item {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:hover {
    background: var(--bg-primary);
    border-color: var(--accent-green);
    transform: translateX(4px);
}

.history-text {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
}

.history-remove {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-remove:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
    transform: scale(1.1);
}

.results {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    animation: slideUp 0.6s ease-out;
    display: none;
}

.results.show {
    display: block;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.online {
    background: var(--accent-green);
    box-shadow: 0 0 12px rgba(82, 196, 26, 0.6);
    animation: pulse 2s infinite;
}

.status-indicator.offline {
    background: var(--accent-red);
    box-shadow: 0 0 12px rgba(255, 77, 79, 0.6);
}

.status-title {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.share-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: var(--accent-green);
    border-color: var(--accent-green);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.share-btn:active {
    transform: translateY(0);
}

.info-section {
    margin-bottom: 24px;
}

.info-section h3 {
    font-size: 0.9em;
    margin-bottom: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.info-content {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.motd-display {
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.8;
    white-space: pre-wrap;
    font-size: 14px;
}

.motd-display .minecraft-format-obfuscated {
    animation: obfuscate 0.5s infinite;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.info-item {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.info-item strong {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.player-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.player-item {
    background: var(--bg-primary);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.player-item:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-green);
}

.player-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-green);
    border-radius: 6px;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.loading {
    text-align: center;
    padding: 60px 20px;
}

.loading p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 8px;
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-green);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.error {
    background: rgba(255, 77, 79, 0.1);
    color: var(--accent-red);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 77, 79, 0.3);
    font-weight: 500;
}

.error ul {
    margin-top: 12px;
    margin-left: 20px;
    color: var(--text-secondary);
}

.error ul li {
    margin-bottom: 6px;
}

.favicon-img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    image-rendering: pixelated;
}

.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--accent-green);
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    font-size: 14px;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification.show {
    transform: translateX(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

@keyframes obfuscate {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@media (max-width: 768px) {
    body {
        padding: 20px 16px;
    }

    .header {
        margin-bottom: 32px;
    }

    .minecraft-logo h1 {
        font-size: 2em;
    }

    .minecraft-logo h2 {
        font-size: 1em;
    }

    .search-box {
        padding: 24px;
    }

    .input-group {
        grid-template-columns: 1fr;
    }

    .results {
        padding: 24px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .status-header {
        flex-wrap: wrap;
    }

    .share-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 12px;
    }

    .notification {
        left: 16px;
        right: 16px;
        transform: translateY(-100px);
    }

    .notification.show {
        transform: translateY(0);
    }
}

.results:empty {
    display: none;
}
.history-container {
    display: none;
    margin-top: 20px;
}

.history-box {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    animation: slideUp 0.6s ease-out;
}