/* ========================================
   ファミコン風8ビットスタイル
   ======================================== */

:root {
    /* ファミコンカラーパレット */
    --fc-black: #000000;
    --fc-dark-gray: #1a1a1a;
    --fc-gray: #3a3a3a;
    --fc-white: #ffffff;
    --fc-red: #fc1f47;
    --fc-blue: #009ffd;
    --fc-cyan: #00d9ff;
    --fc-green: #00ff41;
    --fc-yellow: #ffdd00;
    --fc-orange: #ff6b00;
    --fc-purple: #c300ff;
    --fc-pink: #ff00c3;
    
    /* グリッドサイズ */
    --pixel-size: 4px;
}

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

body {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--fc-black);
    color: var(--fc-white);
    overflow-x: hidden;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

/* ========================================
   ファミコン風起動画面
   ======================================== */

.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--fc-black);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: scanlines 0.1s infinite;
}

.boot-content {
    text-align: center;
}

.boot-logo {
    font-size: 48px;
    color: var(--fc-red);
    text-shadow: 
        4px 4px 0 var(--fc-blue),
        8px 8px 0 var(--fc-cyan);
    animation: glitch 1s infinite, float 2s ease-in-out infinite;
    margin-bottom: 40px;
}

.boot-text {
    font-size: 16px;
    color: var(--fc-cyan);
    margin-bottom: 60px;
    letter-spacing: 4px;
}

.boot-press {
    font-size: 14px;
    color: var(--fc-yellow);
    animation: blink 1s infinite;
    cursor: pointer;
    padding: 10px 20px;
    border: 3px solid var(--fc-yellow);
    display: inline-block;
    background: var(--fc-dark-gray);
    box-shadow: 0 4px 0 var(--fc-orange);
}

.boot-press:hover {
    background: var(--fc-yellow);
    color: var(--fc-black);
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--fc-orange);
}

.pixel-spinner {
    margin-top: 40px;
    width: 40px;
    height: 40px;
    margin-left: auto;
    margin-right: auto;
    background: 
        linear-gradient(var(--fc-red) 50%, transparent 50%),
        linear-gradient(90deg, var(--fc-blue) 50%, transparent 50%);
    animation: spin 0.8s steps(8) infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

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

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

@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 4px; }
}

@keyframes glitch {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 2px);
    }
    94% {
        transform: translate(2px, -2px);
    }
    96% {
        transform: translate(-2px, -2px);
    }
    98% {
        transform: translate(2px, 2px);
    }
}

/* ========================================
   ヘッダー
   ======================================== */

.game-header {
    background: var(--fc-dark-gray);
    border-bottom: 4px solid var(--fc-red);
    padding: 20px 0;
    box-shadow: 0 4px 0 var(--fc-blue);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo {
    font-size: 24px;
    color: var(--fc-red);
    text-shadow: 2px 2px 0 var(--fc-blue);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.score-board {
    background: var(--fc-black);
    border: 3px solid var(--fc-cyan);
    padding: 10px 20px;
    font-size: 12px;
    color: var(--fc-cyan);
}

.nav-menu {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    background: var(--fc-gray);
    color: var(--fc-white);
    border: 3px solid var(--fc-white);
    padding: 12px 24px;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 4px 0 var(--fc-dark-gray);
}

.nav-btn:hover {
    background: var(--fc-cyan);
    color: var(--fc-black);
    border-color: var(--fc-cyan);
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--fc-dark-gray);
}

.nav-btn.active {
    background: var(--fc-red);
    border-color: var(--fc-red);
    color: var(--fc-white);
    box-shadow: 0 4px 0 var(--fc-blue);
}

/* ========================================
   セクション共通
   ======================================== */

.game-section {
    display: none;
    padding: 60px 0;
    min-height: calc(100vh - 200px);
}

.game-section.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 28px;
    color: var(--fc-yellow);
    text-align: center;
    margin-bottom: 60px;
    text-shadow: 
        2px 2px 0 var(--fc-orange),
        4px 4px 0 var(--fc-red);
    animation: glitch 3s infinite;
}

/* ========================================
   ホームセクション
   ======================================== */

.hero-area {
    margin-bottom: 60px;
}

.pixel-art-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: 
        repeating-linear-gradient(
            0deg,
            var(--fc-dark-gray) 0px,
            var(--fc-dark-gray) 2px,
            var(--fc-black) 2px,
            var(--fc-black) 4px
        );
    border: 4px solid var(--fc-cyan);
    margin-bottom: 40px;
    overflow: hidden;
}

