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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    text-decoration: none;
}

.pixel-bird {
    width: 32px;
    height: 32px;
    margin-right: 15px;
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    clip-path: polygon(0 50%, 20% 0, 60% 0, 80% 20%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0 80%);
    animation: float 3s ease-in-out infinite;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pixel-bird:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
}

.nav-links a:hover, .nav-links a.active {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
    transform: translateY(-2px);
}

.main-content {
    margin-top: 80px;
    padding: 10px 20px;
}

/* ランダム表示セクション */
.random-section {
    display: block;
    text-align: center;
    margin-bottom: 60px;
    padding: 10px 0;
}

.random-section.hidden {
    display: none;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #00ff88, #88ff00, #ffff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(0, 255, 136, 0.5); }
    to { text-shadow: 0 0 30px rgba(0, 255, 136, 0.8); }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #cccccc;
    margin-bottom: 40px;
}

.random-display {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.random-image-container {
    position: relative;
    margin-bottom: 15px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 255, 136, 0.2);
    border: 2px solid rgba(0, 255, 136, 0.3);
}

.random-image {
    width: 100%;
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.random-image:hover {
    transform: scale(1.02);
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 255, 136, 0.3);
    border-top: 4px solid #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.random-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.random-info-left {
    flex: 1;
    min-width: 0;
}

.random-title {
    font-size: 20px;
}

.random-meta {
    color: #cccccc;
    font-size: 16px;
    margin: 0;
}

.random-controls {
    margin: 0;
    display: flex;
    gap: 5px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.control-btn {
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid rgba(0, 255, 136, 0.5);
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: bold;
    margin: 0 10px;
    font-family: inherit;
}

.control-btn:hover {
    background: rgba(0, 255, 136, 0.4);
    transform: scale(1.1);
}

.top-counter {
    color: #00ff88;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    padding: 5px 15px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    white-space: nowrap;
}

.control-btn:disabled {
    background: rgba(102, 102, 102, 0.2);
    border-color: rgba(102, 102, 102, 0.5);
    cursor: not-allowed;
    transform: none;
}

.next-btn {
    background: linear-gradient(45deg, #00ff88, #88ff00);
    color: #000;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 25px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.next-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

.next-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ギャラリーセクション */
.gallery-section {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-section.active {
    display: block;
}

.gallery-header {
    text-align: center;
    margin-bottom: 60px;
}

.gallery-title {
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #00ff88, #88ff00, #ffff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-subtitle {
    font-size: 1.2rem;
    color: #cccccc;
    margin-bottom: 30px;
}

.gallery-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.view-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 14px;
}

.view-toggle:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
}

.view-toggle.active {
    background: rgba(0, 255, 136, 0.3);
    border-color: #00ff88;
    color: #00ff88;
}

.year-section {
    margin-bottom: 60px;
    width: 100%;
}

.year-title {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #00ff88;
    text-align: center;
    position: relative;
}

.year-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(45deg, #00ff88, #88ff00);
    border-radius: 2px;
}

.thumbnails-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    transition: all 0.3s ease;
    max-width: 1200px;
    margin: 0 auto;
}

.thumbnails-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 1200px;
}

.thumbnail-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 5px 5px 10px 5px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    height: fit-content;
}

.thumbnail-card.compact {
    padding: 5px;
    border-radius: 5px;
    margin: 0;
}

.thumbnail-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
}

.thumbnail-card:hover .thumbnail-image {
    transform: scale(1.02);
}

.thumbnail-card:hover .thumbnail-image.compact {
    transform: scale(1.05);
}

.thumbnail-image {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
    flex: 1;
    aspect-ratio: auto;
    display: block;
}

.thumbnail-image.compact {
    max-height: 200px;
    margin-bottom: 5px;
    border-radius: 6px;
    object-fit: cover;
}

.thumbnail-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #ffffff;
}

.thumbnail-title.compact {
    font-size: 12px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thumbnail-meta {
    font-size: 14px;
    color: #cccccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thumbnail-meta.compact {
    font-size: 10px;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.thumbnail-date {
    background: rgba(0, 255, 136, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.thumbnail-date.compact {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 8px;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 0;
}

.modal-content {
    max-width: 100%;
    max-height: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0 0 80px 0;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: auto;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 15px;
    margin-bottom: 10px;
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #00ff88;
    margin: 0 10px 5px 10px;
}

.modal-meta {
    color: #cccccc;
    font-size: 16px;
    margin-bottom: 20px;
    margin: 0 10px 10px 10px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: #ffffff;
    cursor: pointer;
    transition: color 0.3s ease;
    display: none;
}

.close-btn:hover {
    color: #00ff88;
}

.modal-nav {
    position: relative;
    transform: none;
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid rgba(0, 255, 136, 0.5);
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: bold;
    margin: 0 10px;
}

.modal-nav:hover {
    background: rgba(0, 255, 136, 0.4);
    transform: scale(1.1);
}

.modal-prev {
    left: auto;
}

.modal-next {
    right: auto;
}

.modal-navigation {
    display: flex;
    justify-content: center;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    z-index: 2001;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .gallery-title {
        font-size: 2rem;
    }
    
    .year-title {
        font-size: 2rem;
    }
    
    .nav-links {
        gap: 15px;
    }
    
    .nav-links a {
        font-size: 14px;
    }
    
    .thumbnails-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0;
    }
    
    .thumbnails-grid.compact {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 5px;
        padding: 0;
    }
    
    .thumbnail-card {
        padding: 10px;
        border-radius: 10px;
        margin: 0;
    }

    .thumbnail-card.compact {
        padding: 5px;
        border-radius: 5px;
        margin: 0;
    }
    
    .random-title {
        font-size: 20px;
    }

    .random-section {
        padding: 10px 0;
    }

    .random-image {
        max-height: 60vh;
    }

    .random-image-container {
        margin-bottom: 10px;
    }

    .random-info {
        padding: 15px;
    }

    .modal {
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 0;
        padding: 0 0 70px 0;
    }

    .modal-image {
        border-radius: 0;
        margin-bottom: 10px;
    }

    .modal-title {
        margin: 0 10px 5px 10px;
    }

    .modal-meta {
        margin: 0 10px 10px 10px;
    }

    .modal-navigation {
        bottom: 10px;
        padding: 6px 12px;
        border-radius: 20px;
    }

    .main-content {
        padding: 10px 0;
    }

    .gallery-section {
        padding: 0;
        margin: 0;
    }

    .year-section {
        margin-bottom: 20px;
        padding: 0;
    }

    .year-title {
        margin-bottom: 10px;
        padding: 0 10px;
    }
}

.pixel-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background-image: 
        radial-gradient(circle at 25% 25%, #00ff88 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, #88ff00 2px, transparent 2px),
        radial-gradient(circle at 25% 75%, #ffff00 2px, transparent 2px),
        radial-gradient(circle at 75% 25%, #ff8800 2px, transparent 2px);
    background-size: 40px 40px;
    animation: pixelMove 10s linear infinite;
    pointer-events: none;
}

@keyframes pixelMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}