:root {
    --tile-size: 180px;
    --tile-radius: 14px;
    --tile-gap: 18px;
    --label-bg: rgba(0, 0, 0, 0.72);
    --search-bg: rgba(255, 255, 255, 0.10);
    --search-bg-focus: rgba(255, 255, 255, 0.18);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: #0a0d12;
    -webkit-font-smoothing: antialiased;
}

.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(64, 120, 180, 0.35), transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(120, 90, 200, 0.30), transparent 55%),
        linear-gradient(160deg, #0e1a2b 0%, #0a0d12 55%, #1a1326 100%);
    background-attachment: fixed;
}

.bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
}

.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.search-bar {
    width: 100%;
    max-width: 560px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    background: var(--search-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    transition: background 160ms ease, transform 160ms ease,
                box-shadow 160ms ease;
}

.search-bar:focus-within {
    background: var(--search-bg-focus);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.search-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    color: var(--text-dim);
}

#search {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text);
    font-size: 18px;
    letter-spacing: 0.2px;
}

#search::placeholder {
    color: var(--text-dim);
}

.grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--tile-size), 1fr));
    gap: var(--tile-gap);
    justify-content: center;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-dim);
    padding: 40px;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1;
    border-radius: var(--tile-radius);
    background: var(--bg, #2a2f3a);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 10px 24px rgba(0, 0, 0, 0.35);
    transition: transform 180ms ease, box-shadow 180ms ease;
    isolation: isolate;
}

.tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.10) 0%,
        rgba(255, 255, 255, 0.00) 40%,
        rgba(0, 0, 0, 0.20) 100%);
    pointer-events: none;
    z-index: 1;
}

.tile:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.10) inset,
        0 18px 38px rgba(0, 0, 0, 0.5);
}

.tile:active {
    transform: translateY(-1px) scale(1.0);
}

.tile-icon {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
    overflow: hidden;
}

.tile-icon img,
.tile-icon svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tiles using a Simple Icons / monogram (rather than a local image)
   keep the original padded layout so the symbol doesn't look stretched. */
.tile.has-symbol .tile-icon {
    padding: 18%;
}

.tile.has-symbol .tile-icon img,
.tile.has-symbol .tile-icon svg {
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.tile-fallback {
    font-size: 42px;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.tile-label {
    background: var(--label-bg);
    color: var(--text);
    padding: 10px 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile.empty {
    background: transparent;
    border: 2px dashed rgba(255, 255, 255, 0.18);
    color: var(--text-dim);
    box-shadow: none;
    cursor: default;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
}

.tile.empty:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.28);
    color: var(--text);
}

.foot {
    color: var(--text-dim);
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

@media (max-width: 480px) {
    :root {
        --tile-size: 140px;
        --tile-gap: 14px;
    }

    .dashboard {
        padding: 32px 16px 48px;
        gap: 28px;
    }

    #search {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tile,
    .search-bar {
        transition: none;
    }
}