.pixel-building {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 150px;
    background: var(--fc-gray);
    border: 4px solid var(--fc-white);
    box-shadow: 
        inset 0 0 0 4px var(--fc-dark-gray),
        0 8px 0 var(--fc-black);
}

.pixel-building::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 30px;
    height: 30px;
    background: var(--fc-yellow);
    box-shadow: 
        50px 0 0 var(--fc-yellow),
        100px 0 0 var(--fc-yellow),
        0 40px 0 var(--fc-yellow),
        50px 40px 0 var(--fc-yellow),
        100px 40px 0 var(--fc-yellow),
        0 80px 0 var(--fc-yellow),
        50px 80px 0 var(--fc-yellow),
        100px 80px 0 var(--fc-yellow);
    animation: windowBlink 2s infinite;
}

@keyframes windowBlink {
    0%, 45%, 55%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.pixel-crowd {
    position: absolute;
    bottom: 10px;
    left: 10%;
    width: 12px;
    height: 20px;
    background: var(--fc-white);
    box-shadow: 
        20px 0 0 var(--fc-cyan),
        40px 0 0 var(--fc-white),
        60px 0 0 var(--fc-pink),
        80px 0 0 var(--fc-white),
        100px 0 0 var(--fc-cyan),
        120px 0 0 var(--fc-white);
    animation: crowd 1s infinite;
}

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

.laser-show {
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    height: 100px;
    background: 
        linear-gradient(45deg, transparent 49%, var(--fc-cyan) 49%, var(--fc-cyan) 51%, transparent 51%),
        linear-gradient(-45deg, transparent 49%, var(--fc-pink) 49%, var(--fc-pink) 51%, transparent 51%);
    background-size: 40px 40px;
    opacity: 0.5;
    animation: laserMove 2s linear infinite;
}

@keyframes laserMove {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 40px 40px, -40px 40px; }
}

.hero-text {
    text-align: center;
}

.hero-text h2 {
    font-size: 32px;
    color: var(--fc-cyan);
    margin-bottom: 20px;
    position: relative;
}

.glitch {
    position: relative;
    color: var(--fc-cyan);
    text-shadow: 
        2px 2px 0 var(--fc-red),
        -2px -2px 0 var(--fc-blue);
}

