/* Cyberpunk Theme for Typing Game */

#win-typing .window-content {
    background-color: #0d0d0d !important;
    border: 1px solid #ff00ff;
    box-shadow: 0 0 15px #ff00ff, inset 0 0 10px #ff00ff;
}

#typing-stats {
    background: linear-gradient(45deg, rgba(255, 0, 255, 0.1), rgba(0, 255, 255, 0.1)) !important;
    border: 1px solid #00ffff !important;
    text-shadow: 0 0 5px #00ffff;
    color: #00ffff;
}

#typing-monitor {
    background-color: #000 !important;
    border: 2px solid #ff00ff !important;
    color: #00ff00;
    text-shadow: 0 0 8px #00ff00;
    font-family: 'Consolas', 'Courier New', monospace !important;
    font-size: 24px !important;
    font-weight: bold;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

/* Scanline effect */
#typing-monitor::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.2),
        rgba(0, 0, 0, 0.2) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 0; /* 文字の背面に設定 */
}

#typing-prompt {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    overflow: hidden;
    z-index: 2; /* 文字を走査線の前面に出す */
}

/* 入力済みの文字のスタイル */
#typing-prompt .prompt-typed {
    color: #000000; /* 黒文字 */
    background-color: #00ff00; /* 緑背景で塗りつぶす */
    text-shadow: none; /* 発光を消す */
}

#typing-cursor {
    display: inline-block;
    background-color: #00ff00;
    box-shadow: 0 0 8px #00ff00;
    width: 9px;
    margin-left: 1px;
    animation: blink-cyber 0.8s infinite;
}

@keyframes blink-cyber {
    0%, 100% { background-color: #00ff00; box-shadow: 0 0 8px #00ff00; }
    50% { background-color: transparent; box-shadow: none; }
}

#typing-keyboard {
    display: grid;
    grid-template-columns: repeat(30, 1fr);
    grid-template-rows: repeat(5, 1fr);
    grid-gap: 5px;
    width: 100%;
    height: 220px;
}

.keyboard-key {
    grid-column: span 2;
    background-color: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff;
    color: #00ffff;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    transition: all 0.1s ease;
    position: relative;
    text-shadow: 0 0 3px #00ffff;
}

.keyboard-key:hover {
    background-color: rgba(0, 255, 255, 0.2);
}

.keyboard-key.pressed {
    background-color: #ff00ff;
    border-color: #ff00ff;
    color: #fff;
    transform: translateY(1px);
    box-shadow: 0 0 15px #ff00ff;
    text-shadow: 0 0 5px #fff;
}

/* Specific key sizes */
.key-backspace { grid-column: span 4; }
.key-tab { grid-column: span 3; }
.key-caps { grid-column: span 4; }
.key-enter { grid-column: span 5; }
.key-shift-left { grid-column: span 5; }
.key-shift-right { grid-column: span 6; }
.key-ctrl, .key-alt { grid-column: span 3; }
.key-space { grid-column: span 12; }
.key-slash { grid-column: span 3; }

#typing-start-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* スマホ・タブレットで画面のキーボードを非表示にする */
@media screen and (max-width: 1024px) {
    #typing-keyboard {
        display: none !important;
    }
}