/* Modern bottom dock */

.ethiomark-bottom-navbar {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 4px 4px 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    z-index: 100;
    background: color-mix(in srgb, var(--bg-secondary, #1e293b) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid color-mix(in srgb, var(--border-color, #334155) 80%, transparent);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);
    color: var(--text-primary);
}

html[data-theme="light"] .ethiomark-bottom-navbar {
    background: color-mix(in srgb, #ffffff 94%, transparent);
    border-top-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.08);
}

.ethiomark-bottom-navbar.has-profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.ethiomark-bottom-navbar.has-profile .nav-action-btn.profile {
    justify-self: start;
}

.ethiomark-bottom-navbar.has-profile .nav-action-btn.start {
    justify-self: center;
}

.ethiomark-bottom-navbar.has-profile .nav-action-btn.prize {
    justify-self: end;
}

.nav-action-btn {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    cursor: pointer;
    margin: 0;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-primary);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-action-btn:active {
    transform: scale(0.97);
}

/* Shared side tiles */
.nav-action-btn.profile,
.nav-action-btn.prize {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    margin: 0;
    padding: 0 clamp(4px, 1.6vw, 10px);
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--border-color, #475569) 70%, transparent);
    background: color-mix(in srgb, var(--bg-secondary, #334155) 88%, #000);
    box-shadow: none;
    box-sizing: border-box;
    overflow: hidden;
    min-width: 0;
}

html[data-theme="light"] .nav-action-btn.profile,
html[data-theme="light"] .nav-action-btn.prize {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
}

.nav-action-btn.profile:hover,
.nav-action-btn.prize:hover {
    border-color: color-mix(in srgb, var(--accent-color) 55%, transparent);
    transform: none;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-color) 25%, transparent);
}

/* Wallet / profile: icon + stacked labels (fluid by available width) */
.nav-action-btn.profile {
    width: 100%;
    max-width: min(160px, 100%);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(3px, 1.5vw, 8px);
    background: color-mix(in srgb, #ffffff 78%, var(--bg-secondary, #1e293b));
    border-color: color-mix(in srgb, #ffffff 35%, var(--border-color, #475569));
    container-type: inline-size;
    container-name: profile-nav;
}

html[data-theme="light"] .nav-action-btn.profile {
    background: color-mix(in srgb, #ffffff 94%, #e2e8f0);
    border-color: rgba(15, 23, 42, 0.1);
}

.nav-action-btn.profile .nav-btn-icon {
    font-size: clamp(0.82rem, 18cqi, 1.15rem);
    line-height: 1;
    grid-row: 1 / span 2;
    flex-shrink: 0;
}

.nav-action-btn.profile .nav-btn-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.nav-action-btn.profile .nav-btn-main,
.nav-action-btn.profile .nav-btn-label,
.nav-action-btn.profile .nav-btn-sub {
    display: contents;
}

.nav-action-btn.profile .nav-btn-sub-chip {
    font-size: clamp(0.5rem, 12.5cqi, 0.78rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.15;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-action-btn.profile .nav-btn-sub-chip--deposit {
    color: #15803d;
}

.nav-action-btn.profile .nav-btn-sub-chip--withdraw {
    color: #dc2626;
}

/* Fallback when container units are unsupported */
@supports not (font-size: 1cqi) {
    .nav-action-btn.profile .nav-btn-icon {
        font-size: clamp(0.82rem, 3.6vw, 1.15rem);
    }
    .nav-action-btn.profile .nav-btn-sub-chip {
        font-size: clamp(0.5rem, 2.6vw, 0.78rem);
    }
}

@media (max-width: 360px) {
    .ethiomark-bottom-navbar.has-profile {
        gap: 4px;
    }
    .nav-action-btn.profile,
    .nav-action-btn.prize {
        padding: 0 4px;
    }
}

/* Prize tile mirrors profile geometry */
.nav-action-btn.prize {
    width: 100%;
    max-width: min(160px, 100%);
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1.5vw, 8px);
}

.nav-action-btn.prize .nav-btn-icon {
    font-size: clamp(0.9rem, 3.8vw, 1.15rem);
    line-height: 1;
    flex-shrink: 0;
}

.nav-action-btn.prize .nav-btn-label {
    font-size: clamp(0.55rem, 2.6vw, 0.78rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--highlight-color, #f59e0b);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Primary START CTA */
.nav-action-btn.start {
    position: relative;
    flex: none;
    width: auto;
    min-width: clamp(96px, 28vw, 126px);
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0 clamp(12px, 4vw, 22px);
    border-radius: 999px;
    border: none;
    background: linear-gradient(180deg, var(--primary-500) 0%, var(--primary-700) 100%);
    color: #fff;
    font-size: clamp(0.78rem, 3.2vw, 0.92rem);
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
    box-shadow:
        0 2px 8px color-mix(in srgb, var(--primary-600) 40%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.nav-action-btn.start:hover {
    filter: brightness(1.06);
    transform: none;
}

.count-badge {
    display: none;
    position: absolute;
    top: -7px;
    right: -2px;
    background-color: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 999px;
    padding: 3px 7px;
    min-width: 18px;
    text-align: center;
    line-height: 1.1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
    border: 2px solid color-mix(in srgb, var(--bg-secondary, #1e293b) 80%, #fff);
}
