:root {
    --bg: #0f1115;
    --tile: #181b22;
    --tile-hover: #20242d;
    --border: #262a33;
    --text: #e8eaee;
    --muted: #8a909c;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 3rem 2.5rem;
}

.head {
    margin-bottom: 2.5rem;
}

.head h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.head p {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Desktop: rugalmas rács minimális kártyaszélességgel, több sorba törve */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.tile {
    --accent: #7aa2f7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 220px;
    padding: 1.75rem 1rem;
    background: var(--tile);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: inherit;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.tile:hover,
.tile:focus-visible {
    background: var(--tile-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
    outline: none;
}

.tile svg {
    width: 72px;
    height: 72px;
    margin-bottom: 0.75rem;
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.name {
    font-size: 1.05rem;
    font-weight: 600;
}

.host {
    color: var(--muted);
    font-size: 0.8rem;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    word-break: break-all;
}

.t-kino    { --accent: #f7768e; }
.t-ha      { --accent: #41bdf5; }
.t-esp     { --accent: #e0e0e0; }
.t-mybook  { --accent: #e0af68; }
.t-sql     { --accent: #2ac3de; }
.t-dev     { --accent: #73daca; }
.t-z2m     { --accent: #ffc107; }
.t-tor     { --accent: #e06c50; }
.t-stream  { --accent: #bb9af7; }
.t-dlna    { --accent: #9ece6a; }
.t-cockpit { --accent: #7aa2f7; }
.t-cups    { --accent: #8a909c; }

/* Mobil: dobozok, két oszlop */
@media (max-width: 640px) {
    body {
        padding: 1.5rem 1rem;
    }

    .head {
        margin-bottom: 1.5rem;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .tile {
        aspect-ratio: 1 / 1;
        min-height: 0;
        padding: 1rem 0.5rem;
        border-radius: 14px;
        overflow: hidden;
    }

    .tile svg {
        width: 52px;
        height: 52px;
        margin-bottom: 0.4rem;
    }

    .name {
        font-size: 0.95rem;
    }

    .host {
        font-size: 0.72rem;
    }
}