.subtitle {
    font-size: 14px;
    color: var(--fc-yellow);
    margin-bottom: 40px;
    letter-spacing: 2px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-box {
    background: var(--fc-dark-gray);
    border: 4px solid var(--fc-green);
    padding: 20px 30px;
    text-align: center;
    box-shadow: 0 4px 0 var(--fc-gray);
}

.stat-value {
    font-size: 24px;
    color: var(--fc-green);
    margin-bottom: 10px;
}

.stat-label {
    font-size: 10px;
    color: var(--fc-white);
}

.message-box {
    background: var(--fc-dark-gray);
    border: 4px solid var(--fc-blue);
    margin: 40px 0;
    box-shadow: 0 8px 0 var(--fc-gray);
}

.message-header {
    background: var(--fc-blue);
    color: var(--fc-black);
    padding: 15px 20px;
    font-size: 12px;
}

.message-content {
    padding: 30px;
    font-size: 12px;
    line-height: 2;
    color: var(--fc-cyan);
}

.message-content p {
    margin-bottom: 20px;
}

/* COMPANYセクション用の大きいテキスト */
.company-large-text {
    font-size: 14px !important;
}

.company-large-text p {
    margin-bottom: 25px;
}

.company-large-text strong {
    color: var(--fc-yellow);
}

/* コンタクトフォーム（シンプル版） */
.contact-form-simple {
    max-width: 100%;
}

.contact-form-simple .form-group {
    margin-bottom: 25px;
}

.contact-form-simple label {
    display: block;
    font-size: 10px;
    color: var(--fc-yellow);
    margin-bottom: 10px;
}

.form-status {
    margin-top: 20px;
    padding: 15px;
    font-size: 10px;
    text-align: center;
    border: 3px solid transparent;
    display: none;
}

.form-status.success {
    display: block;
    background: var(--fc-dark-gray);
    border-color: var(--fc-green);
    color: var(--fc-green);
}

.form-status.error {
    display: block;
    background: var(--fc-dark-gray);
    border-color: var(--fc-red);
    color: var(--fc-red);
}

.form-status.sending {
    display: block;
    background: var(--fc-dark-gray);
    border-color: var(--fc-cyan);
    color: var(--fc-cyan);
}

/* ========================================
   ワークセクション
   ======================================== */

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.work-card {
    background: var(--fc-dark-gray);
    border: 4px solid var(--fc-cyan);
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 8px 0 var(--fc-gray);
}

.work-card:hover {
    transform: translateY(-8px);
    border-color: var(--fc-pink);
    box-shadow: 0 12px 0 var(--fc-gray);
}

.work-image {
    width: 100%;
    height: 200px;
    background: var(--fc-gray);
    position: relative;
    overflow: hidden;
}

/* ピクセルアートパターン */
.pixel-image-1 {
    background: 
        repeating-linear-gradient(90deg, var(--fc-red) 0, var(--fc-red) 20px, var(--fc-orange) 20px, var(--fc-orange) 40px),
        repeating-linear-gradient(0deg, var(--fc-blue) 0, var(--fc-blue) 20px, var(--fc-cyan) 20px, var(--fc-cyan) 40px);
    background-blend-mode: screen;
}

.pixel-image-2 {
    background: 
        repeating-linear-gradient(45deg, var(--fc-purple) 0, var(--fc-purple) 15px, var(--fc-pink) 15px, var(--fc-pink) 30px);
}

.pixel-image-3 {
    background: 
        repeating-linear-gradient(90deg, var(--fc-green) 0, var(--fc-green) 25px, var(--fc-cyan) 25px, var(--fc-cyan) 50px);
}

.pixel-image-4 {
    background: 
        repeating-linear-gradient(0deg, var(--fc-yellow) 0, var(--fc-yellow) 20px, var(--fc-orange) 20px, var(--fc-orange) 40px);
}

.pixel-image-5 {
    background: 
        repeating-linear-gradient(90deg, var(--fc-blue) 0, var(--fc-blue) 10px, var(--fc-cyan) 10px, var(--fc-cyan) 20px),
        repeating-linear-gradient(0deg, var(--fc-purple) 0, var(--fc-purple) 10px, var(--fc-pink) 10px, var(--fc-pink) 20px);
    background-blend-mode: multiply;
}

.pixel-image-6 {
    background: 
        repeating-conic-gradient(var(--fc-red) 0deg 90deg, var(--fc-yellow) 90deg 180deg, var(--fc-cyan) 180deg 270deg, var(--fc-purple) 270deg 360deg);
}

.work-info {
    padding: 20px;
}

.work-info h3 {
    font-size: 14px;
    color: var(--fc-white);
    margin-bottom: 10px;
}

.work-info p {
    font-size: 10px;
    color: var(--fc-cyan);
    margin-bottom: 15px;
}

.work-link {
    color: var(--fc-cyan);
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
}

.work-link:hover {
    color: var(--fc-yellow);
    text-decoration: underline;
    transform: translateX(5px);
}

.work-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background: var(--fc-black);
    color: var(--fc-green);
    border: 2px solid var(--fc-green);
    padding: 5px 10px;
    font-size: 8px;
}

/* ========================================
   アバウトセクション
   ======================================== */

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.team-card {
    background: var(--fc-dark-gray);
    border: 4px solid var(--fc-purple);
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 0 var(--fc-gray);
}

.pixel-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--fc-gray);
    border: 3px solid var(--fc-white);
}

.avatar-1 {
    background: 
        radial-gradient(circle at 30% 30%, var(--fc-cyan) 10px, transparent 10px),
        radial-gradient(circle at 70% 30%, var(--fc-cyan) 10px, transparent 10px),
        linear-gradient(var(--fc-pink) 60%, var(--fc-purple) 60%);
}

.avatar-2 {
    background: 
        radial-gradient(circle at 30% 30%, var(--fc-green) 10px, transparent 10px),
        radial-gradient(circle at 70% 30%, var(--fc-green) 10px, transparent 10px),
        linear-gradient(var(--fc-orange) 60%, var(--fc-red) 60%);
}

.avatar-3 {
    background: 
        repeating-linear-gradient(45deg, var(--fc-yellow) 0, var(--fc-yellow) 5px, var(--fc-cyan) 5px, var(--fc-cyan) 10px);
}

