:root {
    --bg: #0d1117;
    --card: #161b22;
    --text: #c9d1d9;
    --acc: #58a6ff;
    --err: #f85149;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, system-ui, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}
.hidden {
    display: none !important;
}
#auth,
#main {
    width: 100%;
    max-width: 800px;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    width: 100%;
}
.item {
    background: var(--card);
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    text-align: center;
    position: relative;
    transition: 0.1s;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    cursor: pointer;
}
.item:hover {
    border-color: var(--acc);
    transform: translateY(-2px);
}
.item img {
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
    border-radius: 4px;
    pointer-events: none;
}
.del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: #30363d;
    border-radius: 50%;
    font-size: 12px;
    line-height: 20px;
    cursor: pointer;
    opacity: 0;
    z-index: 10;
}
.item:hover .del {
    opacity: 1;
}
.del:hover {
    background: var(--err);
}
.arrow {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #30363d;
    border: none;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    border-radius: 2px;
    opacity: 0.8;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.arrow:hover {
    background: var(--acc);
    opacity: 1;
}
.arrow.up {
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
}
.arrow.down {
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}
.arrow.left {
    top: 50%;
    left: 4px;
    transform: translateY(-50%);
}
.arrow.right {
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
}
.form {
    margin-top: 40px;
    padding: 20px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid #30363d;
    display: flex;
    gap: 10px;
    flex-direction: row;
}
.form input#u {
    flex: 2;
}
.form input#n {
    flex: 1;
}
input {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    outline: none;
    transition: 0.2s;
}
input:focus {
    border-color: var(--acc);
}
button {
    padding: 12px 24px;
    background: var(--acc);
    border: none;
    color: #fff;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}
.controls {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #8b949e;
    cursor: pointer;
    text-decoration: underline;
    text-align: center;
}
@media (max-width: 600px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form {
        flex-direction: column;
    }
    .del {
        opacity: 1;
        background: var(--err);
    }
}
