* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 960px;
    padding: 2rem;
}

.hero {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.hero img {
    width: 100%;
    max-width: 640px;
    height: auto;
    image-rendering: pixelated;
}

.grid {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    height: 350px;
}

.cell {
    border: 2px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    text-decoration: none;
    color: #fff;
    transition: border-color 0.15s;
}

a.cell:hover {
    border-color: #fff;
}

.cell-photos img,
.cell-videos img {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    filter: invert(1);
}

.cell-photos {
    grid-row: 1;
    grid-column: 1;
}

.cell-videos {
    grid-row: 2;
    grid-column: 1;
}

/* Activity - center column, spans both rows */
.cell-activity {
    grid-row: 1 / 3;
    grid-column: 2;
    align-items: stretch;
    justify-content: stretch;
    padding: 0.75rem;
    gap: 0.75rem;
}

.cell-reading {
    grid-row: 1;
    grid-column: 3;
}

.cell-watching {
    grid-row: 2;
    grid-column: 3;
}

.activity-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.activity-heading {
    font-size: 10px;
    color: #666;
}

.activity-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-arrow {
    width: 16px !important;
    height: 16px !important;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
    image-rendering: pixelated;
}

.nav-arrow:hover {
    opacity: 1;
}

.activity-label {
    font-size: 8px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#route3d {
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

#route3d canvas {
    transition: transform 0.3s ease;
    cursor: pointer;
}

#route3d:hover canvas {
    transform: scale(1.2);
}

/* Reading & Watching - right column */
.cell-reading,
.cell-watching {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.75rem;
    gap: 0.4rem;
    overflow: hidden;
}

.cell-heading {
    font-size: 8px;
    color: #666;
    margin-bottom: 0.25rem;
}

#reading-list,
#watching-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.media-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 50px;
}

.media-item img {
    width: 46px;
    height: 68px;
    object-fit: cover;
    border-radius: 2px;
    image-rendering: pixelated;
    filter: grayscale(1);
    transition: filter 0.3s, image-rendering 0s;
}

.media-item img:hover {
    filter: grayscale(0);
    image-rendering: auto;
}

.media-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-align: center;
    width: 100%;
}

.media-title {
    font-size: 5px;
    color: #fff;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.media-title a {
    color: #fff;
    text-decoration: underline;
    text-decoration-skip-ink: none;
}

.media-author {
    font-size: 4px;
    color: #666;
    line-height: 1.3;
    overflow-wrap: break-word;
}

/* Mobile */
@media (max-width: 600px) {
    body {
        align-items: flex-start;
    }

    .container {
        padding: 1rem;
    }

    .hero {
        margin-bottom: 1rem;
    }

    .grid {
        display: flex;
        flex-direction: column;
        height: auto;
        gap: 4px;
    }

    .grid .cell {
        width: 100%;
    }

    /* Photos & Videos side by side */
    .cell-photos,
    .cell-videos {
        display: inline-flex;
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
    }

    .cell-photos {
        grid-row: 1;
        grid-column: 1;
    }

    .cell-videos {
        grid-row: 1;
        grid-column: 2;
    }

    .cell-activity {
        grid-row: 2;
        grid-column: 1 / 3;
        min-height: 280px;
    }

    .cell-reading {
        grid-row: 3;
        grid-column: 1 / 3;
    }

    .cell-watching {
        grid-row: 4;
        grid-column: 1 / 3;
    }

    .cell-photos img,
    .cell-videos img {
        width: 32px;
        height: 32px;
    }

    .cell span {
        font-size: 10px;
    }

    .activity-heading {
        font-size: 8px;
    }

    .activity-label {
        font-size: 7px;
    }

    .media-item {
        flex-direction: row;
        width: auto;
        align-items: center;
    }

    .media-item img {
        width: 36px;
        height: 54px;
    }

    .media-info {
        text-align: left;
    }
}
