/* The apps that log what was climbed - the tick list, the gym session and trad.
   common/log.js runs the session and puts idle, running or saving on
   body[data-state]; what is on screen follows from that here. */
[data-state="idle"] #sessionHolder {
    display: none;
}
[data-state="running"] #primaryButton,
[data-state="saving"] #primaryButton,
[data-state="saving"] #finishButton {
    display: none;
}
[data-state="running"] #discard,
[data-state="saving"] #discard {
    display: inline-block;
}
#finishButton {
    margin-bottom: 40px;
}
/* the note can be written as you go; the stars and save wait for FINISH */
[data-state="running"] #endingDiv {
    display: block;
    margin-bottom: 0;
}
[data-state="running"] #endingDiv :is(.save-title, .star-holder, #saveSession) {
    display: none;
}

/* The top of a session: its date, the count and the hardest */
#sessionBar {
    display: block;
    width: 100%;
    margin: 16px auto 12px;
    padding: 12px;
    background: var(--panel);
    color: var(--strong);
    border-radius: 5px;
}
#sessionBar label {
    font-size: 14px;
    margin-right: 8px;
}
#sessionBar h3 {
    font-size: 44px;
    margin: 10px 0 0;
}
#sessionBar .of {
    font-size: 20px;
    opacity: 0.6;
}
#summary {
    margin: 4px 0 0;
    font-size: 16px;
    opacity: 0.8;
}

/* ================= The ladder =================
   The gym session's and trad's grades, two columns so a normal day fits on one
   screen. Each cell is a tile to add a climb and a minus to take one back: two
   buttons, since a button can't hold another. HARDER takes the next cell. */
#grades {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.grade-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin: 0;
}
.grade-add {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 56px;
    margin: 0;
    padding: 6px 42px 6px 9px;
    border-left: 8px solid transparent;
    border-radius: 8px;
    font-family: 'Hind', sans-serif;
    font-size: 15px;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
}
.grade-row .route-grade {
    font-size: 20px;
    line-height: 1.1;
}
/* band colour, faint until climbed; blue if the ladder has no bands */
.grade-add {
    border-left-color: color-mix(in srgb, var(--c, transparent) 30%, transparent);
}
.grade-row.done .grade-add {
    border-left-color: var(--c, var(--primary));
}
.grade-count {
    position: absolute;
    top: 50%;
    right: 9px;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
}
.grade-minus {
    flex: 0 0 auto;
    width: 42px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
}
.grade-harder {
    min-height: 56px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 15px;
}
@media (max-width: 380px) {
    #grades {
        gap: 6px;
    }
    .grade-add {
        font-size: 14px;
        padding: 6px 32px 6px 7px;
        border-left-width: 6px;
    }
    .grade-row .route-grade {
        font-size: 18px;
    }
    .route-colour {
        font-size: 11px;
    }
    .grade-minus {
        width: 36px;
        font-size: 20px;
    }
    .grade-count {
        right: 7px;
        font-size: 20px;
    }
    .grade-harder {
        font-size: 14px;
        padding: 6px 4px;
    }
}
