.cube-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.25rem;
    background: var(--bg);
    border-bottom: 0.0625rem solid var(--link-border);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.header-logo {
    color: var(--text);
    text-decoration: none;
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: -0.05em;
    transition: all 0.3s ease;
    cursor: pointer;
}

.header-logo:hover {
    color: var(--accent);
}

.header-sep {
    color: var(--text-dim);
    font-size: 1.25rem;
    font-weight: 300;
}

.header-page {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 300;
    transition: color 0.3s ease;
}

.header-page:hover {
    color: var(--accent);
}

body.cube-body {
    display: block;
    padding-top: 6rem;
}

.cube-container {
    width: 100%;
    max-width: 40rem;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
}

.cube-intro {
    text-align: center;
    margin-bottom: 2.5rem;
}

.cube-intro h1 {
    font-size: 2.25rem;
    font-weight: 300;
    letter-spacing: -0.03em;
    color: var(--text-bright);
    margin-bottom: 0.625rem;
}

.cube-intro p {
    color: var(--text-dim);
    font-size: 1rem;
    font-weight: 300;
}

.set-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.set-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--link-bg);
    color: var(--text);
    text-decoration: none;
    border: 0.0625rem solid var(--link-border);
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 40rem;
}

.set-link:hover {
    background: var(--link-bg-hover);
    border-color: var(--accent);
    color: var(--text-bright);
    box-shadow: 0 0 0.625rem rgba(246, 195, 36, 0.2);
}

.set-link:active {
    transform: scale(0.98);
}

.set-link-title {
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.01875rem;
}

.set-link-sub {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.set-link-count {
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
}

body.list-body {
    display: block;
    padding-top: 5.5rem;
}

.list-container {
    width: 100%;
    max-width: 68rem;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
}

.list-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: -0.03em;
    color: var(--text-bright);
    margin-bottom: 1.5rem;
}

.filter-bar {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.filter-dropdown {
    padding: 0.625rem 1rem;
    background: var(--link-bg);
    color: var(--text);
    border: 0.0625rem solid var(--link-border);
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.filter-dropdown:hover {
    border-color: var(--accent);
}

.filter-dropdown:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--link-bg-hover);
}

.filter-dropdown option {
    background: var(--link-bg);
    color: var(--text);
}

.case-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.case-card {
    background: var(--link-bg);
    border: 0.0625rem solid var(--link-border);
    border-radius: 0.375rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.25s ease;
}

.case-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0.625rem rgba(246, 195, 36, 0.15);
}

.case-card.hidden {
    display: none;
}

.case-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-bright);
}

.case-right-side {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.alg-input {
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    color: var(--text);
    border: 0.0625rem solid var(--link-border);
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: all 0.25s ease;
}

.alg-input:focus {
    outline: none;
    border-color: var(--accent);
}

.alg-display {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.setup-alg-display {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-dim);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.mini-grid-extended {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    background: var(--bg);
    padding: 0.1875rem;
    border-radius: 0.25rem;
    border: 0.0625rem solid var(--link-border);
    flex-shrink: 0;
}

.grid-row {
    display: flex;
    gap: 0.1875rem;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 5.5rem;
    height: 5.5rem;
    gap: 0.1875rem;
    background: var(--bg);
    padding: 0.1875rem;
    border-radius: 0.25rem;
    border: 0.0625rem solid var(--link-border);
    flex-shrink: 0;
}

.mini-cell {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.125rem;
    background: #2c2c2c;
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .mini-cell {
    background: #cfcfcf;
}

.mini-cell.on {
    background: var(--accent);
}

.mini-cell.half {
    height: 0.75rem;
}

.mini-cell.half-width {
    width: 0.75rem;
}

.mini-cell.quarter {
    width: 0.75rem;
    height: 0.75rem;
    visibility: hidden;
}

.mini-cell.hidden {
    visibility: hidden;
}

.mini-cell.spacer {
    background: transparent;
    cursor: default;
}

.mini-cell .tri-a,
.mini-cell .tri-b {
    position: absolute;
    inset: 0;
}

.mini-cell .tri-a {
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.mini-cell .tri-b {
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.case-info {
    text-align: center;
    width: 100%;
}

.case-name {
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--text-bright);
    letter-spacing: 0.01em;
}

.case-category {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.125rem;
}

.alg-input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    background: var(--bg);
    color: var(--text);
    border: 0.0625rem solid var(--link-border);
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Consolas', monospace;
    transition: all 0.3s ease;
    text-align: center;
}

.alg-input::placeholder {
    color: var(--text-dim);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.alg-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0.5rem rgba(246, 195, 36, 0.2);
}

.no-results {
    text-align: center;
    color: var(--text-dim);
    padding: 3rem 0;
    display: none;
}

.no-results.show {
    display: block;
}

@media (max-width: 37.5rem) {
    .list-title { font-size: 1.6rem; }
    .case-grid { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.75rem; }
    .mini-grid { width: 4.5rem; height: 4.5rem; }
    .cube-intro h1 { font-size: 1.8rem; }
}