/* ================= GLOBAL ================= */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}

:root {
    --mainWidth: 360px;
    --orange: #f15822;
    --blue: #6fccdd;
}

button {
    padding: 0;
    line-height: 1;
}

#selectedDrill {
    color: var(--orange);
}

/* ================= 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;
    color: var(--orange); /* 🔥 */
}

.connected {
    color: var(--orange);
}

/* ================= 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: var(--blue);
    color: #000;
}
/* ================= 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: var(--blue);
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.secondaryBtn {
    width: 100%;
    margin-top: 2px;
    padding: 8px;
    border-radius: 10px;
    border: none;
    background: #eaeef2;
    background: rgba(111,204,221,0.15);
    color: var(--blue);
}

/* ================= 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: 390%;
    max-width: var(--mainWidth);
    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;
    color: var(--orange);
}

#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;
}

/* ================= FULL-WIDTH DIAGNOSTICS ================= */

/* stack rows vertically */
.histRow,
.waveRow {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* each chart box = full width, fixed height */
.histBox,
.waveBox {
    width: 100%;
    height: 180px; /* adjust if needed */
}

    /* force canvas to fill box (Chart.js fix) */
    .histBox canvas,
    .waveBox canvas {
        width: 100% !important;
        height: 100% !important;
        display: block;
    }



/* ===== new ===== */
/* ===== SLIDER CONTAINER (BOX) ===== */
.sliderBlock {
    width: 100%;
    max-width: var(--mainWidth);
    margin: 8px auto;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
}

/* ===== SLIDER CORE ===== */
#rangeSlider {
    position: relative;
    width: 100%;
    height: 30px; /* 🔥 prevents overlap/collapse */
}

/* ===== BASE TRACK ===== */
.sliderTrack {
    position: absolute;
    height: 6px;
    width: 100%;
    background: #ddd;
    border-radius: 4px;
    top: 50%;
    transform: translateY(-50%);
}

    /* ===== ACTIVE (BLUE) RANGE ===== */
    .sliderTrack::after {
        content: "";
        position: absolute;
        height: 100%;
        background: var(--blue);
        border-radius: 4px;
        left: var(--min, 20%);
        width: calc(var(--max, 80%) - var(--min, 20%));
    }

/* ===== RANGE INPUTS ===== */
#rangeSlider input[type="range"] {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    appearance: none;
    background: none;
}

/* ===== THUMBS (CHROME / SAFARI) ===== */
#rangeSlider input::-webkit-slider-thumb {
    pointer-events: all;
    appearance: none;
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: var(--blue);
    cursor: pointer;
    border: none;
}

/* ===== THUMBS (FIREFOX) ===== */
#rangeSlider input::-moz-range-thumb {
    pointer-events: all;
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: var(--blue);
    cursor: pointer;
    border: none;
}

/* ===== REMOVE DEFAULT TRACK (FIREFOX) ===== */
#rangeSlider input::-moz-range-track {
    background: transparent;
}

#devPanel {
    cursor: pointer;
}

#rawView {
    width: 100%;
    max-width: var(--mainWidth);
    margin: 0 auto;
}

.histGrid
    .histBox {
        width: 100%;
        height: 140px;
    }

    .histBox canvas {
        width: 100% !important;
        height: 100% !important;
    }

#backToSessionBtn {
    position: sticky;
    bottom: 0;
    display: block;
    margin: 10px auto;
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: rgba(111,204,221,0.15);
    color: var(--blue);
}