* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

button, input, textarea, select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

body {
    font-family: 'Mochiy Pop One', 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background: #faa700;
    min-height: 100vh;
    padding: 40px; /* 左右を2倍に（20px → 40px） */
    padding-bottom: 150px; /* スクロール時の下余白 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

h1 {
    color: #2c3e50;
    text-align: center;
    padding: 10px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    font-size: 1.5rem;
}

.title-break {
    display: none;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.input-section {
    margin-bottom: 30px;
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.form-label {
    min-width: 120px;
    font-weight: bold;
    color: #333;
    font-size: 0.95rem;
}

.game-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

#gameInput {
    width: 130px;
    padding: 8px 10px; 
    font-size: 1.3rem; 
    border: 2px solid #ddd;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    font-family: 'Arial', sans-serif;
}

#gameInput:focus {
    outline: none;
    border-color: #667eea;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.key {
    padding: 15px;
    font-size: 1.3rem;
    font-weight: bold;
    background: #f5f5f5;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.02s;
    font-family: 'Arial', sans-serif;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.key:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.key:active {
    transform: scale(0.95);
}

.key.clear {
    background: #ff6b6b;
    color: white;
}

.key.clear:hover {
    background: #ff6b6b;
}

.key.backspace {
    background: #ffa500;
    color: white;
}

.key.backspace:hover {
    background: #ffa500;
}

.bonus-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    flex-wrap: wrap;
}

.bonus-btn {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Arial', sans-serif;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.bonus-btn:hover {
    transform: scale(1.05);
}

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

.bonus-btn.big {
    border-color: #e74c3c;
    color: #e74c3c;
    background: white;
}

.bonus-btn.big:hover {
    background: #ffe5e5;
}

.bonus-btn.reg {
    border-color: #3498db;
    color: #3498db;
    background: white;
}

.bonus-btn.reg:hover {
    background: #e3f2fd;
}

.bonus-btn.now {
    border-color: #27ae60;
    color: #27ae60;
    background: white;
}

.bonus-btn.now:hover {
    background: #e8f5e9;
}

.bonus-btn.last {
    border-color: #9b59b6;
    color: #9b59b6;
    background: white;
}

.bonus-btn.last:hover {
    background: #f3e5f5;
}

.bonus-btn.delete-one {
    border-color: #e67e22;
    color: #e67e22;
    background: white;
}

.bonus-btn.delete-one:hover {
    background: #fef5e7;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 15px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-camera {
    background: #3498db;
    color: white;
}

.btn-camera:hover {
    background: #2980b9;
}

.screenshot-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.screenshot-label {
    font-weight: bold;
    color: #333;
}

.screenshot-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
}

.screenshot-checkbox label {
    font-weight: bold;
    color: #333;
    cursor: pointer;
}

.screenshot-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.summary-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.summary-title {
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.section-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mode-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mode-selector-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    margin-bottom: 10px;
}

.mode-label {
    font-size: 0.95rem;
    font-weight: bold;
    color: #333;
}

.mode-toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: #ccc;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.mode-toggle-switch.active {
    background: #667eea;
}

.mode-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mode-toggle-switch.active .mode-toggle-slider {
    transform: translateX(30px);
}

.section-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.2s;
    white-space: nowrap;
}

.section-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.section-btn.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* 3項目を横に並べる */
.summary-grid {
    display: flex;
    justify-content: center; /* グリッド全体を中央に */
    gap: 10px; 
    margin-top: 15px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 累計データのラベルの文字サイズを修正 */
.summary-label {
    font-size: 0.8rem; 
    opacity: 0.9;
    margin-bottom: 5px;
    color: white;
    white-space: nowrap;
    text-align: center;
}

/* 累計データの値の文字サイズを修正 */
.summary-value {
    font-size: 1.2rem; 
    font-weight: bold;
    color: white;
    white-space: nowrap;
    text-align: center;
}

.summary-value.highlight {
    font-size: 1.2rem; 
    color: white;
}

/* 特定の表示を1行にするためのスタイル (不要になったが残す) */
.summary-value.no-break {
    white-space: nowrap;
}

.history {
    margin-top: 30px;
}

/* 履歴タイトルコンテナ */
.history-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

.history-title-text {
    font-size: 0.95rem;
    font-weight: bold;
    color: #333;
}


.history-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

/* スマホ対応 */
@media (max-width: 480px) {
    .container {
        padding: 15px; /* スマホでは余白を縮小 */
    }
    
    body {
        padding: 20px; /* 左右を2倍に（10px → 20px） */
        padding-bottom: 150px; /* スクロール時の下余白 */
    }
    
    .history-title-text {
        font-size: 0.95rem;
    }
    
    .history-title {
        font-size: 1.3rem;
    }
}

/* 超小型スマホ対応（iPhone SE, 13 miniなど） */
@media (max-width: 375px) {
    .container {
        padding: 10px; /* 小型スマホではさらに余白を縮小 */
    }
    
    body {
        padding: 16px; /* 左右を2倍に（8px → 16px） */
        padding-bottom: 150px; /* スクロール時の下余白 */
    }
    
    .history-title-text {
        font-size: 0.95rem;
    }
    
    .history-title {
        font-size: 1.3rem;
    }
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.history-table th {
    background: #f8f9fa;
    padding: 6px 8px;
    text-align: center;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #ddd;
    font-size: 0.9rem;
}

.history-table td {
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

/* 累計G列（4列目）はデフォルトで中央揃え */
.history-table th:nth-child(4),
.history-table td:nth-child(4) {
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    padding-left: 0px;
    padding-right: 8px;
}

/* 種別列（3列目）の右側paddingを調整 */
.history-table th:nth-child(3),
.history-table td:nth-child(3) {
    padding-right: 0px;
}


/* ゲーム数表示のスタイル - 3パーツ構成 */
.games-left {
    display: inline-block;
    text-align: right;
    min-width: 50px;
    white-space: nowrap;
}

.games-arrow {
    display: inline-block;
    text-align: right;
    min-width: 20px;
    white-space: nowrap;
}

.games-right {
    display: inline-block;
    text-align: right;
    min-width: 55px;
    white-space: nowrap;
}


.history-table tr:hover {
    background: #f8f9fa;
}

.history-table tr.now-row {
    background: #f5f5f5;
}

.history-table tr.now-row:hover {
    background: #eeeeee;
}

.history-table tr.section-break {
    background: #fff9c4;
    border-top: 3px solid #ffd700;
    border-bottom: 3px solid #ffd700;
    cursor: move;
    cursor: grab;
    user-select: none;
}

.history-table tr.section-break.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.history-table tr.section-break td {
    padding: 4px 8px;
    font-weight: bold;
    color: #f57c00;
    font-size: 0.85rem;
}

.history-table tr.section-break:hover {
    background: #fff59d;
}

.history-table tr.drag-over {

/* ドラッグ中の通常行のスタイル */
.history-table tr.dragging {
    opacity: 0.5;
    cursor: grabbing;
}
    border-top: 3px solid #667eea;
}

.bonus-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    font-family: 'Arial', sans-serif;
}

.bonus-badge.big {
    background: #e74c3c;
    color: white;
}

.bonus-badge.reg {
    background: #3498db;
    color: white;
}

.bonus-badge.now {
    background: #27ae60;
    color: white;
}

.bonus-badge.last {
    background: #9b59b6;
    color: white;
}

.payout-value {
    font-weight: bold;
}

.payout-value.positive {
    color: #27ae60;
}

.payout-value.negative {
    color: #e74c3c;
}

.kikai-wari {
    font-weight: bold;
    font-size: 1.1rem;
}

.kikai-wari.positive {
    color: #27ae60;
}

.kikai-wari.negative {
    color: #e74c3c;
}

.delete-btn {
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.delete-btn:hover {
    background: #c0392b;
}

.memo-section {
    margin-top: 30px;
    display: none;
}

.memo-title {
    font-size: 0.95rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

.memo-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    font-size: 1rem;
    font-family: 'Mochiy Pop One', 'Helvetica Neue', Arial, sans-serif;
    border: 2px solid #ddd;
    border-radius: 10px;
    resize: vertical;
    box-sizing: border-box;
}

.memo-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.screenshot-section {
    margin-top: 20px;
    display: none;
}

.screenshot-section .btn-camera {
    width: 100%;
    display: block;
    margin-bottom: 15px;
}

/* トグルスイッチ */

/* ゲーム数入力行のレイアウト調整 */
.game-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.game-input-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.2rem;
    }

    .title-break {
        display: block;
    }

    .container {
        padding: 15px;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .game-input-row {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }


    /* スマホではフル機能を先に表示 */
    .game-input-left {
        order: 2;
    }

    .toggle-container {
        justify-content: flex-end;
        order: 1;
        width: auto;
        align-self: flex-end;
    }
    }

    .bonus-buttons {
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
    }

    .bonus-btn {
        padding: 10px 5px;
        font-size: 0.75rem;
    }

    /* モバイル用 */
    .summary-grid {
        display: flex;
        justify-content: center;
    }

    .summary-value {
        font-size: 1.2rem;
        text-align: center;
    }

    .summary-label {
        font-size: 0.8rem;
        text-align: center;
    }

    .summary-header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .section-selector {
        justify-content: center;
    }

    .section-btn {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .memo-textarea {
        font-size: 0.9rem;
        padding: 10px;
        min-height: 80px;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    /* 【再修正箇所】1行に収めるための調整 */
    .screenshot-options {
        flex-wrap: nowrap; /* 改行を禁止 */
        gap: 5px; /* 要素間の隙間をさらに詰める */
        padding: 0 5px;
        justify-content: space-between; /* 均等に配置 */
        overflow-x: auto; /* 収まらない場合は横スクロール */
        align-items: center;
        font-size: 0.8rem; /* 全体のフォントを小さく */
        min-height: 40px; /* タッチしやすい高さを確保 */
    }

    .screenshot-label {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.8rem; /* ラベルのフォントサイズを小さく */
    }
    
    .screenshot-checkbox {
        flex-shrink: 0;
        margin: 0 3px; /* チェックボックス間のマージンを詰める */
    }

    /* チェックボックスのラベルをさらに小さく */
    .screenshot-checkbox label {
        writing-mode: horizontal-tb;
        white-space: nowrap;
        font-size: 0.75rem; /* ラベルのフォントサイズをさらに小さく */
    }
    /* /【再修正箇所】 */
    
    /* テーブルヘッダーの縦書きを強制的に横書きに戻す */
    .history-table th {
        writing-mode: horizontal-tb; 
        white-space: nowrap; 
        transform: none; 
    }

    .history-table {
        font-size: 0.7rem;
    }

    .history-table th,
    .history-table td {
        padding: 3px 2px;
        width: auto !important;
        min-width: 0 !important;
        white-space: nowrap;
    }

    .history-table th:first-child,
    .history-table td:first-child {
        width: 50px !important;
    }

    .history-table .payout-value,
    .history-table .kikai-wari {
        font-size: 0.65rem;
    }

    .bonus-badge {
        padding: 2px 6px;
        font-size: 0.65rem;
    }

    .delete-btn {
        padding: 4px 6px;
        font-size: 0.7rem;
    }

    /* キーのタップ反応を改善 */
    .key:hover {
        background: #f5f5f5;
        transform: none;
    }
}

/* ========== 総回転数計算モード用CSS（calc-プレフィックス付き） ========== */
#calcMode {
    display: none;
}

.calc-input-display {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.calc-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.calc-input-row:last-child {
    margin-bottom: 0;
}

.calc-input-label {
    font-weight: bold;
    color: #333;
    font-size: 1rem;
}

.calc-input-value {
    display: flex;
    align-items: center;
    gap: 5px;
}

.calc-input-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    min-width: 60px;
    text-align: right;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.calc-input-unit {
    font-size: 1rem;
    color: #666;
    font-weight: bold;
}

.calc-result-divider {
    width: 100%;
    height: 1px;
    background: #ddd;
    margin: 15px 0;
}

.calc-result {
    color: #5dade2 !important;
}

.calc-keypad-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.calc-display {
    text-align: center;
    margin-bottom: 15px;
}

.calc-display-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.calc-display-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    padding: 8px 15px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.calc-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.calc-key {
    padding: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    background: #f5f5f5;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.02s;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.calc-key:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.calc-key:active {
    transform: scale(0.95);
}

.calc-key.clear {
    background: #ff6b6b;
    color: white;
}

.calc-key.clear:hover {
    background: #ff6b6b;
}

.calc-key.backspace {
    background: #ffa500;
    color: white;
}

.calc-key.backspace:hover {
    background: #ffa500;
}

.calc-bonus-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.calc-bonus-btn {
    padding: 12px 8px;
    font-size: 1rem;
    font-weight: bold;
    border: 3px solid;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.calc-bonus-btn:hover {
    transform: scale(1.05);
}

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

.calc-bonus-btn.big {
    border-color: #e74c3c;
    color: #e74c3c;
}

.calc-bonus-btn.big:hover {
    background: #ffe5e5;
}

.calc-bonus-btn.reg {
    border-color: #3498db;
    color: #3498db;
}

.calc-bonus-btn.reg:hover {
    background: #e3f2fd;
}

.calc-bonus-btn.normal {
    border-color: #9b59b6;
    color: #9b59b6;
}

.calc-bonus-btn.normal:hover {
    background: #f3e5f5;
}

.calc-bonus-btn.start {
    border-color: #27ae60;
    color: #27ae60;
}

.calc-bonus-btn.start:hover {
    background: #e8f5e9;
}

.calc-action-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.calc-action-btn.calculate {
    background: #5dade2;
    color: white;
}

.calc-action-btn.calculate:hover {
    background: #3498db;
    transform: scale(1.02);
}

.calc-action-btn.reset {
    background: #e74c3c;
    color: white;
}

.calc-action-btn.reset:hover {
    background: #c0392b;
    transform: scale(1.02);
}

.calc-result-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.calc-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.calc-result-item {
    background: rgba(255,255,255,0.15);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.calc-result-label {
    font-size: 0.9rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.calc-result-value {
    font-size: 2rem;
    font-weight: bold;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* ========================================
   PWAモード（ホーム画面に追加）専用スタイル
   ======================================== */
@media (display-mode: standalone) {
    .history-title {
        font-size: 1.3rem !important;
    }
}

/* PWAモード + スマホ */
@media (display-mode: standalone) and (max-width: 480px) {
    .container {
        padding: 15px !important;
    }
    
    body {
        padding: 20px !important; /* 左右を2倍に（10px → 20px） */
        padding-bottom: 150px !important; /* スクロール時の下余白 */
    }
    
    .history-title {
        font-size: 1.3rem !important;
    }
}

/* PWAモード + 小型スマホ */
@media (display-mode: standalone) and (max-width: 375px) {
    .container {
        padding: 10px !important;
    }
    
    body {
        padding: 16px !important; /* 左右を2倍に（8px → 16px） */
        padding-bottom: 150px !important; /* スクロール時の下余白 */
    }
    
    .history-title {
        font-size: 1.3rem !important;
    }
}

/* フル機能トグルスイッチ */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.toggle-label {
    font-size: 0.95rem;
    font-weight: bold;
    color: #333;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: #ccc;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.toggle-switch.active {
    background: #667eea;
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(30px);
}
