    body {
        margin: 0;
        padding: 0;
        overflow: hidden;
        font-family: 'Arial', sans-serif;
        touch-action: none;
        background-color: #2c3e50;
        color: #ecf0f1;
        height: 100dvh;
        user-select: none;
    }
    
    .screen {
        position: absolute;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        display: none;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .screen.active {
        display: flex;
    }

    h1 {
        font-size: clamp(2rem, 8vw, 4rem);
        margin: 0 10px 10px;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    }
    
    p.desc {
        font-size: 1.1rem;
        margin-bottom: 30px;
        text-align: center;
        color: #bdc3c7;
        line-height: 1.5;
    }

    button.btn {
        padding: 12px 30px;
        font-size: 1.2rem;
        border: none;
        border-radius: 30px;
        background: #ecf0f1;
        color: #2c3e50;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        transition: transform 0.1s, box-shadow 0.1s;
        margin: 10px;
        font-weight: bold;
    }
    button.btn:active {
        transform: scale(0.95);
    }

    #stage-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        width: 90vw;
        max-width: 500px;
        margin-bottom: 20px;
    }

    .stage-card {
        background: rgba(0, 0, 0, 0.2);
        color: #2c3e50;
        cursor: pointer;
        border: none;
        border-radius: 0;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        transition: transform 0.1s, box-shadow 0.1s;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px;
        box-sizing: border-box;
        height: 160px;
    }
    .stage-card:active {
        transform: scale(0.95);
    }
    .stage-card-title {
        font-size: 1.2rem;
        font-weight: bold;
        margin-bottom: 10px;
        color: #ffffff;
    }
    .stage-card-board {
        position: relative;
        width: 100%;
        height: 100px;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
    .mini-hex {
        width: 26px !important;
        height: 30px !important;
        box-shadow: inset 0 0 4px rgba(0,0,0,0.3) !important;
    }
    .mini-badge {
        width: 10px !important;
        height: 10px !important;
        border-width: 1px !important;
    }

    #stage-pagination {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
        margin-bottom: 20px;
    }

    #header-ui {
        position: absolute;
        top: 20px;
        left: 0;
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding: 0 20px;
        box-sizing: border-box;
        z-index: 100;
    }
    
    .status-text, .toggle-container {
        font-size: 1.2rem;
        font-weight: bold;
        background: rgba(0, 0, 0, 0.4);
        padding: 8px 15px;
        border-radius: 15px;
    }

    #game-controls {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 80px;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(8px);
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
        z-index: 1000;
    }

    #board-container {
        position: relative;
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .hex {
        position: absolute;
        width: 80px;
        height: 92.37px;
        clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
        transform: translate(-50%, -50%);
        transition: background-color 0.3s ease, transform 0.1s;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
    }
    
    .hex:active {
        transform: translate(-50%, -50%) scale(0.85);
    }

    .state-0 { background-color: #ecf0f1; } /* 白 */
    .state-1 { background-color: #e74c3c; } /* 赤 */
    .state-2 { background-color: #3498db; } /* 青 */

    .badge {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        border: 2px solid rgba(0,0,0,0.4);
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
        pointer-events: none;
    }
    .type-WR { background: linear-gradient(135deg, #ecf0f1 50%, #e74c3c 50%); }
    .type-RB { background: linear-gradient(135deg, #e74c3c 50%, #3498db 50%); }
    .type-BW { background: linear-gradient(135deg, #3498db 50%, #ecf0f1 50%); }

    #clear-message {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0);
        font-size: clamp(3rem, 15vw, 5rem);
        font-weight: bold;
        color: #f1c40f;
        text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
        z-index: 2000;
        opacity: 0;
        pointer-events: none;
        transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s;
    }
    #clear-message.show {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    .info-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #34495e; 
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: help;
    position: relative;
    }

    .tooltip {
    position: absolute;
    top: 130%; 
    left: 50%;
    transform: translateX(-50%); 
    width: 200px;
    padding: 10px;
    background-color: #2c3e50;
    color: #ecf0f1;
    font-size: 12px;
    font-weight: normal;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease-in-out; 
    
    pointer-events: none; 
    z-index: 100;
    }

    .tooltip::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #2c3e50 transparent;
    }

    .info-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
    }

    /* チュートリアル・About画面用スタイル */
    .rule-slider-container { width: 90vw; max-width: 500px; overflow: hidden; position: relative; margin-bottom: 10px; }
    .rule-slider-track { display: flex; width: 300%; transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1); }
    .rule-step { width: 33.3333%; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
    .rule-step p.desc { height: 70px; margin-bottom: 20px; }
    .demo-board-container { position: relative; width: 100%; height: 250px; display: flex; justify-content: center; align-items: center; background: rgba(0, 0, 0, 0.2); border-radius: 20px; }
    .hex-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
    #rule-controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 25px; }
    .nav-btn { padding: 10px 20px !important; font-size: 1.5rem !important; }
    #demo-clear-message { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0); font-size: 3.5rem; font-weight: bold; color: #f1c40f; text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8); z-index: 100; opacity: 0; pointer-events: none; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s; }
    #demo-clear-message.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    .demo-cursor { position: absolute; width: 40px; height: 40px; background: rgba(255, 255, 255, 0.5); border: 2px solid #fff; border-radius: 50%; pointer-events: none; z-index: 50; opacity: 0; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: transform 0.4s ease, opacity 0.3s, background-color 0.1s; left: calc(50% - 20px); top: calc(50% - 20px); }
    .about-container { width: 90vw; max-width: 400px; background: rgba(0, 0, 0, 0.2); border-radius: 15px; padding: 20px 30px; margin-bottom: 30px; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
    .about-section { margin-bottom: 20px; }
    .about-section:last-child { margin-bottom: 0; }
    .about-section h2 { font-size: 1.2rem; color: #ffffff; margin: 0 0 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 5px; }
    .about-section p { margin: 8px 0; font-size: 1rem; color: #ecf0f1; }
    .about-section span.label { color: #bdc3c7; margin-right: 5px; }
    .about-section a { color: #3498db; text-decoration: none; transition: color 0.2s; }
    .about-section a:hover { color: #2980b9; }

    /* --- 共有通知 --- */
    #toast-notification {
        position: fixed;
        top: -150px;
        left: 50%;
        transform: translateX(-50%);
        background: #2c3e50;
        color: #fff;
        padding: 15px 30px;
        border-radius: 20px;
        font-weight: bold;
        font-size: 1.1rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        z-index: 9999;
        pointer-events: none;
        transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    #toast-notification.show {
        top: 20px;
    }

    @media screen and (max-width: 500px) {
        #game-controls.share-active {
            gap: 1px; 
        }
        #game-controls.share-active .btn {
            margin: 5px 2px; 
        }
    }
    /* --- シェア用 --- */
    .share-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        background: rgba(0,0,0,0.8);
        z-index: 4000;
        display: none;
        justify-content: center;
        align-items: center;
    }
    .share-modal-overlay.active {
        display: flex;
    }
    .share-modal-content {
        background: #2c3e50;
        padding: 30px 20px 20px;
        border-radius: 15px;
        width: 90%;
        max-width: 400px;
        position: relative;
        text-align: center;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
        border: 2px solid #34495e;
    }
    .close-btn {
        position: absolute;
        top: 10px;
        right: 15px;
        background: none;
        border: none;
        color: #bdc3c7;
        font-size: 2rem;
        cursor: pointer;
        line-height: 1;
    }
    #share-url-input {
        width: 100%;
        padding: 10px;
        margin: 15px 0;
        box-sizing: border-box;
        border: none;
        border-radius: 5px;
        background: #1a252f;
        color: #ecf0f1;
        font-family: monospace;
        font-size: 0.9rem;
    }
    .sns-buttons {
        display: flex;
        gap: 10px;
        justify-content: center;
        margin-top: 10px;
    }
    .sns-btn {
        padding: 10px 15px;
        border: none;
        border-radius: 8px;
        font-weight: bold;
        color: #fff;
        cursor: pointer;
        flex: 1;
        font-size: 1rem;
        transition: transform 0.1s;
    }
    .sns-btn:active {
        transform: scale(0.95);
    }
    .x-btn { background: #000000; }
    .line-btn { background: #06C755; }
    .facebook-btn { background: #1877F2; }
