/* dronedash-live.css — per-tile layout (video pane with lap strip directly
   underneath, in a single grid), plus a marquee ticker pinned to the bottom. */

.dd-screen {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    gap: 8px;
    padding: 8px;
}

.dd-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 2), 1fr);
    grid-template-rows: repeat(var(--rows, 2), 1fr);
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
}

.dd-tile {
    display: flex;
    flex-direction: column;
    background: transparent;
    overflow: hidden;
    border-radius: 6px;
    min-height: 0;
}

.dd-video {
    flex: 1 1 auto;
    background: var(--dd-panel);
    border: 1px dashed var(--dd-line);
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.dd-video-placeholder {
    color: var(--dd-muted);
    font: 600 0.85rem/1 'Oswald', sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Strip lives at the bottom of its tile, fused to the video above it. */
.dd-strip {
    background: var(--dd-bg);
    border: 1px solid var(--dd-line);
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 8px 12px 10px 12px;
    color: var(--dd-txt);
    font-family: 'Oswald', 'Segoe UI', sans-serif;
    flex: 0 0 auto;
}

.dd-strip-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.dd-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background-size: cover; background-position: center;
    background-color: var(--dd-panel2);
    border: 2px solid var(--dd-line);
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.95rem; color: var(--dd-muted);
}

.dd-channel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 24px;
    padding: 0 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    flex-shrink: 0;
}

.dd-pilot-name {
    font-weight: 600;
    font-size: 1.05rem;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dd-position {
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
    min-width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.dd-strip-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.dd-stat { display: flex; flex-direction: column; align-items: flex-start; }

.dd-stat-label {
    font-size: 0.65rem;
    color: var(--dd-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    line-height: 1;
    margin-bottom: 2px;
}

.dd-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--dd-txt);
    font-variant-numeric: tabular-nums;
}

.dd-stat-suffix { font-size: 0.85rem; color: var(--dd-muted); font-weight: 500; }

/* Highlight the strip that just got a fresh lap. */
.dd-strip.dd-flash {
    box-shadow: inset 0 0 0 2px var(--accent), 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
    transition: box-shadow 0.15s ease-in;
}

/* Compact for crowded grids. */
.dd-screen[style*="--cols:4"] .dd-stat-value { font-size: 1.2rem; }
.dd-screen[style*="--cols:4"] .dd-pilot-name { font-size: 0.95rem; }

/* Time-trial strips carry a 4th stat (Best X consec + PB), so widen the grid
   and shrink the values to fit the (wider) consecutive-lap sums. */
.dd-screen[data-is-tt="true"] .dd-strip-bottom { grid-template-columns: repeat(4, 1fr); }
.dd-screen[data-is-tt="true"] .dd-stat-value { font-size: 1.15rem; }
.dd-screen[data-is-tt="true"][style*="--cols:4"] .dd-stat-value { font-size: 0.95rem; }
.dd-stat-value[data-consec] { color: var(--dd-consec); }   /* best-consec in the accent green */
.dd-stat-value[data-pb] { color: var(--dd-pb); }       /* PB in purple (matches dashboard PB) */

/* Marquee ticker pinned at the bottom of the screen. */
.dd-ticker {
    position: relative;
    height: 56px;
    background: var(--dd-panel);
    border-top: 1px solid var(--dd-line);
    border-radius: 4px;
    overflow: hidden;
    flex: 0 0 auto;
}
.dd-ticker-chip {
    position: absolute;
    top: 50%;
    transform: translate(0, -50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: var(--dd-chip-bg);
    border-radius: 4px;
    color: var(--dd-txt);
    font-family: 'Oswald','Segoe UI',sans-serif;
    white-space: nowrap;
    font-size: 1.05rem;
    will-change: transform;
}
.dd-ticker-chip .dd-channel { min-width: 32px; height: 22px; font-size: 0.8rem; padding: 0 7px; }
.dd-ticker-chip .ticker-name { font-weight: 600; }
.dd-ticker-chip .ticker-lap  { font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums; }
.dd-ticker-chip .ticker-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.dd-ticker-chip .ticker-dot  { color: var(--dd-muted); padding: 0 4px; }
