/* WebAR 魔法陣 - スタイルシート */

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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent !important; /* 黒背景から透明に変更 */
}

/* A-Frame関連の全要素を透明化 */
a-scene, 
a-scene *,
canvas,
canvas[data-aframe-canvas="true"],
.a-canvas,
.a-enter-vr,
.a-loader-title {
    background: transparent !important;
    background-color: transparent !important;
}

/* UI オーバーレイ */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background: transparent; /* 明示的に透明背景を設定 */
}

/* 指示テキスト */
.instruction-text {
    background: rgba(0, 0, 0, 0.7); /* 透明度を少し下げる */
    color: white;
    padding: 15px; /* パディングを小さくする */
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(5px); /* ブラー効果を軽減 */
    border: 2px solid rgba(74, 144, 226, 0.8); /* ボーダーも少し透明に */
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.2); /* シャドウを軽減 */
    max-width: 300px; /* 最大幅を制限 */
    margin: 0 auto; /* 中央寄せ */
}

.instruction-text h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #4a90e2;
    text-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

.instruction-text p {
    font-size: 16px;
    margin: 5px 0;
    line-height: 1.4;
}

/* ステータステキスト */
.status-text {
    background: rgba(255, 215, 0, 0.8); /* 透明度を少し下げる */
    color: #333;
    padding: 12px; /* パディングを小さくする */
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 16px; /* フォントサイズを小さくする */
    align-self: center;
    display: none;
    border: 2px solid rgba(255, 215, 0, 0.8); /* ボーダーも透明に */
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); /* シャドウを軽減 */
    max-width: 250px; /* 最大幅を制限 */
}

/* 結果テキスト */
.result-text {
    background: rgba(50, 205, 50, 0.8); /* 透明度を少し下げる */
    color: white;
    padding: 15px; /* パディングを小さくする */
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 20px;
    align-self: center;
    border: 2px solid #32cd32;
    box-shadow: 0 0 20px rgba(50, 205, 50, 0.5);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* リプレイボタン */
#replay-btn {
    background: linear-gradient(45deg, #4a90e2, #357abd);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    align-self: center;
    pointer-events: auto;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#replay-btn:hover {
    background: linear-gradient(45deg, #357abd, #2a5a87);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

#replay-btn:active {
    transform: translateY(0);
}

/* AR Scene */
a-scene {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
}

/* A-Frameキャンバスの背景を強制的に透明化 */
a-scene canvas {
    background: transparent !important;
    background-color: transparent !important;
}

/* A-Frameのデフォルト背景を削除 */
a-scene .a-canvas {
    background: transparent !important;
    background-color: transparent !important;
}

/* WebGLキャンバスの背景も透明化 */
canvas[data-aframe-canvas="true"] {
    background: transparent !important;
    background-color: transparent !important;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .instruction-text {
        padding: 15px;
        margin: 10px;
    }
    
    .instruction-text h2 {
        font-size: 20px;
    }
    
    .instruction-text p {
        font-size: 14px;
    }
    
    .status-text {
        font-size: 16px;
        padding: 12px;
    }
    
    .result-text {
        font-size: 18px;
        padding: 15px;
    }
    
    #replay-btn {
        font-size: 16px;
        padding: 12px 25px;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* タッチフィードバック */
.touching {
    background: rgba(255, 215, 0, 0.9) !important;
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.7) !important;
}
