body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    background: black;
    color: #ccc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.navbar {
    border-bottom: 1px solid #333;
    padding: 8px 12px;
    font-size: 12px;
}

.navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand a {
    color: #ccc;
    text-decoration: none;
    font-weight: 600;
}

.navbar-brand a:hover {
    color: white;
}

.navbar-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.navbar-links a {
    color: #888;
    text-decoration: none;
}

.navbar-links a:hover {
    color: white;
}

.navbar-user {
    color: #666;
}

.navbar-form {
    display: inline;
}

.navbar-form button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #888;
    cursor: pointer;
    font-size: 12px;
}

.navbar-form button:hover {
    color: white;
}

/* Footer */
.footer {
    border-top: 1px solid #333;
    padding: 16px 12px;
    font-size: 12px;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.footer-links a {
    color: #888;
    text-decoration: none;
}

.footer-links a:hover {
    color: white;
}

.footer-copyright {
    color: #666;
}

/* Chart list */
.chart-list {
    padding: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.chart-list h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 24px 0;
    color: #ccc;
}

.chart-list-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chart-list-items li {
    border-bottom: 1px solid #222;
}

.chart-list-items li:first-child {
    border-top: 1px solid #222;
}

.chart-list-items a {
    display: block;
    padding: 12px 8px;
    color: #888;
    text-decoration: none;
    font-size: 13px;
}

.chart-list-items a:hover {
    color: white;
    background: #111;
}

/* Login page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.login-container {
    width: 100%;
    max-width: 320px;
    padding: 32px;
}

.login-container h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 24px 0;
    color: #ccc;
}

.login-form p {
    margin: 0 0 16px 0;
    font-size: 13px;
}

.login-form label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.login-form input {
    width: 100%;
    padding: 10px 12px;
    background: #111;
    border: 1px solid #333;
    color: #ccc;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.login-form input:focus {
    outline: none;
    border-color: #555;
}

.errorlist {
    color: #c77;
    font-size: 12px;
    margin: 0 0 12px 0;
    padding: 0;
    list-style: none;
}

/* Password rules list (not in .helptext wrapper) */
.login-form ul:not(.errorlist) {
    font-size: 10px;
    color: #555;
    margin: 4px 0 0 0;
    padding-left: 14px;
    list-style: disc;
}

.login-form ul:not(.errorlist) li {
    margin: 2px 0;
}

.helptext {
    font-size: 10px;
    color: #555;
    margin-top: 4px;
}

.helptext ul {
    margin: 4px 0 0 0;
    padding-left: 14px;
    list-style: disc;
}

.helptext li {
    margin: 2px 0;
}

.login-btn {
    width: 100%;
    padding: 10px 12px;
    background: #222;
    border: 1px solid #333;
    color: #ccc;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
}

.login-btn:hover {
    background: #2a2a2a;
    border-color: #444;
}

.login-alt {
    margin-top: 16px;
    text-align: center;
}

.login-alt a {
    color: #888;
    text-decoration: none;
    font-size: 12px;
}

.login-alt a:hover {
    color: white;
}

/* Group container layout */
.group-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.header-cell {
    text-align: center;
    font-weight: 600;
    padding: 8px 4px;
}

.grid-cell,
.row-header {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: break-word;
}

.row-header {
    font-weight: 600;
    height: 100%;
    box-sizing: border-box;
    min-width: 30px;
}

.grid-cell {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid #ddd;
    cursor: pointer;
    border-width: 2px;
    border-color: transparent;
    min-height: 48px;
}

.empty {
    border: none;
}

.grid-cell img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Score overlay */
.grid-cell[mu-score]:not([mu-score="None"])::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    background-size: contain;
    background-repeat: no-repeat;
    background-image: var(--score-image);
    z-index: 1;
    pointer-events: none;
}

/* Prefix overlay */
.grid-cell[mu-prefix]:not([mu-prefix="None"])::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    width: 60%;
    height: 60%;
    background-size: contain;
    background-repeat: no-repeat;
    background-image: var(--prefix-image);
    z-index: 2;
    pointer-events: none;
}

.grid-cell[mu-score]:not([mu-score="None"]) img {
    filter: grayscale(0.9);
}

.album-list-element.focused .album-name {
    text-decoration: underline;
    color: white;
    opacity: 1;
}

.album-thumb.focused {
    border-width: 2px;
    border-color: white;
}

/* Grid and list containers */
.grid-container {
    flex: 1;
    min-width: 0;
}

.list-container {
    width: 100%;
    font-size: 13px;
    font-weight: 500;
}
