/* ================= GLOBAL ================= */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}
:root {
    --mainWidth: 360px;
}
button {
    padding: 0;
    line-height: 1;
}

/* ================= TOP BAR ================= */
#topBar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    max-width: 360px; /* 🔒 LOCK WIDTH */
    margin: 0 auto; /* center it */
}

.appTitleBtn {
    font-size: 24px;
    font-weight: bold;
}

    .appTitleBtn.connected {
        color: #00c853;
    }

/* ================= GRIP ================= */
#gripHeaderWrap {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.gripLabel {
    font-size: 14px;
    color: #666;
}

.gripBar.horizontal {
    width: 100%;
    height: 10px;
    display: flex;
    gap: 3px;
}

    .gripBar.horizontal .led {
        flex: 1;
        border-radius: 5px;
    }

.led {
    background: #d0d7de;
}

    .led.active.low {
        background: #ffeb3b;
    }

    .led.active.mid {
        background: #ff9800;
    }

    .led.active.high {
        background: #f44336;
    }

/* ================= IQ ================= */
.iqBlock {
    text-align: center;
}

.iqValue {
    color: #00bfa5;
}

/* ================= SECTION ================= */
.sectionBlock,
.sessionBlock,
#coachBox {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px;
}

.sectionHeaderBox {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-align: center;
    padding: 4px;
    margin-bottom: 6px;
    background: #f0f2f5;
    border-radius: 6px;
}

/* ================= GRID SYSTEM ================= */
.selectRow {
    display: grid;
    width: 100%;
    gap: 8px;
}

/* SHOT + STYLE */
.shotRow,
.styleRow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* FOCUS — 🔥 LOCKED WIDTH */
.focusRow {
    grid-template-columns: repeat(3, 110px); /* 🔒 FIXED WIDTH */
    justify-content: space-between; /* 🔥 spreads across full width */
}

/* ================= BUTTON ================= */
.selectRow button {
    width: 100%;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* 🔥 vertical centering */

    gap: 4px; /* 🔥 consistent spacing */

    border-radius: 12px;
    border: none;
    background: #f0f2f5;
    color: #555;
    font-size: 10px;
    font-weight: 600;
    box-sizing: border-box;
}

    /* TEXT LOCK */
        .selectRow button span {
            width: 100%;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

.icon {
    font-size: 14px;
    line-height: 14px;
    height: 14px;
}

/* ICON */
.icon {
    font-size: 14px;
    line-height: 14px;
}

/* ACTIVE */
.selectRow button.active {
    background: linear-gradient(135deg, #4CAF50, #2ecc71);
    color: white;
}
/* ================= DRILL ================= */
#selectedDrill {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* ================= COACH ================= */
#coachBox {
    width: 100%;
    max-width: 340px;
    margin: 2px auto;
    text-align: center;
}

#coachTitle {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}

#coachText {
    font-size: 15px;
    color: #bbb;
}

/* ================= BUTTONS ================= */
#startDrillBtn {
    width: 100%;
    margin-top:5px;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #2196F3, #00bcd4);
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.secondaryBtn {
    width: 100%;
    margin-top: 2px;
    padding: 8px;
    border-radius: 10px;
    border: none;
    background: #eaeef2;
    color: #555;
}

/* ================= SESSION ================= */
#sessionView {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#sessionScore {
    font-size: 32px;
    text-align: center;
}

#sessionTitle {
    text-align: center;
    width: 100%;
}
#stopSessionBtn {
    display: block;
    margin: 15px auto; /* 🔥 centers horizontally */

    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: #e53935;
    color: white;
}
/* ===== SHARED COACH BOX ===== */
.coachBox {
    width: 100%;
    max-width: 340px;
    margin: 8px auto;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    text-align: center;
}

#sessionCoachTitle {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

#sessionCoachText {
    font-size: 15px;
    color: #bbb;
    min-height: 40px;
}

#topBar,
.sessionBlock,
.coachBox,
#sessionCoachBox,
#devPanel {
    width: 100%;
    max-width: var(--mainWidth);
    margin: 0 auto;
}
/* ================= DEV ================= */
#devPanel {
    padding: 8px;
    background: #f7f9fb;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.devGrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    font-size: 9px;
}

/* ================= CHARTS ================= */
.histRow,
.waveRow {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.histBox,
.waveBox {
    height: 160px;
}
