html, body { height: 100%; margin: 0; overflow: hidden; background: #0f172a; font-family: sans-serif; }
.container { display: flex; flex-direction: column; height: 100vh; height: -webkit-fill-available; }
.screen { display: none; flex: 1; overflow: hidden; }
.screen.active { display: flex; flex-direction: column; }

header {
    background: #1e293b; padding: 10px 5px; border-bottom: 2px solid #334155;
    padding-top: calc(10px + env(safe-area-inset-top));
    display: flex; justify-content: space-between; align-items: center;
    min-height: 120px; /* 少し高さを確保 */
}

.team-info { width: 30%; display: flex; flex-direction: column; align-items: center; position: relative; padding-bottom: 10px; }
.team-label { font-size: 0.7rem; color: #94a3b8; }
.team-name { font-size: 0.9rem; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; text-align: center; color: #e2e8f0; }
.score-num { font-size: 2.5rem; font-weight: 900; color: #f8fafc; line-height: 1; }

.team-info.active .active-marker {
    position: absolute; bottom: 0; width: 80%; height: 4px;
    background: #38bdf8; box-shadow: 0 0 15px #38bdf8, 0 0 5px #38bdf8 inset; border-radius: 2px;
}
.team-info.active .team-name { color: #38bdf8; }

.center-info { width: 40%; display: flex; flex-direction: column; align-items: center; }
#diamond-display { display: flex; flex-direction: column; align-items: center; margin-bottom: 5px; }
.lower-bases { display: flex; gap: 20px; }
.base { color: #475569; font-size: 1.4rem; transition: color 0.2s; }
.base.active { color: #fbbf24; text-shadow: 0 0 10px #fbbf24, 0 0 5px #fbbf24 inset; }

.inning-info { display: flex; flex-direction: column; align-items: center; gap: 2px; }
#current-inning { font-size: 1.2rem; color: #e2e8f0; font-weight: bold; }

/* アウトランプのスタイル */
#out-lamps { display: flex; gap: 10px; }
.out-lamp {
    font-size: 1.5rem; color: #475569; /* 消灯時の色 */
    transition: all 0.2s;
}
.out-lamp.active {
    color: #ef4444; /* 点灯時の赤色 */
    text-shadow: 0 0 10px #ef4444, 0 0 5px #ef4444 inset; /* 光るエフェクト */
}

/* ログエリア（白背景で見やすく） */
.log-area { flex: 1; overflow-y: auto; padding: 15px; background: #f1f5f9; -webkit-overflow-scrolling: touch; }
.log-entry { 
    background: #ffffff; padding: 12px; border-radius: 8px; margin-bottom: 8px; 
    border-left: 6px solid #94a3b8; font-size: 0.95rem; color: #0f172a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
/* ログの色分け（左の線だけ変更） */
.log-hit { border-left-color: #22c55e; }
.log-out { border-left-color: #ef4444; }
.log-point { border-left-color: #fbbf24; background: #fffbeb; }

.controller {
    background: #ffffff; padding: 15px; 
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.1);
}
.input-row { display: flex; gap: 10px; margin-bottom: 15px; align-items: center; }

/* 打者名を大きく表示するスタイル */
.player-box { flex: 1; display: flex; align-items: center; background: #f1f5f9; padding: 5px; border-radius: 10px; border: 2px solid #e2e8f0; }
.big-name { 
    flex: 1; border: none; background: transparent; font-size: 1.3rem; font-weight: bold; 
    height: 45px; padding: 5px; color: #0f172a;
}

.btn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.action-btn { border: none; padding: 16px 0; border-radius: 10px; font-weight: bold; font-size: 0.85rem; color: white; transition: transform 0.1s; }
.action-btn:active { transform: scale(0.98); }

.hit { background: #22c55e; } 
.hr { background: #16a34a; box-shadow: 0 0 15px rgba(34,197,94,0.4); }
.bb { background: #3b82f6; } 
.out { background: #ef4444; }
.err { background: #f59e0b; } 
.spec { background: #8b5cf6; } 
.point { background: #fbbf24; color: #000; font-weight: 900; }
.copy { background: #06b6d4; } 
.reset { background: #64748b; }
.util-btn { background: #1e293b; color: white; border: none; padding: 12px 15px; border-radius: 8px; font-size: 0.9rem; font-weight: bold; }

/* 設定画面 */
#settings-screen { padding: 30px; color: white; overflow-y: auto; background: #0f172a; }
#settings-screen h2 { text-align: center; margin-bottom: 30px; color: #38bdf8; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; width: 100%; }
.form-group { width: 100%; margin-bottom: 20px; }
.form-group label { font-size: 0.9rem; color: #94a3b8; margin-bottom: 8px; display: block; font-weight: bold; }
input, select, textarea { width: 100%; padding: 12px; background: #1e293b; border: 1px solid #475569; color: white; border-radius: 8px; box-sizing: border-box; font-size: 1rem; }
textarea { resize: vertical; height: 150px; }
.primary-btn { width: 100%; padding: 18px; background: linear-gradient(135deg, #38bdf8, #2563eb); border: none; color: white; font-weight: bold; border-radius: 12px; font-size: 1.2rem; margin-top: 20px; box-shadow: 0 5px 15px rgba(37,99,235,0.4); }