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

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #000;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(76, 0, 255, 0.1) 0%, transparent 60%),
        linear-gradient(45deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 50, 0.8) 100%);
    flex-direction: column;
    gap: 20px;
    font-family: 'Noto Sans JP', sans-serif;
    color: #fff;
}

.game-container {
    position: relative;
    display: none;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
    margin: 0 auto;
    width: auto;
    max-width: 95vw;
}

#gameCanvas {
    border: 2px solid #333;
    background-color: rgba(0, 0, 0, 0.8);
    display: block;
    margin: 0 auto;
}

.game-info {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 18px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 5px;
}

#score, #life, #best-score {
    margin: 5px 0;
    white-space: nowrap;
}

.settings-panel {
    background-color: rgba(20, 20, 40, 0.9);
    padding: 30px;
    border-radius: 15px;
    color: #fff;
    font-family: 'Noto Sans JP', sans-serif;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    border: 1px solid rgba(0, 255, 255, 0.1);
}

.title-section {
    text-align: center;
    margin-bottom: 30px;
}

.title-section h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: #4df;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    margin-bottom: 10px;
}

.title-section h1 i {
    margin-right: 10px;
    color: #4df;
    animation: pulse 2s infinite;
}

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

.title-section h2 {
    font-size: 1.2em;
    color: #adf;
    font-weight: normal;
}

.instructions {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.instructions h3 {
    color: #4df;
    margin-bottom: 15px;
    text-align: center;
}

.instructions h3 i {
    margin-right: 10px;
    color: #4df;
}

.control-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.key {
    background-color: rgba(0, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 5px;
    font-family: monospace;
    border: 1px solid rgba(0, 255, 255, 0.3);
    min-width: 80px;
    text-align: center;
}

.description {
    color: #bdf;
}

.game-description {
    text-align: center;
    line-height: 1.6;
    color: #9bf;
    font-size: 0.9em;
    margin-top: 20px;
}

.settings-section {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.settings-section h3 {
    color: #4df;
    margin-bottom: 15px;
    text-align: center;
}

.settings-section h3 i {
    margin-right: 10px;
    color: #4df;
}

.setting-item {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item label {
    min-width: 150px;
    color: #7a7a7a;
}

.setting-item label i {
    margin-right: 8px;
    width: 20px;
    color: #4df;
}

.setting-item input[type="range"] {
    flex: 1;
    max-width: 200px;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #4df;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #4df;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    border: none;
}

.setting-item input[type="range"]:active::-webkit-slider-thumb,
.setting-item input[type="range"]:focus::-webkit-slider-thumb {
    background: #00a0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.setting-item input[type="range"]:active::-moz-range-thumb,
.setting-item input[type="range"]:focus::-moz-range-thumb {
    background: #00a0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.setting-item span {
    min-width: 50px;
    text-align: right;
    font-weight: bold;
    color: #4df;
}

.difficulty-display {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.difficulty-level {
    font-weight: bold;
    color: #2196F3;
    font-size: 1.2em;
    text-shadow: 0 0 5px rgba(33, 150, 243, 0.3);
}

#startGame {
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    background: linear-gradient(45deg, #2196F3, #00BCD4);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
}

#startGame:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}

#startGame:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 255, 255, 0.3);
}

#startGame i {
    margin-right: 8px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* モーダルウィンドウ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100000; /* 非常に高い値にして確実に最前面へ */
    animation: fadeIn 0.3s ease-in-out;
    backdrop-filter: blur(5px);
    box-sizing: border-box;
    padding: 10px;
    font-family: 'Noto Sans JP', sans-serif;
    /* 全画面モードでの問題を防ぐためのスタイル */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: opacity;
}

/* ゲームコンテナ内に配置した場合のモーダルスタイル（Android Chrome対策） */
.game-container > .modal {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.9);
}

/* モーダルコンテンツのスタイル */
.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 620px;
    background: linear-gradient(135deg, #12172e, #203354);
    color: white;
    padding: 25px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 255, 0.3), 0 0 30px rgba(0, 183, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    border: 1px solid rgba(77, 255, 255, 0.3);
    max-height: 95vh;
    overflow-y: auto;
    box-sizing: border-box;
    /* 表示問題対策のための追加スタイル */
    transform: translate(-50%, -50%) translateZ(0);
    -webkit-transform: translate(-50%, -50%) translateZ(0);
    will-change: transform, opacity;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -55%) translateZ(0);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) translateZ(0);
        opacity: 1;
    }
}

.result-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
    box-shadow: inset 0 0 15px rgba(0, 183, 255, 0.1);
}

.result-info p {
    margin: 10px 0;
    font-size: 1.2em;
    text-align: center;
    width: 100%;
}

.result-info p i {
    margin-right: 10px;
    width: 20px;
    color: #4df;
    text-shadow: 0 0 10px rgba(77, 255, 255, 0.6);
}

