:root {
    --bg-dark: #0a0b10;
    --panel-bg: rgba(25, 27, 38, 0.7);
    --panel-border: rgba(255, 255, 255, 0.08);
    --accent-1: #6366f1;
    --accent-2: #ec4899;
    --accent-gradient: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --glass-blur: blur(16px);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+ */
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.12) 0%, transparent 45%);
    color: var(--text-main);
    font-family: 'Outfit', 'Noto Sans JP', 'Inter', sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

.app-container {
    width: 100%;
    max-width: 1150px;
    padding: 30px 20px;
    z-index: 2;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.main-title {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.main-title span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.05rem;
    font-weight: 300;
}

/* メインフレーム (Glassmorphism) */
.glass-panel.main-frame {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* モード切り替えタブ */
.mode-selector {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.mode-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.mode-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

/* メインビジュアル＋操作部のエリア */
.viz-area {
    display: grid;
    grid-template-columns: 2fr 1.1fr;
    gap: 24px;
    align-items: start;
}

/* 左カラムパネル（メインエリア） */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

/* 右カラムパネル（解説のみ） */
.right-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 結果と計算式の表示領域 */
.result-display-panel {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.2);
}

.result-summary-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.formula-text {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--accent-1);
    background: rgba(99, 102, 241, 0.08);
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    text-align: center;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
    white-space: pre-line; /* 改行を有効化 */
}

/* キャンバスコンテナ */
.canvas-container {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.canvas-view-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#viz-canvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    touch-action: none;
}

/* コントロールパネル */
.controls-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.controls-panel.horizontal {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.slider-group {
    flex: 1.2;
}

.shape-group {
    flex: 1.5;
}

.action-group {
    flex: 1;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 0.95rem;
    color: var(--text-dim);
    font-weight: 600;
}

/* キャンバス内オーバーレイの共通スタイル */
.canvas-control-overlay {
    position: absolute;
    z-index: 5;
    background: rgba(10, 11, 16, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    gap: 12px;
}

.canvas-control-overlay.top-left {
    top: 14px;
    left: 14px;
    padding: 6px 8px;
}

.canvas-control-overlay.top-left .shape-selector {
    gap: 4px;
}

.canvas-control-overlay.top-left .shape-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 12px;
}

/* キャンバス右上オーバーレイ（番号トグル） */
.canvas-toggle-overlay.top-right {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    background: rgba(10, 11, 16, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    min-width: 120px;
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.pattern-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 2px;
}

.pattern-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-dim);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.pattern-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

/* キャンバス下部オーバーレイ（スライダー・アクション） */
.canvas-control-overlay.bottom-center {
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 560px;
    padding: 8px 18px;
    border-radius: 24px;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.canvas-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 260px;
}

.slider-title-inline {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dim);
    white-space: nowrap;
}

.slider-control-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.slider-control-inner input[type="range"] {
    flex: 1;
}

/* アニメーションボタン (PC・スマホ共通でキャンバス内右下、スライダーパネルの上に配置) */
#action-controls {
    position: absolute;
    bottom: 76px;
    right: 66px; /* 視点リセットボタン (right: 18px) の左隣 */
    z-index: 10;
    display: block;
}

#action-controls.hidden {
    display: none !important;
}

.action-wrapper .action-btn {
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

#btn-animate {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 700;
    user-select: none;
    letter-spacing: 0.5px;
}

/* スライダースイッチ */
.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider-round:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-dim);
    transition: .3s;
    border-radius: 50%;
}

.switch input:checked + .slider-round {
    background: var(--accent-gradient);
    border-color: transparent;
}

.switch input:checked + .slider-round:before {
    transform: translateX(18px);
    background-color: #fff;
}

.highlight-val {
    color: var(--accent-2);
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 4px;
    font-family: 'Outfit', sans-serif;
}

/* スライダー */
.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.step-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.step-btn:active {
    transform: scale(0.95);
}

#step-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    transition: background 0.3s;
}

#step-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-2);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
    transition: transform 0.1s;
}

#step-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* 多角形選択ボタン */
.shape-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.shape-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-dim);
    padding: 10px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.shape-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.shape-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-1);
    color: #a5b4fc;
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.2);
}

/* アクション制御（アニメーションボタン） */
.action-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.action-btn.primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.action-btn.primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.action-btn.primary:active {
    transform: translateY(0);
}

/* 数式表示ボックス */
.formula-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.formula-title {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.formula-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

/* 解説パネル */
.explanation-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.hint-icon {
    font-size: 1.8rem;
    line-height: 1;
    background: rgba(250, 204, 21, 0.1);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(250, 204, 21, 0.2);
}

.explanation-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.explanation-content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.explanation-content div {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-dim);
}

.explanation-content strong {
    color: var(--text-main);
}

/* サイドバーボタンと戻るボタン */
.sidebar-buttons {
    position: fixed;
    bottom: 25px;
    left: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.side-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-dim);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    text-decoration: none;
}

.side-btn svg {
    width: 20px;
    height: 20px;
}

.side-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.version-tag {
    position: fixed;
    bottom: 12px;
    right: 15px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.15);
    z-index: 10;
}

.hidden {
    display: none !important;
}

