:root {
    --bg-color: #1a1a1a;
    --card-color: #2c2c2c;
    --text-color: #f0f0f0;
    --primary-color: #00a8ff;
    --online-color: #4caf50;
    --offline-color: #f44336; /* Added for offline status */
}

body {
    margin: 0;
    padding: 0 1rem; /* Add some padding to prevent card from touching screen edges */
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.server-card {
    background-color: var(--card-color);
    padding: 2rem 3rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    filter: drop-shadow(0 0 15px rgba(0, 168, 255, 0.15));
    transition: transform 0.3s ease, filter 0.3s ease;
    width: 100%;
    max-width: 500px; /* Set a max-width for the card */
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Good practice for mobile */
    user-select: none; /* Prevents text selection on long press */
}

/* --- THIS IS THE NEW, SIMPLER FIX --- */
/* Apply hover effect ONLY if the body does NOT have the 'touch-device' class */
.touch-device .server-card:hover {
    /* Explicitly disable hover effect on touch devices */
    transform: none;
    filter: drop-shadow(0 0 15px rgba(0, 168, 255, 0.15));
}

html:not(.touch-device) .server-card:hover {
    /* Apply hover effect on non-touch devices */
    transform: translateY(-5px);
    filter: drop-shadow(0 0 25px rgba(0, 168, 255, 0.35));
}
/* --- END OF FIX --- */

.server-title {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.status-online {
    color: var(--online-color);
    font-weight: bold;
}

/* New style for offline status */
.status-offline {
    color: var(--offline-color);
    font-weight: bold;
}

.ip-container {
    /* Changed to inline-flex to fit content width */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #383838;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin-top: 1.5rem;
}

.server-ip {
    margin-right: 1rem;
    font-family: monospace;
    font-size: 1.1rem;
    word-break: break-all; /* Allow long IPs to wrap if needed */
}

.copy-ip-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.copy-ip-btn:hover {
    background-color: #007bb5;
}

.copy-ip-btn.copied {
    background-color: var(--online-color);
}

/* Style for when the button is disabled */
.copy-ip-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* --- Mobile Responsive Styles --- */
@media (max-width: 600px) {
    .server-card {
        padding: 1.5rem;
    }

    .server-title {
        font-size: 1.5rem;
    }

    p {
        font-size: 0.9rem;
    }

    .ip-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        /* The "width: 100%" was removed from here. This is the fix. */
    }

    .server-ip {
      /* Add these lines to your existing rule, or add the whole block */
      user-select: none; /* Standard */
      -webkit-user-select: none; /* Safari */
      -moz-user-select: none; /* Firefox */
      -ms-user-select: none; /* IE/Edge */
      
      /* ... any other styles you have for this class ... */
    }
}
