/* ------------------------------
   1. Setting All
   ------------------------------ */

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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    text-align: center;     
    background: #212121 url('/common/img_chariot.webp') no-repeat center / cover fixed;
    color: #ffffff;            
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    overflow-x: hidden;
}

body .bgm-btn:focus,body .size-btn:focus,body .manual-btn:focus,body .reset-btn:focus {
    outline: none;
    box-shadow: none;
}

.ui-container {
    width: min(1280px, 95vw);
    position: relative;
}

/* ------------------------------
   2. Title Area
   ------------------------------ */
.title-area h1 {
    font-size: 1.25rem;     
    font-weight: bold;      
    letter-spacing: 2px;    
    padding: 6px 0;        
    background-color: rgba(0, 32, 16, 0.85); 
    color: #00ffcc; 
    border-radius: 9999px;    
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.6); 
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 
                inset 0 0 15px rgba(0, 255, 204, 0.2); 
    border: 1px solid #00bfa5; 
}

/* ------------------------------
   3. Stuts Area
   ------------------------------ */
.status-area {
    display: grid;
    grid-template-columns: 1fr auto; 
    align-items: center;
    margin: 0px 0;
}

.status-info {
    font-size: 1rem;
    font-weight: bold;
    color: #e0e0e0;
    text-align: left; 
    padding-left: 4px;
    white-space: pre-line;  
}

.btn-group {
    display: flex;
    gap: 6px; 
    align-items: center; 
}

/* ------------------------------
   4. Button
   ------------------------------ */
.reset-btn, .manual-btn, .size-btn, .bgm-btn {
    width: 100px;           
    padding: 6px 0;        
    font-size: 0.95rem;        
    font-weight: bold;      
    border: none; 
    border-radius: 9999px;    
    cursor: pointer;        
    display: inline-block;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s, text-shadow 0.2s;
}

.reset-btn:active, .manual-btn:active, .size-btn:active, .bgm-btn:active {
    transform: scale(0.95);
}

.reset-btn { 
    background-color: rgba(211, 47, 47, 0.2); 
    border: 1px solid #ff8a80; 
    color: #ff8a80; 
    text-shadow: 0 0 5px rgba(255, 138, 128, 0.6);
    box-shadow: 0 0 10px rgba(255, 138, 128, 0.3), inset 0 0 5px rgba(255, 138, 128, 0.2);
}
.reset-btn:hover { 
    background-color: #b71c1c; 
    color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 138, 128, 0.8), 0 0 30px rgba(255, 138, 128, 0.4); 
}

.manual-btn {
    background-color: rgba(26, 115, 232, 0.2); 
    border: 1px solid #4fc3f7; 
    color: #4fc3f7; 
    text-shadow: 0 0 5px rgba(79, 195, 247, 0.6);
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.3), inset 0 0 5px rgba(79, 195, 247, 0.2);
}
.manual-btn:hover {
    background-color: #1557b0; 
    color: #ffffff;
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.8), 0 0 30px rgba(79, 195, 247, 0.4); 
}

.size-btn {
    background-color: rgba(0, 191, 165, 0.15); 
    border: 1px solid #00ffcc; 
    color: #00ffcc; 
    text-shadow: 0 0 5px rgba(0, 255, 204, 0.6);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.3), inset 0 0 5px rgba(0, 255, 204, 0.2);
}
.size-btn:hover {
    background-color: #00796b; 
    color: #ffffff;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.8), 0 0 30px rgba(0, 255, 204, 0.4); 
}

.bgm-btn {
    background-color: rgba(255, 145, 0, 0.2); 
    border: 1px solid #ff9100; 
    color: #ff9100; 
    text-shadow: 0 0 5px rgba(255, 145, 0, 0.6);
    box-shadow: 0 0 10px rgba(255, 145, 0, 0.3), inset 0 0 5px rgba(255, 145, 0, 0.2);
}
.bgm-btn:hover {
    background-color: rgba(255, 145, 0, 0.8); 
    border: 1px solid #ff9100;
    color: #ffffff; 
    box-shadow: 0 0 20px rgba(255, 145, 0, 0.8), 0 0 30px rgba(255, 145, 0, 0.4); 
}

/* ----------------------------
   5. Field Area
   ---------------------------- */
.field-area {
    position: relative;
    width: 1280px;
    height: 720px;
    border-radius: 12px;    
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8); 
    border: 6px solid #37474f; 
    overflow: hidden; 
}

.bg-layer, .fx-layer, .core-layer, .card-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Layer 1: bg */
.bg-layer {
    z-index: 1;
    background-color: #212121; 
}

/* Layer 2: Effect */
.fx-layer {
    z-index: 2;
    pointer-events: none;
}

/* Layer 3: Core */
.core-layer {
    z-index: 3;
    display: grid;          
    padding: 0;
    gap: 0px;
}

/* Layer 4: Card */
.card-layer {
    z-index: 4;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.75);
}

/* ----------------------------
   6. Layer 4 Card
   ---------------------------- */
.card-layer.hide-layer {
    display: none;
}

.content-card {
    background-color: rgba(16, 24, 32, 0.95);
    border: 2px solid #5dade2;
    padding: 30px;
    width: 600px;
    text-align: left;
    position: relative;
    box-shadow: 0 0 20px rgba(93, 173, 226, 0.3);
}

.title-card {
    font-size: 1.4rem;
    font-weight: bold;
    color: #5dade2;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.line-card {
    font-size: 1rem;
    line-height: 1.8;
    color: #e0e0e0;
    margin-bottom: 10px;
}

.powered-card {
    font-size: 0.8rem;
    color: #7f8c8d;
    text-align: right;
    margin-top: 25px;
    letter-spacing: 1px;
}

.scanline-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    z-index: 5;
    pointer-events: none;
}

/* ==========================================
   7. Responsive Settings (for Mobile)
   ========================================== */
@media screen and (max-width: 768px) {
    /* 1. Setting All */
    body {
        padding: 8px;
        min-height: auto;
    }

    .ui-container {
        width: 100%;
    }

    /* 2. Title Area */
    .title-area h1 {
        font-size: 1rem;
        letter-spacing: 1px;
        padding: 6px 0;
    }

    /* 3. Stuts Area */
    .status-area {
        grid-template-columns: 1fr; /* 縦並びにして余裕を持たせる */
        gap: 8px;
        margin: 8px 0;
    }

    .status-info {
        font-size: 0.85rem;
        text-align: center;
        padding-left: 0;
    }

    .btn-group {
        justify-content: center;
        flex-wrap: wrap; /* ボタンが溢れたら折り返す */
        gap: 6px;
    }

    /* 4. Button */
    .reset-btn, .manual-btn, .size-btn, .bgm-btn {
        width: calc(50% - 4px); /* 2列で綺麗に並ぶように調整 */
        min-width: 80px;
        padding: 6px 0;
        font-size: 0.85rem;
    }

    /* 5. Field Area */
    .field-area {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9; /* 1280x720の比率（16:9）をスマホでも維持 */
        border-width: 3px; /* 枠線を細く */
    }

    /* 6. Layer 4 Card */
    .content-card {
        width: 90%; /* 画面幅に合わせる */
        padding: 16px;
    }

    .title-card {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .line-card {
        font-size: 0.85rem;
        line-height: 1.6;
        margin-bottom: 6px;
    }

    .powered-card {
        font-size: 0.7rem;
        margin-top: 15px;
    }
}