/* Eye Training CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Meiryo', sans-serif;
    background: linear-gradient(000, #000 0%, #000 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

header h1 {
    font-size: 3em;
    color: #4a5568;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.2em;
    color: #718096;
}

.game-area {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.info-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(000, #000 0%, #000 100%);
    border-radius: 15px;
    color: white;
    font-weight: bold;
}

.score span, .level span {
    margin: 0 15px;
    font-size: 1.1em;
}

.training-screen {
    background: #f8f9fa;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 30px;
}

#landolt-ring {
    transition: all 0.3s ease;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
}

.initial-title {
    text-align: center;
    color: #333;
    animation: fadeIn 1s ease-in;
}

.initial-title h1 {
    font-size: 5em;
    font-weight: bold;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 30px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 2px;
}

.initial-title p {
    font-size: 2.2em;
    color: #666;
    font-weight: 300;
    margin: 0;
}

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

/* 10段階のサイズクラス - PC版に1段階追加 */
#landolt-ring.size1 {
    width: 400px !important;
    height: auto;
}

#landolt-ring.size2 {
    width: 320px !important;
    height: auto;
}

#landolt-ring.size3 {
    width: 260px !important;
    height: auto;
}

#landolt-ring.size4 {
    width: 200px !important;
    height: auto;
}

#landolt-ring.size5 {
    width: 150px !important;
    height: auto;
}

#landolt-ring.size6 {
    width: 100px !important;
    height: auto;
}

#landolt-ring.size7 {
    width: 70px !important;
    height: auto;
}

#landolt-ring.size8 {
    width: 50px !important;
    height: auto;
}

#landolt-ring.size9 {
    width: 35px !important;
    height: auto;
}

#landolt-ring.size10 {
    width: 25px !important; /* PC版追加サイズ */
    height: auto;
}

/* スマホ用サイズ調整 - 顕微鏡レベル */
@media (max-width: 768px) {
    #landolt-ring.size1 {
        width: min(30px, 8vw) !important; /* 顕微鏡レベル */
    }
    
    #landolt-ring.size2 {
        width: min(28px, 7vw) !important;
    }
    
    #landolt-ring.size3 {
        width: min(25px, 6vw) !important;
    }
    
    #landolt-ring.size4 {
        width: min(22px, 5vw) !important;
    }
    
    #landolt-ring.size5 {
        width: min(20px, 4vw) !important;
    }
    
    #landolt-ring.size6 {
        width: min(18px, 3vw) !important;
    }
    
    #landolt-ring.size7 {
        width: min(15px, 2vw) !important;
    }
    
    #landolt-ring.size8 {
        width: min(12px, 1vw) !important;
    }
    
    #landolt-ring.size9 {
        width: min(10px, 1vw) !important; /* 最極小 */
    }
}

.feedback {
    position: absolute;
    bottom: 20px;
    font-size: 2em;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback.correct {
    background: #48bb78;
    color: white;
    opacity: 1;
}

.feedback.incorrect {
    background: #f56565;
    color: white;
    opacity: 1;
}

.controls {
    text-align: center;
}

.controls h3 {
    margin-bottom: 20px;
    color: #4a5568;
}

.key-guide {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.key {
    background: #4a5568;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1em;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.space-key {
    background: #667eea;
    padding: 15px 30px;
    font-size: 1em;
}

button {
    background: linear-gradient(000, #000 0%, #000 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 10px;
    cursor: pointer;
    margin: 0 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.instructions {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.instructions h3 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.instructions ol {
    line-height: 2;
    font-size: 1.1em;
    color: #4a5568;
    padding-left: 20px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        margin-bottom: 120px; /* 固定ボタンのための余白 */
    }
    
    .info-panel {
        flex-direction: column;
        gap: 10px;
    }
    
    .key-guide {
        display: none !important;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    /* スマホ用方向ボタンを表示 */
    .mobile-controls {
        display: block !important;
    }
}

@media (min-width: 769px) {
    /* PC用キーガイドを表示 */
    .key-guide {
        display: flex;
    }
    
    .mobile-controls {
        display: none;
    }
}

/* モバイル用方向ボタン - 固定配置 */
.mobile-controls {
    display: none;
    position: fixed; /* 固定位置 */
    bottom: 20px; /* 下から20px */
    left: 50%;
    transform: translateX(-50%); /* 中央揃え */
    margin: 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8); /* 半透明背景 */
    border-radius: 20px;
    z-index: 1000; /* 最前面に表示 */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.direction-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* コンパクトな間隔 */
    max-width: 100%;
    margin: 0 auto;
    width: auto;
}

.middle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* コンパクトな間隔 */
    width: auto;
}

.center-space {
    width: 50px; /* 固定サイズ */
    height: 50px;
}

.direction-btn {
    width: 50px; /* 固定サイズ */
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 20px; /* 固定フォントサイズ */
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    outline: none;
    border: 2px solid rgba(255, 255, 255, 0.2); /* 白い縁取り */
}

.direction-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.direction-btn:active, .direction-btn:focus {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    outline: none;
}

.direction-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}