:root { --bg: #0f172a; --panel: #1e293b; --text: #e2e8f0; --accent: #00e676; --neg: #ef4444; --sub: #38bdf8; --border: #334155; --highlight: #facc15; }
body { font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 10px; padding-bottom: 60px; font-size: 15px; }
.container { max-width: 1300px; margin: auto; display: grid; grid-template-columns: 1fr 480px; gap: 10px; }
@media (max-width: 1000px) { .container { grid-template-columns: 1fr; } }

h2 { grid-column: 1 / -1; text-align: center; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 15px; position: relative; display: flex; justify-content: center; align-items: center; gap: 12px; }
.title-logo { width: 36px; height: 36px; border-radius: 8px; box-shadow: 0 0 15px rgba(0, 230, 118, 0.2); }

.header-btns { position: absolute; right: 0; top: 5px; display: flex; gap: 8px; flex-direction: row; }
.manual-btn { background: rgba(59, 130, 246, 0.1); border: 1px solid var(--sub); color: var(--sub); padding: 5px 10px; font-size: 0.9em; cursor: pointer; border-radius: 4px; font-weight:bold; transition: 0.2s; }
.manual-btn:hover { background: var(--sub); color: #fff; }

.panel { background: var(--panel); padding: 15px; border-radius: 6px; border: 1px solid var(--border); box-shadow: 0 4px 20px rgba(0,0,0,0.3); min-width: 0; }
.row { display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-end; }
.col { flex: 1; }

label { display: block; font-size: 0.95em; color: #94a3b8; margin-bottom: 4px; font-weight: bold; }
input[type="number"], select { width: 100%; background: #0f172a; border: 1px solid #334155; color: #f8fafc; padding: 6px; font-family: monospace; font-size: 1.25em; border-radius: 4px; box-sizing: border-box; }
.readonly-val { color: #fff; font-weight: bold; font-family: monospace; font-size: 1.3em; text-align: right; display: block; padding: 6px; background: #0f172a; border-radius: 4px; border: 1px solid #334155; }

.comp-box { border: 1px solid #334155; padding: 10px; background: rgba(15, 23, 42, 0.5); margin-top: 10px; border-radius: 6px; position: relative; }
.comp-tag { position: absolute; top: -10px; left: 10px; background: var(--panel); padding: 0 5px; color: var(--accent); font-size: 0.85em; font-weight: bold; border: 1px solid #334155; }

.btn-run { width: 100%; background: linear-gradient(135deg, var(--accent), #059669); color: #fff; border: none; padding: 12px; font-weight: bold; font-size: 1.3em; cursor: pointer; border-radius: 6px; margin-top: 15px; transition: 0.2s; }
.btn-run:hover { transform: translateY(-1px); box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4); }

#calc-audit { margin-top: 15px; background: #020617; padding: 15px; border-radius: 6px; border: 1px solid #334155; font-family: 'Courier New', monospace; font-size: 0.9em; color: #cbd5e1; display: none; line-height: 1.5; }
.calc-step { display: block; margin-bottom: 8px; border-bottom: 1px dashed #334155; padding-bottom: 4px; }
.calc-title { color: var(--sub); font-weight: bold; display: block; margin-top: 12px; margin-bottom: 5px; border-bottom: 2px solid var(--sub); font-size: 1.0em; }
.highlight { color: var(--accent); font-weight: bold; }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #334155; margin-bottom: 15px; border: 1px solid #334155; border-radius: 4px; overflow: hidden; }
.res-cell { background: #1e293b; padding: 10px; text-align: center; }
.res-lbl { font-size: 0.8em; color: #94a3b8; display: block; margin-bottom: 3px; }
.res-val { font-size: 1.4em; font-weight: bold; color: #fff; }
.total-box { grid-column: 1 / -1; background: #0f172a; padding: 15px; }
.total-val { font-size: 4.0em; color: var(--accent); font-weight: 800; line-height: 1.0; }
.total-sub { font-size: 0.9em; color: #94a3b8; font-weight: normal; margin-top: 8px; display: block; } 

.chart-wrapper { width: 100%; height: 120px; background: #0f172a; border: 1px solid #334155; margin-top: 15px; position: relative; overflow: hidden; }

.tuning-section { margin-bottom: 15px; border: 1px solid #334155; border-radius: 6px; overflow: hidden; }
.tuning-header { background: #1e293b; padding: 8px; font-weight: bold; color: var(--accent); text-align: center; border-bottom: 1px solid #334155; font-size: 1.1em; }

table.tuning-table { width: 100%; border-collapse: collapse; font-size: 0.9em; text-align: center; }
table.tuning-table th { background: #334155; color: #fff; padding: 6px; }
table.tuning-table td { background: #0f172a; color: #cbd5e1; padding: 6px; border-bottom: 1px solid #334155; }
table.tuning-table tr.current-row td { color: #fff; font-weight: bold; border-top: 2px solid var(--sub); border-bottom: 2px solid var(--sub); background: rgba(56, 189, 248, 0.15); }
.dist-up { color: var(--highlight); font-weight: bold; text-shadow: 0 0 5px rgba(250, 204, 21, 0.3); }
.sub-header { padding: 6px 8px; background: #020617; border-bottom: 1px solid #334155; font-weight: bold; color: #cbd5e1; font-size: 0.9em; border-top: 1px solid #334155; }
.disclaimer { font-size: 0.8em; color: #64748b; margin-top: 8px; line-height: 1.5; padding: 0 5px; margin-bottom: 10px; }

.gauge-container { position: relative; width: 100%; height: 500px; background: #0f172a; overflow: hidden; display: flex; justify-content: center; align-items: center; padding-bottom: 20px; }
.gauge-circle { width: 228px; height: 228px; border-radius: 50%; position: absolute; top: 136px; left: calc(50% - 114px); z-index: 0; border: 1px solid #334155; background: radial-gradient(circle, #1e3a8a 0%, #0f172a 100%); }
.guide-line { position: absolute; top: 250px; left: 50%; width: 0; height: 114px; transform-origin: top center; z-index: 2; transition: 0.3s ease-out; }

.swing-pivot-shoulder { position: absolute; top: 250px; left: 50%; width: 0; height: 0; z-index: 20; }
.swing-arm { position: absolute; top: 0; left: -2px; width: 5px; height: 42px; background: #000; border-radius: 2px; transform-origin: top center; }
.swing-pivot-hand { position: absolute; top: 42px; left: 0; width: 0; height: 0; }
.swing-club { position: absolute; top: 0; left: -1px; width: 3px; height: 66px; background: #facc15; border-radius: 1px; transform-origin: top center; }
.swing-head { position: absolute; bottom: -4px; left: -5px; width: 13px; height: 16px; background: #ccc; border-radius: 3px 3px 8px 3px; }

.ball-pivot { position: absolute; top: 250px; left: 50%; width: 0; height: 0; transform: rotate(-15deg); z-index: 15; }
.golf-ball { position: absolute; top: 108px; left: -4px; width: 8px; height: 8px; background: #fff; border-radius: 50%; box-shadow: 0 0 4px #fff; }

.clock-num { position: absolute; color: #94a3b8; font-size: 1.1em; font-weight: bold; z-index: 4; text-shadow: 0 1px 3px #000;}
.num-12 { top: 140px; left: 50%; transform: translateX(-50%); }
.num-9 { top: 250px; left: calc(50% - 105px); transform: translateY(-50%); }
.num-3 { top: 250px; right: calc(50% - 105px); transform: translateY(-50%); }
.num-6 { top: 345px; left: 50%; transform: translateX(-50%); }

.time-label { position: absolute; font-size: 0.85em; font-weight: bold; color: #fff; z-index: 10; line-height: 1.4; text-shadow: 0 0 3px #000; transition: 0.3s ease-out; }

.playback-info { position: absolute; top: 10px; left: 10px; z-index: 40; text-align: left; }
#slowRate { color: #facc15; font-weight: bold; font-size: 1.0em; margin-bottom: 5px; }
#animTimer { color: #fff; font-weight: 800; font-size: 3.5em; text-shadow: 0 2px 10px rgba(0,0,0,0.5); line-height: 1.0; font-family: monospace; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 1000; display: none; justify-content: center; align-items: center; }
.modal-content { background: #1e293b; width: 90%; max-width: 900px; max-height: 90vh; overflow-y: auto; padding: 30px; border: 1px solid #334155; border-radius: 8px; font-size: 1.1em; }
.close-modal { float: right; font-size: 2em; cursor: pointer; color: #fff; }
.math-block { background: #0f172a; padding: 15px; margin: 15px 0; border-left: 4px solid var(--sub); overflow-x: auto; color: #e2e8f0; font-family: monospace; font-size: 0.9em; }
.footer { position: fixed; bottom: 0; left: 0; width: 100%; background: #020617; border-top: 1px solid #334155; padding: 5px; text-align: center; color: #64748b; font-size: 0.8em; z-index: 999; }