/* ============================================================================
   Smart Taala Tracker — the Avartana Dial
   The ring a thala is drawn as. One component, four jobs: a preview on the
   home chooser, the live cursor during practice, a session's score on the
   dashboard, and a 24px glyph in a list of past sessions.
   Behaviour and geometry: js/avartanaDial.js.
   ========================================================================= */

.dial-mount {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px;
}
.dial {
    display: block;
    width: 100%;
    /* A preview, not a poster: large enough to tell Adi from Khanda Jhampa,
       small enough to sit inside a 380px practice panel. */
    max-width: calc(180px * var(--scale));
    height: auto;
    overflow: visible;
}

/* ── The aksharas ─────────────────────────────────────────────────────────
   One stroked arc per akshara. Rounded caps so a 29-akshara cycle reads as
   beads rather than a dashed line. */
.dial-segment {
    fill: none;
    stroke: var(--line-strong);
    stroke-width: 9;
    /* Butt, not round: a round cap adds half the stroke width at each end,
       which at this radius is wider than the gap between aksharas and welds
       the ring back into one circle. Square ends keep the beads apart. */
    stroke-linecap: butt;
    transition: stroke var(--motion-fast), stroke-width var(--motion-fast);
}
.dial-segment.anga-start { stroke: var(--ink-3); }

/* The live akshara. The cursor is the one thing allowed to be loud. */
.dial-segment.on {
    stroke: var(--beat);
    stroke-width: 15;
}

/* A scored dial takes its colour from js/avartanaDial.js (scoreColour), which
   writes the stroke inline; these rules only set the weight and the hover. */
.dial-segment.scored { stroke-width: 11; }
.dial-segment.scored:hover { stroke-width: 15; }

/* The dot on the first akshara of each anga — the beat that is clapped, and
   the one the beat sound marks more strongly (js/beatSwara.js). */
.dial-mark { fill: var(--ink-3); }

/* ── The angas ────────────────────────────────────────────────────────────
   Drawn outside the ring, one arc each, so the SHAPE of the thala is visible
   before a note is played: Chatusra Triputa is 4 + 2 + 2, Khanda Jhampa is
   5 + 1 + 2, and they no longer look alike. */
.dial-anga {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    opacity: .85;
}
.dial-anga.anga-laghu { stroke: var(--accent); }
.dial-anga.anga-drutha { stroke: var(--violet); }
.dial-anga.anga-anudrutha { stroke: var(--beat); }
.dial-anga.anga-none { stroke: var(--line-strong); }

/* ── The middle ───────────────────────────────────────────────────────── */
.dial-centre-text {
    font-family: var(--font-display);
    font-size: var(--text-36);
    font-weight: 700;
    fill: var(--ink);
}
.dial-centre-count {
    font-family: var(--font);
    font-size: var(--text-13);
    fill: var(--ink-3);
}

/* ── The history glyph ────────────────────────────────────────────────────
   A whole session as one small shape. A column of these is readable at a
   glance in a way a column of percentages is not. */
.dial-glyph {
    width: calc(34px * var(--scale));
    max-width: none;
}
/* The strokes are in the 240-unit viewBox, so at 34px every one of them is
   drawn at about a seventh of its size. They have to be far heavier here or
   the glyph fades to a grey ring and tells you nothing. */
.dial-glyph .dial-segment { stroke-width: 28; }
.dial-glyph .dial-anga { stroke-width: 22; opacity: 1; }
.dial-glyph .dial-segment.anga-start { stroke: var(--ink-2); }

/* The caption under a preview dial. */
.dial-caption {
    font-size: var(--text-14);
    color: var(--ink-2);
    text-align: center;
}
.dial-caption strong { color: var(--ink); }

/* A legend small enough to live under the preview, naming the three angas in
   the same colours the arcs use. Colour is never the only carrier: the word
   is right there beside it. */
.dial-legend {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px;
    font-size: var(--text-13); color: var(--ink-2);
}
.dial-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dial-legend i {
    width: 14px; height: 3px; border-radius: 2px; background: var(--line-strong);
}
.dial-legend .laghu i { background: var(--accent); }
.dial-legend .drutha i { background: var(--violet); }
.dial-legend .anudrutha i { background: var(--beat); }
