:root{--bg: #f6f7f5;--surface: #ffffff;--text: #1c1f1d;--muted: #5d6660;--accent: #14532d;--accent-text: #ffffff;--border: #d5dad6;--danger: #b42318;--highlight: #fef3c7;font-family:system-ui,-apple-system,Hiragino Sans,Noto Sans JP,sans-serif;color:var(--text);background:var(--bg)}@media(prefers-color-scheme:dark){:root{--bg: #121412;--surface: #1d211e;--text: #e8ebe9;--muted: #9aa39d;--accent: #4ade80;--accent-text: #0b1a10;--border: #353b37;--danger: #f87171;--highlight: #3b3310}}*{box-sizing:border-box}body{margin:0;background:var(--bg)}.app{max-width:560px;margin:0 auto;padding:max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}h1{font-size:1.3rem}h2{font-size:.9rem;color:var(--muted);margin:0 0 8px}button{min-height:48px;padding:8px;font-size:1rem;border-radius:10px;border:1px solid var(--border);background:var(--surface);color:var(--text);touch-action:manipulation;word-break:keep-all}button:disabled{opacity:.4}button.primary{background:var(--accent);color:var(--accent-text);border-color:var(--accent);font-weight:600}button.highlight{background:var(--highlight)}select{min-height:44px;font-size:1rem;border-radius:8px;padding:0 8px}.panel,.scoreboard,.situation{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:12px;margin-bottom:12px}.scoreboard{overflow-x:auto}.scoreboard table{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums;font-size:.9rem}.scoreboard th,.scoreboard td{padding:4px;text-align:center;white-space:nowrap}.scoreboard tbody th{text-align:left}.scoreboard .total{font-weight:700}.situation{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:center}.inning{font-size:1.4rem;font-weight:700}.count{display:flex;gap:12px;font-size:1.2rem;font-variant-numeric:tabular-nums;justify-content:flex-end}.diamond{grid-column:1 / -1;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,36px);gap:4px}.base{border:1px dashed var(--border);border-radius:6px;font-size:.75rem;display:flex;align-items:center;justify-content:center;overflow:hidden}.base.on{background:var(--accent);color:var(--accent-text);border-style:solid}.base-2{grid-column:2;grid-row:1}.base-3{grid-column:1;grid-row:2}.base-1{grid-column:3;grid-row:2}.batter{grid-column:1 / -1;font-weight:600}.grid button{font-size:.95rem;padding:8px 4px}.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}@media(max-width:380px){.grid{grid-template-columns:repeat(3,1fr)}}.row{display:flex;gap:8px;align-items:center}.row button{flex:1}.runner-editor{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}.runner-row{display:flex;gap:8px;align-items:center}.runner-name{flex:1}.error{color:var(--danger);font-weight:600}.note{color:var(--muted);font-size:.85rem}.final{font-size:1.2rem;font-weight:700;text-align:center}button.wide{width:100%}button.danger{background:var(--danger);border-color:var(--danger);color:#fff;font-weight:600}button.danger-outline{color:var(--danger)}button.link{min-height:auto;border:none;background:none;padding:0 4px;color:var(--accent);text-decoration:underline;font-size:inherit}.game-header{display:grid;grid-template-columns:auto 1fr;gap:4px 8px;align-items:center;margin-bottom:12px}.game-header .back{min-height:40px}.game-title{display:flex;flex-direction:column;min-width:0}.game-title strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.save-status{grid-column:1 / -1;font-size:.8rem;color:var(--muted)}.save-status.saving{color:var(--text)}.save-alert{grid-column:1 / -1;display:flex;flex-direction:column;gap:6px;padding:12px;border:2px solid var(--danger);border-radius:10px;color:var(--danger);background:var(--surface)}.save-alert .note{color:var(--text)}.message{padding:8px 12px;border-radius:8px;background:var(--highlight)}.meta-form{display:flex;flex-direction:column;gap:10px}.meta-form label,.dialog label{display:flex;flex-direction:column;gap:4px;font-size:.85rem;color:var(--muted);flex:1;min-width:0}input{min-height:44px;font-size:1rem;padding:0 10px;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text);width:100%}input:disabled{opacity:.6}.game-list{margin:12px 0}.game-card{display:flex;flex-direction:column;gap:8px}.game-open{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;border:none;padding:0;background:none}.game-card-title{font-weight:700;font-size:1.05rem}.game-card-status{font-variant-numeric:tabular-nums;font-weight:600}.row.small button{min-height:40px;font-size:.9rem}.storage-notice p{margin:0 0 8px}.dialog-backdrop{position:fixed;inset:0;background:#00000080;display:flex;align-items:flex-end;justify-content:center;padding:16px;z-index:10}.dialog{background:var(--surface);color:var(--text);border-radius:14px;padding:16px;width:100%;max-width:480px;display:flex;flex-direction:column;gap:10px}.dialog h2{font-size:1.1rem;color:var(--text);margin:0}.dialog p{margin:0}.pending-item{display:flex;flex-direction:column;gap:6px;color:var(--text)}.app>.save-alert{margin-bottom:12px}select{max-width:100%}.toggle{display:flex;align-items:center;gap:8px;min-height:44px;font-size:.95rem}.toggle input{width:22px;height:22px;min-height:0}.segmented{display:flex;gap:4px;margin:8px 0}.segmented button{flex:1;min-height:44px;font-size:.9rem;padding:4px}.segmented button.selected{background:var(--accent);color:var(--accent-text);border-color:var(--accent);font-weight:600}button.icon{min-height:44px;min-width:44px;padding:0}.player-edit-list,.order-edit,.sub-history,.sub-pending ul{list-style:none;padding:0;margin:8px 0;display:flex;flex-direction:column;gap:6px}.player-edit-list li,.order-edit li,.sub-pending li{display:flex;gap:6px;align-items:center}.player-edit-list input{flex:1;min-width:0}.player-edit-list .number-input{flex:0 0 4.2em;text-align:center}.order-edit select{flex:1;min-width:0}.order-edit .position-select{flex:0 0 6.5em}.order-no{flex:0 0 1.6em;text-align:center;font-weight:700;font-variant-numeric:tabular-nums}.bulk{margin-top:8px}.bulk textarea{width:100%;font-size:1rem;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text);padding:8px;margin:6px 0}.issues ul{margin:4px 0 12px;padding-left:1.2em}.lineup-table{width:100%;border-collapse:collapse;font-size:.95rem}.lineup-table td{padding:6px 4px;border-bottom:1px solid var(--border)}.lineup-table .pos{width:2em;text-align:center;font-weight:600}.lineup-table tr.is-batter{background:var(--highlight)}.badge{display:inline-block;margin-left:6px;padding:0 6px;border-radius:6px;font-size:.75rem;border:1px solid var(--border);color:var(--muted)}.removed{text-decoration:none;opacity:.8}.quick-row{grid-column:1 / -1;display:flex;justify-content:space-between;align-items:center;gap:8px}.quick-buttons{display:flex;gap:6px}.quick-buttons button{min-height:40px;padding:4px 10px;font-size:.9rem}.dialog.sheet{max-height:calc(100dvh - 32px);overflow-y:auto;padding-bottom:calc(16px + env(safe-area-inset-bottom))}.sheet-header{display:flex;justify-content:space-between;align-items:center}.dialog h3{font-size:.95rem;margin:4px 0}.pick-list{display:flex;flex-direction:column;gap:6px}.pick-list button{text-align:left;padding:8px 12px}.position-grid{grid-template-columns:repeat(3,1fr)}.sub-menu{grid-template-columns:repeat(2,1fr)}.sub-pending{border-top:1px solid var(--border);padding-top:8px}.sub-pending li{justify-content:space-between}.sub-history li{border-bottom:1px solid var(--border);padding-bottom:6px}details>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:600}.dh-exception{border:1px solid var(--border);border-radius:10px;padding:8px 12px;margin:8px 0;display:flex;flex-direction:column;gap:6px}.dh-exception legend{font-weight:600;padding:0 4px}.dialog .toggle{flex-direction:row;color:var(--text);font-size:.95rem}
