/* Crypto — Main Zone.
 *
 * Chunky 3D "button" treatment on the card:
 *   - inner top highlight (simulated light hitting the top edge)
 *   - offset darker shadow below (makes the card look raised)
 *   - a dark base plate pseudo-element peeking out underneath
 *
 * All sizes are in container-query units (cqmin / cqw / cqh) so the
 * effect scales identically on any screen — 1080p panel, 4K TV, or a
 * small sidebar zone all produce the same proportions.
 *
 * All colors come from theme variables:
 *   var(--text)   card background (same inversion pattern stocks uses)
 *   var(--bg)     foreground text color
 *   var(--accent) market-cap label
 *   var(--font)   theme font
 * Derived shades (darker var(--text) for the 3D offset, darker var(--bg)
 * for the base plate) use `color-mix(in srgb, ...)` so they adapt.
 *
 * Up/down semantic colors (green / red) stay literal on the change pill
 * and candlestick bodies — they're universally understood direction cues.
 */

.ck-main {
    width: 100%;
    height: 100%;
    container-type: size;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font, 'Roboto'), sans-serif;
}

.ck-main-card {
    position: relative;
    width: 80cqw;
    height: 80cqh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 2cqmin;
    padding: 3.5cqmin 4.5cqmin;
    direction: ltr;

    background-color: var(--text);
    color: var(--bg);
    border-radius: 1cqmin;
    /* inner highlight + raised black shadow, all in container units */
    -webkit-box-shadow:
        inset 0 0.25cqmin 0 rgba(255, 255, 255, 0.22),
        0 1.5cqmin 0 #000;
    -moz-box-shadow:
        inset 0 0.25cqmin 0 rgba(255, 255, 255, 0.22),
        0 1.5cqmin 0 #000;
    box-shadow:
        inset 0 0.25cqmin 0 rgba(255, 255, 255, 0.22),
        0 1.5cqmin 0 #000;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Black base plate that peeks out beneath the card. */
.ck-main-card::after {
    content: "";
    position: absolute;
    bottom: -2.2cqmin;
    left: -0.6cqmin;
    width: 100%;
    height: 100%;
    padding: 0.6cqmin;
    z-index: -1;
    background-color: #000;
    border-radius: 1cqmin;
    box-sizing: content-box;
}

/* Header row — logo + name centered at the top of the card. */
.ck-main-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5cqmin;
    flex-shrink: 0;
    width: 100%;
}
.ck-main-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

/* Price row — three-column grid so the price is truly centered in the
 * card width regardless of the mcap badge / change pill widths. Mcap
 * badge docks to the inside edge of the left column (right-aligned),
 * change pill docks to the inside edge of the right column (left-aligned). */
.ck-main-price-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 3cqmin;
    flex-shrink: 0;
    width: 100%;
}
.ck-main-price-row > .ck-main-mcap   { justify-self: end; }
.ck-main-price-row > .ck-main-price  { justify-self: center; }
.ck-main-price-row > .ck-main-change { justify-self: start; }

.ck-main-logo {
    width: 10cqmin !important;
    height: 10cqmin !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}
.ck-main-name {
    font-size: 6.5cqmin !important;
    font-weight: 700 !important;
    line-height: 1.05 !important;
    letter-spacing: -0.01em !important;
    color: var(--bg) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Symbol badge inside the chart, bottom-left — mirrors the 7D range
 * label on the bottom-right. */
.ck-main-chart-symbol {
    position: absolute;
    bottom: 1cqmin;
    left: 1.5cqmin;
    font-size: 5cqmin !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text) !important;
    opacity: 0.75;
    pointer-events: none;
}

.ck-main-price {
    font-size: 14cqmin !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: -0.03em !important;
    direction: ltr;
    unicode-bidi: embed;
    color: var(--bg) !important;
    text-align: center;
}

/* Market-cap badge — themed pill sitting to the left of the price. */
.ck-main-mcap {
    padding: 0.8cqmin 2cqmin;
    border-radius: 10cqmin;
    background: color-mix(in srgb, var(--bg) 25%, transparent);
    color: var(--bg) !important;
    font-size: 5cqmin !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: -0.01em;
    direction: ltr;
    unicode-bidi: embed;
    white-space: nowrap;
}

/* Change pill — semantic green/red direction indicator. */
.ck-main-change {
    padding: 0.8cqmin 2cqmin;
    border-radius: 10cqmin;
    color: #fff !important;
    font-size: 5cqmin !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    direction: ltr;
    unicode-bidi: embed;
    white-space: nowrap;
}
.ck-main-change.is-up   { background: #22c55e; }
.ck-main-change.is-down { background: #ef4444; }

/* Chart area, framed by dashed rules above and below.
 * The dashes pick up the foreground color at low alpha so they adapt
 * to whatever theme is rolled. */
.ck-main-chart {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border-radius: 1.5cqmin;
    padding: 2cqmin 2.5cqmin;
    border: 0.8cqmin dashed color-mix(in srgb, var(--bg) 35%, transparent);
    box-sizing: border-box;
}
.ck-main-chart svg {
    width: 100%;
    height: 100%;
    display: block;
}
.ck-main-chart-label {
    position: absolute;
    bottom: 1cqmin;
    right: 1.5cqmin;
    font-size: 5cqmin !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text) !important;
    opacity: 0.75;
    pointer-events: none;
}