.team-card h3 {
    font-size: 12px;
    color: var(--fc-white);
    margin-bottom: 10px;
}

.team-card p {
    font-size: 10px;
    color: var(--fc-purple);
}

.services-list {
    list-style: none;
}

.services-list li {
    padding: 10px 0;
    font-size: 11px;
    color: var(--fc-green);
    border-bottom: 2px solid var(--fc-gray);
}

/* ========================================
   コンタクトセクション
   ======================================== */

.contact-content {
    max-width: 900px;
    margin: 0 auto;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.contact-form-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.pixel-form {
    background: var(--fc-dark-gray);
    border: 4px solid var(--fc-cyan);
    padding: 30px;
    box-shadow: 0 8px 0 var(--fc-gray);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 10px;
    color: var(--fc-yellow);
    margin-bottom: 10px;
}

.pixel-input,
.pixel-textarea {
    width: 100%;
    background: var(--fc-black);
    border: 3px solid var(--fc-white);
    color: var(--fc-cyan);
    padding: 12px;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    outline: none;
}

.pixel-input:focus,
.pixel-textarea:focus {
    border-color: var(--fc-cyan);
    box-shadow: 0 0 0 3px var(--fc-blue);
}

.pixel-button {
    width: 100%;
    background: var(--fc-green);
    border: 4px solid var(--fc-white);
    color: var(--fc-black);
    padding: 15px;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 6px 0 var(--fc-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pixel-button:hover {
    background: var(--fc-cyan);
    transform: translateY(3px);
    box-shadow: 0 3px 0 var(--fc-gray);
}

.pixel-button:active {
    transform: translateY(6px);
    box-shadow: none;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-box {
    background: var(--fc-dark-gray);
    border: 4px solid var(--fc-pink);
    padding: 20px;
    box-shadow: 0 8px 0 var(--fc-gray);
}

.info-box h3 {
    font-size: 12px;
    color: var(--fc-pink);
    margin-bottom: 15px;
}

.info-box p {
    font-size: 10px;
    color: var(--fc-white);
    line-height: 1.8;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-btn {
    display: block;
    background: var(--fc-black);
    border: 2px solid var(--fc-cyan);
    color: var(--fc-cyan);
    padding: 10px;
    text-align: center;
    text-decoration: none;
    font-size: 9px;
    transition: all 0.2s;
}

.social-btn:hover {
    background: var(--fc-cyan);
    color: var(--fc-black);
}

/* ========================================
   フッター
   ======================================== */

.game-footer {
    background: var(--fc-dark-gray);
    border-top: 4px solid var(--fc-red);
    padding: 40px 0;
    margin-top: 60px;
    box-shadow: 0 -4px 0 var(--fc-blue);
}

.footer-content {
    text-align: center;
}

.footer-content p {
    font-size: 10px;
    color: var(--fc-cyan);
    margin-bottom: 10px;
}

.pixel-divider {
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        var(--fc-red) 0,
        var(--fc-red) 10px,
        var(--fc-blue) 10px,
        var(--fc-blue) 20px,
        var(--fc-cyan) 20px,
        var(--fc-cyan) 30px
    );
    margin-top: 20px;
}

/* ========================================
   レスポンシブ
   ======================================== */

@media (max-width: 768px) {
    .boot-logo {
        font-size: 32px;
    }
    
    .boot-text {
        font-size: 12px;
    }
    
    .boot-press {
        font-size: 10px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .nav-menu {
        justify-content: center;
    }
    
    .nav-btn {
        font-size: 8px;
        padding: 10px 15px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .hero-text h2 {
        font-size: 20px;
    }
    
    .subtitle {
        font-size: 10px;
    }
    
    .work-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-form-container {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
}

/* ========================================
   スクロールバー
   ======================================== */

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--fc-dark-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--fc-red);
    border: 2px solid var(--fc-blue);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fc-cyan);
}

/* ========================================
   カーソルエフェクト
   ======================================== */

.pixel-cursor {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><rect width="16" height="16" fill="%23ffffff" /></svg>'), auto;
}

/* ========================================
   アニメーション効果
   ======================================== */

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.coin-sound::after {
    content: '♪';
    position: fixed;
    top: 50%;
    left: 50%;
    font-size: 48px;
    color: var(--fc-yellow);
    animation: coinFloat 1s forwards;
    pointer-events: none;
}

@keyframes coinFloat {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -100px) scale(1.5);
        opacity: 0;
    }
}