:root {
    --bg: #14161b;
    --panel: #1c1f26;
    --line: #2b2f39;
    --text: #e7e9ee;
    --dim: #8a90a0;
    --accent: #9db4ff;
    color-scheme: dark;
}
* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font:
        15px/1.4 ui-sans-serif,
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        sans-serif;
}
#prog {
    position: fixed;
    left: 0;
    top: 0;
    height: 3px;
    width: 0;
    background: var(--accent);
    transition: width 0.15s;
    z-index: 5;
}
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(16px, 4vw, 40px);
}
#zone {
    display: flex;
    align-items: center;
    justify-content: center;
    height: clamp(120px, 22vh, 200px);
    border: 1.5px dashed var(--line);
    border-radius: 14px;
    color: var(--dim);
    cursor: pointer;
    text-align: center;
    padding: 12px;
    transition:
        border-color 0.15s,
        color 0.15s,
        background 0.15s;
}
#zone:hover,
#zone:focus-visible,
body.over #zone {
    border-color: var(--accent);
    color: var(--text);
    background: var(--panel);
    outline: none;
}
#msg {
    min-height: 1.4em;
    margin: 12px 2px;
    color: var(--dim);
}
#grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}
.t {
    position: relative;
    display: block;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--panel);
    color: inherit;
    text-decoration: none;
}
.t img,
.t video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.t .ic {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 44px;
    color: var(--dim);
}
.t .bar {
    position: absolute;
    inset: auto 0 0 0;
    padding: 28px 8px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    gap: 6px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.12s;
}
.t:hover .bar,
.t:focus-within .bar {
    opacity: 1;
}
@media (hover: none) {
    .t .bar {
        opacity: 1;
    }
}
.t .n {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}
.t button {
    all: unset;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 12px;
}
.t button:hover,
.t button:focus-visible {
    background: rgba(255, 255, 255, 0.3);
}
.t button.x:hover {
    background: #c0392b;
}
#none {
    color: var(--dim);
    margin: 24px 2px;
}