/* レスポンシブ */
@media (max-width: 850px) {
    .viz-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .main-title {
        font-size: 2.2rem;
    }
    
    .glass-panel.main-frame {
        padding: 20px;
    }

    .mode-selector {
        overflow-x: auto;
        padding: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .mode-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 15px 10px;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .glass-panel.main-frame {
        padding: 14px;
        border-radius: 16px;
        gap: 16px;
    }

    /* モード選択タブをスクロールではなく、2列のグリッドにして一目で見えるように */
    .mode-selector {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        background: rgba(0, 0, 0, 0.25);
        padding: 6px;
        border-radius: 16px;
        overflow-x: visible;
    }

    .mode-btn {
        padding: 8px 6px;
        font-size: 0.78rem;
        white-space: normal;
        text-align: center;
        justify-content: center;
        border-radius: 8px;
    }

    /* 5つ目の「問題に挑戦」ボタンを横いっぱいに広げる */
    .mode-btn:last-child {
        grid-column: span 2;
    }

    /* モバイル用にキャンバスコンテナ内の絶対配置レイアウトを解除し縦並び化 */
    .canvas-container {
        aspect-ratio: auto;
        display: flex;
        flex-direction: column;
        background: transparent;
        border: none;
        overflow: visible;
    }

    .canvas-view-wrapper {
        position: relative;
        width: 100%;
        aspect-ratio: 4 / 3;
    }
    
    #viz-canvas {
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.35);
        border: 1px solid var(--panel-border);
        border-radius: 18px;
        display: block;
    }

    /* キャンバス上に浮いていたオーバーレイを、通常パネル化してキャンバスの下へ */
    .canvas-control-overlay, 
    .canvas-toggle-overlay {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 12px;
        background: var(--card-bg) !important;
        border: 1px solid var(--card-border) !important;
        border-radius: 16px !important;
        box-shadow: none !important;
        padding: 12px 14px !important;
    }

    #shape-select-group {
        order: 2; /* canvasの直下 */
    }

    #hard-mode-balloon {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        margin-top: 12px !important;
        white-space: normal !important;
        order: 1; /* 最優先で表示 */
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }

    .mobile-br {
        display: block !important;
    }

    .canvas-toggle-overlay.top-right {
        order: 2;
        min-width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .canvas-toggle-overlay.top-right .control-row {
        width: auto;
        flex: 1;
        min-width: 110px;
        justify-content: flex-start;
        gap: 8px;
    }

    .canvas-control-overlay.bottom-center {
        order: 3;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .canvas-slider-wrapper {
        min-width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .slider-title-inline {
        text-align: center;
    }

    .action-wrapper {
        width: 100%;
    }

    .action-wrapper .action-btn {
        width: 100%;
    }

    .shape-selector {
        grid-template-columns: repeat(4, 1fr); /* 4つのボタンを横並びに */
        width: 100%;
    }

    .shape-btn {
        font-size: 0.75rem;
        padding: 8px 4px;
        text-align: center;
    }

    .result-display-panel {
        padding: 12px;
    }

    .result-summary-text {
        font-size: 1.1rem;
    }

    .formula-text {
        font-size: 1rem;
        padding: 6px 10px;
    }

    .explanation-panel {
        padding: 14px;
    }
}

/* トグルスイッチの基本スタイル */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .3s;
    border-radius: 22px;
}

.slider-round:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider-round {
    background-color: #f59e0b; /* 難問用のオレンジ */
}

input:checked + .slider-round:before {
    transform: translateX(22px);
}

/* ホームに戻るボタンを画面右上に配置 */
.sidebar-buttons {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 9999 !important;
}

.side-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(25, 27, 38, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 50% !important;
    color: var(--text-main) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.2s ease !important;
    text-decoration: none;
}

.side-btn:hover {
    background: var(--accent-gradient) !important;
    border-color: transparent !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4) !important;
}

.side-btn svg {
    width: 22px;
    height: 22px;
}

/* 視点リセットボタン */
.canvas-btn-overlay.bottom-right {
    position: absolute;
    bottom: 76px; /* スライダー（bottom: 15px）と被らないように上部に配置 */
    right: 18px;
    z-index: 10;
    width: 42px;
    height: 42px;
    background: rgba(10, 11, 16, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    padding: 0;
}

.canvas-btn-overlay.bottom-right:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    transform: scale(1.08) rotate(30deg);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

.canvas-btn-overlay.bottom-right:active {
    transform: scale(0.95);
}

.canvas-btn-overlay.bottom-right svg {
    width: 20px;
    height: 20px;
}

/* スマホ版（width: 600px以下）の時のボタンサイズ縮小 (80%) ＆ 描画エリア内右下への配置強制 */
@media (max-width: 600px) {
    /* 視点リセットボタンを描画エリアの右下隅に浮かす */
    .canvas-btn-overlay.bottom-right {
        position: absolute !important;
        bottom: 12px !important;
        right: 12px !important;
        top: auto !important;
        left: auto !important;
        width: 34px !important;
        height: 34px !important;
        z-index: 10 !important;
    }

    .canvas-btn-overlay.bottom-right svg {
        width: 18px !important;
        height: 18px !important;
    }

    /* 再生ボタンをリセットボタンの左隣に浮かす */
    #action-controls {
        position: absolute !important;
        bottom: 12px !important;
        right: 54px !important; /* リセットボタンの左隣 */
        top: auto !important;
        left: auto !important;
        z-index: 10 !important;
        display: block !important;
        width: auto !important;
    }
    
    #action-controls.hidden {
        display: none !important;
    }
    
    #btn-animate {
        width: 34px !important;
        height: 34px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    }
    
    #btn-animate svg {
        width: 18px !important;
        height: 18px !important;
    }
}