.result-info span {
    font-weight: bold;
    color: #4df;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

#resultTitle {
    color: #4df;
    font-size: 2.2em;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    width: 100%;
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px;
}

.share-buttons-and-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-sizing: border-box; /* ボックスサイズを正確に計算 */
}

.new-record-badge {
    display: none;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    margin: 10px auto 20px;
    animation: glow 1.2s ease-in-out infinite alternate;
    font-size: 1.1em;
    letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.new-record-badge i {
    margin-right: 8px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.share-buttons {
    margin: 10px 0 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.share-button {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 220px;
    flex: 1;
    max-width: 250px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.share-button.twitter {
    background: linear-gradient(45deg, #1da1f2, #0d8ecf);
    color: white;
}

.share-button.line {
    background: linear-gradient(45deg, #00b900, #008e00);
    color: white;
}

.share-button i {
    margin-right: 10px;
}

.share-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.share-button:active {
    transform: translateY(1px);
}

.modal-buttons {
    margin-top: 5px;
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    border-top: 1px solid rgba(77, 255, 255, 0.2);
    padding-top: 20px;
    box-sizing: border-box; /* ボックスサイズを正確に計算 */
    flex-wrap: wrap; /* 幅が足りない場合は折り返し */
}

.modal-buttons button {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    flex: 0 1 auto;
    max-width: 280px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    min-width: 170px;
    text-align: center;
    box-sizing: border-box; /* ボックスサイズを正確に計算 */
}

.modal-buttons button:first-child {
    background: linear-gradient(45deg, #2196F3, #00BCD4);
    color: white;
}

.modal-buttons button:last-child {
    background: linear-gradient(45deg, #607D8B, #455A64);
    color: white;
}

.modal-buttons button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.modal-buttons button:active {
    transform: translateY(1px);
}

.modal-buttons button i {
    margin-right: 10px;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700;
    }
    to {
        box-shadow: 0 0 20px #ffd700, 0 0 30px #ffd700, 0 0 40px #e60073;
    }
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.action-button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.2);
}

.action-button.retry {
    background: linear-gradient(45deg, #2196F3, #00BCD4);
    color: white;
}

.action-button.settings {
    background: linear-gradient(45deg, #607D8B, #455A64);
    color: white;
}

#best-score {
    color: #4df;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
    font-weight: bold;
}

.official-site-link {
    text-align: center;
    margin: 20px 0;
}

.official-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4a90e2;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.official-link:hover {
    background-color: #357abd;
}

.official-link i {
    margin-right: 8px;
}

/* モバイル対応のメディアクエリ */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .game-container {
        width: 95%;
        height: auto;
        max-width: 1200px;
        padding: 0;
        margin: 0 auto;
    }
    
    canvas {
        border-radius: 0;
        box-shadow: none;
        width: 100%;
        height: auto;
        display: block;
        max-width: 100%;
    }
    
    .game-info {
        position: absolute;
        top: 10px;
        left: 10px;
        background-color: rgba(0, 0, 0, 0.5);
        border-radius: 8px;
        padding: 8px;
        font-size: 0.9rem;
        z-index: 100;
        max-width: 70%;
    }
    
    .game-info div {
        margin-bottom: 5px;
        white-space: nowrap;
    }
    
    .settings-panel {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        box-sizing: border-box;
        margin: 0;
        border-radius: 0;
    }
    
    .title-section {
        margin-bottom: 20px;
    }
    
    .title-section h1 {
        font-size: 1.8rem;
    }
    
    .title-section h2 {
        font-size: 1rem;
    }
    
    .instructions {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .instructions h3,
    .settings-section h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .control-item {
        margin-bottom: 8px;
    }
    
    .key {
        padding: 4px 8px;
        font-size: 0.85rem;
        min-width: 70px;
    }
    
    .description {
        font-size: 0.9rem;
    }
    
    .settings-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .difficulty-display {
        margin-top: 15px;
        padding: 12px;
    }
    
    .difficulty-level {
        font-size: 1.1em;
    }
    
    /* ゲームスタートボタンを調整 */
    #startGame {
        padding: 12px 0;
        font-size: 1.1rem;
        margin-top: 10px;
    }
    
    .settings-section h3 {
        font-size: 1.2rem;
    }
    
    .control-item {
        margin-bottom: 10px;
    }
    
    .key {
        padding: 5px 10px;
        font-size: 0.9rem;
    }
    
    .setting-item {
        margin-bottom: 12px;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 5px;
        align-items: center;
    }
    
    .setting-item label {
        width: 100%;
        grid-column: 1 / 3;
        grid-row: 1;
        margin-bottom: 4px;
        font-size: 0.95rem;
    }
    
    .setting-item input[type="range"] {
        width: 100%;
        height: 22px;
        margin: 0;
        grid-column: 1;
        grid-row: 2;
    }
    
    .setting-item span {
        grid-column: 2;
        grid-row: 2;
        width: auto;
        min-width: 35px;
        font-size: 0.95rem;
        margin-left: 8px;
        text-align: right;
    }
    
    .setting-item input[type="range"]::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
    }
    
    .setting-item input[type="range"]::-moz-range-thumb {
        width: 22px;
        height: 22px;
    }
    
    /* モーダルウィンドウ */
    .modal-content {
        width: 95%;
        padding: 20px;
        max-width: 95%;
        max-height: 90vh; /* 画面の高さの90%までに制限 */
        overflow-y: auto; /* 内容が収まらない場合はスクロール可能に */
    }
    
    .share-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .share-button {
        margin-bottom: 5px;
        width: 100%;
        min-width: unset;
        max-width: 100%;
        white-space: nowrap;
    }
    
    .modal-buttons {
        flex-direction: row; /* 横並びに */
        gap: 10px;
        margin-top: 8px;
        padding-top: 15px;
        border-top: 1px solid rgba(77, 255, 255, 0.2);
    }
    
    .modal-buttons button {
        padding: 12px 15px;
        font-size: 1rem;
        flex: 1;
        white-space: normal;
        min-width: unset;
    }
    
    /* タッチ操作の説明を追加 */
    .touch-controls-info {
        display: block;
        margin-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-top: 15px;
    }
    
    .touch-control-item {
        display: flex;
        align-items: center;
        margin-bottom: 10px;
    }
    
    .touch-control-icon {
        background-color: rgba(255, 255, 255, 0.2);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 15px;
    }
    
    /* 横持ち推奨メッセージ */
    .orientation-message {
        display: none; /* デフォルトでは非表示 */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.9);
        z-index: 1000;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .orientation-message i {
        font-size: 4rem;
        margin-bottom: 20px;
        color: #4df;
        animation: rotate 2s infinite;
    }
    
    @keyframes rotate {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(90deg); }
    }
}

/* 横持ち用のレイアウトクラス - JavaScriptで追加 */
.modal-content.landscape-layout {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    max-height: 85vh;
    animation: none; /* アニメーションを無効化（位置ずれ防止） */
}

.modal-content.landscape-layout #resultTitle {
    width: 100%;
    font-size: 1.8em;
    margin-bottom: 15px;
}

.modal-content.landscape-layout .result-info {
    width: 48%;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 65vh;
    padding: 15px;
    margin: 0;
}

.modal-content.landscape-layout .result-info p {
    margin: 8px 0;
    font-size: 1em;
    text-align: left;
}

.modal-content.landscape-layout .share-buttons-and-actions {
    width: 48%;
    display: flex;
    flex-direction: column;
    margin: 0;
    justify-content: flex-start;
    padding-top: 10px;
}

.modal-content.landscape-layout .share-buttons {
    margin: 10px 0 15px;
    width: 100%;
    flex-direction: column;
    gap: 10px;
}

.modal-content.landscape-layout .share-button {
    margin-bottom: 5px;
    width: 100%;
    max-width: 100%;
}

.modal-content.landscape-layout .modal-buttons {
    margin-top: 10px;
    width: 100%;
    flex-direction: row;
    gap: 10px;
    border-top: 1px solid rgba(77, 255, 255, 0.2);
    padding-top: 15px;
}

.modal-content.landscape-layout .new-record-badge {
    margin: 10px auto 15px;
    font-size: 1em;
    padding: 5px 12px;
}

/* 横持ち時の特別な調整（横向きのモバイルデバイス用） */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        padding: 15px;
        max-height: 85vh; /* 横向き時はさらに小さく */
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: flex-start;
        transform: translate(-50%, -50%) !important; /* 位置を固定 */
    }
    
    #resultTitle {
        font-size: 1.7em;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .result-info {
        padding: 15px;
        margin: 0;
        width: 48%;
        box-sizing: border-box;
        overflow-y: auto;
        max-height: 65vh;
    }
    
    .result-info p {
        margin: 8px 0;
        font-size: 1em;
        text-align: left;
    }
    
    .new-record-badge {
        margin: 5px auto 10px;
        font-size: 0.95em;
        padding: 5px 10px;
    }
    
    .share-buttons-and-actions {
        width: 48%;
        display: flex;
        flex-direction: column;
        margin: 0;
        padding-top: 5px;
    }
    
    .share-buttons {
        margin: 5px 0;
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .share-button {
        margin-bottom: 0;
        width: 100%;
        padding: 10px 15px;
        font-size: 1em;
    }
    
    .modal-buttons {
        margin-top: 10px;
        width: 100%;
        flex-direction: row;
        gap: 10px;
    }
    
    .modal-buttons button {
        width: 100%;
        flex: 1;
        max-width: 100%;
        padding: 10px 15px;
        font-size: 1em;
    }
}

/* モバイルデバイスの縦向きの場合のみ表示（ただしゲーム開始前のみ） */
@media (max-width: 768px) and (orientation: portrait) {
    .orientation-message.mobile-only:not(.hidden) {
        display: flex;
    }
    
    /* ゲームプレイ中は非表示 */
    body:has(.game-container[style*="display: flex"]) .orientation-message {
        display: none !important;
    }
}

/* ボタンとSNS共有の配置を整える - PC向け */
@media (min-width: 769px) {
    .modal-content {
        padding: 25px 20px;
        overflow-y: auto;
        width: 85%;
        max-width: 600px;
    }
    
    .result-info {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .share-buttons-and-actions {
        max-width: 100%;
        margin: 0 auto;
        width: 100%;
    }
    
    .share-buttons {
        margin-bottom: 20px;
        display: flex;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .share-button {
        min-width: 160px;
        max-width: 220px;
        padding: 12px 15px;
        font-size: 1em;
        white-space: nowrap;
        flex: 0 1 auto;
    }
    
    .modal-buttons {
        padding-top: 15px;
        margin-top: 8px;
        display: flex;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
        width: 100%;
    }
    
    .modal-buttons button {
        min-width: 160px;
        max-width: 220px;
        padding: 12px 15px;
        font-size: 1em;
        flex: 0 1 auto;
        white-space: nowrap;
    }
}

/* 非常に小さい画面向けの追加調整 */
@media (max-width: 360px) {
    .title-section h1 {
        font-size: 1.6rem;
    }
    
    .title-section h2 {
        font-size: 0.9rem;
    }
    
    .instructions, .settings-section {
        padding: 12px;
    }
    
    .setting-item label {
        font-size: 0.9rem;
    }
    
    .setting-item span {
        font-size: 0.9rem;
        min-width: 30px;
    }
    
    .setting-item input[type="range"] {
        height: 20px;
    }
    
    .setting-item input[type="range"]::-webkit-slider-thumb,
    .setting-item input[type="range"]::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }
}

/* スライダーのタッチ操作時のスタイル */
.setting-item input[type="range"].touching::-webkit-slider-thumb {
    transform: scale(1.2);
    background: #00a0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.setting-item input[type="range"].touching::-moz-range-thumb {
    transform: scale(1.2);
    background: #00a0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

/* タッチデバイス向けのスライダーの改良 */
@media (pointer: coarse) {
    .setting-item input[type="range"]::-webkit-slider-thumb {
        border: 2px solid rgba(255, 255, 255, 0.8);
    }
    
    .setting-item input[type="range"]::-moz-range-thumb {
        border: 2px solid rgba(255, 255, 255, 0.8);
    }
    
    /* タッチフィードバックの強化 */
    .setting-item input[type="range"]:active::-webkit-slider-thumb,
    .setting-item input[type="range"]:focus::-webkit-slider-thumb,
    .setting-item input[type="range"].touching::-webkit-slider-thumb {
        transform: scale(1.2);
        background: #00a0ff;
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
        transition: all 0.1s ease;
    }
    
    .setting-item input[type="range"]:active::-moz-range-thumb,
    .setting-item input[type="range"]:focus::-moz-range-thumb,
    .setting-item input[type="range"].touching::-moz-range-thumb {
        transform: scale(1.2);
        background: #00a0ff;
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
        transition: all 0.1s ease;
    }
}

/* Android Chrome対策のための追加クラス */
.android-modal-fix {
    position: fixed !important;
    z-index: 200000 !important;
    pointer-events: auto !important;
    touch-action: auto !important;
    visibility: visible !important;
    /* ハードウェアアクセラレーション強制 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

.android-content-fix {
    transform: translate(-50%, -50%) translateZ(0) !important;
    -webkit-transform: translate(-50%, -50%) translateZ(0) !important;
    z-index: 200001 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    touch-action: auto !important;
}

/* Android Chrome向け特別なスタイル */
@media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) and (max-width: 1024px) {
    .game-container {
        width: 95vw !important; /* 画面の95%幅 */
        max-width: 1200px; /* 最大幅 */
        margin: 0 auto; /* 中央揃え */
    }
    
    #gameCanvas {
        width: 100%; /* コンテナの100%幅 */
        height: auto; /* 高さは自動調整 */
        display: block; /* ブロック表示 */
    }
}

/* Android Chrome向けの特別なスタイル */
@media screen and (max-width: 768px) and (-webkit-min-device-pixel-ratio:0) {
    .game-container {
        width: 95vw !important;
        max-width: 1200px;
        margin: 0 auto;
        box-sizing: border-box;
        padding: 0;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
        box-sizing: border-box;
        border-radius: 0;
    }
} 