/* Retro PC fonts - multiple sources for reliability */
@import url('https://fonts.googleapis.com/css2?family=VT323:wght@400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono:wght@400&display=swap');

@font-face {
    font-family: 'Web DOS/V re. JPN24';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/web_dos-v_re_jpn24.ttf') format('truetype'),
         url('fonts/web_dos-v_re_jpn24.woff') format('woff');
    font-display: swap;
}

body {
    margin: 0;
    overflow: hidden; /* スクロールバーを非表示に */
    background-color: #000; /* 黒背景 */
    height: 100vh; /* 旧ブラウザ用 */
    height: 100dvh; /* モバイルの動的バーに追随 */
    /* スムーズな色変更のためtransitionを追加 */
    transition: background-color 0.3s ease;
    /* display, justify-content, align-items は不要なので削除 */
}

#ai-my-logo {
    position: fixed; /* ビューポート基準で移動（上下端まで届く） */
    /* left/top は JS で transform を使うので 0 に初期化 */
    left: 0;
    top: 0;
    /* レスポンシブサイズ（モバイル対応） */
    width: min(720px, 60vw); /* 最大720pxまたは画面幅60% */
    max-width: 90vw; /* モバイルでは画面幅90%まで */
    height: auto; /* アスペクト比を維持 */
    filter: hue-rotate(0deg); /* 色変更用（初期値） */
    user-select: none; /* 画像選択を無効に */
    /* ブラウザ最適化 */
    will-change: transform; /* GPU加速を促進 */
    backface-visibility: hidden; /* 裏面描画を無効化 */
    /* Logo is on top of everything */
    z-index: 2000;
    /* transform は script.js で設定 */
}

/* モバイル端末用の追加最適化 */
@media (max-width: 768px) {
    #ai-my-logo {
        width: 40vw;
        max-width: 300px;
    }
}

/* Waitlist Overlay Styles - Always centered, behind logo */
.waitlist-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Mobile dynamic viewport */
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* Allow logo animation to continue underneath */
    z-index: 1000; /* Below logo (z-index: 2000) */
}

.waitlist-container {
    padding: 2rem;
    text-align: center;
    min-width: 320px;
    max-width: 90vw;
    pointer-events: auto; /* Enable interaction with form */
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.waitlist-container:hover {
    transform: translateY(-2px);
}

/* True 90s Retro Access Counter - Cheesy style */
.access-counter {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.counter-display {
    background: rgb(0, 0, 255); /* Blue background */
    border: 2px inset #c0c0c0;
    padding: 4px 8px;
    font-family: 'Web DOS/V re. JPN24', 'VT323', 'Courier New', monospace;
}

#access-count {
    font-size: 1.4rem;
    font-weight: normal;
    color: #ffffff; /* White text */
    letter-spacing: 0.1em;
    display: inline-block;
    transition: transform 0.3s ease;
    font-family: 'Web DOS/V re. JPN24', 'VT323', 'Courier New', monospace;
}

.waitlist-form {
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

/* 90s Input Field Style */
.retro-input {
    padding: 4px 6px;
    border: 2px inset #c0c0c0;
    background: #ffffff;
    color: #000000;
    font-size: 11px;
    font-family: 'MS Sans Serif', 'Tahoma', sans-serif;
    outline: none;
    flex: 1;
    min-width: 200px;
}

.retro-input::placeholder {
    color: #808080;
}

.retro-input:focus {
    background: #ffffff;
}

/* 90s Internet Button Style */
.retro-button {
    padding: 8px 16px;
    background: #c0c0c0;
    color: rgb(0, 0, 255); /* Blue text */
    border: 2px outset #c0c0c0;
    font-size: 11px;
    font-weight: normal;
    cursor: pointer;
    font-family: 'Web DOS/V re. JPN24', 'VT323', 'Share Tech Mono', 'Courier New', monospace;
    text-transform: uppercase;
    white-space: nowrap;
}

.retro-button:hover:not(:disabled) {
    background: #e0e0e0;
}

.retro-button:active {
    border: 2px inset #c0c0c0;
    background: #a0a0a0;
}

.retro-button:disabled {
    color: #808080;
    cursor: not-allowed;
}

.button-loading {
    display: none;
}

.form-footer {
    color: rgb(0, 0, 255); /* Blue text */
    font-size: 10px;
    margin-top: 0.5rem;
    font-family: 'Web DOS/V re. JPN24', 'VT323', 'Share Tech Mono', 'Courier New', monospace;
}

.message-container {
    margin-top: 0.5rem;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: normal;
    color: inherit;
    font-family: 'Web DOS/V re. JPN24', 'VT323', 'Share Tech Mono', 'Courier New', monospace;
}

.message-success {
    background: transparent;
    border: none;
    color: #000000; /* plain text */
}

.message-error {
    background: transparent;
    border: none;
    color: rgb(255, 0, 0); /* pure red */
}

.message-info {
    background: transparent;
    border: none;
    color: rgb(255, 0, 0); /* pure red */
}

/* Mobile responsive */
@media (max-width: 768px) {
    .waitlist-container {
        padding: 1.5rem;
        min-width: 280px;
        margin: 1rem;
    }
    
    .waitlist-counter {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .counter-icon {
        font-size: 1.2rem;
    }
    
    .email-input, .join-button {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* UI State Management */
.ui-state {
    text-align: center;
}

.success-message h2 {
    font-size: 14px;
    color: #000000;
    margin: 0.5rem 0;
    font-family: 'MS Sans Serif', 'Tahoma', sans-serif;
    font-weight: bold;
}

.success-message p {
    font-size: 11px;
    color: #000000;
    margin: 0;
    font-family: 'MS Sans Serif', 'Tahoma', sans-serif;
}

/* Animation for counter updates */
@keyframes countUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.counter-animate {
    animation: countUpdate 0.3s ease;
}

/* Enhanced responsive design for all screen sizes */
@media (max-width: 480px) {
    .waitlist-container {
        padding: 1.2rem;
        min-width: 260px;
        margin: 0.8rem;
    }
    
    .waitlist-counter {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .success-message h2 {
        font-size: 1.6rem;
    }
    
    .success-message p {
        font-size: 1rem;
    }
}

/* Ensure perfect centering on very large screens */
@media (min-width: 1920px) {
    .waitlist-container {
        max-width: 400px;
    }
}
